2 Replies Latest reply on Dec 30, 2013 11:30 AM by sbutt

    Registry Details for service could not be determined...

    sbutt

      Hi All,

       

      I have a implemented a very simple Junit test using Arquillian on Jboss 6.1.Final (running locally). I am implementing my services using JBossESB.

       

      My Pom configuration looks like this:

       

      
      
        ...
        <dependencyManagement>
        <dependencies>
        <dependency>
        <groupId>org.jboss.arquillian</groupId>
        <artifactId>arquillian-bom</artifactId>
        <version>1.0.0.Final</version>
        <scope>import</scope>
        <type>pom</type>
        </dependency>
        </dependencies>
        </dependencyManagement>
        <dependencies>
      
        <dependency>
        <groupId>org.jboss.soa.bpel.dependencies.esb</groupId>
        <artifactId>jbossesb-rosetta</artifactId>
        <version>4.8</version>
        <scope>provided</scope>
        </dependency>
        <dependency>
        <groupId>commons-httpclient</groupId>
        <artifactId>commons-httpclient</artifactId>
        <version>3.1</version>
        <scope>provided</scope>
        </dependency>
        <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.8.1</version>
        <scope>test</scope>
        </dependency>
        <dependency>
        <groupId>org.jboss.arquillian.junit</groupId>
        <artifactId>arquillian-junit-container</artifactId>
        <scope>test</scope>
        </dependency>
        </dependencies>
        <profiles>
        <profile>
        <id>remotedeployment</id>
        <build>
        <plugins>
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        </plugin>
        </plugins>
        </build>
        </profile>
        <profile>
        <id>localserver</id>
        <build>
        <plugins>
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        </plugin>
        </plugins>
        </build>
        </profile>
        <profile>
        <id>arquillian-jbossas-remote-6</id>
        <activation>
        <activeByDefault>true</activeByDefault>
        </activation>
        <dependencies>
        <dependency>
        <groupId>org.jboss.arquillian.container</groupId>
        <artifactId>arquillian-jbossas-remote-6</artifactId>
        <version>1.0.0.CR3</version>
        </dependency>
        <dependency>
        <groupId>javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>3.9.0.GA</version>
        </dependency>
        <dependency>
        <groupId>org.jboss.jbossas</groupId>
        <artifactId>jboss-as-client</artifactId>
        <version>6.1.0.Final</version>
        <type>pom</type>
        <exclusions>
        <exclusion>
        <artifactId>istack-commons-runtime</artifactId>
        <groupId>com.sun.istack</groupId>
        </exclusion>
        <exclusion>
        <artifactId>wstx-asl</artifactId>
        <groupId>woodstox</groupId>
        </exclusion>
        <exclusion>
        <artifactId>policy</artifactId>
        <groupId>ws-commons</groupId>
        </exclusion>
        <exclusion>
        <artifactId>asm</artifactId>
        <groupId>asm</groupId>
        </exclusion>
        </exclusions>
        </dependency>
        </dependencies>
        <build>
        <plugins>
        <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.13</version>
        <configuration>
        <systemProperties>
        <arquillian.launch>jbossas-remote-6</arquillian.launch>
        <arquillian.remoteServerAddress>${arquillian.remoteServerAddress}</arquillian.remoteServerAddress>
        <arquillian.providerUrl>${arquillian.providerUrl}</arquillian.providerUrl>
        <!--arquillian.providerUrl>jnp://localhost:1099</arquillian.providerUrl-->
        </systemProperties>
        </configuration>
        </plugin>
        </plugins>
        </build>
        </profile>
        </profiles>
      </project>
      

       

      In my maven local repository .settings file, I am setting:

       

      <arquillian.remoteServerAddress>localhost</arquillian.remoteServerAddress>
      <arquillian.providerUrl>jnp://localhost:1099</arquillian.providerUrl>
      

       

      My projects arquillian.xml file looks like this:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jboss="urn:arq:org.jboss.arquillian.container.jbossas.remote_6_0" xsi:schemaLocation="http://jboss.org/schema/arquillian
        http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
        <jboss:container>
        <remoteServerAddress>${arquillian.remoteServerAddress}</remoteServerAddress>
        </jboss:container>
        <container qualifier="jbossas-remote-6" default="true">
        <configuration>
        <property name="providerUrl">${arquillian.providerUrl}</property>
        </configuration>
        </container>
        <engine>
        <property name="deploymentExportPath">target/deployments</property>
        </engine>
      </arquillian>
      

       

       

      Now when I build my project in maven, it builds fine, but I get the following error on the server, when arquillian deploys the test.war (default)

       

      17:09:48,646 INFO  [org.jboss.soa.esb.client.ServiceInvoker] Service: IntegraUtils:CredentialReaderService not found in the registry

      17:09:48,660 INFO  [org.jboss.soa.esb.client.ServiceInvoker] Service: IntegraUtils:CredentialReaderService not found in the registry

      17:09:48,664 INFO  [org.jboss.soa.esb.client.ServiceInvoker] Delivering message [header: [  ]] to DLQ.

      17:09:48,680 INFO  [org.apache.juddi.api.impl.InquiryHelper] uddi:juddi.apache.org:a200082d-0b94-4c32-8f3d-59f576eb94b2 is modified Fri Dec 20 16:59:4

      8 CET 2013 1387555188147

      17:09:48,729 ERROR [com.traveltainment.integra.middleware.common.CredentialReader] Registry details for service [IntegraUtils:CredentialReaderService] could not be determined from the registry.

      17:09:48,779 INFO  [org.jboss.profileservice.management.upload.remoting.DeployHandler] invoke, payload: {DeploymentTargetID=names=[test.war], clientAsdress=/127.0.0.1}, parameter: stop

       

       

      I think I know to some extent the reason of this error. My test class CredentialReaderTest is calling my actual class CredentialReader, which at one point calling an external service:

       

       

      ServiceInvoker invoker = new ServiceInvoker("IntegraUtils", "CredentialReaderService");
        Message result = invoker.deliverSync(msg, 5000);
        String result_profile = (String) result.getBody().get();
      

       

      This 'CredentialReaderService' esb service is what is not found within the 'test.war' which is created and deployed by the Arquillain.

       

      I have looked inside the content of test.war file, which is created inside the target/deployments folder

       

      _DEFAULT___DEFAULT__test.war

       

      The contents are Test.jar and few other arquillian related .jar.

       

      I have also looked inside the contents of Test.jar and found only 2 classes, i.e. CredentialReaderTest.class and CredentialReader.class.

       

      Now my main question is how can I tell Arquillian to include all the dependent archives as well inside test.war while deploying it onto the server at the time of Junit test execution? For example, my current project depends on a number of other services, which are defined inside the deployment.xml of my main project, which i am building.

       

      <?xml version="1.0" encoding="UTF-8"?>
      <jbossesb-deployment>
         <depends>jboss.esb.integra.middleware.destination:service=Queue,name=integra-credential_reader-queue</depends>
         <depends>jboss.esb.integra.middleware.destination:service=Queue,name=integra-credential_reader-queue_reply</depends>
          <depends>jboss.esb:deployment=com.traveltainment.integra.common.utility-esb.esb</depends>
        <depends>jboss.esb:deployment=com.traveltainment.integra.common.service.transformer-esb.esb</depends>
        <depends>jboss.jca:service=DataSourceBinding,name=IntegraCredentialDS</depends>
      </jbossesb-deployment>
      

       

      Please note that the jboss-as-6.1.final which I am using is a freshly installed server and it does not contain any other .esb file. I have just configured a Datasource on it which is used by the CredentialReaderService.

       

      My understanding is that Arquillian should bundle all the dependent archives in one test.war and should deploy it onto the server?

       

      Many thanks.

        • 1. Re: Registry Details for service could not be determined...
          sbutt

          Any help, please?

          • 2. Re: Registry Details for service could not be determined...
            sbutt

            got it solved myself, finally:)

             

            [code]

             

            @Deployment

              public static EnterpriseArchive createTestArchive() {

              JavaArchive jarArchive = ShrinkWrap.create(JavaArchive.class, "Test.jar")

              .addClasses(CredentialReader.class, CredentialReaderTest.class)

              .addAsResource("META-INF/xsl/credential-reader/CredentialReaderCreateRS.xsl")

              .addAsResource("META-INF/xsl/credential-reader/CredentialReaderExtractUUIDFromProfil.xsl")

              .addAsResource("META-INF/xsl/credential-reader/CredentialReaderRequestRouter.xsl")

              .addAsResource("META-INF/xsl/credential-reader/CredentialReaderReuseRequest.xsl")

              .addAsResource("META-INF/xsl/credential-reader/CredentialReaderRowset2RetrieveRS.xsl")

              .addAsResource("META-INF/xsl/credential-reader/sqlQueryForCredentialReader.xsl");

             

              

              EnterpriseArchive archive = ShrinkWrap.create(EnterpriseArchive.class, "Test.esb")

              .addAsManifestResource("META-INF/jboss-esb.xml", "jboss-esb.xml")

              .addAsManifestResource("META-INF/deployment.xml","deployment.xml")

              .addAsApplicationResource("hornetq-jms.xml","hornetq-jms.xml")

              .addAsLibraries(jarArchive);

              

              return archive;

             

             

              }

             

            [/code]