cancel
Showing results for 
Search instead for 
Did you mean: 

Enabled XPath support to the Alfresco WebService

formi05
Champ in-the-making
Champ in-the-making
Hi guys, we are using the Alfresco Repository (2.0 community edition) in our project to handle our site content.

I am running the CMS on a separate machine from the app/web server (Spring) so I needed to find a way to connect to the CMS from our application remotely.

Initially I tried the RMI connector (Jackrabbit) and it just didn't work at all. I had some threading issues which I believe have been discussed in other threads in this forum.

Because of that I decided to switch over to using the WebService connector and whoha to my great horror realized that it didn't support  XPath. Well after some digging around I discovered that the XPath support was disabled in org.alfresco.repo.webservice.repository.RepositoryWebService.java
and I knew that XPath was supported through the NodeBrowser so I just disabled the language check in the query method and viola, I can now use XPath to retreive my content Smiley Happy

Just wanted to tell you guys that.

Alfresco really kicks ass Smiley Happy
10 REPLIES 10

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

Sounds good.  Would it be possible for you to create an issue in Jira (http://issues.alfresco.com) about the details of this problem and the changes you made to fix it.

Then we can review the changes and put them into the main codeline if appropraite.

Thanks for your help with this,
Roy

formi05
Champ in-the-making
Champ in-the-making
Sure I will do that Smiley Happy

alessioa_
Champ in-the-making
Champ in-the-making
Hi formi05,
please say to us what are you changed in RepositoryWebService to enable the xpath, i need the same thing…
Thank you very much
Alessio A.

formi05
Champ in-the-making
Champ in-the-making
Hi Alessio, here is a code snippet from RepositoryWebService to enable xpath.

public QueryResult query(Store store, Query query, boolean includeMetaData)  throws RemoteException, RepositoryFault
    {     
//        String language = query.getLanguage();
//        if (language.equals(Utils.QUERY_LANG_LUCENE) == false)
//        {
//            throw new RepositoryFault(110, "Only '"
//                    + Utils.QUERY_LANG_LUCENE
//                    + "' queries are currently supported!");
//        }


Just comment away the language check, compile the source and deploy the new remote-api.jar and restart the server.

Cheers Smiley Happy

alessioa_
Champ in-the-making
Champ in-the-making
Thanks formi05,
i followed your suggest but when i try to use an xpath query i receive a server error.
My code is:
// Get a reference to the respository web service
RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();
      
String queryS ="//app:company_home/app:guest_home/cm:Fox_Test//*[like(@cm:*,\"%"+ISO9075.encode("lost")+"%\") or  cm:*[contains(\""+ISO9075.encode("lost")+"\")]]//*";
      
// Create a query object, looking for all items with alfresco in the
// name of text
Query query = new Query("xpath", queryS);

// Execute the query
QueryResult queryResult = repositoryService.query(STORE, query, false);

The error i received is:
17:41:32,921 ERROR [org.apache.axis.encoding.ser.BeanSerializer] Exception:
java.io.IOException: Non nillable element 'message1' is null.
   at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:215)
   at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1504)
   at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
   at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:680)
   at org.alfresco.repo.webservice.repository.RepositoryFault.writeDetails(RepositoryFault.java:156)
   at org.apache.axis.message.SOAPFault.outputImpl(SOAPFault.java:165)
   at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
   at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
   at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
   at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
   at org.apache.axis.AxisFault.output(AxisFault.java:759)
   at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:301)
   at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:269)
   at org.apache.axis.SOAPPart.saveChanges(SOAPPart.java:530)
   at org.apache.axis.attachments.AttachmentsImpl.getAttachmentCount(AttachmentsImpl.java:554)
   at org.apache.axis.Message.getContentType(Message.java:486)
   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:775)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)
17:41:32,921 ERROR [org.apache.axis.SOAPPart] Exception:
java.io.IOException: java.io.IOException: Non nillable element 'message1' is null.
   at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:275)
   at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1504)
   at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
   at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:680)
   at org.alfresco.repo.webservice.repository.RepositoryFault.writeDetails(RepositoryFault.java:156)
   at org.apache.axis.message.SOAPFault.outputImpl(SOAPFault.java:165)
   at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
   at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
   at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
   at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
   at org.apache.axis.AxisFault.output(AxisFault.java:759)
   at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:301)
   at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:269)
   at org.apache.axis.SOAPPart.saveChanges(SOAPPart.java:530)
   at org.apache.axis.attachments.AttachmentsImpl.getAttachmentCount(AttachmentsImpl.java:554)
   at org.apache.axis.Message.getContentType(Message.java:486)
   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:775)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)
17:41:32,921 WARN  [org.apache.axis.attachments.AttachmentsImpl] Exception:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString:
faultActor:
faultNode:
faultDetail:
   {http://xml.apache.org/axis/}exceptionNameSmiley Surprisedrg.alfresco.repo.webservice.repository.RepositoryFault
   {http://xml.apache.org/axis/}stackTrace:
   at org.alfresco.repo.webservice.repository.RepositoryWebService.query(RepositoryWebService.java:233)
   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 org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
   at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
   at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
   at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
   at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
   at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
   at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
   at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)

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


   at org.alfresco.repo.webservice.repository.RepositoryWebService.query(RepositoryWebService.java:233)
   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 org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
   at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
   at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
   at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
   at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
   at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
   at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
   at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)
17:41:32,968 ERROR [org.apache.axis.encoding.ser.BeanSerializer] Exception:
java.io.IOException: Non nillable element 'message1' is null.
   at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:215)
   at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1504)
   at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
   at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:680)
   at org.alfresco.repo.webservice.repository.RepositoryFault.writeDetails(RepositoryFault.java:156)
   at org.apache.axis.message.SOAPFault.outputImpl(SOAPFault.java:165)
   at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
   at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
   at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
   at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
   at org.apache.axis.AxisFault.output(AxisFault.java:759)
   at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:301)
   at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:269)
   at org.apache.axis.SOAPPart.saveChanges(SOAPPart.java:530)
   at org.apache.axis.attachments.AttachmentsImpl.getAttachmentCount(AttachmentsImpl.java:554)
   at org.apache.axis.Message.writeTo(Message.java:535)
   at org.apache.axis.transport.http.AxisServlet.sendResponse(AxisServlet.java:902)
   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:777)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)
17:41:32,968 ERROR [org.apache.axis.SOAPPart] Exception:
java.io.IOException: java.io.IOException: Non nillable element 'message1' is null.
   at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:275)
   at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1504)
   at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
   at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:680)
   at org.alfresco.repo.webservice.repository.RepositoryFault.writeDetails(RepositoryFault.java:156)
   at org.apache.axis.message.SOAPFault.outputImpl(SOAPFault.java:165)
   at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
   at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
   at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
   at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
   at org.apache.axis.AxisFault.output(AxisFault.java:759)
   at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:301)
   at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:269)
   at org.apache.axis.SOAPPart.saveChanges(SOAPPart.java:530)
   at org.apache.axis.attachments.AttachmentsImpl.getAttachmentCount(AttachmentsImpl.java:554)
   at org.apache.axis.Message.writeTo(Message.java:535)
   at org.apache.axis.transport.http.AxisServlet.sendResponse(AxisServlet.java:902)
   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:777)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)
17:41:33,187 WARN  [org.apache.axis.attachments.AttachmentsImpl] Exception:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString:
faultActor:
faultNode:
faultDetail:
   {http://xml.apache.org/axis/}exceptionNameSmiley Surprisedrg.alfresco.repo.webservice.repository.RepositoryFault
   {http://xml.apache.org/axis/}stackTrace:
   at org.alfresco.repo.webservice.repository.RepositoryWebService.query(RepositoryWebService.java:233)
   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 org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
   at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
   at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
   at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
   at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
   at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
   at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
   at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)

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


   at org.alfresco.repo.webservice.repository.RepositoryWebService.query(RepositoryWebService.java:233)
   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 org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
   at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
   at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
   at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
   at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
   at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
   at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
   at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)
17:41:33,187 ERROR [org.apache.axis.encoding.ser.BeanSerializer] Exception:
java.io.IOException: Non nillable element 'message1' is null.
   at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:215)
   at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1504)
   at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
   at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:680)
   at org.alfresco.repo.webservice.repository.RepositoryFault.writeDetails(RepositoryFault.java:156)
   at org.apache.axis.message.SOAPFault.outputImpl(SOAPFault.java:165)
   at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
   at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
   at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
   at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
   at org.apache.axis.AxisFault.output(AxisFault.java:759)
   at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:301)
   at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:269)
   at org.apache.axis.Message.writeTo(Message.java:539)
   at org.apache.axis.transport.http.AxisServlet.sendResponse(AxisServlet.java:902)
   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:777)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)
17:41:33,187 ERROR [org.apache.axis.SOAPPart] Exception:
java.io.IOException: java.io.IOException: Non nillable element 'message1' is null.
   at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:275)
   at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1504)
   at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
   at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:680)
   at org.alfresco.repo.webservice.repository.RepositoryFault.writeDetails(RepositoryFault.java:156)
   at org.apache.axis.message.SOAPFault.outputImpl(SOAPFault.java:165)
   at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
   at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
   at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
   at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
   at org.apache.axis.AxisFault.output(AxisFault.java:759)
   at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:301)
   at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:269)
   at org.apache.axis.Message.writeTo(Message.java:539)
   at org.apache.axis.transport.http.AxisServlet.sendResponse(AxisServlet.java:902)
   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:777)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)
17:41:33,187 ERROR [org.apache.axis.Message] java.io.IOException:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString:
faultActor:
faultNode:
faultDetail:
   {http://xml.apache.org/axis/}exceptionNameSmiley Surprisedrg.alfresco.repo.webservice.repository.RepositoryFault
   {http://xml.apache.org/axis/}stackTrace:
   at org.alfresco.repo.webservice.repository.RepositoryWebService.query(RepositoryWebService.java:233)
   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 org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
   at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
   at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
   at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
   at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
   at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
   at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
   at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)

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


   at org.alfresco.repo.webservice.repository.RepositoryWebService.query(RepositoryWebService.java:233)
   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 org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
   at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
   at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
   at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
   at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
   at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
   at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
   at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)

Do you have idea why i have had this problem?

Thank you very much
Alessio

formi05
Champ in-the-making
Champ in-the-making
Hi Alessio, the first thing I would do is to verify that your xpath expression works at all.

Do this by going to the Node Browser from the Admin Console (logged in as admin) and test your expression there.

1) select workspace://SpacesStore
2) selecting xpath as your language
3) paste in your expression

(sorry if you have already done this Smiley Happy

If you get any error it will be displayed under the expression text field. This error is also what you get when you enable the log4j appender for the webservice but in a summary form.


If this doesn't work, enable the webservice logging by adding these two lines to the file <Alfresco Install Path>\tomcat\webappsalfresco/WEB-INF/classes/log4j.properties and restart the server.

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


Try to execute your client code again and open the <Alfresco Install Path>/alfresco.log file and go to the end of it to see the full stack trace. Here you will usually see what is actually going on on the server.

As an aside: initially when I was experimenting with Lucenes' XPath support I discovered that the
org.alfresco.repo.searchl.impl.lucene.LuceneXPathHandeler
was only partially supported with quite a few OperationNotSupportExceptions.

When there is an exception on the server side Axis usually translated this into a java.io.IOException: Non nillable element 'message1' is null.  which is what you can see in the client stack trace.



I am using Alfresco Community Edition 2.0

Hope this was helpful Smiley Happy

jackal1973
Champ in-the-making
Champ in-the-making
Hi formi05, i tried to use xpath function and predicates in xpath query, in query browser and in webservice client  code, but when i execute it the server launches an java.lang.UnsupportedOperationException,  therefore i can not  use normal xpath function with RepositoryWebService
Thank you very much

formi05
Champ in-the-making
Champ in-the-making
Hi jackal1973, yes that is probably because you are running the server with the original version (community v2.0) of the remote-api.jar. This file contains the RepositoryWebService.class that has to be patched and recompiled in order for the xpath stuff to work.

The reason you are getting UnsupportedOperationException is probably because you are using the xpath feature in Lucene which is not yet supported.

Ok my assumption here is that anything you can execute in the node browser by specifying xpath as the search language (not lucene) will also work with my patch to the RepositoryWebService class. I have tried various xpaths expressions that I needed in my project and it worked very well. But I have not pushed the limits for what can be done yet. Maybe predicates are not supported even though I would kind of expect if from such as mature product as Alfresco.

As I said in an earlier post, enable the logj4 appender in order to get some logging going and post the output here in this forum and maybe we can solve this little enigma Smiley Happy

jackal1973
Champ in-the-making
Champ in-the-making
Hi jackal1973, yes that is probably because you are running the server with the original version (community v2.0) of the remote-api.jar. This file contains the RepositoryWebService.class that has to be patched and recompiled in order for the xpath stuff to work.

The reason you are getting UnsupportedOperationException is probably because you are using the xpath feature in Lucene which is not yet supported.

Ok my assumption here is that anything you can execute in the node browser by specifying xpath as the search language (not lucene) will also work with my patch to the RepositoryWebService class. I have tried various xpaths expressions that I needed in my project and it worked very well. But I have not pushed the limits for what can be done yet. Maybe predicates are not supported even though I would kind of expect if from such as mature product as Alfresco.

As I said in an earlier post, enable the logj4 appender in order to get some logging going and post the output here in this forum and maybe we can solve this little enigma Smiley Happy
Ops sorry little error I was to say Node Browser not Query browser
anyway i ha tried to execute the xpat query with Node browser and  I have got the same exception.
The same query work very well with  jcr native api.
thanks again. Smiley Happy