<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Re: How to add a resource-adapter programatically?
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/madhu.garimilla">Madhu Garimilla</a> in <i>JNDI and Naming</i> - <a href="https://community.jboss.org/message/827919#827919">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi Ramesh,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I tried to test this by adding multiple file data sources.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; </p><pre class="jive-pre"><code class="jive-code"> final Admin admin = AdminFactory.getInstance().createAdmin("localhost",9999,"admin","admin".toCharArray());

&#160;&#160;&#160;&#160;&#160;&#160;&#160; final Properties p = new Properties();
&#160;&#160;&#160;&#160;&#160;&#160;&#160; p.setProperty("class-name","org.teiid.resource.adapter.file.FileManagedConnectionFactory");
&#160;&#160;&#160;&#160;&#160;&#160;&#160; p.setProperty("ParentDirectory", "${jboss.home.dir}/../data/");
&#160;&#160;&#160;&#160;&#160;&#160;&#160; p.setProperty("AllowParentPaths", "true");
&#160;&#160;&#160;&#160;&#160;&#160;&#160; admin.createDataSource("java:/marketdata-file","teiid-connector-file.rar",p);

&#160;&#160;&#160;&#160;&#160;&#160;&#160; final Properties p1 = new Properties();
&#160;&#160;&#160;&#160;&#160;&#160;&#160; p1.setProperty("class-name","org.teiid.resource.adapter.file.FileManagedConnectionFactory");
&#160;&#160;&#160;&#160;&#160;&#160;&#160; p1.setProperty("ParentDirectory", "${jboss.home.dir}/../data/");
&#160;&#160;&#160;&#160;&#160;&#160;&#160; p1.setProperty("AllowParentPaths", "true");
&#160;&#160;&#160;&#160;&#160;&#160;&#160; admin.createDataSource("java:/marketdata-file1","teiid-connector-file.rar",p1);</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Then it throws the below exception in the jboss console. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>13:28:58,987 INFO&#160; <a class="jive-link-external-small" href="org.jboss.as.connector.deployers.RaXmlDeployer" rel="nofollow">org.jboss.as.connector.deployers.RaXmlDeployer</a> (MSC service thread 1-2) IJ020001: Required license terms for file:/C:/Chorus/CAR/</p><p>Work/jboss-as-7.1.1.Final/standalone/tmp/vfs/temp98701600a4006a0e/teiid-connector-file.rar-4c490c2c33dad3d0/contents/</p><p>13:28:58,993 INFO&#160; <a class="jive-link-external-small" href="org.jboss.as.deployment.connector" rel="nofollow">org.jboss.as.deployment.connector</a> (MSC service thread 1-2) JBAS010406: Registered connection factory java:/marketdata-file</p><p>13:28:58,996 INFO&#160; <a class="jive-link-external-small" href="org.jboss.as.connector.deployers.RaXmlDeployer" rel="nofollow">org.jboss.as.connector.deployers.RaXmlDeployer</a> (MSC service thread 1-2) IJ020002: Deployed: file:/C:/Chorus/CAR/Work/jboss-as-7.1</p><p>.1.Final/standalone/tmp/vfs/temp98701600a4006a0e/teiid-connector-file.rar-4c490c2c33dad3d0/contents/</p><p>13:28:58,998 INFO&#160; <a class="jive-link-external-small" href="org.jboss.as.deployment.connector" rel="nofollow">org.jboss.as.deployment.connector</a> (MSC service thread 1-8) JBAS010401: Bound JCA ConnectionFactory <a class="jive-link-external-small" href="" rel="nofollow">java:/marketdata-file</a></p><p>13:28:59,379 INFO&#160; <a class="jive-link-external-small" href="org.jboss.as.deployment.connector" rel="nofollow">org.jboss.as.deployment.connector</a> (MSC service thread 1-11) JBAS010410: Unbound JCA ConnectionFactory <a class="jive-link-external-small" href="" rel="nofollow">java:/marketdata-file</a></p><p>13:28:59,381 ERROR <a class="jive-link-external-small" href="org.jboss.msc.service.fail" rel="nofollow">org.jboss.msc.service.fail</a> (MSC service thread 1-16) MSC00001: Failed to start service jboss.ra.deployment."teiid-connector-file.</p><p>rar_1": org.jboss.msc.service.StartException in service jboss.ra.deployment."teiid-connector-file.rar_1": org.jboss.jca.core.spi.mdr.NotFoundException</p><p>: IJ000855: teiid-connector-file isn't registered</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:127)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) <a class="jive-link-external-small" href="" rel="nofollow">jboss-msc-1.0.2.GA.jar:1.0.2.GA</a></p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) <a class="jive-link-external-small" href="" rel="nofollow">jboss-msc-1.0.2.GA.jar:1.0.2.GA</a></p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) <a class="" href="https://community.jboss.org/message/827919#827919#827919/rt.jar:1.7.0_03">Re: How to add a resource-adapter programatically?</a></p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) <a class="" href="https://community.jboss.org/message/827919#827919#827919/rt.jar:1.7.0_03">Re: How to add a resource-adapter programatically?</a></p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at java.lang.Thread.run(Thread.java:722) <a class="" href="https://community.jboss.org/message/827919#827919#827919/rt.jar:1.7.0_03">Re: How to add a resource-adapter programatically?</a></p><p>Caused by: org.jboss.jca.core.spi.mdr.NotFoundException: IJ000855: teiid-connector-file isn't registered</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.jca.core.mdr.SimpleMetadataRepository.getResourceAdapter(SimpleMetadataRepository.java:150)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:87)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; ... 5 more</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>13:28:59,453 INFO&#160; <a class="jive-link-external-small" href="org.jboss.as.controller" rel="nofollow">org.jboss.as.controller</a> (management-handler-thread - 1) JBAS014774: Service status report</p><p>JBAS014777:&#160;&#160; Services which failed to start:&#160;&#160;&#160;&#160;&#160; service jboss.ra.deployment."teiid-connector-file.rar_1": org.jboss.msc.service.StartException in s</p><p>ervice jboss.ra.deployment."teiid-connector-file.rar_1": org.jboss.jca.core.spi.mdr.NotFoundException: IJ000855: teiid-connector-file isn't registered</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>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.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/827919#827919">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JNDI and Naming at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>