-
1. Re: home.create()
adrian.brock Jan 7, 2002 6:16 AM (in response to oli306)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
parameters.
Regards,
Adrian -
2. Re: home.create()
oli306 Jan 7, 2002 7:22 AM (in response to oli306)hi adrian,
I've checked all the classes I use for parameters. All of them are serializable and have a no-arg constructor. -
3. Re: home.create()
adrian.brock Jan 7, 2002 7:48 AM (in response to oli306)In that case it must the class returned by
home.create()
This is one of those annoying java things.
Anybody can claim
implements Serializable
in their class definition but you don't know it's
not true until it falls over at runtime.
Regards,
Adrian -
4. Re: home.create()
oli306 Jan 7, 2002 10:13 AM (in response to oli306)If it's a serialization problem, why don't I get this error from my standalone app ?
-
5. Re: home.create()
adrian.brock Jan 7, 2002 12:03 PM (in response to oli306)What do you mean by standalone app.
Is it in the same VM or are you running a separate
client?
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
non-optimized.
Regards,
Adrian -
6. Re: home.create()
oli306 Jan 8, 2002 9:08 AM (in response to oli306)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. -
7. Re: home.create()
adrian.brock Jan 8, 2002 1:53 PM (in response to oli306)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?
Regards,
Adrian -
8. Re: home.create()
oli306 Jan 9, 2002 4:47 AM (in response to oli306)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. -
9. Re: home.create()
cisbrh Jan 9, 2002 6:40 AM (in response to oli306)Have you tried with Jetty ? I had nightmares with Tomcat because of the classloader and swaped to Jetty and everything is fine now.
Benjamin -
10. Re: home.create()
oli306 Jan 9, 2002 7:44 AM (in response to oli306)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. -
11. Re: home.create()
andreas Jan 9, 2002 9:54 AM (in response to oli306)Hi Oli,
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? -
12. Re: home.create()
oli306 Jan 10, 2002 5:19 AM (in response to oli306)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 :
java.lang.NoClassDefFoundError
at java.io.ObjectInputStream.allocateNewObject(Native Method)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1347)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
at java.rmi.MarshalledObject.get(MarshalledObject.java:138)
at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invokeHome(HomeProxy.java:258)
at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:182)
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 -
13. Re: home.create()
adrian.brock Jan 10, 2002 6:59 AM (in response to oli306)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 why.
You haven't mentioned which versions of JBoss and
Tomcat you are using?
Regards,
Adrian -
14. Re: home.create()
oli306 Jan 10, 2002 8:41 AM (in response to oli306)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.
regards,
olivier