Nobody?

well i got a bit further:
i created a clean translatable bean, as shared between legacy and GWT
and the legacy bean is extending it.
so i have now a entrypoint-less gwt module with those shared beans.
and everything compiles nicely (i first tried with just an interface,
but then it did not compile at all, why??),
but when executing the RPC service i get:

Feb 17, 2010 1:07:32 PM org.apache.catalina.core.ApplicationContext
log
SEVERE: Exception while dispatching incoming RPC call
com.google.gwt.user.client.rpc.SerializationException: Type
'legacybean' was not included in the set of types which can be
serialized by this SerializationPolicy or its Class object could not
be loaded. For security purposes, this type will not be serialized.:
instance = some text
        at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:
610)
        at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:
129)
        at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter
$ValueWriter$8.write(ServerSerializationStreamWriter.java:152)
        at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:
534)
        at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:609)
        at
com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess(RPC.java:
467)
        at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
564)
        at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
188)
        at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:
224)
        at
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:
62)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
290)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
206)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
233)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
191)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
128)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
102)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
109)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
293)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
849)
        at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:
454)
        at java.lang.Thread.run(Thread.java:619)

so my question is:
why is GWT trying to use the legacy bean (which is not translatable to
js) and not the implemented shared bean i am using in my GWT code??

here is the big picture again:

legacy code (no translatable into js):
- class LegacyBeanFactory
  - method getBean

- class LegacyBean extends SharedBean
  - getters and setters

shared code (translatable in js):
- class SharedBean
    - getters and setters (a translatable subset from LegacyBean)

gwt code:
- BeanService
  - method SharedBean getBean() { return LegacyFactory.getBean(); }

can somebody tell what is wrong here?
or how to achieve something similar?

many thanks
Michael

On Feb 16, 1:23 pm, mmoossen <[email protected]> wrote:
> Dear all!
>
> i am wondering if the is a good way to re-use legacy code in GWT.
>
> the use case is to extend a well established webapp with GWT, where
> the legacy code has several beans that perfectly fit in the 'shared'
> package of a GWT module, ie. that can/should be used in the server, as
> well as translated into js in the client.
>
> the problem is that those beans are part of packages with lot of other
> classes that do not fit for js translation, but GWT only allows me to
> 'import' whole packages with the 'source' node of a *.gwt.xml module
> configuration file.
>
> on the other hand, it would be easy to rewrite the beans for exclusive
> use in the GWT module, but then i will have to always translate the
> legacy beans into the gwt beans and vice-versa, which could be a very
> expensive and unnecessary task...
>
> so i am just wondering if there is any way to use my legacy code
> without the expensive translation process...
>
> mmm.... i see it is even not THAT easy, since in one of those beans
> there is for instance a constructor i know i wont use in GWT, which
> uses *bad* classes...
> it would be great to have some annotations to tell GWT that some
> classes/methods are (or are not) to be translated into js...
>
> i realize by myself that chances to be able to do what i need are not
> big.
> but i would wonder if there has not been anybody else facing this
> problem...
> so any help is very much appreciated...
>
> thanks
> Michael

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to