on 01-29-2010 6:28 AM
Hi,
I am getting a NoClassDefFoundError when trying to use JCO class in my code. I added the sapjco.jar in libraries and references. I have also checked for the sapjcorfc.dll and lib32rfc.dll in Windows/System32 directory. The dll's are exisiting in the folder.
What else could be the reason for NoClassDefFoundError?
Code snippet below (it fails when calling JCO.getClientPoolManager)
try
{
logMan.logMessage("INFO", "In SAPPoolManager.getClientObject call");
JCO.Pool pool = JCO.getClientPoolManager().getPool(poolName);
If you look in the Sun API documentation for class [NoClassDefFoundError|http://java.sun.com/javase/6/docs/api/java/lang/NoClassDefFoundError.html] (package <i>java.lang.LinkageError</i>) you'll see that there's exactly one reason why this Error is thrown: The class could not be found. Or more eloquently as the documentation says:
Thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new expression) and no definition of the class could be found.
The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found.
So basically you have to check your VM arguments when executing your code. Your classpath cannot contain the reference to the sapjco.jar, otherwise you wouldn't see this error.
Cheers, harald
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.