cancel
Showing results for 
Search instead for 
Did you mean: 

SAXException during Authentication - please help

jfrench
Champ in-the-making
Champ in-the-making
I have alfresco 1.2.1 successfully running in jboss, however, when I try to connect to the web server with the following code:


        AuthenticationUtils.startSession("admin", "admin");
       
        try
        { // do something  
        }
        finally
        {
            // End the session
            AuthenticationUtils.endSession();
        }


I get the following Exception:


Caused by: org.xml.sax.SAXException: Processing instructions are not allowed within SOAP messages
        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 org.alfresco.webservice.authentication.AuthenticationServiceSoapBindingStub.startSession(AuthenticationServiceSoapBindingStub.java:187)
        at org.alfresco.webservice.util.AuthenticationUtils.startSession(AuthenticationUtils.java:70)
        … 151 more
Caused by: org.xml.sax.SAXException: Processing instructions are not allowed within SOAP messages
        at org.apache.axis.encoding.DeserializationContext.startDTD(DeserializationContext.java:1161)
        at org.apache.xerces.parsers.AbstractSAXParser.doctypeDecl(Unknown Source)
        at org.apache.xerces.impl.dtd.XMLDTDValidator.doctypeDecl(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentScannerImpl.scanDoctypeDecl(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(Unknown Source)
        at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
        … 161 more

I've looked at the axis 1.4 DeserializationContext.startDTD method and it appears that it *always* throws this Exception. What am I doing wrong?

java -version:  java version "1.5.0_06"
jboss AS: jboss-4.0.SPI
I'm unsure of the version of xerces I'm using, but I believe it is the default one with JBoss.
1 REPLY 1

jfrench
Champ in-the-making
Champ in-the-making
The issue was that JBoss wasn't finding my webserviceclient.properties file because of the bug fixed in this JIRA issue:

http://www.alfresco.org/jira/browse/AR-589

because the web-service-client wasn't finding the properties file, the web-service code was trying to connect to the wrong url. I found this by enabling the tomcat RequestDumperValue and examining the Http request before the stack trace.

Although this proved easy to fix and just a problem in configuration, it was difficult to discover because the stack trace lead me down several other paths. Is it possible to throw a better exception which indicates or at least prints out the current web service configuration so the programmer has a clue what is going on?