AnsweredAssumed Answered

org.xml.sax.SAXParseException: Premature end of file

Question asked by jaime.martin on Oct 17, 2008
Latest reply on Oct 21, 2008 by jaime.martin
hi:
Up to now I have been using with Alfresco 3 Labs. I was using this method to create users

     public static void createAlfrescoUser(AlfrescoUser user) {
        try {
          NewUserDetails[] newUsers = new NewUserDetails[] { new NewUserDetails(
                user.getUserName(), user.getPassword(), createPersonProperties(
                      user.getUserName(),
                      "workspace://SpacesStore/",
                      user.getFirstName(), "",user.getLastName(), user.getEmail(), user.getCompany() )) };
          WebServiceFactory.getAdministrationService().createUsers(newUsers);
        }catch(Exception ex) {
           ex.printStackTrace();
        }
       }
An example of AlfrescoUser values is this:
AlfrescoUser::[ UserName:=KUKU Password:=KUKU FirstName:=Jaime LastName:=Smith Email:=sfsdfsd@jmp.com Company:=JMP]
Now I want to use it with Alfresco Community 2.1. Using same program I come across this error:
org.xml.sax.SAXParseException: Premature end of file
Full message is the following one:

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/}stackTrace:org.xml.sax.SAXParseException: Premature end of file.
   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.XMLVersionDetector.determineDocVersion(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 org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
   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.webservice.administration.AdministrationServiceSoapBindingStub.createUsers(AdministrationServiceSoapBindingStub.java:618)
   at es.rbcdexia.risk.alfresco.AlfrescoManager.creaUsuario(AlfrescoManager.java:417)


I test it again with Alfresco Labs 3 and all goes perfect.
Is there anything to be configured in 2.1?
By the way, WebServiceFactory I´m using is that of org.alfresco.webservice.util.WebServiceFactory.
I´m importing jar alfresco-web-service-client.jar which is with SDK 2.1.
Same code, same jars, but different Alfresco version.
any idea? thanks in advance!

Outcomes