You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2013/06/04 20:41:14 UTC
svn commit: r1489552 - in /uima/uima-as/trunk/uimaj-as-activemq/src:
main/java/org/apache/uima/adapter/jms/activemq/
test/java/org/apache/uima/ee/test/ test/resources/deployment/
test/resources/descriptors/analysis_engine/
Author: cwiklik
Date: Tue Jun 4 18:41:01 2013
New Revision: 1489552
URL: http://svn.apache.org/r1489552
Log:
UIMA-2751 Modified to detect init error in nested uima-as controller
Added:
uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/deployment/Deploy_TopAggregateWithInnerAggregateDelegateInitFailure.xml (with props)
uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/descriptors/analysis_engine/SecondLevelAggregateWithDelegateInitError.xml (with props)
uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/descriptors/analysis_engine/ThirdLevelAggregateWithDelegateInitError.xml (with props)
uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/descriptors/analysis_engine/TopLevelAggregateWithDelegateInitError.xml (with props)
Modified:
uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/SpringContainerDeployer.java
uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java
Modified: uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/SpringContainerDeployer.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/SpringContainerDeployer.java?rev=1489552&r1=1489551&r2=1489552&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/SpringContainerDeployer.java (original)
+++ uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/SpringContainerDeployer.java Tue Jun 4 18:41:01 2013
@@ -60,7 +60,7 @@ public class SpringContainerDeployer imp
private volatile boolean serviceInitializationException;
- private Semaphore serviceInitializationSemaphore = new Semaphore(1);
+ private Semaphore serviceInitializationSemaphore = new Semaphore(0);
private ConcurrentHashMap springContainerRegistry = null;
@@ -275,8 +275,9 @@ public class SpringContainerDeployer imp
.getBeanNamesForType(org.apache.uima.aae.controller.AnalysisEngineController.class);
for (int i = 0; controllers != null && i < controllers.length; i++) {
AnalysisEngineController cntlr = (AnalysisEngineController) ctx.getBean(controllers[i]);
+ cntlr.addControllerCallbackListener(this);
if (cntlr instanceof org.apache.uima.aae.controller.UimacppServiceController) {
- cntlr.addControllerCallbackListener(this);
+ //cntlr.addControllerCallbackListener(this);
topLevelController = cntlr;
} else {
// Pass a reference to the context to each of the Controllers
@@ -517,7 +518,7 @@ public class SpringContainerDeployer imp
} else {
throw new ResourceInitializationException(new Exception("Details of failure(s) written to UIMA log"));
}
- }
+ }
}
public void notifyOnInitializationFailure(AnalysisEngineController aController, Exception e) {
Modified: uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java?rev=1489552&r1=1489551&r2=1489552&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java (original)
+++ uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java Tue Jun 4 18:41:01 2013
@@ -277,7 +277,7 @@ public class TestUimaASExtended extends
spinShutdownThread(eeUimaEngine, 5000, containers, SpringContainerDeployer.QUIESCE_AND_STOP);
runTest(appCtx, eeUimaEngine, String.valueOf(broker.getMasterConnectorURI()),
- "TopLevelTaeQueue", 1000, EXCEPTION_LATCH);
+ "TopLevelTaeQueue", 5000, EXCEPTION_LATCH);
//eeUimaEngine.stop();
}
/*
@@ -2663,6 +2663,16 @@ public class TestUimaASExtended extends
runTest(null, eeUimaEngine, String.valueOf(broker.getMasterConnectorURI()), "TopLevelTaeQueue",
1, PROCESS_LATCH);
}
+ public void testProcessAggregateWithInnerAggregateDelegateInitFailure() throws Exception {
+ System.out.println("-------------- testProcessAggregateWithInnerAggregateDelegateInitFailure -------------");
+ BaseUIMAAsynchronousEngine_impl eeUimaEngine = new BaseUIMAAsynchronousEngine_impl();
+ try {
+ deployService(eeUimaEngine, relativePath + "/Deploy_TopAggregateWithInnerAggregateDelegateInitFailure.xml");
+ fail("Expected ResourceInitializationException But The Deployment Succeeded Instead");
+ } catch( ResourceInitializationException e) {
+ eeUimaEngine.stop();
+ }
+ }
public void testBlueJDeployment() throws Exception {
System.out.println("-------------- testBlueJDeployment -------------");
Added: uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/deployment/Deploy_TopAggregateWithInnerAggregateDelegateInitFailure.xml
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/deployment/Deploy_TopAggregateWithInnerAggregateDelegateInitFailure.xml?rev=1489552&view=auto
==============================================================================
--- uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/deployment/Deploy_TopAggregateWithInnerAggregateDelegateInitFailure.xml (added)
+++ uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/deployment/Deploy_TopAggregateWithInnerAggregateDelegateInitFailure.xml Tue Jun 4 18:41:01 2013
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+ <!--
+ ***************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ***************************************************************
+ -->
+
+<analysisEngineDeploymentDescription xmlns="http://uima.apache.org/resourceSpecifier">
+
+ <name>Top Level TAE</name>
+ <description></description>
+
+ <deployment protocol="jms" provider="activemq">
+ <casPool numberOfCASes="5"/>
+ <service>
+ <inputQueue endpoint="TopLevelTaeQueue" brokerURL="${DefaultBrokerURL}" prefetch="1"/>
+ <topDescriptor>
+ <import location="../descriptors/analysis_engine/TopLevelAggregateWithDelegateInitError.xml"/>
+ </topDescriptor>
+ <analysisEngine>
+ <delegates>
+
+ <analysisEngine key="FirstLevelTestMultiplier">
+ <casMultiplier poolSize="5"/>
+ </analysisEngine>
+
+ <analysisEngine key="SecondLevelAggregateCM" async="true">
+ <casMultiplier poolSize="25" initialFsHeapSize="20000"/>
+ <delegates>
+ <analysisEngine key="ThirdLevelAggregateCM" async="true">
+ <casMultiplier poolSize="25" initialFsHeapSize="20000"/>
+ <asyncAggregateErrorConfiguration>
+ <getMetadataErrors maxRetries="0" timeout="60000" errorAction="terminate"/>
+ <processCasErrors maxRetries="0" timeout="0" continueOnRetryFailure="false" thresholdCount="0" thresholdWindow="0" thresholdAction="terminate"/>
+ <collectionProcessCompleteErrors timeout="0" additionalErrorAction="terminate"/>
+ </asyncAggregateErrorConfiguration>
+ </analysisEngine>
+ </delegates>
+ <asyncAggregateErrorConfiguration>
+ <getMetadataErrors maxRetries="0" timeout="60000" errorAction="terminate"/>
+ <processCasErrors maxRetries="0" timeout="0" continueOnRetryFailure="false" thresholdCount="0" thresholdWindow="0" thresholdAction="terminate"/>
+ <collectionProcessCompleteErrors timeout="0" additionalErrorAction="terminate"/>
+ </asyncAggregateErrorConfiguration>
+ </analysisEngine>
+
+ </delegates>
+ </analysisEngine>
+ </service>
+ </deployment>
+
+</analysisEngineDeploymentDescription>
Propchange: uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/deployment/Deploy_TopAggregateWithInnerAggregateDelegateInitFailure.xml
------------------------------------------------------------------------------
svn:eol-style = LF
Added: uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/descriptors/analysis_engine/SecondLevelAggregateWithDelegateInitError.xml
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/descriptors/analysis_engine/SecondLevelAggregateWithDelegateInitError.xml?rev=1489552&view=auto
==============================================================================
--- uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/descriptors/analysis_engine/SecondLevelAggregateWithDelegateInitError.xml (added)
+++ uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/descriptors/analysis_engine/SecondLevelAggregateWithDelegateInitError.xml Tue Jun 4 18:41:01 2013
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+ <!--
+ ***************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ***************************************************************
+ -->
+
+<analysisEngineDescription xmlns="http://uima.apache.org/resourceSpecifier">
+ <frameworkImplementation>org.apache.uima.java</frameworkImplementation>
+ <primitive>false</primitive>
+ <delegateAnalysisEngineSpecifiers>
+
+ <delegateAnalysisEngine key="TestMultiplier">
+ <import location="../multiplier/SimpleCasGenerator.xml"/>
+ </delegateAnalysisEngine>
+
+ <delegateAnalysisEngine key="ThirdLevelAggregateCM">
+ <import location="ThirdLevelAggregateWithDelegateInitError.xml"/>
+ </delegateAnalysisEngine>
+
+ </delegateAnalysisEngineSpecifiers>
+ <analysisEngineMetaData>
+ <name>Second Level Aggregate TAE</name>
+ <description>Detects Nothing</description>
+ <configurationParameters/>
+ <configurationParameterSettings/>
+ <flowConstraints>
+ <fixedFlow>
+
+ <node>TestMultiplier</node>
+ <node>ThirdLevelAggregateCM</node>
+
+ </fixedFlow>
+ </flowConstraints>
+ <capabilities>
+ <capability>
+ <inputs/>
+ <outputs>
+ </outputs>
+ <languagesSupported>
+ <language>en</language>
+ </languagesSupported>
+ </capability>
+ </capabilities>
+ <operationalProperties>
+ <modifiesCas>true</modifiesCas>
+ <multipleDeploymentAllowed>true</multipleDeploymentAllowed>
+ <outputsNewCASes>true</outputsNewCASes>
+ </operationalProperties>
+ </analysisEngineMetaData>
+</analysisEngineDescription>
Propchange: uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/descriptors/analysis_engine/SecondLevelAggregateWithDelegateInitError.xml
------------------------------------------------------------------------------
svn:eol-style = LF
Added: uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/descriptors/analysis_engine/ThirdLevelAggregateWithDelegateInitError.xml
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/descriptors/analysis_engine/ThirdLevelAggregateWithDelegateInitError.xml?rev=1489552&view=auto
==============================================================================
--- uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/descriptors/analysis_engine/ThirdLevelAggregateWithDelegateInitError.xml (added)
+++ uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/descriptors/analysis_engine/ThirdLevelAggregateWithDelegateInitError.xml Tue Jun 4 18:41:01 2013
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ ***************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ***************************************************************
+ -->
+<analysisEngineDescription xmlns="http://uima.apache.org/resourceSpecifier">
+ <frameworkImplementation>org.apache.uima.java</frameworkImplementation>
+ <primitive>false</primitive>
+ <delegateAnalysisEngineSpecifiers>
+
+ <delegateAnalysisEngine key="Multiplier1">
+ <import location="../multiplier/SimpleCasGenerator.xml"/>
+ </delegateAnalysisEngine>
+
+ <delegateAnalysisEngine key="Multiplier2">
+ <import location="../multiplier/SimpleCasGenerator.xml"/>
+ </delegateAnalysisEngine>
+
+ <delegateAnalysisEngine key="BadNoOp">
+ <import location="NoOpAnnotatorWithInitFailure.xml"/>
+ </delegateAnalysisEngine>
+ </delegateAnalysisEngineSpecifiers>
+ <analysisEngineMetaData>
+ <name>Third Level Aggregate TAE</name>
+ <description>Detects Nothing</description>
+ <configurationParameters searchStrategy="language_fallback">
+ <configurationParameter>
+ <name>NumberToGenerate</name>
+ <description>Approximate number of CASes to create.</description>
+ <type>Integer</type>
+ <multiValued>false</multiValued>
+ <mandatory>true</mandatory>
+ <overrides>
+ <parameter>Multiplier2/NumberToGenerate</parameter>
+ </overrides>
+ </configurationParameter>
+ </configurationParameters>
+ <configurationParameterSettings>
+ <nameValuePair>
+ <name>NumberToGenerate</name>
+ <value>
+ <integer>10</integer>
+ </value>
+ </nameValuePair>
+ </configurationParameterSettings>
+
+ <flowConstraints>
+ <fixedFlow>
+ <node>Multiplier1</node>
+ <node>Multiplier2</node>
+ <node>BadNoOp</node>
+ </fixedFlow>
+ </flowConstraints>
+ <capabilities>
+ <capability>
+ <inputs/>
+ <outputs/>
+ <languagesSupported>
+ <language>en</language>
+ </languagesSupported>
+ </capability>
+ </capabilities>
+ <operationalProperties>
+ <modifiesCas>true</modifiesCas>
+ <multipleDeploymentAllowed>true</multipleDeploymentAllowed>
+ <outputsNewCASes>true</outputsNewCASes>
+ </operationalProperties>
+ </analysisEngineMetaData>
+</analysisEngineDescription>
Propchange: uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/descriptors/analysis_engine/ThirdLevelAggregateWithDelegateInitError.xml
------------------------------------------------------------------------------
svn:eol-style = LF
Added: uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/descriptors/analysis_engine/TopLevelAggregateWithDelegateInitError.xml
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/descriptors/analysis_engine/TopLevelAggregateWithDelegateInitError.xml?rev=1489552&view=auto
==============================================================================
--- uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/descriptors/analysis_engine/TopLevelAggregateWithDelegateInitError.xml (added)
+++ uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/descriptors/analysis_engine/TopLevelAggregateWithDelegateInitError.xml Tue Jun 4 18:41:01 2013
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+ <!--
+ ***************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ***************************************************************
+ -->
+
+<analysisEngineDescription xmlns="http://uima.apache.org/resourceSpecifier">
+ <frameworkImplementation>org.apache.uima.java</frameworkImplementation>
+ <primitive>false</primitive>
+ <delegateAnalysisEngineSpecifiers>
+
+ <delegateAnalysisEngine key="FirstLevelTestMultiplier">
+ <import location="../multiplier/SimpleCasGenerator.xml"/>
+ </delegateAnalysisEngine>
+
+ <delegateAnalysisEngine key="SecondLevelAggregateCM">
+ <import location="SecondLevelAggregateWithDelegateInitError.xml"/>
+ </delegateAnalysisEngine>
+
+ </delegateAnalysisEngineSpecifiers>
+ <analysisEngineMetaData>
+ <name>Top Level Aggregate TAE</name>
+ <description>Detects Nothing</description>
+ <configurationParameters/>
+ <configurationParameterSettings/>
+ <flowConstraints>
+ <fixedFlow>
+
+ <node>FirstLevelTestMultiplier</node>
+ <node>SecondLevelAggregateCM</node>
+
+ </fixedFlow>
+ </flowConstraints>
+ <capabilities>
+ <capability>
+ <inputs/>
+ <outputs>
+ </outputs>
+ <languagesSupported>
+ <language>en</language>
+ </languagesSupported>
+ </capability>
+ </capabilities>
+ <operationalProperties>
+ <modifiesCas>true</modifiesCas>
+ <multipleDeploymentAllowed>true</multipleDeploymentAllowed>
+ <outputsNewCASes>true</outputsNewCASes>
+ </operationalProperties>
+ </analysisEngineMetaData>
+</analysisEngineDescription>
Propchange: uima/uima-as/trunk/uimaj-as-activemq/src/test/resources/descriptors/analysis_engine/TopLevelAggregateWithDelegateInitError.xml
------------------------------------------------------------------------------
svn:eol-style = LF