9 Replies Latest reply: May 11, 2012 9:50 AM by Ramesh Reddy RSS

Error during (re) adding connection factory using CLI

Ramesh Reddy Master

Hi,

 

In Teiid, we make use of CLI to create connection factories for tooling purposes. When I run the following CLI commands

 

/subsystem=resource-adapters/resource-adapter=wsDS:add(archive=teiid-connector-ws.rar, transaction-support=NoTransaction)
/subsystem=resource-adapters/resource-adapter=wsDS/connection-definitions=wsDS:add(jndi-name=java:/wsDS, class-name=org.teiid.resource.adapter.ws.WSManagedConnectionFactory, enabled=true, use-java-context=true)
/subsystem=resource-adapters/resource-adapter=wsDS/connection-definitions=wsDS/config-properties=EndPoint:add(value={end_point})
/subsystem=resource-adapters/resource-adapter=wsDS:activate

 

It creates a resource adapter and then creates connection factory, all is good. Now execute

 

/subsystem=resource-adapters/resource-adapter=wsDS:remove

 

the connection factory along with the resource adapter removed. Now re-execute same code above to re-create the resource adapter and connection factory, it fails with following message on the AS7 console window

 

20:48:02,169 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.ra.deployment."teiid-connector-ws.rar_1": org.jboss.msc.service.StartException in service jboss.ra.deployment."teiid-connector-ws.rar_1": org.jboss.jca.core.spi.mdr.NotFoundException: IJ000855: teiid-connector-ws isn't registered
    at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:127)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]
    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]
Caused by: org.jboss.jca.core.spi.mdr.NotFoundException: IJ000855: teiid-connector-ws isn't registered
    at org.jboss.jca.core.mdr.SimpleMetadataRepository.getResourceAdapter(SimpleMetadataRepository.java:150)
    at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:87)
    ... 5 more

 

 

Can somebody please tell me what I may be doing wrong or is this a bug in code?

 

 

Thank you

 

Ramesh..

  • 1. Re: Error during (re) adding connection factory using CLI
    Stefano Maestri Expert

    I can't reproduce it on latest master. Can you try to update AS7 to latest master?

     

     

    regards

    S.

  • 2. Re: Error during (re) adding connection factory using CLI
    Ramesh Reddy Master

    Stefano,

     

    I tried with latest nightly (05/09/12) and see the same behavior.

     

    13:26:52,087 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.ra.deployment."teiid-connector-ws.rar_1": org.jboss.msc.service.StartException in service jboss.ra.deployment."teiid-connector-ws.rar_1": org.jboss.jca.core.spi.mdr.NotFoundException: IJ000855: teiid-connector-ws isn't registered
        at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:128)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]
        at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]
    Caused by: org.jboss.jca.core.spi.mdr.NotFoundException: IJ000855: teiid-connector-ws isn't registered
        at org.jboss.jca.core.mdr.SimpleMetadataRepository.getResourceAdapter(SimpleMetadataRepository.java:150)
        at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:88)
        ... 5 more
    
    13:26:52,194 INFO  [org.jboss.as.controller] (management-handler-thread - 1) JBAS014774: Service status report
    JBAS014777:   Services which failed to start:      service jboss.ra.deployment."teiid-connector-ws.rar_1": org.jboss.msc.service.StartException in service jboss.ra.deployment."teiid-connector-ws.rar_1": org.jboss.jca.core.spi.mdr.NotFoundException: IJ000855: teiid-connector-ws isn't registered
    

     

    Thanks.

     

    Ramesh..

  • 3. Re: Error during (re) adding connection factory using CLI
    Jesper Pedersen Master

    Please, attach the resource adapter, or send it to us. TIA

  • 4. Re: Error during (re) adding connection factory using CLI
    Ramesh Reddy Master

    Please see attached. The "dependent-modules" needs to overlayed on the "modules" directory, then you can deploy the "rar" file.

     

    Thank you.

     

    Ramesh..

  • 5. Re: Error during (re) adding connection factory using CLI
    Stefano Maestri Expert

    I've opened a bug report and I'm working on it. While I'm solving it, may I ask you if you really need to remove the resource-adapter and why?

    You could leave it there and just call :activate again on it to reapply its configs. You should be able to edit it too.

     

    It's definitely a bug, and I'm going to solve it, but asking because maybe you are doing a redundant operation.

     

    regards

    S.

  • 6. Re: Error during (re) adding connection factory using CLI
    Ramesh Reddy Master

    Stefano,

     

    This is under Teiid tooling api, as user adds/removes the data models to virtual database these actions are performed. So, we really do not have total control over it. The issue surfaced when we tried to add (using CLI)

    • two different connection factories under one resource-adapter
    • two spearate resource-adapters using the same RAR file but with individual connection factory inside it

     

    it behaves exactly the same way with same exception. The above is prime usecase in Teiid as it can have multiple connections of same resource-adapter but to different sources. For example, different salesforce accounts or different web-services. May be you can also test above scenarios after your fix.

     

    Also, I really do wish the "activate/enable" and corresponding "deactivate/disable" at the connection factory level rather than the resource-adpater level. This would match to the "data sources" behavior. You can keep the add/remove at the resource-adpater level. Currently IMO, configuration aspects are mixed with the runtime aspects with "activate/remove" calls, they should be separate.

     

    Thank you very much for looking into it.

     

    Ramesh..

  • 7. Re: Error during (re) adding connection factory using CLI
    Stefano Maestri Expert

    Ramesh Reddy wrote:

     

    Stefano,

     

    This is under Teiid tooling api, as user adds/removes the data models to virtual database these actions are performed. So, we really do not have total control over it. The issue surfaced when we tried to add (using CLI)

    • two different connection factories under one resource-adapter
    • two spearate resource-adapters using the same RAR file but with individual connection factory inside it

     

    it behaves exactly the same way with same exception. The above is prime usecase in Teiid as it can have multiple connections of same resource-adapter but to different sources. For example, different salesforce accounts or different web-services. May be you can also test above scenarios after your fix.

     

    I'llinvestigate. But it's quite strange, it's the primary use case we was covering w/ resource-adapters. I belive we have also test cases about that, but I'll be back to you when verified.

     

     

     

    Also, I really do wish the "activate/enable" and corresponding "deactivate/disable" at the connection factory level rather than the resource-adpater level. This would match to the "data sources" behavior. You can keep the add/remove at the resource-adpater level. Currently IMO, configuration aspects are mixed with the runtime aspects with "activate/remove" calls, they should be separate.

     

     

    We will see if we can do something in next release. We CAN'T change API at this stage of course.

     

    regards

    S.

  • 8. Re: Error during (re) adding connection factory using CLI
    Stefano Maestri Expert

    Ramesh Reddy wrote:

     

    Stefano,

     

    This is under Teiid tooling api, as user adds/removes the data models to virtual database these actions are performed. So, we really do not have total control over it. The issue surfaced when we tried to add (using CLI)

    • two different connection factories under one resource-adapter
    • two spearate resource-adapters using the same RAR file but with individual connection factory inside it

     

    it behaves exactly the same way with same exception. The above is prime usecase in Teiid as it can have multiple connections of same resource-adapter but to different sources. For example, different salesforce accounts or different web-services. May be you can also test above scenarios after your fix.

     

    While I'm fixing the first issue reported, can you paste here command used in cli for those use cases? It would help me a lot.

     

    regards

    S.

  • 9. Re: Error during (re) adding connection factory using CLI
    Ramesh Reddy Master

    Stefano,

     

    Here they are.

     

    • two different connection factories under one resource-adapter
    /subsystem=resource-adapters/resource-adapter=wsDS:add(archive=teiid-connector-ws.rar, transaction-support=NoTransaction)
    /subsystem=resource-adapters/resource-adapter=wsDS/connection-definitions=wsOneDS:add(jndi-name=java:/wsOneDS, class-name=org.teiid.resource.adapter.ws.WSManagedConnectionFactory, enabled=true, use-java-context=true)
    /subsystem=resource-adapters/resource-adapter=wsDS/connection-definitions=wsOneDS/config-properties=EndPoint:add(value={end_point})
    /subsystem=resource-adapters/resource-adapter=wsDS:activate
    
    
    /subsystem=resource-adapters/resource-adapter=wsDS/connection-definitions=wsTwoDS:add(jndi-name=java:/wsTwoDS, class-name=org.teiid.resource.adapter.ws.WSManagedConnectionFactory, enabled=true, use-java-context=true)
    /subsystem=resource-adapters/resource-adapter=wsDS/connection-definitions=wsTwoDS/config-properties=EndPoint:add(value={end_point})
    /subsystem=resource-adapters/resource-adapter=wsDS:activate
    

     

     

    • two separate resource-adapters using the same RAR file but with individual connection factory inside it
    /subsystem=resource-adapters/resource-adapter=wsOneDS:add(archive=teiid-connector-ws.rar, transaction-support=NoTransaction)
    /subsystem=resource-adapters/resource-adapter=wsOneDS/connection-definitions=wsOneDS:add(jndi-name=java:/wsOneDS, class-name=org.teiid.resource.adapter.ws.WSManagedConnectionFactory, enabled=true, use-java-context=true)
    /subsystem=resource-adapters/resource-adapter=wsOneDS/connection-definitions=wsOneDS/config-properties=EndPoint:add(value={end_point})
    /subsystem=resource-adapters/resource-adapter=wsOneDS:activate
    
    
    /subsystem=resource-adapters/resource-adapter=wsTwoDS:add(archive=teiid-connector-ws.rar, transaction-support=NoTransaction)
    /subsystem=resource-adapters/resource-adapter=wsTwoDS/connection-definitions=wsTwoDS:add(jndi-name=java:/wsTwoDS, class-name=org.teiid.resource.adapter.ws.WSManagedConnectionFactory, enabled=true, use-java-context=true)
    /subsystem=resource-adapters/resource-adapter=wsTwoDS/connection-definitions=wsTwoDS/config-properties=EndPoint:add(value={end_point})
    /subsystem=resource-adapters/resource-adapter=wsTwoDS:activate
    

     

     

    Thank you.

     

    Ramesh..