Invoke custom Java class
Hi experts,
we're trying to invoke our custom Java classes in user forms. But deploying the jar Files into /WSHOME/WEB-INF/lib as well as copying the classes to /WSHOME/WEB-INF/classes/com/myPackage/ always ends up in the following error code:
XPRESS exception ==> com.waveset.util.WavesetException: Class com.myPackage.MyClass not found.
I get the error when I try to create a new user in IDM and also during the reconcilation process. In the form the method is called by
<Field name='waveset.accountId'>
<Expansion>
<block trace='true'>
<invoke name='myFunction' class='com.myPackage.MyClass'/>
</block>
</Expansion>
</Field>
I restarted the application server (Tomcat 5.5) several times, unfortunately without any success.
Best regards,
Sebastian
[891 byte] By [
suelmanna] at [2007-11-26 17:07:04]

# 1
Too many things can be the source of the problem:
Did you double or triple-check the spelling of the class package?
Did you try putting the jar files in the tomcat lib folder to see if it would work?
If you are using war file are you sure sure you didn't forget to repackage and redeploy the war file?
Are you using the same JDK version for compiling the class and running tomcat?
# 3
Thanks for your replies!
I checked again the spelling of the package and compared the Java versions (both 1.4.2). I put the jar file in tomcathome/common/lib as well as in tomcathome/shared/lib, stopped Tomcat, cleaned up the work folder and started it again (don't know how often now).
But it always ends up in the same error exception. Does anybody know about some issue with a Tomcat server 5.5? Or do I need some special code within my Java lines:
// Start Code
package com.myPackage;
public class MyClass {
public String myFunction() {
return "Hello world";
}
}
// End Code
# 5
The problem seems really that I created the files on another system (but with the same java version). As I created now the files directly on the server, the error messages changed : )
No, the server finds the classes. Proof: If I wanna call function not included in the class, I get the message 'Couldn't find method myFunctionTest in class com.myPackage.MyClass ==> java.lang.NoSuchMethodException' which is absolutely correct.
But if I call an existing function I get:
XPRESS exception ==> java.lang.NullPointerException:
There are no entries (except '<invoke name='myFunction' class='com.myPackage.MyClass'>') in the Tomcat's logfile.
Does this sound familiar to anybody?
# 6
Check for my thread http://forum.java.sun.com/thread.jspa?threadID=5131601I had the same problem, I am still not sure the reason for the problem but putting <List> around invoke helped, check for the corrections in my XPress.thanks,
# 7
It works right now! The problem is that I've got to compile the files directly on the server. Thereason for the later 'XPRESS exception ==> java.lang.NullPointerException:' message was an old file with the same class name in the /WEB-INF/lib folder.
I'm still not sure what's the real problem is but I guess I'll set up a new machine and try it with a clean version.
Thanks a lot for your support, guys