Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JBoss 7.0 - GWT - Exception while dispatching incoming RPC call

I am currently migrating GWT apps from JBoss 5.1 to JBoss 7.0 EAP server.
I have bundled gwt-servlet.jar in the war deployed to server
I am getting the below error.

05:11:49,068 ERROR [io.undertow.servlet] (default task-5) Exception while dispatching incoming RPC call: com.google.gwt.user.client.rpc.SerializationException: Type 'java.io.FileNotFoundException' 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 = java.io.FileNotFoundException
        at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:667)
        at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:130)
        at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:153)
        at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:587)
        at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:605)
        at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:393)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:579)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:265)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:305)
        at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
        at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
        at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
        at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
        at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
        at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
        at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
        at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:285)
        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:264)
        at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
        at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:175)
        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:792)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

Why am I getting FileNotFoundException here. Please help to resolve the above issue.

like image 389
Karthik Avatar asked Feb 13 '17 12:02

Karthik


2 Answers

Building on El Hoss's answer:

Somewhere in your GWT client code, you're trying to access a file.

In your JBoss 5 environment, this file was available. Because the file was available, a FileNotFoundException was never generated, so GWT never tried to load or serialize that class and thus it never failed (it only does so for classes reachable from the entry point).

Now, in your JBoss 7 environment, this file is not available for some reason. Because the file is not available, a FileNotFoundException is being created on the GWT client code, but GWT doesn't know about that class (it is not included in GWT's Java emulation library), so it fails.

You can solve the problem by finding the missing file and making it available again.

On top of that, it'd be better yet if you refactored your client code so it doesn't throw exceptions that are not included in the emulation library.

like image 168
walen Avatar answered Oct 16 '22 07:10

walen


java.io.FileNotFoundException

is not part of the emulation library and there fore can not be used on the client side!

Take a look here: GWT Java emulation library

like image 28
El Hoss Avatar answered Oct 16 '22 08:10

El Hoss