urgent: rpc call with user-defined type parameter

4 views
Skip to first unread message

abo

unread,
Mar 15, 2007, 4:57:26 AM3/15/07
to Google Web Toolkit
I have just developed a web application with GWT1.2.2. It runs without
any problem in hosted-mode. But when I deploy it in Tomcat 5.5, some
rpc calls fail. rpc call like 'MyClass myRPCCall(int int1, String
str1, ...)' works fine, but rpc call like 'int myRPCCall(MyClass
myObj, ...)' fails. Seems Method parameters can not be user defined
type. Following is the tomcat log when rpc method with user defined
type parameter is called. (where Profile is a user defined type)


2007-3-15 14:46:16 org.apache.catalina.core.ApplicationContext log
严重: Exception while dispatching incoming RPC call
com.google.gwt.user.client.rpc.SerializationException:
java.lang.ClassNotFoundException: com.xxx.common.Profile
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:
150)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:
59)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeValue(ServerSerializationStreamReader.java:
62)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
251)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:
146)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
869)
at org.apache.coyote.http11.Http11BaseProtocol
$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:
664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:
527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:
80)
at org.apache.tomcat.util.threads.ThreadPool
$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.xxx.common.Profile
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:
128)
... 20 more

has anyone known how to solve this problem?

Kirin

unread,
Mar 15, 2007, 5:30:19 AM3/15/07
to Google Web Toolkit
the user define object must implements IsSerialisable interface, do
you implements it ?

Luciano Broussal

unread,
Mar 15, 2007, 6:36:04 AM3/15/07
to Google Web Toolkit
Kirin is right!
take care also that all the properties members are also
isSerializable.

abo

unread,
Mar 15, 2007, 10:17:20 PM3/15/07
to Google Web Toolkit
Yes, they are isSerializable. In fact they can be used as return type,
but when they are used as parameters, problem arises.


On 3月15日, 下午5时30分, "Kirin" <kiri...@gmail.com> wrote:
> the user define object must implements IsSerialisable interface, do
> you implements it ?
>
> On 15 mar, 09:57, "abo" <eyu...@gmail.com> wrote:
>
>
>
> > I have just developed a web application with GWT1.2.2. It runs without
> > any problem in hosted-mode. But when I deploy it in Tomcat 5.5, some
> > rpc calls fail. rpc call like 'MyClass myRPCCall(int int1, String
> > str1, ...)' works fine, but rpc call like 'int myRPCCall(MyClass
> > myObj, ...)' fails. Seems Method parameters can not be user defined
> > type. Following is the tomcat log when rpc method with user defined
> > type parameter is called. (where Profile is a user defined type)
>
> > 2007-3-15 14:46:16 org.apache.catalina.core.ApplicationContext log
> > 严重: Exception while dispatching incoming RPC call
> > com.google.gwt.user.client.rpc.SerializationException:
> > java.lang.ClassNotFoundException: com.xxx.common.Profile
> > at

> > com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deseria-lize(ServerSerializationStreamReader.java:
> > 150)
> > at
> > com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readO-bject(AbstractSerializationStreamReader.java:
> > 59)
> > at
> > com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deseria-lizeValue(ServerSerializationStreamReader.java:
> > 62)
> > at
> > com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServi-ceServlet.java:
> > 251)
> > at
> > com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceSer-vlet.java:


> > 146)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> > at

> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio-nFilterChain.java:
> > 252)
> > at
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC-hain.java:
> > 173)
> > at
> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j-ava:
> > 213)
> > at
> > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j-ava:


> > 178)
> > at
> > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
> > 126)
> > at
> > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
> > 105)
> > at

> > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav-a:


> > 107)
> > at
> > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
> > 148)
> > at
> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
> > 869)
> > at org.apache.coyote.http11.Http11BaseProtocol
> > $Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:
> > 664)
> > at

> > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.ja-va:
> > 527)
> > at
> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerW-orkerThread.java:


> > 80)
> > at org.apache.tomcat.util.threads.ThreadPool
> > $ControlRunnable.run(ThreadPool.java:684)
> > at java.lang.Thread.run(Unknown Source)
> > Caused by: java.lang.ClassNotFoundException: com.xxx.common.Profile
> > at java.net.URLClassLoader$1.run(Unknown Source)
> > at java.security.AccessController.doPrivileged(Native Method)
> > at java.net.URLClassLoader.findClass(Unknown Source)
> > at java.lang.ClassLoader.loadClass(Unknown Source)
> > at java.lang.ClassLoader.loadClass(Unknown Source)
> > at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> > at java.lang.Class.forName0(Native Method)
> > at java.lang.Class.forName(Unknown Source)
> > at

> > com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deseria-lize(ServerSerializationStreamReader.java:
> > 128)
> > ... 20 more
>
> > has anyone known how to solve this problem?- 隐藏被引用文字 -
>
> - 显示引用的文字 -

jo

unread,
Mar 16, 2007, 5:07:51 AM3/16/07
to Google Web Toolkit
is there a default ctor in your class?

abo

unread,
Mar 16, 2007, 5:57:56 AM3/16/07
to Google Web Toolkit
thank you.

but i don't know what ctor means. could you explain a little?

abo

unread,
Mar 16, 2007, 6:14:16 AM3/16/07
to Google Web Toolkit
now i know what default ctor means, but why a default ctor is needed
for user-defined type? without the default ctor, user-defined type
works well in hosted mode rpc, and also works well as return type of
rpc methods in web mode. problem arises onle when user-defined type is
use as parameter in rpc methods in web mode.

On 3月16日, 下午5时07分, "jo" <netzwerk-explo...@gmx.de> wrote:

Reply all
Reply to author
Forward
0 new messages