6 Replies Latest reply on Mar 12, 2014 11:59 PM by Sahil Avasthi

    Migrating Application from JBOSS 6.0 to JBOSS 7.1.1

    Sahil Avasthi Newbie

      Hi,

       

      From Last few days I am trying to migrate my application from jboss 6.0 to 7.1.1 Final Brontes but I am facing a issue.

       

      In my web.xml file I have load on start up for certain WebServiceImpl classes.

       

      In my web service Impl class I have a @Inject and @EJBQualifier as shown below --

       

      public class ABCWebServiceImpl implements ABCService

      {

        /**

         * A ABCService implementation instance, which is injected from outside.

         */

        @Inject

        @EJBServiceQualifier

        private ABCService abcService;

       

      }

       

      Now this qualifier goes to class --

       

      @EJBServiceQualifier

      public class ABCServiceEntryImpl implements ABCService

      {

        /**

         * A ABCService implementation instance, which is injected from outside.

         */

        @Inject

        @CMTEJBServiceQualifier

        private ABCService abcService;

       

      }

       

      and which further goes to @CMTEJBServiceQualifier class ...

       

      Now when JBOSS 7.1.1 try to deploy this war it throws exception ...

       

       

      Servlet /ABCServer threw load() exception: java.lang.IllegalArgumentException: Can not set (packageName).ABCService field (packageName).ABCServiceEntryImpl.abcService to (packageName).ABCWebServiceImpl

                at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:164) [rt.jar:1.7.0_10-ea]

                at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:168) [rt.jar:1.7.0_10-ea]

                at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:55) [rt.jar:1.7.0_10-ea]

       

      I have checked that I don't have duplicate jars.

       

      Please let me know if you guys have some further questions..

        • 1. Re: Migrating Application from JBOSS 6.0 to JBOSS 7.1.1
          Nicklas Karlsson Master

          What produces/defines the stuff for

           

          @Inject

          @CMTEJBServiceQualifier

          private ABCService abcService;

           

          and what do you mean "injected from outside"? What is the packaging of the application?

          • 2. Re: Migrating Application from JBOSS 6.0 to JBOSS 7.1.1
            Sahil Avasthi Newbie

            Hi Nicklas,

             

             

            Thanks for replying.

             

             

            From injected from outside I mean that container will instationate it.

             

            The flow is like this ....

             

            @Stateless(name = "ABCService", mappedName = "ABCService")

            @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)

            @Interceptors(ExceptionTranslationInterceptor.class)

            @EJBServiceQualifier

            public class ABCServiceEntryImpl implements ABCService

            {

              /**

               * A ABCService implementation instance, which is injected from outside.

               */

              @Inject

              @CMTEJBServiceQualifier

              private ABCService abcService;

            }

             

             

            Then flows goes to ..

             

             

            @Stateless(name = "ABCService", mappedName = "ABCService")

            @CMTEJBServiceQualifier

            public class ABCCMTImpl implements ABCService

            {

              /**

               * A ABCService implementation instance, which is injected from outside.

               */

              @Inject

              @CoreServiceQualifier

              private ABCService abcService;

            }

             

             

            And @CoreServiceQualifier goes to ...

             

             

            //This is the class where business logic is written...

            @CoreServiceQualifier

            public class ABCServiceImpl implements ABCService

            {

             

             

              /**

               * SimpleDAO instance, which is injected from outside.

               */

              @Inject

              private SimpleDAO dao;

             

             

            }

             

            Here ABCService inteface is my Web Service interface which is implemented everywhere even in EJB's it's like this ..

             

            @WebService(name = "ABCService", targetNamespace = "http://aa.aa.aaa")

            @XmlSeeAlso({ ObjectFactory.class })

            public interface ABCService

            {

             

            //some methods ....

             

            }

             

             

            Packaging of application is like this ...

             

            SomeApplication.war

            --META-INF

                  --MANIFEST.MF, which has Class-Path: reference to all jars under WEB-INF/lib

            --WEB-INF

              --classes

               --ExceptionTranslation

               --lib

                 --Has all the jars of my application, In every .jar there is MANIFEST.MF file under META-INF which points to jars needed by them. But there is no jar inside any jar.

               --wsdl

               --xsd

               --beans.xml

               --web.xml

             

            Sahil..

            • 5. Re: Migrating Application from JBOSS 6.0 to JBOSS 7.1.1
              Nicklas Karlsson Master

              Is there something wrong with CMTEJBServiceQualifier so that it's not considered a CDI qualifier? That's the only way I could think of that ABCWebServiceImpl would be considered for injection at that point. Even then, it should produce and ambiguous resolve. If nothing else helps. Place a debug breakpoint in the Weld BeanManager where it does the injection and look at what it really is trying to inject when the exception occurs.

              • 6. Re: Migrating Application from JBOSS 6.0 to JBOSS 7.1.1
                Sahil Avasthi Newbie

                It was a packaging problem with JBoss 7.

                I mean JBOSS 7.0 does not support the packaging which I was using, and which I mentioned in my previous threads.

                When I moved to JBOSS 6.1 Final version it worked.