uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hansen Candrawinata <hansen.candrawin...@gmail.com>
Subject Exception thrown when deploying CAS Processors in managed mode
Date Thu, 03 Dec 2009 06:07:58 GMT
My CAS processors works fine when deployed in integrated mode, but not when 
deployed in managed mode.   

The following exception was thrown instead (notice the path in the exception
message is referring to a directory instead of a file - no idea where the path
came from and how to it was formulated to become like that):

org.apache.uima.util.InvalidXMLException: Invalid descriptor at 
file:/H:/ttsrc/javasoe/documentconversion.
	at org.apache.uima.util.impl.XMLParser_impl.parse(XMLParser_impl.java:193)
	at
org.apache.uima.util.impl.XMLParser_impl.parseResourceSpecifier(XMLParser_impl.j
ava:365)
	at
org.apache.uima.util.impl.XMLParser_impl.parseResourceSpecifier(XMLParser_impl.j
ava:346)
	at
org.apache.uima.collection.impl.cpm.container.CPEFactory.getSpecifier(CPEFactory
.java:809)
	at
org.apache.uima.collection.impl.cpm.engine.CPMEngine.isMultipleDeploymentAllowed
(CPMEngine.java:900)
	at
org.apache.uima.collection.impl.cpm.engine.CPMEngine.isParallizable(CPMEngine.ja
va:973)
	at
org.apache.uima.collection.impl.cpm.engine.CPMEngine.classifyCasProcessors(CPMEn
gine.java:1104)
	at
org.apache.uima.collection.impl.cpm.engine.CPMEngine.deployCasProcessors(CPMEngi
ne.java:1469)
	at org.apache.uima.collection.impl.cpm.BaseCPMImpl.run(BaseCPMImpl.java:458)
	at java.lang.Thread.run(Thread.java:619)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
	at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXPa
rser.java:1231)
	at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXPar
serImpl.java:522)
	at org.apache.uima.util.impl.XMLParser_impl.parse(XMLParser_impl.java:176)
	... 9 more
 ** aborted

--

My CPE descriptor looks like the following:

<?xml version="1.0" encoding="UTF-8"?>
<cpeDescription xmlns="http://uima.apache.org/resourceSpecifier">
    <collectionReader>
        <collectionIterator>
            <descriptor>
                <import location="FileSystemCollectionReader.xml"/>
            </descriptor>
            <configurationParameterSettings>
                <nameValuePair>
                    <name>InputDirectory</name>
                    <value>
                        <string>H:\ttsrc\testingdocssmall</string>
                    </value>
                </nameValuePair>
            </configurationParameterSettings>
        </collectionIterator>
    </collectionReader>
    <casProcessors casPoolSize="3" processingUnitThreadCount="1">
        <casProcessor deployment="local" name="JodAndTika">
            <descriptor>
                <import location="JodAndTika.xml"/>
            </descriptor>
		    <runInSeparateProcess>
		      <exec dir="." executable="java">
		        <env key="CLASSPATH" 
		          value="src;
		                 C:\Program Files\apache-uima-2.2.2\lib\uima-
core.jar;
		                 C:\Program Files\apache-uima-2.2.2\lib\uima-
cpe.jar;
		                 C:\Program Files\apache-uima-2.2.2\lib\uima-
examples.jar;
		                 C:\Program Files\apache-uima-2.2.2\lib\uima-
adapter-vinci.jar;
		                 C:\Program Files\apache-uima-2.2.2
\lib\jVinci.jar"/>
		        <arg>-DLOG=C:/Temp/service.log</arg>
               
<arg>org.apache.uima.reference_impl.collection.service.vinci.VinciAnalysisEngine
rService_impl</arg>
		        <arg>${descriptor}</arg>
		      </exec>
		    </runInSeparateProcess>
            <deploymentParameters/>
            <errorHandling>
                <errorRateThreshold action="terminate" value="0/1000"/>
                <maxConsecutiveRestarts action="terminate" value="30"/>
                <timeout max="100000" default="-1"/>
            </errorHandling>
            <checkpoint batch="10000" time="1000ms"/>
        </casProcessor>
    </casProcessors>
    <cpeConfig>
        <numToProcess>-1</numToProcess>
        <deployAs>immediate</deployAs>
        <checkpoint batch="0" time="300000ms"/>
        <timerImpl/>
    </cpeConfig>
</cpeDescription>

If I change the value of the "deployment" attribute to 'integrated' and then
remove the "runInSeparateProcess" element, everything works fine.

--

And here is my "JodAndTika" aggregate analysis engine descriptor:

<?xml version="1.0" encoding="UTF-8"?>
<analysisEngineDescription xmlns="http://uima.apache.org/resourceSpecifier">
  <frameworkImplementation>org.apache.uima.java</frameworkImplementation>
  <primitive>false</primitive>
  <delegateAnalysisEngineSpecifiers>
    <delegateAnalysisEngine key="Tika">
      <import location="Tika.xml"/>
    </delegateAnalysisEngine>
    <delegateAnalysisEngine key="JodConverter">
      <import location="JodConverter.xml"/>
    </delegateAnalysisEngine>
  </delegateAnalysisEngineSpecifiers>
  <flowController key="MyFlowController">
    <import location="MyFlowController.xml"/>
  </flowController>
  <analysisEngineMetaData>
    <name>JodAndTika</name>
    <description/>
    <version>1.0</version>
    <vendor/>
    <configurationParameters searchStrategy="none"/>
    <configurationParameterSettings/>
    <flowConstraints>
      <fixedFlow>
        <node>JodConverter</node>
        <node>Tika</node>
      </fixedFlow>
    </flowConstraints>
    <typePriorities/>
    <fsIndexCollection/>
    <capabilities>
      <capability>
        <inputs/>
        <outputs>
          <type
allAnnotatorFeatures="true">com.mycompany.documentconversion.Document</type>
        </outputs>
        <languagesSupported/>
      </capability>
    </capabilities>
    <operationalProperties>
      <modifiesCas>true</modifiesCas>
      <multipleDeploymentAllowed>true</multipleDeploymentAllowed>
      <outputsNewCASes>false</outputsNewCASes>
    </operationalProperties>
  </analysisEngineMetaData>
  <resourceManagerConfiguration/>
</analysisEngineDescription>

--

Let me know if you need more information.

Thanks,
Hansen


Mime
View raw message