6 Replies Latest reply on Feb 21, 2012 9:56 AM by jesper.pedersen

    Unable to deploy resource adapter with embedded ironjacamar

    lmcgrath

      I've been getting the following error with default maven-generated project as well as custom adapters. The resource adapters deploy and are usable in a full JBoss AS deployment, but I'm unable to perform any integration tests with the embedded IronJacamar. The ironjacamar.xml files have the jndi-name attributes, yet I'm still getting this error. The problem exists using IronJacamar 1.0.3 (shipped with JBoss AS 7.0.2.Final) as well as IronJacamar 1.0.6.Final and 1.0.7.Final.

       

      -------------------------------------------------------------------------------

      Test set: com.acme.resource.ConnectorTestCase

      -------------------------------------------------------------------------------

      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.091 sec <<< FAILURE!

      com.acme.resource.ConnectorTestCase  Time elapsed: 0 sec  <<< ERROR!

      org.jboss.arquillian.container.spi.client.container.DeploymentException: Could not deploy the application: Deployment file:/C:/Users/lmcgrath/AppData/Local/Temp/ConnectorTestCase.rar failed

          at org.jboss.jca.embedded.arquillian.EmbeddedJCAContainer.deploy(EmbeddedJCAContainer.java:146)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:148)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:115)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:246)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:114)

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

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

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

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

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

          at org.jboss.arquillian.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:50)

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

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

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

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

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:78)

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

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

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

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

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)

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

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

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

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

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)

          at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:86)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:79)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:238)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:222)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:78)

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

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

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

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

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)

          at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

          at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:97)

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

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

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

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

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

          at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:68)

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

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

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

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

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:54)

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

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

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

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

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)

          at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)

          at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:158)

          at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:290)

          at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:45)

          at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:175)

          at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

          at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:123)

          at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)

          at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)

          at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)

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

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

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

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

          at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)

          at $Proxy0.invoke(Unknown Source)

          at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)

          at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)

          at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)

      Caused by: com.github.fungal.spi.deployers.DeployException: Deployment file:/C:/Users/lmcgrath/AppData/Local/Temp/ConnectorTestCase.rar failed

          at org.jboss.jca.deployers.fungal.RADeployer.deploy(RADeployer.java:206)

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

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

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

          at org.jboss.jca.embedded.arquillian.EmbeddedJCAContainer.deploy(EmbeddedJCAContainer.java:142)

          ... 93 more

      Caused by: org.jboss.jca.common.metadata.ParserException: IJ010065: Missing mandatory jndi-name attribute: connection-definition

          at org.jboss.jca.common.metadata.common.CommonIronJacamarParser.parseConnectionDefinitions(CommonIronJacamarParser.java:124)

          at org.jboss.jca.common.metadata.ironjacamar.IronJacamarParser.parseIronJacamar(IronJacamarParser.java:170)

          at org.jboss.jca.common.metadata.ironjacamar.IronJacamarParser.parse(IronJacamarParser.java:100)

          at org.jboss.jca.common.metadata.ironjacamar.IronJacamarParser.parse(IronJacamarParser.java:67)

          at org.jboss.jca.common.metadata.MetadataFactory.getIronJacamarMetaData(MetadataFactory.java:120)

          at org.jboss.jca.deployers.fungal.RADeployer.deploy(RADeployer.java:155)

          ... 97 more

       

      The ironjacamar.xml file:

       

      <!--

      /*

      * JBoss, Home of Professional Open Source.

      * Copyright 2011, Red Hat Middleware LLC, and individual contributors

      * as indicated by the @author tags. See the copyright.txt file in the

      * distribution for a full listing of individual contributors.

      *

      * This is free software; you can redistribute it and/or modify it

      * under the terms of the GNU Lesser General Public License as

      * published by the Free Software Foundation; either version 2.1 of

      * the License, or (at your option) any later version.

      *

      * This software is distributed in the hope that it will be useful,

      * but WITHOUT ANY WARRANTY; without even the implied warranty of

      * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU

      * Lesser General Public License for more details.

      *

      * You should have received a copy of the GNU Lesser General Public

      * License along with this software; if not, write to the Free

      * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA

      * 02110-1301 USA, or see the FSF site: http://www.fsf.org.

      */

      -->

       

      <ironjacamar xmlns="http://www.jboss.org/ironjacamar/schema"

                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                   xsi:schemaLocation="http://www.jboss.org/ironjacamar/schema

                   http://www.jboss.org/ironjacamar/schema/ironjacamar_1_0.xsd">

       

        <transaction-support>NoTransaction</transaction-support>

       

        <connection-definitions>

          <connection-definition class-name="com.acme.resource.AcmeManagedConnectionFactory" enabled="true" jndi-name="java:/eis/AcmeManagedConnectionFactory" use-java-context="true" pool-name="AcmeManagedConnectionFactory">

          </connection-definition>

        </connection-definitions>

       

       

      </ironjacamar>

        • 1. Re: Unable to deploy resource adapter with embedded ironjacamar
          jesper.pedersen

          Could you try with a 1.0.8-SNAPSHOT dependency and if the problem is still there show the "jar tf" of the .rar + the content of the ra.xml file.

          • 2. Re: Unable to deploy resource adapter with embedded ironjacamar
            lmcgrath

            I get the same result. There is no ra.xml file (should there be one?) and the default packaging for the maven project is JAR.

             

            Here's the output from "jar tf resource-0.1.jar" with JAR packaging:

             

            META-INF/

            META-INF/MANIFEST.MF

            com/

            com/acme/

            com/acme/resource/

            com/acme/resource/mbean/

            com/acme/resource/AcmeConnection.class

            com/acme/resource/AcmeConnectionFactory.class

            com/acme/resource/AcmeConnectionFactoryImpl.class

            com/acme/resource/AcmeConnectionImpl.class

            com/acme/resource/AcmeManagedConnection.class

            com/acme/resource/AcmeManagedConnectionFactory.class

            com/acme/resource/AcmeManagedConnectionMetaData.class

            com/acme/resource/AcmeRaMetaData.class

            com/acme/resource/AcmeResourceAdapter.class

            com/acme/resource/mbean/AcmeMBean.class

            com/acme/resource/mbean/AcmeMBeanImpl.class

            META-INF/ironjacamar.xml

            resource.xml

            META-INF/maven/

            META-INF/maven/com.acme/

            META-INF/maven/com.acme/resource/

            META-INF/maven/com.acme/resource/pom.xml

            META-INF/maven/com.acme/resource/pom.properties

             

            Here's the output of "jar tf resource-0.1.rar" if I change the packaging to RAR:

             

            META-INF/

            META-INF/MANIFEST.MF

            ironjacamar-spec-api-1.0.8-SNAPSHOT.jar

            jboss-transaction-api_1.1_spec-1.0.0.Final.jar

            META-INF/maven/

            META-INF/maven/com.acme/

            META-INF/maven/com.acme/resource/

            META-INF/maven/com.acme/resource/pom.xml

            META-INF/maven/com.acme/resource/pom.properties

            • 3. Re: Unable to deploy resource adapter with embedded ironjacamar
              lmcgrath

              Here's the specific commands I'm executing with the code generator:

               

              C:\jboss\ironjacamar-1.0.7.Final\doc\codegenerator>codegenerator.bat -o acme-resource

               

              C:\jboss\ironjacamar-1.0.7.Final\doc\codegenerator>java -jar ironjacamar-codegenerator.jar -o acme-resource

              Profile version (1.6/1.5/1.0) [1.6]:

              Type (O/Outbound/I/Inbound/B/Bidirectional) [O]:

              Package name: com.acme

              Transaction support (N/NoTransaction/L/LocalTransaction/X/XATransaction) [N]:

              Support reauthentication (Y/Yes/N/No) [N]:

              Use annotations (Y/Yes/N/No) [Y]: Y

              Include a ResourceAdapter (Y/Yes/N/No) [Y]: Y

              Resource adapter class name [AcmeResourceAdapter]:

              Resource adapter config properties [enter to quit]:

                  Name:

              Managed connection factory class name [AcmeManagedConnectionFactory]:

              Managed connection factory config properties [enter to quit]:

                  Name:

              Use ResourceAdapterAssociation (Y/Yes/N/No) [Y]:

              Managed connection class name [AcmeManagedConnection]:

              Use CCI (Y/Yes/N/No) [N]:

              Connection factory interface class name [AcmeConnectionFactory]:

              Connection factory implementation class name [AcmeConnectionFactoryImpl]:

              Connection interface class name [AcmeConnection]:

              Connection implementation class name [AcmeConnectionImpl]:

              Add methods to connection interface (Y/Yes/N/No) [N]:

              Additional managed connection factory (Y/Yes/N/No) [N]:

              Include an admin object (Y/Yes/N/No) [N]:

              Generate a MBean class (Y/Yes/N/No) [Y]: N

              Build environment [A/Ant/I/Ant+Ivy/M/Maven] [A]: Maven

              Code generated

               

              After I create the project, I have to remove the ironjacamar-core-spi dependency from pom.xml before it's usable.

              • 4. Re: Unable to deploy resource adapter with embedded ironjacamar
                jesper.pedersen

                There doesn't have to be a META-INF/ra.xml if you are using JCA 1.6 + annotations.

                 

                However, the packaging is wrong it should be:

                 

                acme.rar:

                /META-INF/ironjacamar.xml

                acme.jar

                 

                Including ironjacamar-spec-api-1.0.8-SNAPSHOT.jar and jboss-transaction-api_1.1_spec-1.0.0.Final.jar in the .rar is wrong too.

                 

                See http://docs.jboss.org/ironjacamar/userguide/1.0/en-US/html/deployment.html#packagingrequirements

                • 5. Re: Unable to deploy resource adapter with embedded ironjacamar
                  lmcgrath

                  I know the output is wrong. The actual resource adapter I'm creating contains only the libraries necessary for it to run, not including the ironjacamar-* or jboss-* jars per the documentation. THAT resource adapter deploys successfully into a running JBoss AS 7.0.2.Final instance with IronJacamar 1.0.3.Final and (to the best of my knowledge) works as it should.

                   

                  The problem I'm having is that I am unable to perform automated integration tests using embedded IronJacamar with Arquillian. All my tests thus far have consisted of "eyeball checks" against a WAR containing different test cases triggered by manually accessing web pages.

                   

                  To confirm that the problem wasn't related to MY code, I used the code generator to create a skeleton adapter and then performed the integration test with it. I have the EXACT SAME error in MY resource adapter, as well as the one created with the code generator.

                  • 6. Re: Unable to deploy resource adapter with embedded ironjacamar
                    jesper.pedersen

                    Using AS 7.1.0.Final you will need two @Deployment with an 'order' attribute - one for the RAR (1) and one for the WAR (2) - but those types of questions are better answered in the ShrinkWrap/Arquillian/AS7 forums.

                     

                    For IronJamacar/Embedded we don't have a web container for WAR->RAR testing - you will need pure JUnit test cases against the resource adapter. You can check our test suite for examples - otherwise the user guide contains a basic example too.

                     

                    Having said that, an optional web container integration for IronJacamar/Embedded would be a nice contribution.

                     

                    And we are always looking for feedback for the testing scenario, since it is one of the focus areas for IronJacamar 1.1.