[JAX_WS-1112] Make JAX-WS run on J2SE 5.0 Created: 29/Mar/13  Updated: 02/Apr/13  Resolved: 02/Apr/13

Status: Resolved
Project: jax-ws
Component/s: runtime
Affects Version/s: 2.2.6, 2.2.7
Fix Version/s: 2.2.8

Type: Improvement Priority: Major
Reporter: Opher Shachar Assignee: Martin Grebac
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: jdk_1_5, runtime


The release notes here: http://jax-ws.java.net/nonav/2.2.6-1/docs/ch02.html#required-software claim it should run on J2SE 5.0. Except that trying to run a JAXWS (standalone desktop) client with on-top JDK 1.5 fails with this message:

Exception in thread "Main Thread" java.lang.UnsupportedClassVersionError:
 com/sun/xml/ws/spi/ProviderImpl : unsupported classversion 50.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at javax.xml.ws.spi.FactoryFinder.safeLoadClass(FactoryFinder.java:187)
        at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:66)
        at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:128)
        at javax.xml.ws.spi.Provider.provider(Provider.java:142)
        at javax.xml.ws.Service.<init>(Service.java:92)
        at org.me.calculator.ws.CalculatorWSService.<init>(CalculatorWSService.java:51)
        at org.me.calculator.CalculatorConsoleApp.main(CalculatorConsoleApp.java:26)

I went ahead and downloaded the corresponding source tree from svn:

svn co https://svn.java.net/svn/jax-ws~sources/tags/JAXWS_2_2_6_u1_04052012/jaxws-ri

The build.xml (under rt subdir) does indeed specify "source=1.5" attribute on the javac tag. But this, unfortunately, isn't enough; "target=1.5" must also be specified (i.e. that's what JAXB build script does).
To verify this I built with:

ant -Dant.build.javac.target=1.5 dist

and this produced a jaxws-rt.jar with JDK 1.5 class files.

This last requirement gives rise to a second issue - this one with JDK 6. The javac help here: http://docs.oracle.com/javase/6/docs/technotes/tools/windows/javac.html#crosscomp-options proclaims that specifying the source as "1.5" would set the target to the same value - so target need not be explicitly set. But, javac doesn't behave this way!

To complete the picture, JAX-WS also is missing to dependencies - activation.jar and jsr173_1.0_api.jar - to run on-top of JDK 1.5.

BTW, Do I also file a bug with the javac subproject?

Comment by Martin Grebac [ 02/Apr/13 ]

We should fix the doc. JAXWS is not supposed to run on 1.5 because it depends on javac apis not present in jdk5.

Comment by Martin Grebac [ 02/Apr/13 ]

Fixed the docs. Will commit anytime svn goes up.

Comment by Opher Shachar [ 02/Apr/13 ]

But perhaps a case could be made that dependencies could be separated between compile time and run-time?
Namely, require JDK6 at compile time, and JRE5 at run-time?
It is not difficult to achieve and, in my case, I needed to support a standalone desktop app running on JRE5 that consumes WS.


Generated at Fri Oct 09 04:07:10 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.