Problem running WebServiceExample1 in RemoteAPI project

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
drbaz
Member II

Problem running WebServiceExample1 in RemoteAPI project

When I run the org.alfresco.example.webservce.sample.WebServiceExample1, I get the following error:
Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: Premature end of file.
faultActor:
faultNode:
faultDetail:
   {http://xml.apache.org/axis/}stackTraceSmiley Surprisedrg.xml.sax.SAXParseException: Premature end of file.
   etc etc etc

Any suggestions ?

Other examples run OK
10 Replies
rwetherall
Active Member II

Re: Problem running WebServiceExample1 in RemoteAPI project

Hi,

Yup, I think this has alredy been spotted and fixed.  Is in the next release or you can pick it up in one of the nighlty builds.

Thanks,
Roy
drbaz
Member II

Re: Problem running WebServiceExample1 in RemoteAPI project

Thanks Roy

Just read the previous post re this error, so I picked up the latest nightly build dated 29.11.2505. I extracted the archive to overwrite my projects folder and refreshed my Eclipse projects.
Now I get several compilation errors, which I didn't get in the Release 1 source.

When downloading a nightly release, should I just pick the classes I need and overwrite existing files… or did I do right in overwriting everything ?

Thanks

Barrie
drbaz
Member II

Re: Problem running WebServiceExample1 in RemoteAPI project

solved my problem in loading anightly build into Eclipse - created a new workspce an dimported the new project s.

But I'm still getting the same error when I run the WebServiceSample1

Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: Premature end of file.
faultActor:
rwetherall
Active Member II

Re: Problem running WebServiceExample1 in RemoteAPI project

Hi,

Sorry the update didn't fix your problem.  I've re-tested here and it seams ok. 

Could you turn on the logging by adding these lines to the log4J.properties file found in core/source/java.


log4j.logger.org.alfresco.repo.webservice=debug
log4j.logger.org.alfresco.example.webservice=debug

It might give us some clues (about both problems).

Do the other samples work?

Thanks,
Roy
rsfeir
Member II

Re: Problem running WebServiceExample1 in RemoteAPI project

Hum..  I'm following the WebService sample 1 stuff and am getting this too, and am not entirely sure what the issue is.  I am running with 1.0 release though, but judging from when this problem was fixed it seems it should be in this release no?

My understanding of the error is that it's a schema corruption or incomplete schema.

Any clues?

R
drbaz
Member II

Re: Problem running WebServiceExample1 in RemoteAPI project

Here's the error message from Eclipse:

Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: Premature end of file.
faultActor:
faultNode:
faultDetail:
   {http://xml.apache.org/axis/}stackTraceSmiley Surprisedrg.xml.sax.SAXParseException: Premature end of file.
   at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
   at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:215)
   at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:386)
   at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
   at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:230)
   at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:798)
   at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
   at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
   at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
   at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
   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:424)
   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:2765)
   at org.apache.axis.client.Call.invoke(Call.java:2748)
   at org.apache.axis.client.Call.invoke(Call.java:2424)
   at org.apache.axis.client.Call.invoke(Call.java:2347)
   at org.apache.axis.client.Call.invoke(Call.java:1804)
   at org.alfresco.example.webservice.repository.RepositoryServiceSoapBindingStub.getStores(RepositoryServiceSoapBindingStub.java:666)
   at org.alfresco.example.webservice.sample.WebServiceSample1.main(WebServiceSample1.java:87)

   {http://xml.apache.org/axis/}hostname:linuxserver

org.xml.sax.SAXParseException: Premature end of file.
   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:424)
   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:2765)
   at org.apache.axis.client.Call.invoke(Call.java:2748)
   at org.apache.axis.client.Call.invoke(Call.java:2424)
   at org.apache.axis.client.Call.invoke(Call.java:2347)
   at org.apache.axis.client.Call.invoke(Call.java:1804)
   at org.alfresco.example.webservice.repository.RepositoryServiceSoapBindingStub.getStores(RepositoryServiceSoapBindingStub.java:666)
   at org.alfresco.example.webservice.sample.WebServiceSample1.main(WebServiceSample1.java:87)
Caused by: org.xml.sax.SAXParseException: Premature end of file.
   at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
   at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:215)
   at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:386)
   at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
   at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:230)
   at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:798)
   at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
   at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
   at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
   at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
   at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
   at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
   … 10 more

I will e-mail the alfreso log file
rsfeir
Member II

Re: Problem running WebServiceExample1 in RemoteAPI project

Mine is the same, this is jboss running in IntelliJ IDEA while debugging, the same thing happens outside the IDE as well:

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: Premature end of file.
faultActor:
faultNode:
faultDetail:
   {http://xml.apache.org/axis/}stackTraceSmiley Surprisedrg.xml.sax.SAXParseException: Premature end of file.
   at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
   at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:215)
   at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:386)
   at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
   at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:230)
   at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:798)
   at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
   at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
   at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
   at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
   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 org.alfresco.www.ws.service.repository._1_0.RepositoryServiceSoapBindingStub.getStores(RepositoryServiceSoapBindi...
   at gov.nih.niaid.eric.WebServiceCallback.getAuth(WebServiceCallback.java:63)
   at gov.nih.niaid.eric.WSViewPortlet.getAuth(WSViewPortlet.java:17)
   at system.gov.nih.niaid.eric.WSViewPortletTest.testAuthentication(WSViewPortletTest.java:15)
   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:585)
   at junit.framework.TestCase.runTest(TestCase.java:154)
   at junit.framework.TestCase.runBare(TestCase.java:127)
   at junit.framework.TestResult$1.protect(TestResult.java:106)
   at junit.framework.TestResult.runProtected(TestResult.java:124)
   at junit.framework.TestResult.run(TestResult.java:109)
   at junit.framework.TestCase.run(TestCase.java:118)
   at junit.framework.TestSuite.runTest(TestSuite.java:208)
   at junit.framework.TestSuite.run(TestSuite.java:203)
   at junit.textui.TestRunner.doRun(TestRunner.java:116)
   at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57)
   at junit.textui.TestRunner.start(TestRunner.java:172)
   at com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23)
   at com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:97)
   at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)

   {http://xml.apache.org/axis/}hostname:sfeirr

org.xml.sax.SAXParseException: Premature end of file.
   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.www.ws.service.repository._1_0.RepositoryServiceSoapBindingStub.getStores(RepositoryServiceSoapBindi...
   at gov.nih.niaid.eric.WebServiceCallback.getAuth(WebServiceCallback.java:63)
   at gov.nih.niaid.eric.WSViewPortlet.getAuth(WSViewPortlet.java:17)
   at system.gov.nih.niaid.eric.WSViewPortletTest.testAuthentication(WSViewPortletTest.java:15)
   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:585)
   at junit.framework.TestCase.runTest(TestCase.java:154)
   at junit.framework.TestCase.runBare(TestCase.java:127)
   at junit.framework.TestResult$1.protect(TestResult.java:106)
   at junit.framework.TestResult.runProtected(TestResult.java:124)
   at junit.framework.TestResult.run(TestResult.java:109)
   at junit.framework.TestCase.run(TestCase.java:118)
   at junit.framework.TestSuite.runTest(TestSuite.java:208)
   at junit.framework.TestSuite.run(TestSuite.java:203)
   at junit.textui.TestRunner.doRun(TestRunner.java:116)
   at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57)
   at junit.textui.TestRunner.start(TestRunner.java:172)
   at com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23)
   at com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:97)
   at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)
Caused by: org.xml.sax.SAXParseException: Premature end of file.
   at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
   at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:215)
   at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:386)
   at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
   at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:230)
   at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:798)
   at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
   at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
   at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
   at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
   at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
   at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
   … 30 more

junit.framework.AssertionFailedError: The ticket is not supposed to be null
   at system.gov.nih.niaid.eric.WSViewPortletTest.testAuthentication(WSViewPortletTest.java:16)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)
rwetherall
Active Member II

Re: Problem running WebServiceExample1 in RemoteAPI project

Hi rsfeir,

Yes, these errors at a glance do look like there is something wrong with the schema or data being passed, but in fact this is usually a red Herring.  It seams, from the little I have used it, Axis doesn't do a great job of helping you to debug errors when they occur.

There is definitely a bug in 1.0 getStores example, so taking the nightly build or 1.1 (which is due early next week) is a good idea.

The best way to see whats going on is to turn the logging on and have a look at the output from TomCat. (see above for the lines to add)

From your stack trace it looks like you have added your own authentication callback 'gov.nih.niaid.eric.WebServiceCallback.getAuth' and this is what is causing you the problems since the ticket is failing to authenticate 'The ticket is not supposed to be null '.

Do the other samples work for you or do you get a similar problem?

Thanks,
Roy
rsfeir
Member II

Re: Problem running WebServiceExample1 in RemoteAPI project

I haven't tried the other samples to be honest.  I'm going to get the nightly and see what's up.

Yes I have my own class, but that's only because I was moving code from the sample to ours so I can slowly refactor it and put in shape of what we'll end up using.  So the class itself instead of being called WebServiceSample1 it's just called WebServiceCallback for now, and the reason you see the ticket is not supposed to be null is because I'm testing via a junit test and the ticket object returns null because of the above failure.  I know the ticket is not null because when I step through the debugger I can see the ticket id String, and when I look further at the soap object, I can see that I even connected to the server correctly, authenticated the first time, and got a jsessionid back from the server.

I'm gonna try the nightly and report back.

Thanks much.

Robert