4 Replies Latest reply on Feb 16, 2016 9:13 AM by Chris Coslor

    Can't get IJ embedded to work - resource adapter class is null

    Chris Coslor Newbie

      I'm trying to get a more-or-less full stack of enterprise pieces to run on top of Tomcat, including ActiveMQ, Weld, and embedded Narayana/IronJacamar. I'm very close to getting it all to work, but I keep tripping up on the deployment of the MS SQL Server datasource.

       

      Specifically, I'm trying to initialize the embedded IJ instance in my ServletContextListener, like so:

      public void contextInitialized(ServletContextEvent servletContextEvent) {

        //For IJ's benefit

        System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");

        System.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");

       

        try {

        EMBEDDED_IJ.startup();

        URL jdbcUrl = findURL(servletContext, JDBC_RAR_FILE_NAME);

        EMBEDDED_IJ.deploy(jdbcUrl); !

        EMBEDDED_IJ.deploy(mssqlUrl);

        } catch (Throwable e) {

        logger.error("Couldn't start up listener", e);

        }

      }

      ...but I'm seeing the error below. Basically, the root seems to be here:


      DsXmlDeployer.initAndInject(DsXmlDeployer.java:367)


      ...and the cause is that ra.getResourceadapterClass() is null.


      I'm packaging up jdbc-xa.rar, mssql-xa-ds.xml, and sqljdbc4.jar (the JDBC driver), in what I believe are the appropriate places, but I'm still not having any luck.


      Does this ring any bells out there? I've been beating my head against it for a couple of days now & I'm not getting anywhere. The detailed stack trace is below, and I've attached the relevant config files and server log. The WAR file is on Dropbox here, if you're interested.


      Any help would be greatly appreciated.


      [Feb 12 17:35:38] DEBUG : No activation: org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory

      [Feb 12 17:35:38] DEBUG : Activated: file:/C:/Program%20Files/apache-tomcat-8.0.30/webapps/ROOT/WEB-INF/classes/jdbc-xa.rar

      [Feb 12 17:35:38] DEBUG : Deploying: file:/C:/Program%20Files/apache-tomcat-8.0.30/webapps/ROOT/WEB-INF/classes/mssql-xa-ds.xml

      [Feb 12 17:35:38] DEBUG : Deploying: file:/C:/Program%20Files/apache-tomcat-8.0.30/webapps/ROOT/WEB-INF/classes/mssql-xa-ds.xml

      [Feb 12 17:35:38] ERROR : Couldn't start up listener

      com.github.fungal.spi.deployers.DeployException: Deployment file:/C:/Program%20Files/apache-tomcat-8.0.30/webapps/ROOT/WEB-INF/classes/mssql-xa-ds.xml failed

        at org.jboss.jca.deployers.fungal.DsXmlDeployer.deploy(DsXmlDeployer.java:315)

        at com.github.fungal.impl.MainDeployerImpl.deploy(MainDeployerImpl.java:144)

        at com.github.fungal.impl.MainDeployerImpl.deploy(MainDeployerImpl.java:82)

        at org.jboss.jca.embedded.EmbeddedJCA.deploy(EmbeddedJCA.java:200)

        at example.ApplicationLifecycleListener.contextInitialized(ApplicationLifecycleListener.java:91)

        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812)

        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255)

        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)

        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)

        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)

        at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1675)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:483)

        at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)

        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)

        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)

        at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:465)

        at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:415)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:483)

        at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)

        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)

        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)

        at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1466)

        at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)

        at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1307)

        at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1399)

        at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:828)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:483)

        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)

        at sun.rmi.transport.Transport$1.run(Transport.java:200)

        at sun.rmi.transport.Transport$1.run(Transport.java:197)

        at java.security.AccessController.doPrivileged(Native Method)

        at sun.rmi.transport.Transport.serviceCall(Transport.java:196)

        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)

        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)

        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$240(TCPTransport.java:683)

        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$$Lambda$2/1369292709.run(Unknown Source)

        at java.security.AccessController.doPrivileged(Native Method)

        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

        at java.lang.Thread.run(Thread.java:745)

      Caused by: org.jboss.jca.deployers.common.DeployException: Deployment null failed

        at org.jboss.jca.deployers.fungal.DsXmlDeployer.initAndInject(DsXmlDeployer.java:367)

        at org.jboss.jca.deployers.fungal.DsXmlDeployer.createRa(DsXmlDeployer.java:582)

        at org.jboss.jca.deployers.common.AbstractDsDeployer.createObjectsAndInjectValue(AbstractDsDeployer.java:238)

        at org.jboss.jca.deployers.fungal.DsXmlDeployer.deploy(DsXmlDeployer.java:234)

        ... 50 more

      Caused by: java.lang.NullPointerException

        at java.lang.Class.forName0(Native Method)

        at java.lang.Class.forName(Class.java:344)

        at org.jboss.jca.deployers.fungal.DsXmlDeployer.initAndInject(DsXmlDeployer.java:349)

        ... 53 more