You don't show what stream you're passing in so I can't comment on if that
might be an issue but you should try setting namespaceAware to true like
this to see if it will cause the DeferredDocumentImpl to not be used. I use
code like this and works fine for me.

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder docBuilder = dbf.newDocumentBuilder();
Document document = docBuilder.parse(inputStream);

Stephen


On Thu, May 5, 2011 at 9:16 AM, Richie <richiejr...@gmail.com> wrote:

> Hey guys,
>
> I created an app where a user can upload an xml, I display the nodes
> in a GWT table then the user selects the nodes he/she wants to
> download. Sounds easy, works perfectly in hosted mode.
>
> I use only the base xml parsing, no 3rd party jars in the project
> (aside from commons-fileupload-1.2.1.jar, commons-io-1.3.2.jar,
> gxt-2.2.3-gwt22.jar).
>
>
> Here's the code I use for parsing the XML:
>
> import org.w3c.dom.Document;
> import org.w3c.dom.Element;
> import org.w3c.dom.NodeList;
>
> ...
>
>        public static Document getXml(InputStream stream) throws
> ParserConfigurationException, SAXException, IOException {
>
>        DocumentBuilder parser =
> DocumentBuilderFactory.newInstance().newDocumentBuilder();
>        // Parse xml data
>        Document xml = parser.parse(stream);
>
>        return xml;
>
>    }
>
> It's working perfectly in hosted mode, but when I upload it to the
> appengine servers I get the following exception:
>
> javax.servlet.ServletException: java.lang.RuntimeException:
> java.lang.ClassNotFoundException:
> com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl
>        at
>
> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:
> 240)
>        at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
> 152)
>        at org.mortbay.jetty.Server.handle(Server.java:326)
>        at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
> 542)
>        at org.mortbay.jetty.HttpConnection
> $RequestHandler.headerComplete(HttpConnection.java:923)
>        at
>
> com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:
> 76)
>        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>        at
>
> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:
> 135)
>        at
> com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:
> 260)
>        at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> $2.handleRequest(RuntimePb.java:9669)
>        at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
> 439)
>        at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:
> 573)
>        at com.google.tracing.TraceContext$TraceContextRunnable
> $1.run(TraceContext.java:448)
>        at com.google.tracing.TraceContext.runInContext(TraceContext.java:
> 688)
>        at com.google.tracing.TraceContext
>
> $AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:
> 326)
>        at com.google.tracing.TraceContext
> $AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:
> 318)
>        at com.google.tracing.TraceContext
> $TraceContextRunnable.run(TraceContext.java:446)
>        at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
> 1110)
>        at java.util.concurrent.ThreadPoolExecutor
> $Worker.run(ThreadPoolExecutor.java:603)
>        at java.lang.Thread.run(Thread.java:636)
> Caused by: java.lang.RuntimeException:
> java.lang.ClassNotFoundException:
> com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl
>        at
>
> com.google.apphosting.runtime.jetty.SessionManager.deserialize(SessionManager.java:
> 421)
>        at
>
> com.google.apphosting.runtime.jetty.SessionManager.createSessionFromEntity(SessionManager.java:
> 382)
>        at
>
> com.google.apphosting.runtime.jetty.SessionManager.loadSession(SessionManager.java:
> 320)
>        at
>
> com.google.apphosting.runtime.jetty.SessionManager.getSession(SessionManager.java:
> 288)
>        at
>
> org.mortbay.jetty.servlet.AbstractSessionManager.getHttpSession(AbstractSessionManager.java:
> 237)
>        at
>
> org.mortbay.jetty.servlet.SessionHandler.setRequestedId(SessionHandler.java:
> 246)
>        at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
> 136)
>        at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
> 765)
>        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
> 418)
>        at
>
> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:
> 238)
>        ... 19 more
> Caused by: java.lang.ClassNotFoundException:
> com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl
>        at
>
> com.google.apphosting.runtime.security.UserClassLoader.loadClass(UserClassLoader.java:
> 445)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>        at java.lang.Class.forName0(Native Method)
>        at java.lang.Class.forName(Class.java:264)
>        at com.google.apphosting.runtime.jetty.SessionManager
> $DelegatingObjectInputStream.resolveClass(SessionManager.java:476)
>        at
> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:
> 1592)
>        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:
> 1513)
>        at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:
> 1749)
>        at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
>        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368)
>        at java.util.HashMap.readObject(HashMap.java:1047)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 57)
>        at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
> 43)
>        at java.lang.reflect.Method.invoke(Method.java:616)
>        at
> java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:
> 991)
>        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:
> 1865)
>        at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:
> 1770)
>        at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
>        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368)
>        at
>
> com.google.apphosting.runtime.jetty.SessionManager.deserialize(SessionManager.java:
> 417)
>        ... 28 more
>
>
> I have a suspicion, that it's not even related to the xml parsing(the
> class it can't find says otherwise tho) because after I stripped
> EVERYTHING from my server side classes, only the method stubs
> remained, commented the imports and it still throws this exception.
>
> It's only an empty skeleton and produces this weird exception that it
> absolutely shouldn't.
>
> Please help me, I can't seem to find any solutions. :S
>
> Richie
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-java@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to