1 2 Previous Next 21 Replies Latest reply on Oct 27, 2015 1:30 PM by leysson Go to original post
      • 15. Re: NoClassDefFoundError when call EJB 2.1 in AS7
        sfcoy

        I've managed to get this to work by using a subset of JBossAS 6 client jars.

         

        That is, I have an authenticated servlet in JBoss 7.1.2 invoking a stateless session bean running in JBoss 4.0.5.

         

        As soon as I get a chance I'll bundle it up and post it.

        • 16. Re: NoClassDefFoundError when call EJB 2.1 in AS7
          sfcoy

          Here's a working example. I rolled it back to use JBossAS 5.1.0 jars for the most part as the JBossAS 6 jars are a bit of a mess in Maven.

           

          You will probably need to configure the JBoss maven repo as described in Maven Settings Example - Users if you haven't already.

           

          It just uses the default ApplicationRealm in JBoss 7. You will need to add a user in the role "user" using the add_user.sh/bat script to this realm.

           

          I had my JBoss 4.0.5 instance running with all standard TCP ports +100. ie web @ :8180, rmi @:1199, etc.

          1 of 1 people found this helpful
          • 17. Re: NoClassDefFoundError when call EJB 2.1 in AS7
            sfcoy

            Here's an improved version that uses less jars and uses services in AS 7 in their place.

            • 18. Re: NoClassDefFoundError when call EJB 2.1 in AS7
              huasonator

              Excelet... i will probe this jar as soon as possible.. but i can't right now... i look like a monkey programmer in my job and dont have the environment... this friday i will work in this and tell you how I was..

              • 19. Re: NoClassDefFoundError when call EJB 2.1 in AS7
                huasonator

                Tks.. a lot.. .i'm very grateful....

                • 20. Re: NoClassDefFoundError when call EJB 2.1 in AS7
                  istomisgood

                  Hello Stephen,

                   

                  Have you tried calling EJB 2.1 bean hosted on Jboss 4.0.5 from Wildfly?

                   

                   

                  I have tried your example against Wildfly CR1.

                   

                  In addition to the jboss deps in jee6-client-web I have need to add

                  <!--This gets org.jboss.util.id.GUID -->

                  <dependency>

                              <groupId>jboss</groupId>

                              <artifactId>jboss-common</artifactId>

                              <version>4.0.2</version>

                          </dependency>

                   

                  <!-- This gets org.jboss.tm.TransactionPropagationContextUtil -->

                          <dependency>

                              <groupId>jboss</groupId>

                              <artifactId>jboss-transaction</artifactId>

                              <version>4.2.2.GA</version>

                          </dependency>

                   

                  When calling storeHome.create(); I get

                  Caused by: java.io.NotSerializableException: org.wildfly.extension.undertow.security.AccountImpl$AccountPrincipal

                      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1183) [rt.jar:1.7.0_51]

                      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_51]

                      at org.jboss.invocation.MarshalledInvocation.writeExternal(MarshalledInvocation.java:620) [jboss-client-5.1.0.CR1.jar:5.1.0.CR1 (build: SVNTag=JBoss_5_1_0_CR1 date=200904290912)]

                      at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1455) [rt.jar:1.7.0_51]

                      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_51]

                      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_51]

                      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_51]

                      at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:293) [rt.jar:1.7.0_51]

                      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:152) [rt.jar:1.7.0_51]

                      ... 364 more

                   

                   

                   

                  Looking at the wildfly code I can see AccountImpl is serialisable, however AccountPrincipal is not. It seems to me perhaps AccountPrincipal should be as it is instantiated from within AccountImpl.

                   

                   

                   

                  Kind Regards,

                  Thomas.

                  • 21. Re: NoClassDefFoundError when call EJB 2.1 in AS7
                    leysson

                    create WEB-INF => jboss-deployment-structure.xml

                     

                     

                    <?xml version="1.0"?>

                    <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">

                      <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

                      <deployment>

                      <exclusions>

                           <module name="org.picketbox"/>

                      </exclusions>

                      <dependencies>

                      </dependencies>

                      </deployment>

                    </jboss-deployment-structure>

                    1 2 Previous Next