0 Replies Latest reply: Jul 25, 2014 9:53 AM by user10586926 RSS

    EJBContainer.createEJBContainer for maven project

    user10586926

      I have a simple javaee 6 app with a ejb

       

      I want to write a basic junit test that uses Embedded EJB Container api

       

                  System.setProperty("weblogic.home","C:\\share\\weblogic\\wls1212\\wlserver");

       

       

                  Properties prop = new Properties();

                  prop.setProperty(EJBContainer.MODULES, "target/classes");

                  prop.put(EJBContainer.PROVIDER, "weblogic.ejb.embeddable.EJBContainerProvider");

                  EJBContainer container = EJBContainer.createEJBContainer(prop);

                  System.out.println("Got EJB COntainer=" + container);

                  Context context = container.getContext();

                  System.out.println("Got Context=" + context);

                  context.lookup("java:global/classes/TestEJB");

                  container.close();

       

      what should my pom include as dependencies?

       

      I have tried using weblogic.jar weblogic.server.merged.jar wlfullclient.jar wlsaft3client.jar wlthint3client.jar and combinations of these jars

       

      either I get class not found exceptions, or in one case the junit simply hangs doing nothing (it created blank domain folder in c:\temp)

       

      I opened SR - supports shows me this post Embedded EJB Container // No EJBContainer provider available

       

      This certainly doesnt work and I get - weblogic.ejb.embeddable.EJBContainerProvider: no provider names had been found

       

      BTW Oracle support is completely incompetent and lazy on top - I would really appreciate if the community here helps