1 2 3 Previous Next 30 Replies Latest reply on Jul 14, 2017 7:38 AM by sganeshraj Go to original post
      • 15. Re: Problem packaging wsimport generated classes as AS 7 module
        ctomc

        If you try to import module that has annotations directly to your app, without middle module.

        does it work?

        • 16. Re: Problem packaging wsimport generated classes as AS 7 module
          ctomc

          can you also enable trace logging for org.jboss.modules this way we will be able to find out exacly where the problem is.

           

          I have and hunch that problem might be coused by missing dependancy that has annotation classes defined.

           

           

          --

          tomaz

          • 17. Re: Problem packaging wsimport generated classes as AS 7 module
            iphands

            Tomaz Cerar wrote:

             

            If you try to import module that has annotations directly to your app, without middle module.

            does it work?

             

            I dont think so. What I did to test was:

            • Setup the j-d-s.xml like so
            <?xml version="1.0" encoding="UTF-8"?>
            <jboss-deployment-structure>
                      <deployment>
                                <exclusions>
                                </exclusions>
                                <dependencies>
                                          <module name="org.picketlink" />
                                          <module name="com.example.sso.catalina" />
                                          <!-- <module name="com.example.lm" annotations="true" /> -->
                                          <module name="com.example.gen" annotations="true" />
                                </dependencies>
                      </deployment>
            </jboss-deployment-structure>
            

             

            • Deploy the com.example.lm's artifact in my wars WEB-INF dir

             

            I did this because com.example.lm depends on com.example.gen, and if com.example.lm is a container module then it does not have access to the libs in my war (thus the module deploy would fail.

            So with this setup, things "work" and I know that com.example.gen is using annotations="true", but the issue remains.

             

             

            I am doing this in EAP6, should I be weary about EAP6 vs AS7 differences here? I'll just repro on the lastest AS7.1 to be sure/

            • 18. Re: Problem packaging wsimport generated classes as AS 7 module
              iphands

              Fails the same way on 7.1.1, enabling trace logging.

              • 19. Re: Problem packaging wsimport generated classes as AS 7 module
                iphands

                Tomaz Cerar wrote:

                 

                can you also enable trace logging for org.jboss.modules this way we will be able to find out exacly where the problem is.

                 

                I have and hunch that problem might be coused by missing dependancy that has annotation classes defined.

                 

                 

                --

                tomaz

                 

                I love the hunch, sound plausible to me . Would that be trace level though?

                Also is there anything specific I should be looking for? The trace level org.jboss.modules logs are huge :-D

                 

                I see the jandex.idx get loaded:

                 

                14:03:14,478 TRACE [org.jboss.modules] (MSC service thread 1-7) Attempting to find all resources META-INF/jandex.idx in Module "com.example.gen:main" from local module loader @11bbf1ca (roots: /home/iphands/Download/jboss-as-7.1.1.Final/modules)
                14:03:14,479 TRACE [org.jboss.modules] (MSC service thread 1-7) Finding class org.jboss.jandex.IndexReader from Module "org.jboss.as.server:main" from local module loader @11bbf1ca (roots: /home/iphands/Download/jboss-as-7.1.1.Final/modules)
                14:03:14,480 TRACE [org.jboss.modules] (MSC service thread 1-7) Finding local class org.jboss.jandex.IndexReader from Module "org.jboss.jandex:main" from local module loader @11bbf1ca (roots: /home/iphands/Download/jboss-as-7.1.1.Final/modules)
                14:03:14,480 TRACE [org.jboss.modules] (MSC service thread 1-7) Loading class org.jboss.jandex.IndexReader locally from Module "org.jboss.jandex:main" from local module loader @11bbf1ca (roots: /home/iphands/Download/jboss-as-7.1.1.Final/modules)
                14:03:14,481 TRACE [org.jboss.modules] (MSC service thread 1-7) Attempting to define class org.jboss.jandex.IndexReader in Module "org.jboss.jandex:main" from local module loader @11bbf1ca (roots: /home/iphands/Download/jboss-as-7.1.1.Final/modules)
                14:03:14,483 TRACE [org.jboss.modules] (MSC service thread 1-7) Defined class org.jboss.jandex.IndexReader in Module "org.jboss.jandex:main" from local module loader @11bbf1ca (roots: /home/iphands/Download/jboss-as-7.1.1.Final/modules)
                14:03:14,483 TRACE [org.jboss.modules] (MSC service thread 1-7) Finding class org.jboss.jandex.UnsupportedVersion from Module "org.jboss.jandex:main" from local module loader @11bbf1ca (roots: /home/iphands/Download/jboss-as-7.1.1.Final/modules)
                14:03:14,484 TRACE [org.jboss.modules] (MSC service thread 1-7) Finding local class org.jboss.jandex.UnsupportedVersion from Module "org.jboss.jandex:main" from local module loader @11bbf1ca (roots: /home/iphands/Download/jboss-as-7.1.1.Final/modules)
                14:03:14,485 TRACE [org.jboss.modules] (MSC service thread 1-7) Loading class org.jboss.jandex.UnsupportedVersion locally from Module "org.jboss.jandex:main" from local module loader @11bbf1ca (roots: /home/iphands/Download/jboss-as-7.1.1.Final/modules)
                14:03:14,485 TRACE [org.jboss.modules] (MSC service thread 1-7) Attempting to define class org.jboss.jandex.UnsupportedVersion in Module "org.jboss.jandex:main" from local module loader @11bbf1ca (roots: /home/iphands/Download/jboss-as-7.1.1.Final/modules)
                14:03:14,486 TRACE [org.jboss.modules] (MSC service thread 1-7) Defined class org.jboss.jandex.UnsupportedVersion in Module "org.jboss.jandex:main" from local module loader @11bbf1ca (roots: /home/iphands/Download/jboss-as-7.1.1.Final/modules)
                14:03:14,487 TRACE [org.jboss.modules] (MSC service thread 1-7) Finding class org.jboss.jandex.PackedDataInputStream from Module "org.jboss.jandex:main" from local module loader @11bbf1ca (roots: /home/iphands/Download/jboss-as-7.1.1.Final/modules)
                14:03:14,488 TRACE [org.jboss.modules] (MSC service thread 1-7) Finding local class org.jboss.jandex.PackedDataInputStream from Module "org.jboss.jandex:main" from local module loader @11bbf1ca (roots: /home/iphands/Download/jboss-as-7.1.1.Final/modules)
                14:03:14,489 TRACE [org.jboss.modules] (MSC service thread 1-7) Loading class org.jboss.jandex.PackedDataInputStream locally from Module "org.jboss.jandex:main" from local module loader @11bbf1ca (roots: /home/iphands/Download/jboss-as-7.1.1.Final/modules)
                14:03:14,490 TRACE [org.jboss.modules] (MSC service thread 1-7) Attempting to define class org.jboss.jandex.PackedDataInputStream in Module "org.jboss.jandex:main" from local module loader @11bbf1ca (roots: /home/iphands/Download/jboss-as-7.1.1.Final/modules)
                14:03:14,492 TRACE [org.jboss.modules] (MSC service thread 1-7) Defined class org.jboss.jandex.PackedDataInputStream in Module "org.jboss.jandex:main" from local module loader @11bbf1ca (roots: /home/iphands/Download/jboss-as-7.1.1.Final/modules)
                

                 

                And I noticed "Loading class org.jboss.jandex.UnsupportedVersion" but maybe the name is nothing to worry about there (does that class just get loaded normally?).

                 

                Thanks so much for the continued help. I hope the OP is gaining fom this as well.

                • 20. Re: Problem packaging wsimport generated classes as AS 7 module
                  ctomc

                  Hi,

                   

                  this is great news that it is loaded!

                  What exacly are your annotations? They are present in what module? or better, full annotations class is what?

                   

                   

                  --

                  tomaz

                  • 21. Re: Problem packaging wsimport generated classes as AS 7 module
                    iphands

                    Tomaz Cerar wrote:

                     

                    this is great news that it is loaded!

                    What exacly are your annotations? They are present in what module? or better, full annotations class is what?

                     

                    So the OP and I are generating classes via the wsimport maven plugin (JAX-WS RI).

                    The annotation classes are things like:

                    • javax.xml.ws.WebServiceClient
                    • javax.jws.WebService
                    • javax.xml.bind.annotation.XmlSeeAlso

                     

                    So it does make sense that the com.example.lm module needs to explicitly depend on things that provide those classes. I think that is what you are getting at. I would have expected errors in the logs if any requiered classes were missing though. Right?

                    • 22. Re: Problem packaging wsimport generated classes as AS 7 module
                      iphands

                      Writing some scripts to audit the com.example.lm module now... I will ensure that all of the referenced annotation classes are depended on.

                      • 23. Re: Problem packaging wsimport generated classes as AS 7 module
                        ctomc

                        yeah, that is exacly what I am getting at.

                         

                        can you add dependancies both to module and your deployment.

                         

                        • javax.api
                        • javax.jws.api
                        • javax.xml.ws.api
                        • javax.wsdl4j.api
                        • javax.xml.bind.api
                        • com.sun.xml.bind

                         

                        let me know if anything changes

                        • 24. Re: Problem packaging wsimport generated classes as AS 7 module
                          iphands

                          ZOMG! Done! You are the MAN!

                          I even tested with the module instead of packaging the lib and it seems to work.

                           

                          Right now my j-d-s.xml looks like:

                           

                          <?xml version="1.0" encoding="UTF-8"?>
                          <jboss-deployment-structure>
                                    <deployment>
                                              <exclusions>
                                              </exclusions>
                                              <dependencies>
                                                        <module name="org.picketlink" />
                                                        <module name="com.example.sso.catalina" />
                                                        <module name="com.example.lm" />
                                              </dependencies>
                                    </deployment>
                          </jboss-deployment-structure>
                          

                           

                          And no more org.apache.cxf warnings!

                          com.example.lm depends on com.example.gen using that META-INF include you suggested.

                           

                          I cannot mark solved as I am no the OP, but this certainly solved the issue for me. Thanks!

                          • 25. Re: Problem packaging wsimport generated classes as AS 7 module
                            ctomc

                            Great! that is good news!

                             

                            Thorsten, let us know if this also helps resolve your problem.

                             

                             

                            --

                            tomaz

                            • 26. Re: Problem packaging wsimport generated classes as AS 7 module
                              sunfire

                              Tomaz I have to agree with Ian: you are the man indeed!

                               

                              So all it was was missing dependencies in the module. It doesn't even need the jandex index or META-INF include at all in my case. Just add the dependencies provided by Tomaz to the module - not even the WAR - and everything works as expected.

                               

                              Thank you very much!

                               

                              Just for completeness here are the files now without jandex:

                               

                              module.xml

                              <module xmlns="urn:jboss:module:1.1" name="com.cadebill.schema-ws" slot="4.9.5">
                              
                                  <resources>
                                      <resource-root path="cadebill-schema-ws-4.9.5.0.b01.jar"/>
                                  </resources>
                              
                                  <dependencies>
                                      <module name="javax.api"/>
                                      <module name="javax.jws.api"/>
                                      <module name="javax.xml.ws.api" />
                                      <module name="javax.wsdl4j.api" />
                                      <module name="com.sun.xml.bind" />
                                      <module name="javax.xml.bind.api" />
                                  </dependencies>
                              
                              </module>
                              

                               

                              jboss-deployment-structure.xml

                              <jboss-deployment-structure>
                                        <deployment>
                                                  <dependencies>
                                                            <module name="com.cadebill.schema-ws" slot="4.9.5" />
                                                  </dependencies>
                                        </deployment>
                              </jboss-deployment-structure>
                              
                              • 27. Re: Problem packaging wsimport generated classes as AS 7 module
                                mhlulani

                                I just want to ask.

                                How did you come up with these dependancies, is there a formular, that can be applied?

                                • javax.api
                                • javax.jws.api
                                • javax.xml.ws.api
                                • javax.wsdl4j.api
                                • javax.xml.bind.api
                                • com.sun.xml.bind

                                 

                                Thanks

                                • 28. Re: Problem packaging wsimport generated classes as AS 7 module
                                  ron_sigal

                                  Hi Tomaz,

                                   

                                  I have a related question.  I think the simplest way to express it is: How do I load annotations from one static module into another static module.

                                   

                                  To elaborate, I have a JAXB class, ViolationReport, in module resteasy-validator-provider-11 which contains sets of instances of a JAXB class, ResteasyConstraintViolation,  in module resteasy-jaxrs.  I added a jandex jar to resteasy-validator-provider-11, and now the annotations on ViolationReport are recognized.  But I added a jandex jar to resteasy-jaxrs, and the annotations in the ResteasyConstraintViolation instances aren't there (in the Class.annotations field).

                                   

                                  Do I need to declare something? I don't see anything about it anywhere.

                                   

                                  Thanks,

                                  Ron

                                  • 29. Re: Problem packaging wsimport generated classes as AS 7 module
                                    neeraj.gupta1

                                    Hi Thorsten,

                                    I tried your solution but still facing the same issue.  Can you help me out or provide any other solution?

                                     

                                    Thanks,

                                    Neeraj