Class.forName() fails only on JDK1.5.0_11 /RedHat EL x64, works on HPUX,Win

Hi everyone,

I have come across a problem and wanted to know if anyone has faced a similar problem on RHEL 64 linux JDK1.5.

java.lang.ClassNotFoundException: com.company.abc.runtime.session.impl.FTlrtAsyncRServiceProviderImpl

at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

at java.security.AccessController.doPrivileged(Native Method)

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 java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:164)

The peculiarity is there is another class com.company.abc.runtime.session.impl.FTReadServiceProviderImpl in the same package com.company.abc.runtime.session.impl which gets loaded

by the class.forName() call, both the classes are in the same jar and package, the class name is passed by property value and I have checked many times to see if the Class/package name is correct and it is.

Is there a limit on the size of the fully qualified className ?

The same thing works on HP-UX jdk 1.5,Win32 JDK 1.5 but fails on Linux 64 bit JDK1.5.

I also tried hard coding the invocation of the class com.company.abc.runtime.session.impl.FTlrtAsyncRServiceProviderImpl and it works on linux .

I think there is some bug in the classloader implementation of Linux JDK AMD64 .

--Pranab Dhar

I

[1639 byte] By [pkdhara] at [2007-11-26 23:36:32]
# 1

It's not very likely that there is processor-specific class loading code.

There is probably a limit on the length of a name but it will be a ZIP limitation, not a JAR or Java limitation. I don't think Java has a limit that's anywhere near that class's name, I've used them as long or longer. Anyway if it works on other platforms it should work here.

Can you check your Linux machine to see if GNU Java is installed? If so, delete it and use the Sun JDK for Linux.

ejpa at 2007-7-11 14:59:11 > top of Java-index,Core,Core APIs...