Bug 215084 - UnsupportedClassVersionError when run Axis1 Web service in Java 5 or Java 6 project on Tomcat 5.0
Summary: UnsupportedClassVersionError when run Axis1 Web service in Java 5 or Java 6 p...
Status: CLOSED FIXED
Alias: None
Product: WTP Webservices
Classification: WebTools
Component: jst.ws (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M7   Edit
Assignee: Gilbert Andrews CLA
QA Contact: Kathy Chan CLA
URL:
Whiteboard: PMC
Keywords: PII
Depends on:
Blocks:
 
Reported: 2008-01-11 15:39 EST by Kathy Chan CLA
Modified: 2008-06-05 16:29 EDT (History)
2 users (show)

See Also:
kathy: pmc_approved? (david_williams)
kathy: pmc_approved? (raghunathan.srinivasan)
kathy: pmc_approved? (naci.dai)
deboer: pmc_approved+
neil.hauge: pmc_approved+
kathy: pmc_approved? (kaloyan)


Attachments
addition to validation (12.54 KB, text/plain)
2008-03-05 16:17 EST, Gilbert Andrews CLA
no flags Details
this replaces and fixes the problems mentioned by Kathy (11.92 KB, patch)
2008-04-16 15:42 EDT, Gilbert Andrews CLA
no flags Details | Diff
Updated patch (12.03 KB, patch)
2008-04-16 16:45 EDT, Kathy Chan CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kathy Chan CLA 2008-01-11 15:39:39 EST
1. Create Java project with Java 6 compliance level.  Put a Java bean in it.
2. Select the Java bean in the Java project and select to create Axis1 Web service to run on Tomcat 5.0 (with JDK 1.4).  Move service slider to Test.

When the operation is run on the WSE, I got the error:

Jan 11, 2008 3:04:16 PM org.apache.axis.transport.http.AxisServlet logException
INFO: Exception:
java.lang.UnsupportedClassVersionError: echo/Echo (Unsupported major.minor version 50.0)
	at java.lang.ClassLoader.defineClass0(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
	at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1634)
	at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:219)
	at org.apache.axis.utils.ClassUtils$2.run(ClassUtils.java:177)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:160)
	at org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:142)
	at org.apache.axis.utils.cache.ClassCache.lookup(ClassCache.java:85)
	at org.apache.axis.providers.java.JavaProvider.getServiceClass(JavaProvider.java:428)
	at org.apache.axis.providers.java.JavaProvider.initServiceDesc(JavaProvider.java:461)
	at org.apache.axis.handlers.soap.SOAPService.getInitializedServiceDesc(SOAPService.java:286)
	at org.apache.axis.deployment.wsdd.WSDDService.makeNewInstance(WSDDService.java:500)
	at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:274)
	at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:260)
	at org.apache.axis.deployment.wsdd.WSDDDeployment.getService(WSDDDeployment.java:427)
	
Running Axis1 Web service compiled with Java 5.0 on Tomcat 5.0 (installed with JDK 1.4) would result in similar error:

Jan 11, 2008 3:14:45 PM org.apache.axis.transport.http.AxisServlet logException
INFO: Exception:
java.lang.UnsupportedClassVersionError: echo/Echo (Unsupported major.minor version 49.0)

This is because the Java bean was compiled with a newer version of Java than the JDK used to run Tomcat 5.0.
Comment 1 Kathy Chan CLA 2008-02-07 16:07:21 EST
In ValidationUtil, we need to check if the Java version in the Java project is compatible to the Web project that it will be added as J2EE module dependency.  If it's not compatible, a validation error banner should be displayed. 
Comment 2 Kathy Chan CLA 2008-02-14 15:57:17 EST
Deferring to WTP 3.0 M6.
Comment 3 Gilbert Andrews CLA 2008-03-05 16:17:03 EST
Created attachment 91698 [details]
addition to validation
Comment 4 Kathy Chan CLA 2008-03-05 18:59:04 EST
Thanks for the patch, Gil.

I have a few concerns with the code:

1. The newly added check in ValidationUtils expect serverInstanceId to always be set.  That's not the case.  There are cases when the server has not been created yet and we only have serverId (which is the server factory type Id).  We need to be able to tell if that server factory type Id can support the facet or not.

2. The code would have problem handling the case when initial project is not set.  Such as the case when nothing in the workspace is set when creating client or skeleton.

3. I assume by
 !javaProjectName.equals("projectName")
you mean
 !javaProjectName.equals(projectName)

4. Only need the check to check for whether the Java project can be added as J2EE project dependency to Web project.  We don't need this to run when we start off with one project and choose another project to create the Web service or Web service client in.

Please revise your patch.
Comment 5 Kathy Chan CLA 2008-04-03 12:44:42 EDT
Deferring out from M6.  Please try to have the fix early next week as this is affecting some adoptors as well.
Comment 6 Gilbert Andrews CLA 2008-04-16 15:42:28 EDT
Created attachment 96325 [details]
this replaces and fixes the problems mentioned by Kathy
Comment 7 Kathy Chan CLA 2008-04-16 16:45:24 EDT
Created attachment 96342 [details]
Updated patch

Updated patch that moves the check in ValidationUtil earlier (before runtimeChecker is called).
Comment 8 Kathy Chan CLA 2008-04-16 17:17:58 EDT
Patch committed and released to HEAD as v200804162107.
Comment 9 Kathy Chan CLA 2008-04-17 15:30:00 EDT
I forgot to get PMC approval before dropping one new error message for this fix:

The {0} server does not support the Java project {1}.

Comment 10 Kathy Chan CLA 2008-06-05 16:29:15 EDT
Verified on 05/23 WTP 3.0 driver.