Question

I deployed a resource adapter (XADisk) in jboss 7.1.0.final and now get an exception on JNDI lookup.

I configured the ra.xml and deployed XADisk.rar. Then I added the following to my standalone.xml:

<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
        <resource-adapters>
            <resource-adapter>
                <archive>
                    XADisk.rar
                </archive>
                <transaction-support>XATransaction</transaction-support>
                <connection-definitions>
                    <connection-definition
                        class-name="org.xadisk.connector.outbound.XADiskConnectionFactory"
                        jndi-name="java:/XADiskCF" 
                        pool-name="XADiskConnectionFactory">
                        <xa-pool>
                            <min-pool-size>2</min-pool-size>
                            <max-pool-size>10</max-pool-size>
                        </xa-pool>
                        <security>
                            <application/>
                        </security>
                    </connection-definition>
                </connection-definitions>
            </resource-adapter>
        </resource-adapters>
</subsystem>

Now I tried to use it from a simple servlet:

XADiskConnectionFactory cf1 =
(XADiskConnectionFactory) new InitialContext().lookup("java:/XADiskCF");

if I invoke the servlet the following is raised:

javax.naming.NameNotFoundException: XADiskCF -- service jboss.naming.context.java.XADiskCF at  
org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97) at 
org.jboss.as.naming.NamingContext.lookup(NamingContext.java:177) at 
org.jboss.as.naming.InitialContext.lookup(InitialContext.java:113) at 
org.jboss.as.naming.NamingContext.lookup(NamingContext.java:213) at 
...

I hope someone with a better understanding of jndi and jboss can help me out.

Was it helpful?

Solution

the described problem occured due an incompatibility between xadisk and jboss 7

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top