1 2 Previous Next 19 Replies Latest reply: Feb 6, 2012 9:41 PM by Ramesh Reddy RSS

How to use Teiid DelegatingExecutionFactory

Vineela Gampa Novice

Hi

 

I couldnt find much info on how to use Teiid DelegatingExecutionFactory . Can you point em to an example on how to use it ? My usecase is i want to intercept getMetaData and createResultSetExecuition calls of the translators and do some massaging of passing the exception in an object instead of throwign it to Teiid. As once the exception is thrown to Teiid , teiid stops processing and server startup fails.

 

You may create a delegating translator by extending the org.teiid.translator.BaseDelegatingExecutionFactory. Once your classes are then packaged as a custom translator, you will be able to wire another translator instance into your delegating translator at runtime in order to intercept all of the calls to the delegate.  This base class does not provide any functionality on its own, other than delegation.

Table 13.9. Execution Properties

delegateNameTranslator instance name to delegate to
  • 1. Re: How to use Teiid DelegatingExecutionFactory
    Ramesh Reddy Master

    Vineela,

     

    Lets say you are currently using "oracle" translator in your VDB, you want to intercept the calls going through this translator, then you first write a custom delegating translator like

     

    @Translator(name="interceptor", description="interceptor")
    public class InterceptorExecutionFactory extends org.teiid.translator.BaseDelegatingExecutionFactory{
        @Override
        public void getMetadata(MetadataFactory metadataFactory, C conn) throws TranslatorException {
            // do magic intercepting code here..
    
            // If you want call the original delegate, do not call if do not need to. 
            // but if you did not call the delegate fullfill the method contract
            getDelegate().getMetadata(metadataFactory, conn);
    
            // do more magic intercepting code here..
        }
    }
    

     

    Now deploy this translator in Teiid engine. Then in your -vdb.xml or .vdb file define like below.

     

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <vdb name="myvdb" version="1">
    
        <model name="mymodel">
            <source name="source" translator-name="oracle-interceptor" connection-jndi-name="java:oracle-ds"/>
        </model>
    
        <!-- the below it is called translator overriding, where you can set different properties -->
        <translator name="orcle-interceptor" type="interceptor" />
            <property name="delegateName" value="oracle" /> 
       </translator> 
    </vdb>
    

     

    So, what we have done here, we have defined a "translator" override called "oracle-interceptor", which is based on the custom translator "interceptor" from above, and supplied the translator it needs to delegate to "oracle" as its delegateName. Then, we used this override translator "oracle-interceptor" in your VDB. Now any calls going into this VDB model's translator will be intercepted by YOUR code to do whatever you want to do.

     

    Hope this helps.

     

    Ramesh..

  • 2. Re: How to use Teiid DelegatingExecutionFactory
    Vineela Gampa Novice

    Hi Ramesh,

     

    Thansk Got it. Have few more questions..


        <!-- the below it is called translator overriding, where you can set different properties -->
        <translator name="orcle-interceptor" type="interceptor" />
            <property name="delegateName" value="oracle" />   - Here value="oracle" refers to another translator name ?
       </translator>

     

    say if i hv a translator A which is doing the work it has to do when someone queries for it and i have another delegating translator B which acts liek an interceptor. WIll my vdb definiton looks like somehtign below ??

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <vdb name="myvdb" version="1">

        <model name="mymodel">
            <source name="source" translator-name="work-interceptor" connection-jndi-name="java:oracle-ds"/>
        </model>

        <!-- the below it is called translator overriding, where you can set different properties -->
        <translator name="work-interceptor" type="interceptor" />
            <property name="delegateName" value="A" />
       </translator>
    </vdb>

     

    And i dont see  getDelegate() method available when i extend BaseDelegatingExecutioNFactory. How do i get an instance of the delegate or delegate factory so that i can route the call and it does the work it has to do.

  • 3. Re: How to use Teiid DelegatingExecutionFactory
    Ramesh Reddy Master

    Yes

     

    You can call "super.getMetadata"

     

    Ramesh..

  • 4. Re: How to use Teiid DelegatingExecutionFactory
    Vineela Gampa Novice

    Hi Ramesh

     

    Iam seeing this error on my local.

     

    [11:17:26.326][info][talledLocalContainer] 30 Jan 2012 11:17:26,325 PST INFO  [DeployHandler] Handle stream, deploymentTarget: names=[chorus-vdb.xml], copyContent=true, description=temp:#temp

    [11:17:26.336][info][talledLocalContainer] 30 Jan 2012 11:17:26,336 PST INFO  [DeployHandler] End handle stream, repositoryName: vfsfile:/C:/ws/Chorus/chorus-main/server/chorus-server-run/target/cargo/configurations/jboss51x/deploy/chorus-vdb.xml

    [11:17:26.337][info][talledLocalContainer] 30 Jan 2012 11:17:26,337 PST INFO  [DeployHandler] Begin start, [vfsfile:/C:/ws/Chorus/chorus-main/server/chorus-server-run/target/cargo/configurations/jboss51x/deploy/chorus-vdb.xml]

    [11:17:26.513][info][talledLocalContainer] 30 Jan 2012 11:17:26,511 PST ERROR [AbstractKernelController] Error installing to Real: name=vfsfile:/C:/ws/Chorus/chorus-main/server/chorus-server-run/target/cargo/configurations/jboss51x/deploy/chorus-vdb.xml state=PreReal mode=Manual requiredState=Real

    [11:17:26.513][info][talledLocalContainer] org.jboss.deployers.spi.DeploymentException: java.lang.reflect.InvocationTargetException

    [11:17:26.513][info][talledLocalContainer]     at org.teiid.deployers.TranslatorUtil.buildExecutionFactory(TranslatorUtil.java:102)

    [11:17:26.513][info][talledLocalContainer]     at org.teiid.deployers.VDBDeployer.getExecutionFactory(VDBDeployer.java:206)

    [11:17:26.513][info][talledLocalContainer]     at org.teiid.deployers.VDBDeployer.createConnectorManagers(VDBDeployer.java:185)

    [11:17:26.513][info][talledLocalContainer]     at org.teiid.deployers.VDBDeployer.deploy(VDBDeployer.java:114)

    [11:17:26.513][info][talledLocalContainer]     at org.teiid.deployers.VDBDeployer.deploy(VDBDeployer.java:61)

    [11:17:26.513][info][talledLocalContainer]     at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)

    [11:17:26.513][info][talledLocalContainer]     at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)

    [11:17:26.514][info][talledLocalContainer]     at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)

    [11:17:26.514][info][talledLocalContainer]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)

    [11:17:26.514][info][talledLocalContainer]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)

    [11:17:26.514][info][talledLocalContainer]     at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)

    [11:17:26.514][info][talledLocalContainer]     at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

    [11:17:26.514][info][talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

    [11:17:26.514][info][talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

    [11:17:26.514][info][talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

    [11:17:26.514][info][talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

    [11:17:26.514][info][talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

    [11:17:26.514][info][talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

    [11:17:26.515][info][talledLocalContainer]     at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)

    [11:17:26.515][info][talledLocalContainer]     at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)

    [11:17:26.515][info][talledLocalContainer]     at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)

    [11:17:26.515][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.start(AbstractDeployHandler.java:263)

    [11:17:26.515][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.invoke(AbstractDeployHandler.java:177)

    [11:17:26.515][info][talledLocalContainer]     at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)

    [11:17:26.515][info][talledLocalContainer]     at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)

    [11:17:26.515][info][talledLocalContainer]     at org.jboss.remoting.Client.invoke(Client.java:1724)

    [11:17:26.515][info][talledLocalContainer]     at org.jboss.remoting.Client.invoke(Client.java:629)

    [11:17:26.515][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.remoting.StreamingDeploymentTarget.invoke(StreamingDeploymentTarget.java:305)

    [11:17:26.515][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.remoting.StreamingDeploymentTarget.start(StreamingDeploymentTarget.java:190)

    [11:17:26.516][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.DeploymentProgressImpl.start(DeploymentProgressImpl.java:231)

    [11:17:26.516][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.DeploymentProgressImpl.run(DeploymentProgressImpl.java:88)

    [11:17:26.516][info][talledLocalContainer]     at org.teiid.adminapi.jboss.ManagedUtil.execute(ManagedUtil.java:295)

    [11:17:26.516][info][talledLocalContainer]     at org.teiid.adminapi.jboss.ManagedUtil.deployArchive(ManagedUtil.java:250)

    [11:17:26.516][info][talledLocalContainer]     at org.teiid.adminapi.jboss.ManagedUtil.deployArchive(ManagedUtil.java:228)

    [11:17:26.516][info][talledLocalContainer]     at org.teiid.adminapi.jboss.Admin.deployVDB(Admin.java:186)

    [11:17:26.516][info][talledLocalContainer]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    [11:17:26.516][info][talledLocalContainer]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    [11:17:26.516][info][talledLocalContainer]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    [11:17:26.516][info][talledLocalContainer]     at java.lang.reflect.Method.invoke(Method.java:597)

    [11:17:26.516][info][talledLocalContainer]     at org.teiid.logging.LogManager$LoggingProxy.invoke(LogManager.java:121)

    [11:17:26.517][info][talledLocalContainer]     at org.teiid.jboss.deployers.RuntimeEngineDeployer$2.invoke(RuntimeEngineDeployer.java:303)

    [11:17:26.517][info][talledLocalContainer]     at $Proxy306.deployVDB(Unknown Source)

    [11:17:26.517][info][talledLocalContainer]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    [11:17:26.517][info][talledLocalContainer]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    [11:17:26.517][info][talledLocalContainer]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    [11:17:26.517][info][talledLocalContainer]     at java.lang.reflect.Method.invoke(Method.java:597)

    [11:17:26.517][info][talledLocalContainer]     at org.teiid.transport.ServerWorkItem.run(ServerWorkItem.java:81)

    [11:17:26.517][info][talledLocalContainer]     at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:188)

    [11:17:26.517][info][talledLocalContainer]     at org.teiid.transport.SocketClientInstance.processMessagePacket(SocketClientInstance.java:160)

    [11:17:26.517][info][talledLocalContainer]     at org.teiid.transport.SocketClientInstance.receivedMessage(SocketClientInstance.java:149)

    [11:17:26.517][info][talledLocalContainer]     at org.teiid.transport.SSLAwareChannelHandler.messageReceived(SSLAwareChannelHandler.java:210)

    [11:17:26.517][info][talledLocalContainer]     at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:100)

    [11:17:26.518][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)

    [11:17:26.518][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)

    [11:17:26.518][info][talledLocalContainer]     at org.jboss.netty.handler.stream.ChunkedWriteHandler.handleUpstream(ChunkedWriteHandler.java:144)

    [11:17:26.518][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)

    [11:17:26.518][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)

    [11:17:26.518][info][talledLocalContainer]     at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:302)

    [11:17:26.518][info][talledLocalContainer]     at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:317)

    [11:17:26.518][info][talledLocalContainer]     at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:299)

    [11:17:26.518][info][talledLocalContainer]     at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:214)

    [11:17:26.518][info][talledLocalContainer]     at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:80)

    [11:17:26.518][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)

    [11:17:26.519][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)

    [11:17:26.519][info][talledLocalContainer]     at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:302)

    [11:17:26.519][info][talledLocalContainer]     at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:317)

    [11:17:26.519][info][talledLocalContainer]     at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:299)

    [11:17:26.519][info][talledLocalContainer]     at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:216)

    [11:17:26.519][info][talledLocalContainer]     at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:80)

    [11:17:26.519][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)

    [11:17:26.519][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:540)

    [11:17:26.520][info][talledLocalContainer]     at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274)

    [11:17:26.520][info][talledLocalContainer]     at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261)

    [11:17:26.520][info][talledLocalContainer]     at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:349)

    [11:17:26.520][info][talledLocalContainer]     at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:281)

    [11:17:26.520][info][talledLocalContainer]     at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:201)

    [11:17:26.520][info][talledLocalContainer]     at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)

    [11:17:26.520][info][talledLocalContainer]     at org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.java:46)

    [11:17:26.520][info][talledLocalContainer]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

    [11:17:26.521][info][talledLocalContainer]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

    [11:17:26.521][info][talledLocalContainer]     at java.lang.Thread.run(Thread.java:662)

    [11:17:26.521][info][talledLocalContainer] Caused by: java.lang.reflect.InvocationTargetException

    [11:17:26.521][info][talledLocalContainer]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    [11:17:26.521][info][talledLocalContainer]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    [11:17:26.521][info][talledLocalContainer]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    [11:17:26.521][info][talledLocalContainer]     at java.lang.reflect.Method.invoke(Method.java:597)

    [11:17:26.521][info][talledLocalContainer]     at org.teiid.deployers.TranslatorUtil.injectProperties(TranslatorUtil.java:118)

    [11:17:26.522][info][talledLocalContainer]     at org.teiid.deployers.TranslatorUtil.buildExecutionFactory(TranslatorUtil.java:96)

    [11:17:26.522][info][talledLocalContainer]     ... 80 more

    [11:17:26.522][info][talledLocalContainer] Caused by: java.lang.NullPointerException

    [11:17:26.522][info][talledLocalContainer]     at org.teiid.translator.BaseDelegatingExecutionFactory.setRequiresCriteria(BaseDelegatingExecutionFactory.java:165)

    [11:17:26.522][info][talledLocalContainer]     ... 86 more

    [11:17:26.532][info][talledLocalContainer] 30 Jan 2012 11:17:26,530 PST INFO  [DeployHandler] Failed to complete command: [start] for deployment: names=[vfsfile:/C:/ws/Chorus/chorus-main/server/chorus-server-run/target/cargo/configurations/jboss51x/deploy/chorus-vdb.xml], copyContent=true

    [11:17:26.532][info][talledLocalContainer] org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

    [11:17:26.533][info][talledLocalContainer]

    [11:17:26.533][info][talledLocalContainer] *** DEPLOYMENTS IN ERROR: Name -> Error

    [11:17:26.533][info][talledLocalContainer]

    [11:17:26.533][info][talledLocalContainer] vfsfile:/C:/ws/Chorus/chorus-main/server/chorus-server-run/target/cargo/configurations/jboss51x/deploy/chorus-vdb.xml -> org.jboss.deployers.spi.DeploymentException: java.lang.reflect.InvocationTargetException

    [11:17:26.533][info][talledLocalContainer]

    [11:17:26.533][info][talledLocalContainer]

    [11:17:26.533][info][talledLocalContainer] DEPLOYMENTS IN ERROR:

    [11:17:26.533][info][talledLocalContainer]   Deployment "vfsfile:/C:/ws/Chorus/chorus-main/server/chorus-server-run/target/cargo/configurations/jboss51x/deploy/chorus-vdb.xml" is in error due to the following reason(s): java.lang.NullPointerException

    [11:17:26.533][info][talledLocalContainer]

    [11:17:26.533][info][talledLocalContainer]     at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)

    [11:17:26.533][info][talledLocalContainer]     at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)

    [11:17:26.534][info][talledLocalContainer]     at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)

    [11:17:26.534][info][talledLocalContainer]     at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)

    [11:17:26.534][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.start(AbstractDeployHandler.java:265)

    [11:17:26.534][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.invoke(AbstractDeployHandler.java:177)

    [11:17:26.534][info][talledLocalContainer]     at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)

    [11:17:26.534][info][talledLocalContainer]     at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)

    [11:17:26.534][info][talledLocalContainer]     at org.jboss.remoting.Client.invoke(Client.java:1724)

    [11:17:26.534][info][talledLocalContainer]     at org.jboss.remoting.Client.invoke(Client.java:629)

    [11:17:26.534][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.remoting.StreamingDeploymentTarget.invoke(StreamingDeploymentTarget.java:305)

    [11:17:26.534][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.remoting.StreamingDeploymentTarget.start(StreamingDeploymentTarget.java:190)

    [11:17:26.534][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.DeploymentProgressImpl.start(DeploymentProgressImpl.java:231)

    [11:17:26.534][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.DeploymentProgressImpl.run(DeploymentProgressImpl.java:88)

    [11:17:26.535][info][talledLocalContainer]     at org.teiid.adminapi.jboss.ManagedUtil.execute(ManagedUtil.java:295)

    [11:17:26.535][info][talledLocalContainer]     at org.teiid.adminapi.jboss.ManagedUtil.deployArchive(ManagedUtil.java:250)

    [11:17:26.535][info][talledLocalContainer]     at org.teiid.adminapi.jboss.ManagedUtil.deployArchive(ManagedUtil.java:228)

    [11:17:26.535][info][talledLocalContainer]     at org.teiid.adminapi.jboss.Admin.deployVDB(Admin.java:186)

    [11:17:26.535][info][talledLocalContainer]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    [11:17:26.535][info][talledLocalContainer]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    [11:17:26.535][info][talledLocalContainer]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    [11:17:26.535][info][talledLocalContainer]     at java.lang.reflect.Method.invoke(Method.java:597)

    [11:17:26.535][info][talledLocalContainer]     at org.teiid.logging.LogManager$LoggingProxy.invoke(LogManager.java:121)

    [11:17:26.535][info][talledLocalContainer]     at org.teiid.jboss.deployers.RuntimeEngineDeployer$2.invoke(RuntimeEngineDeployer.java:303)

    [11:17:26.535][info][talledLocalContainer]     at $Proxy306.deployVDB(Unknown Source)

    [11:17:26.536][info][talledLocalContainer]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    [11:17:26.536][info][talledLocalContainer]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    [11:17:26.536][info][talledLocalContainer]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    [11:17:26.536][info][talledLocalContainer]     at java.lang.reflect.Method.invoke(Method.java:597)

    [11:17:26.536][info][talledLocalContainer]     at org.teiid.transport.ServerWorkItem.run(ServerWorkItem.java:81)

    [11:17:26.536][info][talledLocalContainer]     at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:188)

    [11:17:26.536][info][talledLocalContainer]     at org.teiid.transport.SocketClientInstance.processMessagePacket(SocketClientInstance.java:160)

    [11:17:26.536][info][talledLocalContainer]     at org.teiid.transport.SocketClientInstance.receivedMessage(SocketClientInstance.java:149)

    [11:17:26.536][info][talledLocalContainer]     at org.teiid.transport.SSLAwareChannelHandler.messageReceived(SSLAwareChannelHandler.java:210)

    [11:17:26.536][info][talledLocalContainer]     at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:100)

    [11:17:26.536][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)

    [11:17:26.536][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)

    [11:17:26.537][info][talledLocalContainer]     at org.jboss.netty.handler.stream.ChunkedWriteHandler.handleUpstream(ChunkedWriteHandler.java:144)

    [11:17:26.537][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)

    [11:17:26.537][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)

    [11:17:26.537][info][talledLocalContainer]     at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:302)

    [11:17:26.537][info][talledLocalContainer]     at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:317)

    [11:17:26.537][info][talledLocalContainer]     at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:299)

    [11:17:26.537][info][talledLocalContainer]     at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:214)

    [11:17:26.537][info][talledLocalContainer]     at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:80)

    [11:17:26.537][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)

    [11:17:26.537][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)

    [11:17:26.537][info][talledLocalContainer]     at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:302)

    [11:17:26.537][info][talledLocalContainer]     at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:317)

    [11:17:26.538][info][talledLocalContainer]     at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:299)

    [11:17:26.538][info][talledLocalContainer]     at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:216)

    [11:17:26.538][info][talledLocalContainer]     at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:80)

    [11:17:26.538][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)

    [11:17:26.538][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:540)

    [11:17:26.538][info][talledLocalContainer]     at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274)

    [11:17:26.538][info][talledLocalContainer]     at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261)

    [11:17:26.538][info][talledLocalContainer]     at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:349)

    [11:17:26.538][info][talledLocalContainer]     at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:281)

    [11:17:26.538][info][talledLocalContainer]     at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:201)

    [11:17:26.538][info][talledLocalContainer]     at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)

    [11:17:26.538][info][talledLocalContainer]     at org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.java:46)

    [11:17:26.539][info][talledLocalContainer]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

     

     

    <!-- create translator instances that override default properties -->

        <model name="chorus-safety-model">

             <translator name="chorus-safety-transator" type="chorus-translator-safetyHarness" >

                <property key="delegateName" value="chorus-translator-license" />

             </translator>

        </model>

  • 5. Re: How to use Teiid DelegatingExecutionFactory
    Vineela Gampa Novice

    with this vdb definiton

     

    <model name="chorusdata" visible="true">

            <translator type="h2" datasource="java:H2DS" />

        </model>

        <model name="h2util" visible="true">

            <translator type="chorus-translator-h2util" datasource="java:CHORUS-H2-ALERTS-DS" />

        </model>

        

        <!-- define a model fragment for each data source -->

        <model name="chorus-safety">

            <source name="chorus-safety-source" translator-name="chorus-safety-model.chorus-safety-transator"

               datasource="java:H2DS"/>

           

        </model>

     

        <!-- create translator instances that override default properties -->

        <model name="chorus-safety-model">

             <translator name="chorus-safety-transator" type="chorus-translator-safetyHarness" >

                <property key="delegateName" value="chorusdata.h2" />

             </translator>

        </model>

     

    @Translator(name="chorus-translator-safetyHarness")

    public class SafetyHarnessExecutionFactory extends BaseDelegatingExecutionFactory<Object, Object>{

        private static final Logger log = Logger.getLogger(SafetyHarnessExecutionFactory.class.getName());

     

     

       

        @Override

        public void getMetadata(MetadataFactory metadataFactory, Object conn)

                throws TranslatorException {

            System.err.println("in safetyharness getMetaData");

            log.debug("in safetyharness getMetaData");

            super.getMetadata(metadataFactory, conn);

           

            System.err.println("after safetyharness getMetaData");

            log.debug("after safetyharness getMetaData");

        }

     

       

    }

     

    [11:56:13.164][info][talledLocalContainer] 30 Jan 2012 11:56:13,164 PST INFO  [DeployHandler] Handle stream, deploymentTarget: names=[chorus-vdb.xml], copyContent=true, description=temp:#temp

    [11:56:13.175][info][talledLocalContainer] 30 Jan 2012 11:56:13,174 PST INFO  [DeployHandler] End handle stream, repositoryName: vfsfile:/C:/ws/Chorus/chorus-main/server/chorus-server-run/target/cargo/configurations/jboss51x/deploy/chorus-vdb.xml

    [11:56:13.177][info][talledLocalContainer] 30 Jan 2012 11:56:13,176 PST INFO  [DeployHandler] Begin start, [vfsfile:/C:/ws/Chorus/chorus-main/server/chorus-server-run/target/cargo/configurations/jboss51x/deploy/chorus-vdb.xml]

    [11:56:13.385][info][talledLocalContainer] 30 Jan 2012 11:56:13,383 PST ERROR [AbstractKernelController] Error installing to Real: name=vfsfile:/C:/ws/Chorus/chorus-main/server/chorus-server-run/target/cargo/configurations/jboss51x/deploy/chorus-vdb.xml state=PreReal mode=Manual requiredState=Real

    [11:56:13.385][info][talledLocalContainer] org.jboss.deployers.spi.DeploymentException: java.lang.reflect.InvocationTargetException

    [11:56:13.385][info][talledLocalContainer]     at org.teiid.deployers.TranslatorUtil.buildExecutionFactory(TranslatorUtil.java:102)

    [11:56:13.385][info][talledLocalContainer]     at org.teiid.deployers.VDBDeployer.getExecutionFactory(VDBDeployer.java:206)

    [11:56:13.385][info][talledLocalContainer]     at org.teiid.deployers.VDBDeployer.createConnectorManagers(VDBDeployer.java:185)

    [11:56:13.385][info][talledLocalContainer]     at org.teiid.deployers.VDBDeployer.deploy(VDBDeployer.java:114)

    [11:56:13.385][info][talledLocalContainer]     at org.teiid.deployers.VDBDeployer.deploy(VDBDeployer.java:61)

    [11:56:13.386][info][talledLocalContainer]     at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)

    [11:56:13.386][info][talledLocalContainer]     at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)

    [11:56:13.386][info][talledLocalContainer]     at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)

    [11:56:13.386][info][talledLocalContainer]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)

    [11:56:13.386][info][talledLocalContainer]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)

    [11:56:13.386][info][talledLocalContainer]     at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)

    [11:56:13.386][info][talledLocalContainer]     at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

    [11:56:13.386][info][talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

    [11:56:13.386][info][talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

    [11:56:13.386][info][talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

    [11:56:13.386][info][talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

    [11:56:13.387][info][talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

    [11:56:13.387][info][talledLocalContainer]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

    [11:56:13.387][info][talledLocalContainer]     at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)

    [11:56:13.387][info][talledLocalContainer]     at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)

    [11:56:13.387][info][talledLocalContainer]     at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)

    [11:56:13.387][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.start(AbstractDeployHandler.java:263)

    [11:56:13.387][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.invoke(AbstractDeployHandler.java:177)

    [11:56:13.387][info][talledLocalContainer]     at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)

    [11:56:13.388][info][talledLocalContainer]     at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)

    [11:56:13.388][info][talledLocalContainer]     at org.jboss.remoting.Client.invoke(Client.java:1724)

    [11:56:13.388][info][talledLocalContainer]     at org.jboss.remoting.Client.invoke(Client.java:629)

    [11:56:13.388][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.remoting.StreamingDeploymentTarget.invoke(StreamingDeploymentTarget.java:305)

    [11:56:13.388][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.remoting.StreamingDeploymentTarget.start(StreamingDeploymentTarget.java:190)

    [11:56:13.388][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.DeploymentProgressImpl.start(DeploymentProgressImpl.java:231)

    [11:56:13.388][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.DeploymentProgressImpl.run(DeploymentProgressImpl.java:88)

    [11:56:13.388][info][talledLocalContainer]     at org.teiid.adminapi.jboss.ManagedUtil.execute(ManagedUtil.java:295)

    [11:56:13.389][info][talledLocalContainer]     at org.teiid.adminapi.jboss.ManagedUtil.deployArchive(ManagedUtil.java:250)

    [11:56:13.389][info][talledLocalContainer]     at org.teiid.adminapi.jboss.ManagedUtil.deployArchive(ManagedUtil.java:228)

    [11:56:13.389][info][talledLocalContainer]     at org.teiid.adminapi.jboss.Admin.deployVDB(Admin.java:186)

    [11:56:13.389][info][talledLocalContainer]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    [11:56:13.389][info][talledLocalContainer]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    [11:56:13.389][info][talledLocalContainer]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    [11:56:13.389][info][talledLocalContainer]     at java.lang.reflect.Method.invoke(Method.java:597)

    [11:56:13.389][info][talledLocalContainer]     at org.teiid.logging.LogManager$LoggingProxy.invoke(LogManager.java:121)

    [11:56:13.390][info][talledLocalContainer]     at org.teiid.jboss.deployers.RuntimeEngineDeployer$2.invoke(RuntimeEngineDeployer.java:303)

    [11:56:13.390][info][talledLocalContainer]     at $Proxy303.deployVDB(Unknown Source)

    [11:56:13.390][info][talledLocalContainer]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    [11:56:13.390][info][talledLocalContainer]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    [11:56:13.390][info][talledLocalContainer]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    [11:56:13.390][info][talledLocalContainer]     at java.lang.reflect.Method.invoke(Method.java:597)

    [11:56:13.390][info][talledLocalContainer]     at org.teiid.transport.ServerWorkItem.run(ServerWorkItem.java:81)

    [11:56:13.391][info][talledLocalContainer]     at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:188)

    [11:56:13.391][info][talledLocalContainer]     at org.teiid.transport.SocketClientInstance.processMessagePacket(SocketClientInstance.java:160)

    [11:56:13.391][info][talledLocalContainer]     at org.teiid.transport.SocketClientInstance.receivedMessage(SocketClientInstance.java:149)

    [11:56:13.391][info][talledLocalContainer]     at org.teiid.transport.SSLAwareChannelHandler.messageReceived(SSLAwareChannelHandler.java:210)

    [11:56:13.391][info][talledLocalContainer]     at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:100)

    [11:56:13.391][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)

    [11:56:13.391][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)

    [11:56:13.391][info][talledLocalContainer]     at org.jboss.netty.handler.stream.ChunkedWriteHandler.handleUpstream(ChunkedWriteHandler.java:144)

    [11:56:13.392][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)

    [11:56:13.392][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)

    [11:56:13.392][info][talledLocalContainer]     at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:302)

    [11:56:13.392][info][talledLocalContainer]     at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:317)

    [11:56:13.392][info][talledLocalContainer]     at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:299)

    [11:56:13.392][info][talledLocalContainer]     at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:214)

    [11:56:13.392][info][talledLocalContainer]     at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:80)

    [11:56:13.393][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)

    [11:56:13.393][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)

    [11:56:13.393][info][talledLocalContainer]     at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:302)

    [11:56:13.393][info][talledLocalContainer]     at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:317)

    [11:56:13.393][info][talledLocalContainer]     at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:299)

    [11:56:13.393][info][talledLocalContainer]     at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:216)

    [11:56:13.393][info][talledLocalContainer]     at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:80)

    [11:56:13.393][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)

    [11:56:13.393][info][talledLocalContainer]     at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:540)

    [11:56:13.393][info][talledLocalContainer]     at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274)

    [11:56:13.393][info][talledLocalContainer]     at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261)

    [11:56:13.394][info][talledLocalContainer]     at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:349)

    [11:56:13.394][info][talledLocalContainer]     at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:281)

    [11:56:13.394][info][talledLocalContainer]     at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:201)

    [11:56:13.394][info][talledLocalContainer]     at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)

    [11:56:13.394][info][talledLocalContainer]     at org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.java:46)

    [11:56:13.394][info][talledLocalContainer]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

    [11:56:13.394][info][talledLocalContainer]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

    [11:56:13.394][info][talledLocalContainer]     at java.lang.Thread.run(Thread.java:662)

    [11:56:13.394][info][talledLocalContainer] Caused by: java.lang.reflect.InvocationTargetException

    [11:56:13.394][info][talledLocalContainer]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    [11:56:13.395][info][talledLocalContainer]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    [11:56:13.395][info][talledLocalContainer]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    [11:56:13.395][info][talledLocalContainer]     at java.lang.reflect.Method.invoke(Method.java:597)

    [11:56:13.395][info][talledLocalContainer]     at org.teiid.deployers.TranslatorUtil.injectProperties(TranslatorUtil.java:118)

    [11:56:13.395][info][talledLocalContainer]     at org.teiid.deployers.TranslatorUtil.buildExecutionFactory(TranslatorUtil.java:96)

    [11:56:13.395][info][talledLocalContainer]     ... 80 more

    [11:56:13.395][info][talledLocalContainer] Caused by: java.lang.NullPointerException

    [11:56:13.396][info][talledLocalContainer]     at org.teiid.translator.BaseDelegatingExecutionFactory.setRequiresCriteria(BaseDelegatingExecutionFactory.java:165)

    [11:56:13.396][info][talledLocalContainer]     ... 86 more

    [11:56:13.404][info][talledLocalContainer] 30 Jan 2012 11:56:13,403 PST INFO  [DeployHandler] Failed to complete command: [start] for deployment: names=[vfsfile:/C:/ws/Chorus/chorus-main/server/chorus-server-run/target/cargo/configurations/jboss51x/deploy/chorus-vdb.xml], copyContent=true

    [11:56:13.405][info][talledLocalContainer] org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

    [11:56:13.405][info][talledLocalContainer]

    [11:56:13.405][info][talledLocalContainer] *** DEPLOYMENTS IN ERROR: Name -> Error

    [11:56:13.405][info][talledLocalContainer]

    [11:56:13.405][info][talledLocalContainer] vfsfile:/C:/ws/Chorus/chorus-main/server/chorus-server-run/target/cargo/configurations/jboss51x/deploy/chorus-vdb.xml -> org.jboss.deployers.spi.DeploymentException: java.lang.reflect.InvocationTargetException

    [11:56:13.405][info][talledLocalContainer]

    [11:56:13.405][info][talledLocalContainer]

    [11:56:13.405][info][talledLocalContainer] DEPLOYMENTS IN ERROR:

    [11:56:13.405][info][talledLocalContainer]   Deployment "vfsfile:/C:/ws/Chorus/chorus-main/server/chorus-server-run/target/cargo/configurations/jboss51x/deploy/chorus-vdb.xml" is in error due to the following reason(s): java.lang.NullPointerException

    [11:56:13.405][info][talledLocalContainer]

    [11:56:13.405][info][talledLocalContainer]     at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)

    [11:56:13.406][info][talledLocalContainer]     at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)

    [11:56:13.406][info][talledLocalContainer]     at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)

    [11:56:13.406][info][talledLocalContainer]     at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)

    [11:56:13.406][info][talledLocalContainer]     at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.start(AbstractDeployHandler.java:265)

    [11:56:13.406][info][talledLo

  • 6. Re: How to use Teiid DelegatingExecutionFactory
    Ramesh Reddy Master

    Vineela,

     

    For starters your VDB xml fragment provided is all wrong, see the example I provided above. Wrong nesting, tags etc. Then, see the NPE at

     

    at org.teiid.translator.BaseDelegatingExecutionFactory.setRequiresCriteria(BaseDelegatingExecutionFactory.java:165)
    

     

    run your code in debug and see why this is happening.

     

    Ramesh..

  • 7. Re: How to use Teiid DelegatingExecutionFactory
    Vineela Gampa Novice

    Hi Ramesh,

     

    I observed that delegate instance is null in BaseDelegationExecutionFactory . so its throwign an NPE during start of the translator.

     

    Below is the vdb definiton whihc is changed as per your suggestion.

     

    <?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="chorus-safety">

            <property name="importer.useFullSchemaName" value="false"/>

            <source name="chorus-safetysrc" connection-jndi-name="java:H2DS" translator-name="work-interceptor"/>

        </model>

            <translator type="h2" name="chorus-h2-translator"/>

               <!-- the below it is called translator overriding, where you can set different properties -->

        <translator name="work-interceptor" type="chorus-translator-safetyHarness">

            <property name="delegateName" value="h2" />

       </translator>

    </vdb>

     

    Translator class :

    @Translator(name="chorus-translator-safetyHarness")

    public class SafetyHarnessExecutionFactory extends BaseDelegatingExecutionFactory<Object, Object>{

        private static final Logger log = Logger.getLogger(SafetyHarnessExecutionFactory.class.getName());

     

     

       

        @Override

        public void getMetadata(MetadataFactory metadataFactory, Object conn)

                throws TranslatorException {

            System.err.println("in safetyharness getMetaData");

            log.debug("in safetyharness getMetaData");

            super.getMetadata(metadataFactory, conn);

           

            System.err.println("after safetyharness getMetaData");

            log.debug("after safetyharness getMetaData");

        }

     

       

    }

     

    Erorr from jboss logs:

     

    1 Jan 2012 10:02:00,055 PST INFO  [org.teiid.RUNTIME] (main) Teiid translator "ws" has been added.

    31 Jan 2012 10:02:00,073 PST INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (main) deploy, ctxPath=/

    31 Jan 2012 10:02:00,145 PST ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Real: name=vfsfile:/C:/ws/Chorus/chorus-main/server/chorus-server-run/target/appserv/server/default/deploy/chorus-vdb.xml state=PreReal mode=Manual requiredState=Real

    org.jboss.deployers.spi.DeploymentException: Error during deploy: vfsfile:/C:/ws/Chorus/chorus-main/server/chorus-server-run/target/appserv/server/default/deploy/chorus-vdb.xml

        at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)

        at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:177)

        at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)

        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)

        at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)

        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

        at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)

        at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)

        at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)

        at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)

        at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)

        at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)

        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

        at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)

        at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)

        at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)

        at org.jboss.Main.boot(Main.java:221)

        at org.jboss.Main$1.run(Main.java:556)

        at java.lang.Thread.run(Thread.java:662)

    Caused by: java.lang.NullPointerException

        at org.teiid.translator.BaseDelegatingExecutionFactory.start(BaseDelegatingExecutionFactory.java:77)

        at org.teiid.deployers.TranslatorUtil.buildExecutionFactory(TranslatorUtil.java:100)

        at org.teiid.deployers.VDBDeployer.getExecutionFactory(VDBDeployer.java:207)

        at org.teiid.deployers.VDBDeployer.createConnectorManagers(VDBDeployer.java:186)

        at org.teiid.deployers.VDBDeployer.deploy(VDBDeployer.java:113)

        at org.teiid.deployers.VDBDeployer.deploy(VDBDeployer.java:60)

        at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)

        at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)

        at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)

        ... 29 more

    31 Jan 2012 10:02:00,275 PST ERROR [org.jboss.system.server.profileservice.ProfileServiceBootstrap] (main) Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

     

    DEPLOYMENTS IN ERROR:

      Deployment "vfsfile:/C:/ws/Chorus/chorus-main/server/chorus-server-run/target/appserv/server/default/deploy/chorus-vdb.xml" is in error due to the following reason(s): java.lang.NullPointerException

     

    31 Jan 2012 10:02:00,298 PST INFO  [org.apache.coyote.http11.Http11Protocol] (main) Starting Coyote HTTP/1.1 on http-127.0.0.1-8080

    31 Jan 2012 10:02:00,310 PST INFO  [org.apache.coyote.ajp.AjpProtocol] (main) Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009

    31 Jan 2012 10:02:00,314 PST INFO  [org.jboss.bootstrap.microcontainer.ServerImpl] (main) JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221053)] Started in 21s:304ms

    31 Jan 2012 10:05:57,157 PST INFO  [org.jboss.bootstrap.microcontainer.ServerImpl] (JBoss Shutdown Hook) Runtime shutdown hook called, forceHalt: true

    31 Jan 2012 10:05:57,162 PST INFO  [org.apache.coyote.http11.Http11Protocol] (JBoss Shutdown Hook) Pausing Coyote HTTP/1.1 on http-127.0.0.1-8080

    31 Jan 2012 10:05:57,166 PST INFO  [org.apache.coyote.http11.Http11Protocol] (JBoss Shutdown Hook) Stopping Coyote HTTP/1.1 on http-127.0.0.1-8080

    31 Jan 2012 10:05:57,181 PST INFO  [org.apache.coyote.ajp.AjpProtocol] (JBoss Shutdown Hook) Pausing Coyote AJP/1.3 on ajp-127.0.0.1-8009

    31 Jan 2012 10:05:57,183 PST INFO  [org.apache.coyote.ajp.AjpProtocol] (JBoss Shutdown Hook) Stopping Coyote AJP/1.3 on ajp-127.0.0.1-8009

    31 Jan 2012 10:05:57,208 PST INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (JBoss Shutdown Hook) undeploy, ctxPath=/web-console

    31 Jan 2012 10:05:57,288 PST INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (JBoss Shutdown Hook) undeploy, ctxPath=/

    31 Jan 2012 10:05:57,297 PST INFO  [org.apache.catalina.core.StandardService] (JBoss Shutdown Hook) Stopping service jboss.web

    31 Jan 2012 10:05:57,351 PST INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] (JBoss Shutdown Hook) Unbound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=H2DS' from JNDI name 'java:H2DS'

    31 Jan 2012 10:05:57,354 PST INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] (JBoss Shutdown Hook) Unbound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' from JNDI name 'java:DefaultDS'

    31 Jan 2012 10:05:57,364 PST INFO  [org.teiid.RUNTIME] (JBoss Shutdown Hook) Teiid Engine stopped Tue Jan 31 10:05:57 PST 2012

    31 Jan 2012 10:05:57,753 PST INFO  [org.teiid.SECURITY] (JBoss Shutdown Hook) Admin Security Enabled: true

    31 Jan 2012 10:05:57,754 PST INFO  [org.teiid.SECURITY] (JBoss Shutdown Hook) Authentication Type set to: null

    31 Jan 2012 10:05:57,769 PST INFO  [com.arjuna.ats.jbossatx.jta.TransactionManagerService] (JBoss Shutdown Hook) Stopping transaction recovery manager

    31 Jan 2012 10:05:57,770 PST INFO  [com.arjuna.ats.jbossatx.jta.TransactionManagerService] (JBoss Shutdown Hook) Destroying TransactionManagerService

    31 Jan 2012 10:05:58,388 PST INFO  [org.jboss.jdbc.HypersonicDatabase] (JBoss Shutdown Hook) Database standalone closed clean

  • 8. Re: How to use Teiid DelegatingExecutionFactory
    Vineela Gampa Novice

    Ramesh ,

     

    If possible can you attach a working sample with teh translator and VDB configuration. Ill resuse teh same and see if its wrking.

  • 9. Re: How to use Teiid DelegatingExecutionFactory
    Ramesh Reddy Master

    Vineela,

     

    Let me run some tests to see if there is any error. I will attach my results then.

     

    Ramesh..

  • 10. Re: How to use Teiid DelegatingExecutionFactory
    Vineela Gampa Novice

    Sure will be waiting for the results.

  • 11. Re: How to use Teiid DelegatingExecutionFactory
    Ramesh Reddy Master

    Vineela,

     

    I logged https://issues.jboss.org/browse/TEIID-1922

     

    There is very simple workaround, in your extended translator class override the "start" method like

     

        @Override
    public void start() {

    }

     

    Ramesh..

  • 12. Re: How to use Teiid DelegatingExecutionFactory
    Vineela Gampa Novice

    Hi Ramesh,

     

    This worked in the sense, server came up fine but when i issue a select against the delegated translator the code of my interceptor is not hit. When i debugged all teh ovveriden methods are getting hit exception createExecution and createResultSetExecution.

    I verified that delegate execution factory was also getting set correctly. Please let me know if iam missing something.  Can you try from your side to issue a select again the delegated translator and check to see if you are able to do any interception ?

     

    Iam executing query against the delegated translator

    select * from chorus_license.RL_LICENSE -- this is not hitting any of interceptor code .

     

    Metadata :

       <model type="PHYSICAL" visible="true" name="chorus-safety">

            <property name="importer.useFullSchemaName" value="false"/>

            <source name="chorus-safety" connection-jndi-name="java:LICENSE-FILE-DS" translator-name="chorus-safety.delegated-translator"/>

        </model>

    <translator name="chorus-safety.delegated-translator" type="chorus-translator-safetyHarness">

            <property name="delegateName" value="chorus-translator-license"/>---------------------------------------------------------- Here chorus-translator-license is one another translator

        </translator>

     

    Interceptor :

     

    @Translator(name="chorus-translator-safetyHarness")

    public class SafetyHarnessExecutionFactory extends BaseDelegatingExecutionFactory<Object, Object>{

        private static final Logger log = Logger.getLogger(SafetyHarnessExecutionFactory.class.getName());

     

     

        @Override

        public Object getConnection(Object factory,

                ExecutionContext executionContext) throws TranslatorException {

            // TODO Auto-generated method stub

            log.debug("In getConenction of safety");

            return super.getConnection(factory, executionContext);

        }

        @Override

        public void getMetadata(MetadataFactory metadataFactory, Object conn)

                throws TranslatorException {

            System.err.println("in safetyharness getMetaData");

            log.debug("in safetyharness getMetaData");

            super.getMetadata(metadataFactory, conn);

     

            System.err.println("after safetyharness getMetaData");

            log.debug("after safetyharness getMetaData");

        }

        @Override

        public void start() throws TranslatorException {

            System.err.println("in start");

        }

        @Override

        public ResultSetExecution createResultSetExecution(QueryExpression command,

                ExecutionContext executionContext, RuntimeMetadata metadata,

                Object connection) throws TranslatorException {

            log.debug("in safetyharness createResultSetExecution");

            return super.createResultSetExecution(command, executionContext, metadata,

                    connection);

     

        }

       @Override

        public void closeConnection(Object connection, Object factory) {

            log.debug("In close connection of safety");

            super.closeConnection(connection, factory);

        }

       @Override

        public void setDelegate(ExecutionFactory<Object, Object> delegate) {

            // TODO Auto-generated method stub

           log.debug("In setDelegate method of safey" + delegate.getClass());

               super.setDelegate(delegate);

        }

        @Override

        public Execution createExecution(Command command,

                ExecutionContext executionContext, RuntimeMetadata metadata,

                Object connection) throws TranslatorException {

            log.debug("in safetyharness createExecution");

            return super.createExecution(command, executionContext, metadata, connection);

        }

  • 13. Re: How to use Teiid DelegatingExecutionFactory
    Ramesh Reddy Master

    Vineela,

     

    Are you saying your "createExecution" and "createResultsetExecution" as not being intercepted? If you look at the "ExecutionFactory" code, "createExecution" is main method, other "create" methods are called from it. So, if your translator "chrous-translator-license" you did not have same code as ExecutionFactory, then it will not call "createResultsetExecution", however you should have seen the "createExecution" call.

     

    In your interceptor place this

              @Override
         public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws TranslatorException {
              if (command instanceof QueryExpression) {
                   return createResultSetExecution((QueryExpression)command, executionContext, metadata, connection);
              }
              if (command instanceof Call) {
                   return createProcedureExecution((Call)command, executionContext, metadata, connection);
              }
              return createUpdateExecution(command, executionContext, metadata, connection);
         }
    
    

     

    then all the calls wil be intercepted.

     

    Ramesh..

  • 14. Re: How to use Teiid DelegatingExecutionFactory
    Vineela Gampa Novice

    Ramesh,

     

    If you have seen my interceptor code i have ovvridden createExecution method. I just placed a logger and routed it to its parent class ? Should i place the way you told ? It shouldnt matter right ?? I debugged the code, when i issued the sql against the delegated translator , interceptor translator is not called at all.

     

    It was called for getMetaData() , closeConenction(), getConnection(), setDelegate buit not for any create*Execution calls.

     

    @Override

        public Execution createExecution(Command command,

                ExecutionContext executionContext, RuntimeMetadata metadata,

                Object connection) throws TranslatorException {

            log.debug("in safetyharness createExecution");

            return super.createExecution(command, executionContext, metadata, connection);

        }

1 2 Previous Next