Content is not allowed in Prolog SAXParserException - java

I am trying to call a web service but facing a strange behavior. we have a web-service running on my server but the code is not open to us so can not see what going on behind the wall
The owner of the service have exposed web based test client UI which take input in a text box and will show the response to testing purpose.This input box is taking the input in the below mentioned format
<CONTENT>
<CONTENTID></CONTENTID>
<DOCUMENTID>DRI2</DOCUMENTID>
<LOCALECODE>en_US</LOCALECODE>
<LATEST_VERSION>false</LATEST_VERSION>
<INCREASEVIEWCOUNT>false</INCREASEVIEWCOUNT>
<ACTIVITY_TYPE></ACTIVITY_TYPE>
</CONTENT>
its working fine on this UI but when i am trying to call this web service through my java code its getting connected as well getting authorized by the service but when i trying to call the above method it giving me the below error message
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: Content is not allowed in prolog.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Content is not allowed in prolog.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.inquira.imwows.generated.ContentServicesSoapBindingStub.getContentRecord(ContentServicesSoapBindingStub.java:262)
at com.inquira.prep.GetWebService.getcontentRecord(GetWebService.java:87)
at com.inquira.prep.TestWs.main(TestWs.java:13)
{http://xml.apache.org/axis/}hostname:umeshawasthi
org.xml.sax.SAXParseException: Content is not allowed in prolog.
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:701)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.inquira.imwows.generated.ContentServicesSoapBindingStub.getContentRecord(ContentServicesSoapBindingStub.java:262)
at com.inquira.prep.GetWebService.getcontentRecord(GetWebService.java:87)
at com.inquira.prep.TestWs.main(TestWs.java:13)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
... 11 more
below is the code for generating the required XML
inputXml.append("<CONTENT>");
inputXml.append("<CONTENTID>").append("</CONTENTID>");
inputXml.append("<DOCUMENTID>").append("DRI2").append("</DOCUMENTID>");
inputXml.append("<LOCALECODE>").append("en_US").append("</LOCALECODE>");
inputXml.append("<LATEST_VERSION>").append("false").append("</LATEST_VERSION>");
inputXml.append("<INCREASEVIEWCOUNT>").append("false").append("</INCREASEVIEWCOUNT>");
inputXml.append("<ACTIVITY_TYPE>").append("</ACTIVITY_TYPE>");
inputXml.append("</CONTENT>");
and the generated XML is as below
<CONTENT><CONTENTID></CONTENTID><DOCUMENTID>DRI2</DOCUMENTID><LOCALECODE>en_US</LOCALECODE><LATEST_VERSION>false</LATEST_VERSION><INCREASEVIEWCOUNT>false</INCREASEVIEWCOUNT><ACTIVITY_TYPE></ACTIVITY_TYPE></CONTENT>
i even did timing of the generated string something as below
inputXml.toString().trim().replaceFirst("^([\\W]+)<","<");
but unable to find out whats going wrong,one thing i am sure there is some problem in the input XML as its working find on the test Page UI for the same XML
any help in this regard is much appricated

This error is probably related to a byte order mark (BOM) prior to the actual XML content. You need to parse the returned String and discard the BOM, so SAXParser can process the document correctly.
You will find a possible solution here.

to simply remove it, paste your xml file into notepad, you'll see the extra character before the first tag. Remove it & paste back into your file - bof

Check the XML. It is not a valid xml.
Prolog is the first line with xml version info. It ok not to
include it in your xml.
This error is thrown when the parser reads an invalid tag at the start of the document. Normally where the prolog resides.
e.g.
Root/><document>
Root<document>

This error can come if there is validation error either in your wsdl or xsd file. For instance I too got the same issue while running wsdl2java to convert my wsdl file to generate the client.
In one of my xsd it was defined as below
<xs:import schemaLocation="" namespace="http://MultiChoice.PaymentService/DataContracts" />
Where the schemaLocation was empty. By providing the proper data in schemaLocation resolved my problem.
<xs:import schemaLocation="multichoice.paymentservice.DataContracts.xsd" namespace="http://MultiChoice.PaymentService/DataContracts" />

I faced the same issue. Our application running on four application servers and due to invalid schema location mentioned on one of the web service WSDL, hung threads are generated on the servers . The appliucations got down frequently. After corrected the schema Location , the issue got resolved.

Related

How do you configure the spring integration poller after XSD changes have invalidated the fixed-delay and fixed-rate attributes?

Original xml:
<int:poller default="true" task-executor="stepTaskExecutor" fixed-delay="1000">
The fixed-delay attribute is no longer legal, and fails XML parsing in the (eclipse) IDE.
Alternative configuration:
An alternative suggested elsewhere (including https://docs.spring.io/spring-integration/docs/2.0.0.M3/spring-integration-reference/html/samples.html):
<!-- Globally scoped Spring Integration bean resources -->
<!-- see https://stackoverflow.com/questions/73450768/how-to-configure-channels-and-amq-for-spring-batch-integration-where-all-steps-a/73455134#73455134 -->
<!-- see https://stackoverflow.com/questions/28625635/attribute-fixed-rate-is-not-allowed-to-appear-in-element-intpoller -->
<int:poller default="true" task-executor="stepTaskExecutor">
<int:interval-trigger interval="1000"/>
</int:poller>
This passes the XML parsing in the IDE, but fails at runtime
Log snip:
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'int:interval-trigger'. One of '{"http://www.springframework.org/schema/integration":transactional, "http://www.springframework.org/schema/integration":advice-chain}' is expected.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNamespaceBinder.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:77)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:432)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
... 50 common frames omitted
Please advise.
Use Spring Tool Suite (eclipse), or add the spring tools plugin to your eclipse so that the schema is loaded from the jar file instead of from the internet.
https://spring.io/tools

JAX-WS not accepting "xmlns=..." in TAGs [duplicate]

I have a running JAX-WS webservice which already has some working endpoints. Now I'm having the following issue:
I'm having two different SOAP Requests here and I don't understand why the first one works but the second one does not.
The only obvious difference in the requests is that the first one specifies a namespace in the <Envelope> tag while the second one specifies it when calling the method <getMoldDataHistory>.
SOAP Request 1 - Not Working (Namespace is specified at the method call)
<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
>
<s:Body
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<getMoldDataHistory
xmlns="http://history.production.soap.webservices.product.company.at/">
<machineId>92623-15853588</machineId>
<start>0</start>
<end>0</end>
</getMoldDataHistory>
</s:Body>
</s:Envelope>
SOAP Request 2 - Working (Namespace is specified in the <Envelope> tag)
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:his="http://history.production.soap.webservices.product.company.at/">
<soapenv:Header/>
<soapenv:Body>
<his:getMoldDataHistory>
<machineId>92623-15853588</machineId>
<start>0</start>
<end>0</end>
</his:getMoldDataHistory>
</soapenv:Body>
</soapenv:Envelope>
The SOAP error message I'm getting when making the first (Not working) request.
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
<faultcode>S:Server</faultcode>
<faultstring>java.lang.IllegalArgumentException</faultstring>
</S:Fault>
</S:Body>
</S:Envelope>
The stacktrace of the exception thrown from the Server when receiving the first SOAP request.
java.lang.IllegalArgumentException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.reflect.misc.Trampoline.invoke(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.reflect.misc.MethodUtil.invoke(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.xml.internal.ws.api.server.MethodUtil.invoke(Unknown Source)
at com.sun.xml.internal.ws.api.server.InstanceResolver$1.invoke(Unknown Source)
at com.sun.xml.internal.ws.server.InvokerTube$2.invoke(Unknown Source)
at com.sun.xml.internal.ws.server.sei.EndpointMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.server.sei.SEIInvokerTube.processRequest(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)
at com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(Unknown Source)
at com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(Unknown Source)
at com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(Unknown Source)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(Unknown Source)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(Unknown Source)
at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
at sun.net.httpserver.AuthFilter.doFilter(Unknown Source)
at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(Unknown Source)
at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
at sun.net.httpserver.ServerImpl$Exchange.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
So I'm basically trying to figure out why the first request is not working despite it being a valid SOAP request. Is there anything I need to configure at my server to allow such requests?
EDIT:
After doing some more testing I found out that the position of the namespace declaration does NOT matter IF the method I call has 0 parameters. As soon as parameter is required it stops working.
EDIT 2:
Now I stumpled upon this thread here . I have the same issue. My C# Client who makes the requests does not use the namespace int the method TAG. After I add it it works.
Still how can I tell JAX-WS to deal with this.
Does not work:
<getMoldDataHistory xmlns="http://history.production.soap.webservices.product.company.at/">
Works:
<his:getMoldDataHistory xmlns:his="http://history.production.soap.webservices.product.company.at/">
When using a prefix bound to a namespace like in
<his:getMoldDataHistory xmlns:his="http://history.production.soap.webservices.product.company.at/">
<machineId>92623-15853588</machineId>
<start>0</start>
<end>0</end>
</his:getMoldDataHistory>
then only the element getMoldDataHistory is put into the specified namespace. The reason is that the syntax xmlns:his="..." only declares the prefix. This then must used at all elements that you want to be in the specified namespace. In this code snippet, the only element is getMoldDataHistory.
Using the xmlns="..." syntax like in
<getMoldDataHistory xmlns="http://history.production.soap.webservices.product.company.at/">
<machineId>92623-15853588</machineId>
<start>0</start>
<end>0</end>
</getMoldDataHistory>
not only declares the namespace, but also puts the associated element and all child elements into this namespace.
Conclusion: These two XML snippets are not semantically equivalent.
If there was such a thing as an "expanded element name" syntax, then these XML snippets would look like ...
First one:
<{http://history.production.soap.webservices.product.company.at/}getMoldDataHistory>
<{}machineId>92623-15853588</{}machineId>
<{}start>0</{}start>
<{}end>0</{}end>
</{http://history.production.soap.webservices.product.company.at/}getMoldDataHistory>
Second one:
<{http://history.production.soap.webservices.product.company.at/}getMoldDataHistory>
<{http://history.production.soap.webservices.product.company.at/}machineId>92623-15853588</{http://history.production.soap.webservices.product.company.at/}machineId>
<{http://history.production.soap.webservices.product.company.at/}start>0</{http://history.production.soap.webservices.product.company.at/}start>
<{http://history.production.soap.webservices.product.company.at/}end>0<{/http://history.production.soap.webservices.product.company.at/}end>
</{http://history.production.soap.webservices.product.company.at/}getMoldDataHistory>

Problem using google Maps on GWT

I am trying to use the latest jar of google-maps-api-v3 on GWT by following this tutorial step by step but when I try to use it in my application, I got this exception :
Loading modules
ht.haitidataservices.simplemap.SimpleMap
Loading inherited module 'com.google.gwt.maps.Maps'
[ERROR] Unable to find 'com/google/gwt/maps/Maps.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
[ERROR] Line 5: Unexpected exception while processing element 'inherits'
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:262)
at com.google.gwt.dev.cfg.ModuleDefSchema$BodySchema.__inherits_begin(ModuleDefSchema.java:495)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.util.xml.HandlerMethod.invokeBegin(HandlerMethod.java:230)
at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.startElement(ReflectiveParser.java:274)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.parse(ReflectiveParser.java:331)
at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.access$100(ReflectiveParser.java:48)
at com.google.gwt.dev.util.xml.ReflectiveParser.parse(ReflectiveParser.java:402)
at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:280)
at com.google.gwt.dev.cfg.ModuleDefLoader$1.load(ModuleDefLoader.java:192)
at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:308)
at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:151)
at com.google.gwt.dev.DevModeBase.loadModule(DevModeBase.java:979)
at com.google.gwt.dev.DevMode.loadModule(DevMode.java:548)
at com.google.gwt.dev.DevMode.doStartup(DevMode.java:436)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1045)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:804)
at com.google.gwt.dev.DevMode.main(DevMode.java:309)
[ERROR] Failure while parsing XML
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.util.xml.DefaultSchema.onHandlerException(DefaultSchema.java:58)
at com.google.gwt.dev.util.xml.Schema.onHandlerException(Schema.java:66)
at com.google.gwt.dev.util.xml.Schema.onHandlerException(Schema.java:66)
at com.google.gwt.dev.util.xml.HandlerMethod.invokeBegin(HandlerMethod.java:240)
at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.startElement(ReflectiveParser.java:274)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.parse(ReflectiveParser.java:331)
at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.access$100(ReflectiveParser.java:48)
at com.google.gwt.dev.util.xml.ReflectiveParser.parse(ReflectiveParser.java:402)
at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:280)
at com.google.gwt.dev.cfg.ModuleDefLoader$1.load(ModuleDefLoader.java:192)
at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:308)
at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:151)
at com.google.gwt.dev.DevModeBase.loadModule(DevModeBase.java:979)
at com.google.gwt.dev.DevMode.loadModule(DevMode.java:548)
at com.google.gwt.dev.DevMode.doStartup(DevMode.java:436)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1045)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:804)
at com.google.gwt.dev.DevMode.main(DevMode.java:309)
[ERROR] Unexpected error while processing XML
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.parse(ReflectiveParser.java:355)
at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.access$100(ReflectiveParser.java:48)
at com.google.gwt.dev.util.xml.ReflectiveParser.parse(ReflectiveParser.java:402)
at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:280)
at com.google.gwt.dev.cfg.ModuleDefLoader$1.load(ModuleDefLoader.java:192)
at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:308)
at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:151)
at com.google.gwt.dev.DevModeBase.loadModule(DevModeBase.java:979)
at com.google.gwt.dev.DevMode.loadModule(DevMode.java:548)
at com.google.gwt.dev.DevMode.doStartup(DevMode.java:436)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1045)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:804)
at com.google.gwt.dev.DevMode.main(DevMode.java:309)
[ERROR] shell failed in doStartup method
It seems it's a module problem, saying that it cannot find com/google/gwt/maps/Maps.gwt.xml. I don't understand since I follow the tutorial and I am sure that what I am doing is correct.
How can I solve this problem ? Thanks for your help
I am currently developping on JDK 1.6 with Eclipse Indigo on 64-bit Windows 7 system.
[EDIT] For precision, i added the google-maps jar in my application CLASSPATH and added the inherits line in my module file :
<module rename-to='egliseenquete'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.google.gwt.maps.Maps' />
....
</module>
[EDIT] I added the maps gwt jar on my CLASSPATH now I get this exception :
12:27:28.703 [ERROR] [egliseenquete] Unable to load module entry point class ht.haitidataservices.egliseenquete.client.EgliseEnquete (see associated exception for details)
java.lang.RuntimeException: Deferred binding failed for 'com.google.gwt.maps.client.impl.MapOptionsImpl' (did you forget to inherit a required module?)
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53)
at com.google.gwt.core.client.GWT.create(GWT.java:98)
at com.google.gwt.maps.client.impl.MapOptionsImpl.<clinit>(MapOptionsImpl.java:31)
at com.google.gwt.maps.client.MapOptions.<init>(MapOptions.java:40)
at ht.haitidataservices.egliseenquete.client.EgliseEnquete.buildMap(EgliseEnquete.java:100)
at ht.haitidataservices.egliseenquete.client.EgliseEnquete.onModuleLoad(EgliseEnquete.java:94)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:193)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IncompatibleClassChangeError: Found interface com.google.gwt.core.ext.typeinfo.JClassType, but class was expected
at com.google.gwt.jsio.rebind.JSWrapperGenerator.generate(JSWrapperGenerator.java:276)
at com.google.gwt.core.ext.GeneratorExtWrapper.generate(GeneratorExtWrapper.java:48)
at com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrementally(GeneratorExtWrapper.java:60)
at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:681)
at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:74)
at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:285)
at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:141)
at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:585)
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:455)
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
at com.google.gwt.core.client.GWT.create(GWT.java:98)
at com.google.gwt.maps.client.impl.MapOptionsImpl.<clinit>(MapOptionsImpl.java:31)
at com.google.gwt.maps.client.MapOptions.<init>(MapOptions.java:40)
at ht.haitidataservices.egliseenquete.client.EgliseEnquete.buildMap(EgliseEnquete.java:100)
at ht.haitidataservices.egliseenquete.client.EgliseEnquete.onModuleLoad(EgliseEnquete.java:94)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:193)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
at java.lang.Thread.run(Unknown Source)
How can I achieve this problem? Thx for help !!!
I was having a similar problem.
I ended up using this tutorial and it worked great. It is using gwt-maps-1.1.1.zip (Release date for this is much more recent for this one) and the latest GWT.
One thing to note, is that if you are looking at both tutorials to make sure you use:
<inherits name='com.google.gwt.maps.GoogleMaps' />
and not
<inherits name='com.google.gwt.maps.Maps' />
as they have changed the file name in the com.google.gwt.map package of the jar file.
I suspect that if you check the filename in the com.google.gwt.map package of the map jar file, that the file name you were using to inherit is off. Then changing that line to what I suggested should fix it.
Hopefully this helps!
Cheers
After looking inside of the jar file, I noticed that the path inheritance is incorrect for the xml file.
<inherits name='com.google.gwt.maps.GoogleMaps' /> --Is wrong path
<inherits name='com.google.maps.gwt.GoogleMaps' /> --Is correct path
Many hours wasted figuring this out, but this is the solution. Google made a mistake on their tutorial in this respect.

JUpload issue on jsp page

Im getting:
load: class wjhk.jupload2/JUploadApplet.class not found.
java.lang.ClassNotFoundException: wjhk.jupload2.JUploadApplet.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:http://test1/EAMAPP84/data/docuploads/ROADS/NoamTest/wjhk/jupload2/JUploadApplet/class.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 9 more
Exception: java.lang.ClassNotFoundException: wjhk.jupload2.JUploadApplet.class
on the java consule.
the applet is called:
<applet
code="wjhk.jupload2/JUploadApplet.class"
codebase="\EAMAPP84\data\docuploads\ROADS\NoamTest"
archive="JUpload.jar"
width="650"
height="400">
<param name="actionURL"
value="\\test1\EAMAPP84\data\docuploads\ROADS\NoamTest">
</applet>
while the jar is sitting in the given directory.
the wierd thing is, when i create a simple html file using this it works, butwhen using it in my jsp page i get this error.
anyone?
The code attribute should point to the fully qualified name of the class (the same as you would use in import statement of a normal Java class).
code="wjhk.jupload2.JUploadApplet"
The exception is by the way also hinting that:
java.lang.ClassNotFoundException: wjhk.jupload2.JUploadApplet.class
(the .class part doesn't belong there at all)
and also here:
java.io.IOException: open HTTP connection failed:http://test1/EAMAPP84
/data/docuploads/ROADS/NoamTest/wjhk/jupload2/JUploadApplet/class.class
(note the /class.class part which is obviously wrong)
code="wjhk.jupload2/JUploadApplet.class"
Should probably be..
code="wjhk.jupload2.JUploadApplet"

java.lang.ClassNotFoundException

I have embedded an applet (jar file)in a html page
Now when I am trying to access the web page , it is giving the following error.
<APPLET CODE="com.xxx.tru.ReadNFCSerialNumber" NAME="Read" ID="Read" MAYSCRIPT alt="Photo Id" ARCHIVE="\test.jar, \ojdbc14.signed.jar, \ojdbc14_g.signed.jar" WIDTH="100%" HEIGHT="100%" HSPACE="1" VSPACE="1">
</APPLET>
load: class com.xxx.tru.ReadNFCSerialNumber not found.
java.lang.ClassNotFoundException: com.xxx.tru.ReadNFCSerialNumber
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:http://localhost/popit/POPit/com/xxx/tru/ReadNFCSerialNumber.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 7 more
Exception: java.lang.ClassNotFoundException: com.xxx.tru.ReadNFCSerialNumber
What am i doing wrong??
The web browser is trying to load your class from the URI http://localhost/popit/POPit/com/xxx/tru/ReadNFCSerialNumber.class instead of your jar file. The contents of the ARCHIVE attribute looks suspicious to me. Is it really supposed to be a comma-and-space delimited list? Also, the backslashes in front of the file names look suspicious:
ARCHIVE="\test.jar, \ojdbc14.signed.jar, \ojdbc14_g.signed.jar"
I would suggest you look into fixing the ARCHIVE attribute and then see if the web browser will load the class file form the jar as you want it to do.
the CODEBASE attribute is missing. just a thought.code base

Categories

Resources