Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » JAX-WS Web Service support
JAX-WS Web Service support [message #1052134] Mon, 29 April 2013 17:23 Go to next message
Franck Mising name is currently offline Franck Mising name
Messages: 91
Registered: July 2009
Location: France
Member
Hi all,

I have read all the existing messages I could find on the topic, and after experimenting myself for a couple days with loading the Metro reference implementation into Virgo/Tomcat 3.6.1 I would like to get an update on the current status about JAX-WS support in Virgo (existing info is at least 1 year old), in particular:

- are there any plans / discussions by the dev. team to add support for JAX-WS at some point in the future?

- has anyone managed to get the JAX-WS RI working in Virgo 3.6.x? I have been starting from the instructions for Metro on Tomcat, but the metro distribs have loads of Glassfish/Sun specific dependencies which make then hard to load in Virgo.
I am now looking into https://jax-ws.java.net/2.2.5/ which hopefully should have less dependencies.

Thanks!
Re: JAX-WS Web Service support [message #1052470 is a reply to message #1052134] Tue, 30 April 2013 05:49 Go to previous messageGo to next message
Tin N/A is currently offline Tin N/A
Messages: 46
Registered: December 2010
Member

Unfortunately JAX-WS is a real mess, whether in OSGi or plain JEE environment. From my experience, the main reason for that is including a "lite" version of it into JDK and doing a very poor job of it (although the code itself and the documentation could use some/or plenty of work too). So when you need to use the full version you get all kinds of ugly exceptions stemming from the fact that the same classes work differently (contain different code) in JDK than in full JAX-WS.
You might be able to make full JAX-WS work though. I have a version that's working with 3.0.x using the following tricks (and it works for what I need it for, but can't say absolutely all functionalities will work):
1. use "-Djavax.xml.ws.spi.Provider=com.sun.xml.ws.spi.ProviderImpl -Djavax.xml.bind.context.factory=com.sun.xml.bind.v2.ContextFactory" when starting Virgo
2. put the following archives into virgo/endorsed directory: gmbal-api-only.jar, FastInfoset.jar, jaxb-api.jar, jaxb-impl.jar, jaxws-api.jar, stax-ex.jar, management-api.jar, mimepull.jar, streambuffer.jar, jmac-1.0-rev-1.jar
3. Put the JAX-WS implementation bundle, including WSIT into Virgo bundle repository
4. don't forget to start virgo with the -Djava.endorsed.dirs pointing to where you put the JARs from step 2

After that, in your bundle's MANIFEST, just import the whole JAX-WS implementation bundle, and you should hopefully be able to use full JAX-WS functionalities.

If I remember correctly, most or all of the JARs I mentioned above I "borrowed" from Glassfish installation and if some are not there, the rest I downloaded from Maven repos.

Finally, even though the above works for me, I'm not at all happy with how it's duct-taped together. So if there is a chance to make this work more cleanly, or use some other full JAX-WS implementation that's better engineered, documented and easier to integrate (both CXF and Axis2 at least advertise to be), I'd also be grateful if someone made an alternative tutorial or even officially include full JAX-WS into Virgo.

Good luck,
Tin

Re: JAX-WS Web Service support [message #1052911 is a reply to message #1052470] Wed, 01 May 2013 09:30 Go to previous messageGo to next message
Franck Mising name is currently offline Franck Mising name
Messages: 91
Registered: July 2009
Location: France
Member
Thanks Tin, I have tried four or five different approaches and I can't get anything working without suspicious tricks that I wouldn't dare deploy in production (because I don't understand their implications).

I thought I was getting the hang of OSGFication, but the Jax-ws / Metro stuff takes the problem to a new level...
I was really liking Virgo so far, but I will probably have to look into JBoss because I need both JAX-WS and OSGI support.

My last attempt was to put my WSServlet-based webapp in its own plan, along with the metro WS bundles, hoping that the rest of the platform wouldn't see/pick up those bundles. But I can't even get a proper self-contained OSGI compatible version of metro, the OSGI bundles maintained by the Metro project have Glassfish specific dependencies and attempts at repackaging using BND led nowhere.

Franck

Edit: before I give up, a general OSGI question: in the headers below, does the "uses" directive mean that the IBM packages become non-optional? If not why would I get an UnableToSatisfyBundleDependenciesException trying to load that bundle (the headers are from org.glassfish.metro.webservices-osgi_2.2.1.1)??

Import-Package: com.ibm.security.util;resolution:=optional
Export-Package: com.sun.wsit.security;uses:="com.ibm.security.util";version="2.2.1.1"

[Updated on: Wed, 01 May 2013 09:48]

Report message to a moderator

Re: JAX-WS Web Service support [message #1053067 is a reply to message #1052911] Thu, 02 May 2013 10:23 Go to previous messageGo to next message
Franck Mising name is currently offline Franck Mising name
Messages: 91
Registered: July 2009
Location: France
Member
Solved... this one is going on my personal wall of fame of software configuration epics.

The key was to use META-INF/services configuration files rather than globally overriding the jax-ws and jaxb providers for the entire VM, this allowed me to keep everything confined to a plan and avoids messing up with system bundles/boot delegation, which messes up other non-WS virgo services (JAX-RS web applications in my case).

So, essentially I used
- a plan that has my WS web bundle
- a web.xml in that web bundle that declares a WSServlet and a WSServletContextListener (google metro on tomcat)
- a META-INF/services/javax.xml.ws.spi.Provider file in the web bundle with a single line:
com.sun.xml.ws.spi.ProviderImpl

- OSGIfied versions of the JAX-WS RI runtime - I am using bnd to embed most dependencies in a custom bundle, but any OSGI compliant approach should work. I declare all those bundles in the plan, which is scoped, so that they aren't visible outside the plan

One last little thing I need to check is whether bundles dropped in repository/usr, and declared in a plan, really aren't loadable by any non-plan bundles - I suspect they are.
Re: JAX-WS Web Service support [message #1060861 is a reply to message #1053067] Tue, 28 May 2013 17:50 Go to previous messageGo to next message
Sandile Keswa is currently offline Sandile Keswa
Messages: 3
Registered: May 2013
Junior Member
Hey guys, I know this has already been solved, but I wanted to drop my 2 cents. We used JAX-WS in Virgo/Tomcat 3.6.x, but we also didn't use RI. We used Apache CXF DOSGi v1.4 (an example can be found here http:// cxf.apache.org/dosgi-spring-dm-demo-page.html). Using CXF, we were able to auto-expose service interfaces in Spring DM *-context.xml of our web services bundles as follows:
<!-- export internal interfaces -->
<osgi:service ref="someServicesImpl" interface="some.services.Interface">
	<osgi:service-properties>
		<entry key="service.exported.interfaces" value="*" />
		<entry key="org.apache.cxf.ws.databinding"  value="jaxb"/>
		<entry key="org.apache.cxf.ws.address"value="http://${host}:${port}/cxf/path/to/some/services/Interface" />
	</osgi:service-properties>		
</osgi:service>
<osgi:service ref="someServicesImpl" interface="super.services.Interface"/>

Once exposed, the service wsdl becomes available at ${host}:${port}/cxf/path/to/some/services/Interface?wsdl over HTTP. If interested in a working example, let me know.
Re: JAX-WS Web Service support [message #1220392 is a reply to message #1060861] Wed, 11 December 2013 13:22 Go to previous message
Laurent Gauthier is currently offline Laurent Gauthier
Messages: 1
Registered: December 2013
Junior Member
Hi Sandile,

If your offer to share a working example of JAX-WS on Virgo still holds, I would be very interested. I have been struggling with this issue for the past few days.


Previous Topic:Problem Running Greenpages under STS/Eclipse
Next Topic:How to verify Application are Deployed
Goto Forum:
  


Current Time: Thu Oct 23 11:44:03 GMT 2014

Powered by FUDForum. Page generated in 0.02370 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software