axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stadelmann Josef" <josef.stadelm...@axa-winterthur.ch>
Subject AW: [axis2] Exception on element.getXMLStreamReader().getCharacterEncodingScheme().toString();
Date Mon, 07 Nov 2011 10:37:54 GMT
Thank you very much Andrea,

OK I understand now.
And you hit the nail 100%.

Many changes have been made to Axiom since we used the version delivered with Axis2-1.2 
BTW this version runed so well on our server now since 5 years.

The Axiom version, delivered  with Axis2-1.6.1, has changed, an hence we get that error.

Josef



-----Ursprüngliche Nachricht-----
Von: Andreas Veithen [mailto:andreas.veithen@gmail.com] 
Gesendet: Donnerstag, 3. November 2011 20:45
An: java-user@axis.apache.org
Betreff: Re: [axis2] Exception on element.getXMLStreamReader().getCharacterEncodingScheme().toString();

According to the Javadoc, XMLStreamReader#getCharacterEncodingScheme()
"Returns the character encoding declared on the xml declaration" and
"Returns null if none was declared". In your case, the XMLStreamReader
is obtained from an OMElement and is therefore synthetic (i.e. it is
not a real parser). In that case, there is no xml declaration and
getCharacterEncodingScheme() returns null. Older Axiom versions
incorrectly returned "UTF-8" in that case.

Andreas

On Thu, Nov 3, 2011 at 19:49, Stadelmann Josef
<josef.stadelmann@axa-winterthur.ch> wrote:
> I am migrating our well working webservice based on AXIS2-1.2 / JDK 1.5.0_18
> to AXIS2-1.6.1 JDK 1.5.0_18 on OpenVMS
>
> Our webservice was rebuilt against Axis2-1.6.1 and deployes correct, and
> works to some degree, but fails with certain statements.
>
> i.e. The following program segment raises an error now, with AXIS2-1.6.1 but
> was working the past years very well with AXIS2-1.2
>
>
>
>                 element is of type OMElement from axiom
>
>             element.build();
>
>             element.detach();
>
>             //extract SPS-Payload Part from Payload
>
>             OMElement payIN = getLoginPayload(element);
>
>             if (null == payIN) {
>
>                 return setErrorInElement("Authenticate",10003,"No PAYLOAD
> passed to SpezplaService",0,"","NO");
>
>             }
>
>             String username = getFLDVAL(payIN, "USERNAME");
>
>             String serverpa = getFLDVAL(payIN, "SERVERPATH");
>
>             this.log.info("  USERNAME: "+username+"   SERVERPATH:
> "+serverpa);
>
> [394]       this.log.info("get encoding *******************");
>
> [395]       String enc =
> element.getXMLStreamReader().getCharacterEncodingScheme().toString();
>
> [396]       this.log.info("Encoding use: "+enc);
>
> The log shows
>
> [INFO]   USERNAME: adminp   SERVERPATH:
>
> [INFO] get encoding *******************
>
> java.lang.NullPointerException
>
>         at
> axawl.spezpla.servers.SpezplaService.SpServer.login(SpServer.java:395)
>
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
>         at java.lang.reflect.Method.invoke(Method.java:592)
>
>         at
> org.apache.axis2.receivers.RawXMLINOutMessageReceiver.invokeBusinessLogic(RawXMLINOutMessageReceiver.java:97)
>
>         at
> org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:42)
>
>         at
> org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
>
>         at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
>
>         at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
>
>         at
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146)
>
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
>
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
>
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
>
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
>
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
>
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
>
>         at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
>
>         at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
>
>         at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
>
>         at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
>
>         at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
>
>         at java.lang.Thread.run(Thread.java:595)
>
> [ERROR] Unknown Java exception took place within SpezplaService.
>
> Any clue what is wrong, can help AND
>
> sorry to ask here but - HP - deliverd a JVM with no JPDA debugger port for
> OpenVMS JDK 1.5. or JDK 1.6 on Itanium OpenVMS.
>
> I am currently moving my code to Windows Vista and rebuild it and test it
> there and maybe it fails only on OpenVMS. !
>
> Josef

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Mime
View raw message