<!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="http://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;">
    Another injection issue
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/JensMander">Jens Mander</a> in <i>JCA</i> - <a href="http://community.jboss.org/message/567172#567172">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,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I'm trying to set up the "File System Adapter" like shown here <a class="jive-link-external-small" href="http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch7.chapt.html">http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch7.chapt.html</a></p><p>First I build the rar-archive and moved it to the deploy-folder together with the MBean descriptor (notxfs-ds.xml). So far so good. The admin console and the jmx-console showed me that the AS now knows an the connection-factoty</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>JMX (jboss.jca)</p><ul><li><a class="jive-link-external-small" href="http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&amp;name=jboss.jca%3Aservice%3DConnectionFactoryBinding%2Cname%3DNoTransFS">name=NoTransFS,service=ConnectionFactoryBinding</a></li><li><a class="jive-link-external-small" href="http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&amp;name=jboss.jca%3Aservice%3DManagedConnectionFactory%2Cname%3DNoTransFS">name=NoTransFS,service=ManagedConnectionFactory</a></li><li><a class="jive-link-external-small" href="http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&amp;name=jboss.jca%3Aservice%3DManagedConnectionPool%2Cname%3DNoTransFS">name=NoTransFS,service=ManagedConnectionPool</a></li><li><a class="jive-link-external-small" href="http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&amp;name=jboss.jca%3Aservice%3DNoTxCM%2Cname%3DNoTransFS">name=NoTransFS,service=NoTxCM</a></li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Admin-Console</p><p>View by Type:<select name="j_id97:j_id100" size="1"> <option value="All Types">All Types</option> <option selected="selected" value="-3/Resources/Connection Factories/No Tx ConnectionFactory">No Tx ConnectionFactories</option> <option value="-3/Resources/Connection Factories/Tx ConnectionFactory">Tx ConnectionFactories</option> </select><input id="javax.faces.ViewState" name="javax.faces.ViewState" type="hidden" value=""/> <input name="categorySummaryForm" type="hidden" value=""/></p><table border="0" cellpadding="0" cellspacing="0" class="dr-table rich-table controlTable" id="categorySummaryForm:dataTable"><thead class="dr-table-thead"> <tr class="dr-table-header rich-table-header&#160; "><th class="dr-table-headercell rich-table-headercell " id="categorySummaryForm:dataTable:j_id104" style="">Name</th><th class="dr-table-headercell rich-table-headercell " id="categorySummaryForm:dataTable:j_id106" style="">Type</th><th class="dr-table-headercell rich-table-headercell " id="categorySummaryForm:dataTable:j_id108" style="">Status</th><th class="dr-table-headercell rich-table-headercell " id="categorySummaryForm:dataTable:j_id110" style="">Actions</th></tr></thead><tfoot> <tr class="dr-table-footer rich-table-footer&#160; "><td class="dr-table-footercell rich-table-footercell&#160; " colspan="4" scope="colgroup" style=""><a href="http://localhost:8080/admin-console/images/spacer.gif"><span> http://localhost:8080/admin-console/images/spacer.gif </span></a></td></tr></tfoot> <tbody id="categorySummaryForm:dataTable:tb"><tr class="dr-table-firstrow rich-table-firstrow oddRow"><td class="dr-table-cell rich-table-cell rich-table-cell " id="categorySummaryForm:dataTable:0:j_id112" style=""><a class="jive-link-external-small" href="http://localhost:8080/admin-console/secure/summary.seam?path=-13&amp;conversationId=14">NoTransFS</a></td><td class="dr-table-cell rich-table-cell&#160; rich-table-cell " id="categorySummaryForm:dataTable:0:j_id116" style=""><a class="jive-link-external-small" href="http://localhost:8080/admin-console/secure/summary.seam?path=-3%2FResources%2FConnection+Factories%2FNo+Tx+ConnectionFactory&amp;conversationId=14">No Tx ConnectionFactory </a></td><td class="dr-table-cell rich-table-cell&#160; rich-table-cell " id="categorySummaryForm:dataTable:0:j_id120" style="">UP</td><td class="dr-table-cell rich-table-cell&#160; rich-table-cell-action " id="categorySummaryForm:dataTable:0:j_id122" style=""><input class="buttonsmall" id="categorySummaryForm:dataTable:0:removeButton" type="button" value=""/></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Now I'd like to use it in my beans to use file access without using java.io.* so I used the following code:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java"><font color="navy"><b>import</b></font> javax.annotation.Resource;
<font color="navy"><b>import</b></font> javax.resource.cci.ConnectionFactory;
&#160;
...
&#160;
&#160;&#160;&#160; @Resource(name=<font color="red">"NoTransFS"</font>)
&#160;&#160;&#160; <font color="navy"><b>private</b></font> DirContextFactory dcf;
&#160;
&#160;&#160;&#160; <font color="navy"><b>public</b></font> String action() <font color="navy">{</font>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="navy"><b>try</b></font> <font color="navy">{</font>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; DirContext dc = dcf.getConnection();
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; NamingEnumeration&lt;SearchResult&gt; res = dc.search(<font color="red">"myFile"</font>, <font color="navy"><b>null</b></font>);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="navy"><b>while</b></font> (res.hasMore()) <font color="navy">{</font>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println(res.next().toString());
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="navy">}</font>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="navy">}</font> <font color="navy"><b>catch</b></font> (NamingException e) <font color="navy">{</font>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.printStackTrace();
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="navy">}</font>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="navy"><b>return</b></font> <font color="navy"><b>null</b></font>;
&#160;&#160;&#160; <font color="navy">}</font>
&#160;
...&#160;&#160; 
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Unfortunately I can't look up the ConnectionFactory so I'll always receive a NullPointerException.I tried several kinds of the @Resource annotation but nothing works out. Maybe the JNDIView helps somebody to give me some hints:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">java: Namespace

&#160; +- securityManagement (class: org.jboss.security.integration.JNDIBasedSecurityManagement)
&#160; +- comp (class: javax.namingMain.Context)
&#160; +- DeploymentManager (class: org.jboss.aop.generatedproxies.AOPProxy$4)
&#160; +- XAConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
&#160; +- JmsXA (class: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)
&#160; +- authDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
&#160; +- policyRegistration (class: org.jboss.security.plugins.JBossPolicyRegistration)
&#160; +- TransactionPropagationContextImporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
&#160; +- app (class: org.jnp.interfaces.NamingContext)
&#160; |&#160;&#160; +- Manager (class: javax.inject.manager.Manager)
&#160; +- ClusteredConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
&#160; +- Mail (class: javax.mail.Session)
&#160; +- TransactionPropagationContextExporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
&#160; +- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
&#160; +- jaas (class: javax.naming.Context)&#160;&#160; |&#160;&#160; +- HsqlDbRealm (class: org.jboss.security.plugins.SecurityDomainContext)
&#160; |&#160;&#160; +- profileservice (class: org.jboss.security.plugins.SecurityDomainContext)
&#160; |&#160;&#160; +- jboss-web-policy (class: org.jboss.security.plugins.SecurityDomainContext)
&#160; +- ClusteredXAConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
&#160; +- TransactionSynchronizationRegistry (class: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple)
&#160; +- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
&#160; +- ConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)&#160;&#160; +- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
&#160; +- TransactionManager (class: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate)
&#160; +- NoTransFS (class: org.jboss.chap7.ex1.ra.DirContextFactoryImpl)




</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>May anybody help me with this problem?`Thanks a lot</p></div>

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


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

</div>

</body>
</html>