-
1. Re: Problem packaging wsimport generated classes as AS 7 module
iphands Jun 18, 2012 7:15 PM (in response to sunfire)I am having the exact same issue. Works when included in my war, does not work when I load it via a module. I bet it has something to do with the impl to ReflectionServiceFactoryBean bean being different due to the included modules or something.
Bump :-D
-
2. Re: Problem packaging wsimport generated classes as AS 7 module
sfcoy Jun 19, 2012 9:55 AM (in response to sunfire)jax-ws artifacts are required to be packaged in a Java EE module such as a WAR file or EJB JAR file.
As a practical aside, the deployer needs to be able to scan your classes for the various jax-ws annotations. How much of the server classpath do you think it should scan? With the above constraints the deployer knows exactly where to look.
-
3. Re: Problem packaging wsimport generated classes as AS 7 module
cbredesen Jun 19, 2012 10:21 AM (in response to sfcoy)This makes sense for deployed service endpoints but is inconvenient for simple clients which may be invoked from non-EE type deployables (think Connectors, Authenticators, etc). Thanks for the explanation, Stephen.
-
4. Re: Problem packaging wsimport generated classes as AS 7 module
cbredesen Jun 19, 2012 10:25 AM (in response to sfcoy)Any suggestions on a WS client that would "just work" without contianer dependencies or a need to be deployed/recognized by the server?
-
5. Re: Problem packaging wsimport generated classes as AS 7 module
sfcoy Jun 19, 2012 10:27 AM (in response to cbredesen)You get it for free in Java 6.
-
6. Re: Problem packaging wsimport generated classes as AS 7 module
cbredesen Jun 19, 2012 10:28 AM (in response to sfcoy)That's all we're doing here - hence why I'm trying to work out why the AS is buggnig out. Maybe Ian's/my problem differs from OP's?
-
7. Re: Problem packaging wsimport generated classes as AS 7 module
sfcoy Jun 19, 2012 10:34 AM (in response to cbredesen)The OPs are talking about server implementations.
If you're having a problem with a WS client then it's worth starting a new discussion.
-
8. Re: Problem packaging wsimport generated classes as AS 7 module
sunfire Jun 19, 2012 10:51 AM (in response to sunfire)I don't get why I just can package the JAX-WS client artifacts as a module. What do they have to do with the deployer? After all I don't want to deploy an endpoint but just consume a service sitting on a different server using standard JDK functionality.
And since I am declaring the module as a dependency shouldn't all classes from the module be available on the classpath anyways?
Sorry to bother you guys with it but its just not clear to me yet.
Since there seems to be a little bit of confision here is a little example of what I am trying to do:
- run something like this with every regular JDK: wsimport http://www.webservicex.com/globalweather.asmx?WSDL
- put the resulting classes into a JBAS 7 module
- now call "new GlobalWeather().getGlobalWeatherSoap()" from a WAR application that declared the former module as dependency
-
9. Re: Problem packaging wsimport generated classes as AS 7 module
ctomc Jun 19, 2012 10:49 AM (in response to sunfire)Hi,
it is possible for annotated classes to be packed inside module, but the task to do that is not trivial.
Process goes something like this:
- get your jar
- create janex index for it (there is also anttask for it)
- if you created jandex index as separate jar include it into module.xml as another resource
- when importing dependancy to this module in your application, you must specify you also want annotations
for MANIFEST.MF syntax for importing is somehing like this Dependancies: org.project.myModule annotations, my.other.module...
or if you use jboss-deployment-descriptor.xml you must add attribute annotations="true" when adding dependancies.
--
tomaz
-
10. Re: Problem packaging wsimport generated classes as AS 7 module
iphands Jun 19, 2012 11:03 AM (in response to ctomc)Trying the jandex stuff now... thanks for the heads up.
-
11. Re: Problem packaging wsimport generated classes as AS 7 module
iphands Jun 19, 2012 11:48 AM (in response to iphands)So wait. I have a login module jar, lets say com.example.lm
And a genereated sources jar, lets say com.example.gen (generated wsdl client)
com.example.lm's module.xml is:
<?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.1" name="com.example.lm"> <resources> <resource-root path="login-module-eap6.jar"/> </resources> <dependencies> <module name="org.picketbox"/> <module name="javax.api"/> <module name="javax.xml.ws.api"/> <module name="org.jboss.logging"/> <module name="com.example.gen"/> </dependencies> </module>
com.example.gen's module.xml is:
<?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.1" name="com.example.gen"> <resources> <resource-root path="generated-wsdls.jar"/> </resources> <dependencies> <module name="javax.xml.ws.api"/> <module name="javax.api"/> </dependencies> </module>
generated-wsdls.jar is the jar that has a META-INF/jandex.idx
Now in my war's jboss-deployment-structure.xml I have:
<?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" /> </dependencies> </deployment> </jboss-deployment-structure>
But I see:
11:39:09,805 ERROR [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015894: Module com.example.lm:main will not have it's annotations processed as no META-INF/jandex.idx file was found in the deployment. Please generate this file using the Jandex ant task.
Which makes sense because the META-INF/jandex.idx file is in the depenency of com.example.lm and not in com.example.lm it self.
What steps do I take here?
-
12. Re: Problem packaging wsimport generated classes as AS 7 module
ctomc Jun 19, 2012 4:58 PM (in response to iphands)Hi,
never tried it like this i had app dependancy directly to module that has annotations.
try if adding
<module name="com.example.gen" > <imports> <include path="META-INF/"/> </imports> </module>
in
com.example.lm
moduleit might/should work, but didn't tested...
--
tomaz
-
13. Re: Problem packaging wsimport generated classes as AS 7 module
iphands Jun 19, 2012 5:04 PM (in response to ctomc)Tomaz Cerar wrote:
in
com.example.lm
moduleit might/should work, but didn't tested...
/me crosses fingers
-
14. Re: Problem packaging wsimport generated classes as AS 7 module
iphands Jun 19, 2012 5:29 PM (in response to iphands)No good. Well, it did not change.
<?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.1" name="com.example.lm"> <resources> <resource-root path="login-module-eap6.jar"/> </resources> <dependencies> <module name="org.picketbox"/> <module name="javax.api"/> <module name="javax.xml.ws.api"/> <module name="org.jboss.logging"/> <module name="com.example.gen"> <imports> <include path="META-INF/"/> </imports> </module> </dependencies> </module>
And
<include path="META-INF/**"/>
And
<include path="META-INF/*"/>
No dice.
I still get:
17:21:11,557 WARNING [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (http-localhost/127.0.0.1:8180-1) Could not find a matching method for operation {http://services.example.com/}validateUser. Operation will be unavailable. 17:21:11,557 WARNING [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (http-localhost/127.0.0.1:8180-1) Could not find a matching method for operation {http://services.example.com/}login. Operation will be unavailable.