-
1. Re: Chain of delegating translators
rareddy Jul 9, 2012 6:21 PM (in response to nsabina)Sabina,
I do not think the you can chain multiple delegating translators with the current code. However you can write such delegating translator as you have control over it as you control the first delegation, however the configuration will not be same as you shown above, it will be specific to as you write it. If Teiid does, then it has to control order in which it needs to load, avoid circular dependency etc.. which it does not have.
Ramesh..
-
2. Re: Chain of delegating translators
shawkins Jul 9, 2012 9:20 PM (in response to rareddy)Sabina,
What you are trying to do should work. The current code does allow multiple delegate chaining and we will also check for cicurlar dependencies. It should not matter what order you define them in the vdb.xml.
Steve
-
3. Re: Chain of delegating translators
nsabina Jul 9, 2012 9:26 PM (in response to shawkins)Thank you guys.
Steve,
When you say "current code" do you refer to both 7.7 and 8 ?
-
4. Re: Chain of delegating translators
shawkins Jul 10, 2012 7:27 AM (in response to nsabina)Yes, both 7.7 and 8.x.
-
5. Re: Chain of delegating translators
nsabina Jul 10, 2012 10:11 PM (in response to shawkins)I keep getting NullPointerException on translator1.setDelegate(translator2). Exhausted ideas where else to look at the moment, any suggestions are appreciated. JBoss bean for new translator2 is defined, translator jars are all in place, it has to be VDB definition.
Here is an actual generated VDB XML fragment:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<vdb version="1" name="Chorus">
<property name="UseConnectorMetadata" value="true"/>.......
<model type="PHYSICAL" visible="true" name="timeseries">
<property name="importer.useFullSchemaName" value="false"/>
<source name="timeseries" connection-jndi-name="java:CHORUS-H2-METRICPOLLER-DS" translator-name="timeseries.delegated-translator"/>
</model>.......
<translator name="timeseries.delegating-delegated-translator" type="chorus-translator-timezone">
<property name="DelegateName" value="timeseries.delegating-translator"/>
</translator>
<translator name="timeseries.delegating-translator" type="h2"/>
<translator name="timeseries.delegated-translator" type="chorus-translator-safetyHarness">
<property name="DelegateName" value="timeseries.delegating-delegated-translator"/>
</translator></vdb>
* translator1(outer most) = chorus-translator-safetyHarness
** trabslator2 = chorus-translator-timezone
-
6. Re: Chain of delegating translators
shawkins Jul 11, 2012 9:36 AM (in response to nsabina)I didn't have a problem with this scenario on trunk. What version are you using and what exception are you seeing?
-
7. Re: Chain of delegating translators
nsabina Jul 11, 2012 12:04 PM (in response to shawkins)We have Teiid 7.7. Exception happens due to null delegate being passed to out translator1 (SafetyHarness):
[08:46:16.136][info][talledLocalContainer] Caused by: java.lang.NullPointerException
[08:46:16.136][info][talledLocalContainer] at org.teiid.translator.BaseDelegatingExecutionFactory.supportsFullOuterJoins(BaseDelegatingExecutionFactory.java:405)
[08:46:16.136][info][talledLocalContainer] at com.ca.chorus.teiid.safety.SafetyHarnessExecutionFactory.setDelegate(SafetyHarnessExecutionFactory.java:139)
[08:46:16.136][info][talledLocalContainer] at org.teiid.deployers.VDBDeployer.getExecutionFactory(VDBDeployer.java:223)
[08:46:16.136][info][talledLocalContainer] at org.teiid.deployers.VDBDeployer.createConnectorManagers(VDBDeployer.java:196)
[08:46:16.136][info][talledLocalContainer] at org.teiid.deployers.VDBDeployer.deploy(VDBDeployer.java:113)
[08:46:16.136][info][talledLocalContainer] at org.teiid.deployers.VDBDeployer.deploy(VDBDeployer.java:60)
[08:46:16.136][info][talledLocalContainer] at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
[08:46:16.136][info][talledLocalContainer] at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
[08:46:16.136][info][talledLocalContainer] at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
[08:46:16.136][info][talledLocalContainer] ... 73 more
[08:46:16.244][info][talledLocalContainer] 11 Jul 2012 08:46:16,243 PDT INFO [DeployHandler] Failed to complete command: [start] for deployment: names=[vfsfile:/C:/Users/norsa01/workspace/Chorus.1231/Chorus.1231/chorus-main/server/chorus-server-run/target/cargo/configurations/jboss51x/deploy/chorus.1-vdb.xml], copyContent=true
[08:46:16.244][info][talledLocalContainer] org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
[08:46:16.244][info][talledLocalContainer]
[08:46:16.244][info][talledLocalContainer] *** DEPLOYMENTS IN ERROR: Name -> Error
[08:46:16.244][info][talledLocalContainer]
[08:46:16.244][info][talledLocalContainer] vfsfile:/C:/Users/norsa01/workspace/Chorus.1231/Chorus.1231/chorus-main/server/chorus-server-run/target/cargo/configurations/jboss51x/deploy/chorus.1-vdb.xml -> org.jboss.deployers.spi.DeploymentException: Error during deploy: vfsfile:/C:/Users/norsa01/workspace/Chorus.1231/Chorus.1231/chorus-main/server/chorus-server-run/target/cargo/configurations/jboss51x/deploy/chorus.1-vdb.xml
[08:46:16.244][info][talledLocalContainer] -
8. Re: Chain of delegating translators
shawkins Jul 11, 2012 1:17 PM (in response to nsabina)I think the issue may lie in your code. Check your override for the setDelegate method - what object is having supportsFullOuterJoins called and are you still calling super.setDelegate? Also with 7.7.1 and later changes that removed final from supports methods, you're setDelegate override may not be needed.
Steve
-
9. Re: Chain of delegating translators
nsabina Jul 12, 2012 2:35 AM (in response to shawkins)Everything is working now, thank you for the clue Steve!