8 Replies Latest reply on Sep 16, 2010 3:17 AM by nimo stephan

    package javax.ejb.embeddable does not exist

    nimo stephan Master

      I use JBOSS 6 M4 and have a test-class which returns this error:

       

      package javax.ejb.embeddable does not exist

       

       

      My question:

       

      Do I need to include the dependency of javax.ejb.embeddable within maven?

       

      I have thought, that EBJ 3.1 is automatically shipped with javax.ejb.embeddable. So why can I not make use of it in my testng-class?

        • 1. Re: package javax.ejb.embeddable does not exist
          jaikiran pai Master

          That package is available in JBOSS_HOME/client/jboss-ejb-api_3.1_spec.jar

          • 2. Re: package javax.ejb.embeddable does not exist
            nimo stephan Master

            Thank you,

             


            I had included the JBOSS 6 Runtime (whit all its libs) into my eclipse-classpath.

             


            I can import it into classes - however, TestNG (Maven) can not find it.

             

            I guess, I have to import it into my pom.xml with  <scope>test</scope>.

             

            I will try it.

             

            thanks.

             

             

             

            // is available under my classpath

             

            import javax.ejb.embeddable.EJBContainer;
            import javax.naming.Context;

             


            private static EJBContainer ec;
            private static Context ctx;

             


            @BeforeClass
                 public void setUp() {

             


                  ec = EJBContainer.createEJBContainer();
                   ctx = ec.getContext();
                 }

             


            @Test
                public void test() throws Exception{

             


            MyBean ejb = (MyBean) ctx.lookup("java:global/MyBean");  

             

            ...

             

            }

            • 3. Re: package javax.ejb.embeddable does not exist
              nimo stephan Master

              I use this dependency within Maven-pom:

               

              <dependency>
                       <groupId>org.jboss.ejb3</groupId>
                       <artifactId>jboss-ejb3-api</artifactId>
                       <scope>provided</scope>
                       <version>3.1.0</version>
              </dependency>

               

               

              I cannot change the scope to "test", as then all non-test-beans does not compile properly.

               

               

              In glassfish, there is a extra lib which makes it easy to integrate the embeeded-container for my test-suite:

               

              <dependency>
              <groupId>org.glassfish.embedded</groupId>
              <artifactId>glassfish-embedded-all</artifactId>
              <version>3.0</version>
              <scope>test</scope>
              </dependency>

               

               

              How can I put the embeeded container with JBOSS in Maven for my test-suite? I cannot find the appropriate dependency (something like jboss-embedded-all). I use ejb 3.1 and jboss 6m4.

              • 5. Re: package javax.ejb.embeddable does not exist
                nimo stephan Master

                thank you,

                 

                I added this in my pom:

                 

                <repositories>
                       <repository>
                          <id>repository.jboss.org</id>
                          <name>JBoss Repository</name>
                          <url>http://repository.jboss.org/maven2</url>
                       </repository>

                       <!-- Provide this JBoss repository for testsuites (TestNG) -->
                       <repository>
                          <id>repository.jboss.org</id>
                          <name>JBoss Repository 2</name>
                          <url>https://repository.jboss.org/nexus/content/groups/public/org/jboss/spec/jboss-javaee-6.0/1.0.0.Beta6/jboss-javaee-6.0-1.0.0.Beta6.pom</url>
                       </repository>
                   </repositories>



                <dependency>
                          <groupId>org.jboss.spec</groupId>
                          <artifactId>jboss-javaee-6.0</artifactId>
                          <version>1.0.0.Beta6</version>
                          <type>pom</type>

                           <!--I need this dependency only for TestNG -->

                          <scope>test</scope>
                </dependency>

                 

                 

                However, I get this Maven-Error:


                15.09.10 12:58:55 MESZ: [WARN] Missing POM for org.jboss.spec:jboss-javaee-6.0:pom:1.0.0.Beta6
                15.09.10 12:58:55 MESZ: Missing artifact org.jboss.spec:jboss-javaee-6.0:pom:1.0.0.Beta6:test
                15.09.10 12:58:55 MESZ: Maven Builder: AUTO_BUILD

                15.09.10 12:54:41 MESZ: Maven Builder: AUTO_BUILD
                15.09.10 12:54:43 MESZ: Could not download sources for org.jboss.interceptor:jboss-interceptor-api:1.1
                15.09.10 12:54:44 MESZ: Could not download sources for javax.annotation:jsr250-api:1.0
                15.09.10 12:54:45 MESZ: Could not download sources for org.slf4j:slf4j-api:1.5.9.RC1
                15.09.10 12:54:46 MESZ: Could not download sources for javax.xml.bind:jaxb-api:2.1
                15.09.10 12:54:47 MESZ: Could not download sources for javax.xml.stream:stax-api:1.0-2
                15.09.10 12:54:48 MESZ: Could not download sources for javax.activation:activation:1.1
                15.09.10 12:54:49 MESZ: Could not download sources for com.sun.xml.bind:jaxb-impl:2.1.3
                15.09.10 12:54:50 MESZ: Could not download sources for javax.faces:jsf-api:2.0.0-RC
                15.09.10 12:54:51 MESZ: Could not download sources for org.testng:testng:5.10:jdk15
                15.09.10 12:54:53 MESZ: Could not download sources for junit:junit:3.8.1
                15.09.10 12:54:54 MESZ: Could not download sources for org.glassfish.web:el-impl:2.1.2-b04
                15.09.10 12:54:55 MESZ: Could not download sources for org.glassfish.web:el-impl:2.1.2-b04
                15.09.10 12:54:56 MESZ: Could not download sources for concurrent:concurrent:1.3.4

                ...

                 

                Formerly, there was a jboss-embeedable.jar, but I have thought, that this is no more needed with ejb 3.1. What is wrong?

                 


                • 6. Re: package javax.ejb.embeddable does not exist
                  nimo stephan Master

                  I have to make this available for TestNG:

                   

                  import javax.ejb.embeddable.EJBContainer;
                  import javax.naming.Context;

                   

                   

                  I tried it with glassfish-embeeded, it works without problems - however, I have to use glassfish.

                   

                  <dependency>
                  <groupId>org.glassfish.embedded</groupId>
                  <artifactId>glassfish-embedded-all</artifactId>
                  <version>3.0</version>
                  <scope>test</scope>
                  </dependency>

                   

                   

                  but with Jboss it is a torture as it is not working:

                   

                  <repositories>
                         <repository>
                            <id>repository.jboss.org</id>
                            <name>JBoss Repository</name>
                            <url>http://repository.jboss.org/maven2</url>
                         </repository>

                         <!-- Provide this JBoss repository for testsuites (TestNG) -->
                         <repository>
                            <id>repository.jboss.org</id>
                            <name>JBoss Repository 2</name>
                            <url>https://repository.jboss.org/nexus/content/groups/public/org/jboss/spec/jboss-javaee-6.0/1.0.0.Beta6/jboss-javaee-6.0-1.0.0.Beta6.pom</url>
                         </repository>
                     </repositories>



                  <dependency>
                            <groupId>org.jboss.spec</groupId>
                            <artifactId>jboss-javaee-6.0</artifactId>
                            <version>1.0.0.Beta6</version>
                            <type>pom</type>

                             <!--I need this dependency only for TestNG -->

                            <scope>test</scope>
                  </dependency>

                   


                  Is my dependency false? Can anyone provide me an (up-to date) pom to use jboss-embeeded with jboss 6 and maven for TestNG-Classes?

                  • 7. Re: package javax.ejb.embeddable does not exist
                    jaikiran pai Master

                    nimo stephan wrote:

                     


                     

                    but with Jboss it is a torture as it is not working:

                     

                    <repositories>
                           <repository>
                              <id>repository.jboss.org</id>
                              <name>JBoss Repository</name>
                              <url>http://repository.jboss.org/maven2</url>
                           </repository>

                           <!-- Provide this JBoss repository for testsuites (TestNG) -->
                           <repository>
                              <id>repository.jboss.org</id>
                              <name>JBoss Repository 2</name>
                              <url>https://repository.jboss.org/nexus/content/groups/public/org/jboss/spec/jboss-javaee-6.0/1.0.0.Beta6/jboss-javaee-6.0-1.0.0.Beta6.pom</url>
                           </repository>
                       </repositories>




                    You are using a wrong repository URL. The JBoss repository URL is

                    http://repository.jboss.org/nexus/content/groups/public-jboss/

                     

                     

                    See this form more details http://community.jboss.org/wiki/MavenGettingStarted-Users

                    • 8. Re: package javax.ejb.embeddable does not exist
                      nimo stephan Master

                      Thank you!!

                       

                      This repo works! However, I get still little problems but they are dependency-issues..appropriate for http://community.jboss.org/en/build?view=discussions.