Madhu Garimilla [
https://community.jboss.org/people/madhu.garimilla] created the
discussion
"Re: How to add a resource-adapter programatically?"
To view the discussion, visit:
https://community.jboss.org/message/827919#827919
--------------------------------------------------------------
Hi Ramesh,
I tried to test this by adding multiple file data sources.
final Admin admin =
AdminFactory.getInstance().createAdmin("localhost",9999,"admin","admin".toCharArray());
final Properties p = new Properties();
p.setProperty("class-name","org.teiid.resource.adapter.file.FileManagedConnectionFactory");
p.setProperty("ParentDirectory",
"${jboss.home.dir}/../data/");
p.setProperty("AllowParentPaths", "true");
admin.createDataSource("java:/marketdata-file","teiid-connector-file.rar",p);
final Properties p1 = new Properties();
p1.setProperty("class-name","org.teiid.resource.adapter.file.FileManagedConnectionFactory");
p1.setProperty("ParentDirectory",
"${jboss.home.dir}/../data/");
p1.setProperty("AllowParentPaths", "true");
admin.createDataSource("java:/marketdata-file1","teiid-connector-file.rar",p1);
Then it throws the below exception in the jboss console.
13:28:58,987 INFO org.jboss.as.connector.deployers.RaXmlDeployer
org.jboss.as.connector.deployers.RaXmlDeployer (MSC service thread 1-2) IJ020001: Required
license terms for file:/C:/Chorus/CAR/
Work/jboss-as-7.1.1.Final/standalone/tmp/vfs/temp98701600a4006a0e/teiid-connector-file.rar-4c490c2c33dad3d0/contents/
13:28:58,993 INFO org.jboss.as.deployment.connector org.jboss.as.deployment.connector
(MSC service thread 1-2) JBAS010406: Registered connection factory java:/marketdata-file
13:28:58,996 INFO org.jboss.as.connector.deployers.RaXmlDeployer
org.jboss.as.connector.deployers.RaXmlDeployer (MSC service thread 1-2) IJ020002:
Deployed: file:/C:/Chorus/CAR/Work/jboss-as-7.1
.1.Final/standalone/tmp/vfs/temp98701600a4006a0e/teiid-connector-file.rar-4c490c2c33dad3d0/contents/
13:28:58,998 INFO org.jboss.as.deployment.connector org.jboss.as.deployment.connector
(MSC service thread 1-8) JBAS010401: Bound JCA ConnectionFactory java:/marketdata-file
13:28:59,379 INFO org.jboss.as.deployment.connector org.jboss.as.deployment.connector
(MSC service thread 1-11) JBAS010410: Unbound JCA ConnectionFactory java:/marketdata-file
13:28:59,381 ERROR org.jboss.msc.service.fail org.jboss.msc.service.fail (MSC service
thread 1-16) MSC00001: Failed to start service
jboss.ra.deployment."teiid-connector-file.
rar_1": org.jboss.msc.service.StartException in service
jboss.ra.deployment."teiid-connector-file.rar_1":
org.jboss.jca.core.spi.mdr.NotFoundException
: IJ000855: teiid-connector-file 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.runWorker(ThreadPoolExecutor.java:1110)
https://community.jboss.org/message/827919#827919#827919/rt.jar:1.7.0_03 Re: How to add a
resource-adapter programatically?
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
https://community.jboss.org/message/827919#827919#827919/rt.jar:1.7.0_03 Re: How to add a
resource-adapter programatically?
at java.lang.Thread.run(Thread.java:722)
https://community.jboss.org/message/827919#827919#827919/rt.jar:1.7.0_03 Re: How to add a
resource-adapter programatically?
Caused by: org.jboss.jca.core.spi.mdr.NotFoundException: IJ000855: teiid-connector-file
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
13:28:59,453 INFO org.jboss.as.controller org.jboss.as.controller
(management-handler-thread - 1) JBAS014774: Service status report
JBAS014777: Services which failed to start: service
jboss.ra.deployment."teiid-connector-file.rar_1":
org.jboss.msc.service.StartException in s
ervice jboss.ra.deployment."teiid-connector-file.rar_1":
org.jboss.jca.core.spi.mdr.NotFoundException: IJ000855: teiid-connector-file isn't
registered
Where as this works fine when i add only one file data source. Though it is adding the
resource adapters in the standalone-teiid.xml, those are working fine only after a jboss
restart.
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/827919#827919]
Start a new discussion in JNDI and Naming at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]