uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Lally <ala...@alum.rpi.edu>
Subject Re: Call UIMA/SOAP component from an external application
Date Tue, 30 Jun 2009 14:22:39 GMT
This is a bug.  In fact the callAnalysisEngineMetaData method could be
removed entirely, it isn't needed and I don't think anything in UIMA
actually calls it.  Instead, the method callGetMetaData(), which is
inherited from the superclass, is what's actually used.  Feel free to
open a JIRA and submit a patch.

Thanks,
  -Adam

On Thu, Jun 25, 2009 at 8:36 AM, Baptiste
Gaillard<b_gaillard@hotmail.com> wrote:
>
> Hi, i'm trying to call a UIMA component deployed as a WebService inside Jetty and Axis.
>
>
> To call my component I'm using this piece of code (for the moment I've just tried with
'callGetAnalysisEngineMetaData()') :
>
> AxisAnalysisEngineServiceStub axisAnalysisEngineServiceStub = new AxisAnalysisEngineServiceStub(
>                "http://localhost:8080/osimp-uima-component-test-ae/services/OsimpUimaAnalysisEngine?wdsl",
>                10000);
> AnalysisEngineMetaData analysisEngineMetaData = axisAnalysisEngineServiceStub.callGetAnalysisEngineMetaData();
> System.err.println(analysisEngineMetaData.toString());
>
>
> But it does not work as expected, the following exception is returned:
> org.apache.uima.resource.ResourceServiceException
>    at org.apache.uima.adapter.soap.AxisAnalysisEngineServiceStub.callGetAnalysisEngineMetaData(AxisAnalysisEngineServiceStub.java:116)
>    at com.thales.communications.osimp.uima.component.ae.ITOsimpUimaAnalysisEngineSoap.testCallGetAnalysisEngineMetaData(ITOsimpUimaAnalysisEngineSoap.java:139)
>    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:597)
>    at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
>    at org.testng.internal.MethodHelper$1.runTestMethod(MethodHelper.java:698)
>    at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.run(AbstractTestNGSpringContextTests.java:140)
>    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:597)
>    at org.testng.internal.MethodHelper.invokeHookable(MethodHelper.java:706)
>    at org.testng.internal.Invoker.invokeMethod(Invoker.java:468)
>    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:617)
>    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:885)
>    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
>    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
>    at org.testng.TestRunner.runWorkers(TestRunner.java:712)
>    at org.testng.TestRunner.privateRun(TestRunner.java:582)
>    at org.testng.TestRunner.run(TestRunner.java:477)
>    at org.testng.SuiteRunner.runTest(SuiteRunner.java:324)
>    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:319)
>    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:292)
>    at org.testng.SuiteRunner.run(SuiteRunner.java:198)
>    at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:821)
>    at org.testng.TestNG.runSuitesLocally(TestNG.java:788)
>    at org.testng.TestNG.run(TestNG.java:708)
>    at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:62)
>    at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:141)
>    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>    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:597)
>    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
>    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
> Caused by: No such operation 'getAnalysisEngineMetaData'
>    at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
>    at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
>    at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
>    at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
>    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
>    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.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 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.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
>    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
>    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.client.AxisClient.invoke(AxisClient.java:165)
>    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.apache.uima.adapter.soap.AxisAnalysisEngineServiceStub.callGetAnalysisEngineMetaData(AxisAnalysisEngineServiceStub.java:112)
>    ... 37 more
>
>
> The exception says that getAnalysisEngineMetaData is not found, it seems to be normal
because the code of this function is the following (in the code of UIMA 2.2.2-incubating):
>
> public AnalysisEngineMetaData callGetAnalysisEngineMetaData() throws ResourceServiceException
{
>    final QName mOperationQName = new QName("http://uima.apache.org/analysis_engine",
>            "getAnalysisEngineMetaData");
>    final QName mResourceMetaDataTypeQName = new QName("http://uima.apache.org/resourceSpecifier",
>            "resourceMetaData");
>
>    try {
>      Service service = new Service();
>      Call call = (Call) service.createCall();
>      call.setTimeout(getTimeout());
>      call.setTargetEndpointAddress(getServiceEndpoint());
>      call.setOperationName(mOperationQName);
>
>      call.registerTypeMapping(ResourceMetaData.class, mResourceMetaDataTypeQName,
>              new XmlSerializerFactory(), new XmlDeserializerFactory());
>
>      return (AnalysisEngineMetaData) call.invoke(new Object[0]);
>    } catch (ServiceException e) {
>      throw new ResourceServiceException(e);
>    } catch (java.rmi.RemoteException e) {
>      throw new ResourceServiceException(e);
>    }
>  }
>
> If I change the first line by that (replacing 'getAnalysisEngineMetaData' by 'getMetaData'):
> final QName mOperationQName = new QName("http://uima.apache.org/analysis_engine", "getMetaData");
>
> it works as expected.
> In the documentation of UIMA the WSDD deployment descriptor described in section 3.6.1
shows something like:
> <parameter name="allowedMethods" value="getMetaData process"/>
>
> So, why the AxisAnalysisEngineServiceStub.callGetAnalysisEngineMetaData() function is
coded to call 'getAnalysisEngineMetaData()' and not 'getMetaData()' ?
> What am I doing wrong ?
>
> Thanks,
>
> Baptiste Gaillard
>
>
>
>
> _________________________________________________________________
> Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !  Téléchargez-le
maintenant !
> http://www.windowslive.fr/messenger/1.asp

Mime
View raw message