Read the javadocs for java.io.Serializable.
Your request is being marshalled between the web container and the ejb container which requires that
the classes be serializable.
Don't worry about the bean or home classes look at the
I've checked all the classes I use for parameters. All of them are serializable and have a no-arg constructor.
In that case it must the class returned by
This is one of those annoying java things.
Anybody can claim
in their class definition but you don't know it's
not true until it falls over at runtime.
If it's a serialization problem, why don't I get this error from my standalone app ?
What do you mean by standalone app.
Is it in the same VM or are you running a separate
servlet to j2ee should be the same as
client to j2ee except servlet to j2ee can be optimized
if the web container runs in the same VM.
But the marshalling means you are running
I run a separate client with exactly the same code as the servlet for the ejb calls.
That's why I don't understand I get an error in one case only.
Do you have something configured differently,
e.g. You are using transactions or security in the
servlets but not in the client app?
It might be that this part isn't serializable?
well, there's no special configuration with tomcat and I don't use transactions or security apis.
The only thing I'm sure about is that this problem comes from the arguments.For my tests, if I hardcode the parameters and remove the arguments, I get a successfull response.
I have now to understand why in a servlet it throws an exception and why it works fine from my command line app.
I'll try to go deeply in the tomcat configuration files to be sure there's not a special configuration I had not seen.
First of all, I will try with a new install of tomcat.
I will let you know if I find something that may help other guys.
Thanks a lot for your help Adrian.
Have you tried with Jetty ? I had nightmares with Tomcat because of the classloader and swaped to Jetty and everything is fine now.
maybe I should install jboss and tomcat from the bundle zip file available here.
Because I'm using a Tomcat instance installed far before jboss.
I'd prefer to continue using tomcat instead of switching to jetty because I have a lot of stuff in production running under tomcat.
we used Tomcat and Jboss in two different VM's without problems.
Have You double checked, that the jBoss client classes and Your ejb classes in tomcat classpath /lib directory? And the version of the classes the same as under jBoss?
yes, the classpath are corrects.
I have more details : if I refresh the servlet page in my browser, I get another error message for the second call :
at java.io.ObjectInputStream.allocateNewObject(Native Method)
at $Proxy0.create(Unknown Source)
at ...... my code : home.create();
But the first message is always this one at the top of this forum page
Perhaps you could try to reproduce this is a small
test application and post the code.
If it works for us, you know it's your configuration.
If it doesn't work for us, we should be able to tell
You haven't mentioned which versions of JBoss and
Tomcat you are using?
I use jboss2.4.3 and tomcat 4.0.
I don't know how to send you my servlet code since I use many external apis like SAP access.
I have a test application on command line. it works fine.