JDK-4976356 : (cl) S1AS 7 calling ClassLoader.loadClass with array syntax
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:class_loading
  • Affected Version: 5.0
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_2.6,solaris_8
  • CPU: sparc
  • Submitted: 2004-01-09
  • Updated: 2017-05-16
  • Resolved: 2004-02-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b40Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
Looks like there are serious exceptions in Tiger B32 while deploying the apps in S1AS7 could be related to class loading .
Appserver works fine with Tiger B30. But fails with B32

Platform: Solsparc
Here is the failure log(b32), I also added the pass log for reference (b30)

-----------------------------B32------------------------
[09/Jan/2004:12:46:52] INFO ( 7156): CORE1116: Sun ONE Application Server 7.0.0_01
[09/Jan/2004:12:46:57] INFO ( 7157): CORE5076: Using [Java HotSpot(TM) Server VM, Version 1.5.0-beta] from [Sun Mic
rosystems Inc.]
[09/Jan/2004:12:47:14] INFO ( 7157): JMS5023: JMS service successfully started. Instance Name = domain1_spec2001-1,
 Home = [/export/appservers/sunone/imq/bin].
[09/Jan/2004:12:47:20] INFO ( 7157): JTS5014: Recoverable JTS instance, serverId = [100]
[09/Jan/2004:12:47:21] INFO ( 7157): RAR5060: Install JDBC Datasources ...
[09/Jan/2004:12:47:21] INFO ( 7157): RAR5059: Binding [JDBC DataSource Name: jdbc/SPECDB, Pool Name: SpecJPool]
[09/Jan/2004:12:47:22] INFO ( 7157): JMS5015: Install JMS resources ...
[09/Jan/2004:12:47:26] SEVERE ( 7157): DPL5028:Unexpected exception in MethodDescriptor.getMethod()
java.lang.ClassNotFoundException: [Lorg.spec.jappserver.orders.helper.ItemQuantity;
        at com.iplanet.ias.loader.EJBClassLoader.findClass(EJBClassLoader.java:457)
        at com.iplanet.ias.loader.EJBClassLoader.loadClass(EJBClassLoader.java:585)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at com.sun.enterprise.util.TypeUtil.getMethod(TypeUtil.java:362)
        at com.sun.enterprise.deployment.MethodDescriptor.getMethod(MethodDescriptor.java:198)
        at com.sun.enterprise.security.application.EJBSecurityManager.copyUncheckedAndExcludedSets(EJBSecurityManag
er.java:189)
        at com.sun.enterprise.security.application.EJBSecurityManager.initialize(EJBSecurityManager.java:172)
        at com.sun.enterprise.security.application.EJBSecurityManager.<init>(EJBSecurityManager.java:126)
        at com.iplanet.ias.server.AbstractLoader.loadEjbs(AbstractLoader.java:339)
        at com.iplanet.ias.server.ApplicationLoader.load(ApplicationLoader.java:81)
        at com.iplanet.ias.server.AbstractManager.load(AbstractManager.java:134)
        at com.iplanet.ias.server.ApplicationLifecycle.onStartup(ApplicationLifecycle.java:168)
        at com.iplanet.ias.server.ApplicationServer.onStartup(ApplicationServer.java:269)
        at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:162)


--------------------------------------------------------

-----------------------------B30------------------------
[09/Jan/2004:12:29:35] INFO ( 6483): CORE1116: Sun ONE Application Server 7.0.0_01
[09/Jan/2004:12:29:40] INFO ( 6484): CORE5076: Using [Java HotSpot(TM) Server VM, Version 1.5.0-beta] from [Sun Mic
rosystems Inc.]
[09/Jan/2004:12:29:57] INFO ( 6484): JMS5023: JMS service successfully started. Instance Name = domain1_spec2001-1,
 Home = [/export/appservers/sunone/imq/bin].
[09/Jan/2004:12:30:03] INFO ( 6484): JTS5014: Recoverable JTS instance, serverId = [100]
[09/Jan/2004:12:30:04] INFO ( 6484): RAR5060: Install JDBC Datasources ...
[09/Jan/2004:12:30:04] INFO ( 6484): RAR5059: Binding [JDBC DataSource Name: jdbc/SPECDB, Pool Name: SpecJPool]
[09/Jan/2004:12:30:05] INFO ( 6484): JMS5015: Install JMS resources ...
[09/Jan/2004:12:30:10] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:11] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:11] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:12] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:12] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:13] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:13] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:13] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:14] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:14] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:15] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:15] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:16] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:16] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:17] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:17] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:17] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:18] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:18] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:18] WARNING ( 6484): [EntityContainer] Created EntityContainer....
[09/Jan/2004:12:30:18] INFO ( 6484): LDR5010: All ejb(s) of [SPECjAppServer] loaded successfully!
[09/Jan/2004:12:30:18] INFO ( 6484): WEB0100: Loading web module [SPECjAppServer:supplier.war] in virtual server [s
pec2001-1] at [/Supplier]
[09/Jan/2004:12:30:19] INFO ( 6484): WEB0100: Loading web module [SPECjAppServer:web.war] in virtual server [spec20
01-1] at [/SPECjAppServer]
[09/Jan/2004:12:30:21] INFO ( 6484): HTTP3072: HTTP listener http-listener-1 [http://10.5.20.35:8000] ready to acce
pt requests
[09/Jan/2004:12:30:21] INFO ( 6484): CORE3274: successful server startup
[09/Jan/2004:12:30:21] INFO ( 6484): CORE5053: Application onReady complete.


--------------------------------------------------------

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta2 FIXED IN: tiger-beta2 INTEGRATED IN: tiger-b40 tiger-beta2 VERIFIED IN: tiger-beta2
28-08-2004

EVALUATION Looks like S1AS7 is using array syntax to call ClassLoader.loadClass. This syntax was disallowed as part of the fix for bug 4872868. In order to detemine the correct course of action, we will need to see the S1AS7 source which makes this call. -- iag@sfbay 2004-01-09 S1AS7 sources are at: /share/builds/aas/IAS/iAS70/MU/build/builds/20030506.B10.RTM On machine: bstlab12.red.iplanet.com Looks like we need to have account on red.iplanet domain to access ###@###.### 2004-01-13 I don't have access to this machine. I have contacted S1AS7 management to request assistance. -- iag@sfbay 2004-01-13 Still trying to find somebody to give me access to the source. Could I possibly have a guest account on bstlab12.red.iplanet.com? Does this exception cause S1AS7 to completely stop running or are these exceptions merely observed in the logs? -- iag@sfbay 2004-01-14 I could able to get hold of sources, And they are at: /net/jano/export/disk20/GammaBase/Bugs/4976356 --------------- * Loads the class with the specified name. Overrides * java.lang.ClassLoader to work around locks held during delegation * - cause of deadlock. * * The real fix in java.lang.ClassLoader should go into J2SE 1.5 * (bugid 4735126) so at that point in time this method should not * be needed. ---------------- -------com.sun.enterprise.util.TypeUtil.getMethod------------- public static Method getMethod(Class declaringClass, ClassLoader loader, String name, String[] paramClassNames) throws Exception { Class[] parameterTypes=null; if (paramClassNames!=null) { parameterTypes = new Class[paramClassNames.length]; for(int pIndex = 0; pIndex < parameterTypes.length; pIndex++) { String next = paramClassNames[pIndex]; if( primitiveClasses_.containsKey(next) ) { parameterTypes[pIndex] = (Class) primitiveClasses_.get(next); } else { parameterTypes[pIndex] = loader.loadClass(next); } } } return declaringClass.getMethod(name, parameterTypes); } -------------------- -----------com.iplanet.ias.loader.EJBClassLoader.loadClass----------- protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException { // First, check if the class has already been loaded Class c = findLoadedClass(name); if (c == null) { // We know EJBClassLoader is not gonna be the root // class loader so parent is not gonna be null. // So we just omit the check and call it straight. try { c = getParent().loadClass(name); } catch (ClassNotFoundException e) { synchronized(this) { // If still not found, then call findClass in order // to find the class. c = findClass(name); } } } if (resolve) { resolveClass(c); } return c; } ----------- -----------------com.iplanet.ias.loader.EJBClassLoader.findClass protected Class findClass(String name) throws ClassNotFoundException { String nf = (String) notFoundClasses.get(name); if (nf != null && nf.equals(name) ) { throw new ClassNotFoundException(name); } // search thru the JARs for a file of the form java/lang/Object.class String entryName = name.replace('.', '/') + ".class"; int i = 0; while (i < urlSet.size()) { URLEntry u = (URLEntry) this.urlSet.get(i); byte[] result = null; result = loadClassData0(u, entryName); if (result != null) { // START OF IASRI 4709374 // Instruments the classes if the profiler's enabled if (PreprocessorUtil.isPreprocessorEnabled()) { result = PreprocessorUtil.processClass(entryName, result); } // END OF IASRI 4709374 // define codesource so appropriate security permissions // will be associated CodeSource cs = null; if (ejbClassSet.contains(name)) { // give more strict permissions to EJB implementation class cs = ejbCodeSource; } else { cs = new CodeSource(u.source, null); } Class clz = defineClass(name, result, 0, result.length, cs); return clz; } i++; } // add to the not found classes list synchronized (this.notFoundClasses) { notFoundClasses.put(name, name); } throw new ClassNotFoundException(name); } ----------------- Appserver says the server instance started...but the EJBs were not deployed properly. And specJAppserver fails. ###@###.### 2004-01-14 It is purely accidental that array syntax ever worked. There was never any design intent for it to succeed and we haven't seen any scenario where it makes sense. (See the comments section for a detailed analysis of the S1AS 7 code.)^G^G^X In any case, as things stood prior to my change in tiger b32, requests which use array syntax don't always succeed. So far, we have determined that it might be successful if the component type of the array has already been loaded. We have found cases where the load fails even if the component type has already been loaded, but have been unable to further characterize the failures. There may be some latent bug in the way their code works at runtime due to this instability. At this point, we do not expect to modify class loading to rectify the pre-b32 behaviour. We will disable the array syntax check for Tiger (taking us back to the pre-b32 instability). This check will be re-enabled early in mustang (jdk1.6) development. We strongly encourage users to begin removing their dependence on array syntax. To aid testing with mustang behaviour, we will provide a new system property, "sun.lang.ClassLoader.allowArraySyntax". The default value for this property in Tiger is "true". To test with the new behaviour, it must be set to "false". Control of this check may not be provided in mustang. -- iag@sfbay 2004-02-02
02-02-2004