2 Replies Latest reply on Oct 18, 2016 4:00 PM by bessel1

    problem jca

    bessel1

      Good Morning

       

      I want to create one JCA Component on JBOSS. The server Jboss AS 7.1 must link one client with an EIS by socket.
      This project is http://www.mastertheboss.com/jboss-f...ector-tutorial.
      the deployment and the startup are good, the managment console obtain on the JNDI:
      java:/eis/SocketAdapter with the class  socketadapter of type RAConnectionFactoryImpl.
      i don't modify the standalone.xml
      My files are

      <?xml version="1.0" encoding="UTF-8"?>
      <ironjacamar>
        <connection-definitions>
          <connection-definition
           class-name="adapter1.RAManagedConnectionFactory"
           pool-name="socketAdapter"
           jndi-name="java:/eis/socketAdapter"/>
        </connection-definitions>
      </ironjacamar>

       

      ra.xml


      <?xml version="1.0" encoding="UTF-8"?>
      <connector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/connector_1_6.xsd" id="Connector_ID" version="1.6">
        <description></description>
        <display-name>socketAdapter</display-name>
        <vendor-name></vendor-name>
        <eis-type></eis-type>
        <resourceadapter-version></resourceadapter-version>
        <resourceadapter>
        <resourceadapter-class>adapter1.SocketResourceAdapter</resourceadapter-class>
        <config-property>
      <description>Broker host</description>
      <config-property-name>Host</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>localhost</config-property-value>
      </config-property>
      <config-property>
      <description>Broker port</description>
      <config-property-name>Port</config-property-name>
      <config-property-type>java.lang.Integer</config-property-type>
      <config-property-value>5672</config-property-value>
      </config-property>
      <outbound-resourceadapter>
         <connection-definition>
          <managedconnectionfactory-class>adapter1.RAManagedConnectionFactory</managedconnectionfactory-class>
          <connectionfactory-interface>adapter1.RAConnectionFactory</connectionfactory-interface>
          <connectionfactory-impl-class>adapter1.RAConnectionFactoryImpl</connectionfactory-impl-class>
          <connection-interface>adapter1.RAConnection</connection-interface>
         <connection-impl-class>adapter1.RAConnectionImpl</connection-impl-class>
         </connection-definition>
         <transaction-support>LocalTransaction</transaction-support>
         <reauthentication-support>false</reauthentication-support>
        </outbound-resourceadapter>
      <inbound-resourceadapter>
         <messageadapter>
          <messagelistener>
           <messagelistener-type>adapter1.RAMessageListener</messagelistener-type>
           <activationspec>
            <activationspec-class>adapter1.RAActivationSpec</activationspec-class>
            <required-config-property>
             <config-property-name>Factory</config-property-name>
            </required-config-property>
            <required-config-property>
             <config-property-name>port</config-property-name>
            </required-config-property>
           </activationspec>
          </messagelistener>
         </messageadapter>
        </inbound-resourceadapter>
        </resourceadapter>
        </connector>

       

      jndi.properties


      java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory
      java.naming.factory.url.pkgs=org.jboss.ejb.client.naming
      java.naming.provider.url=remote://localhost:4447
      java.naming.security.principal=user1
      java.naming.security.credentials=user

       

       

      public class testclient {
      //@Resource(mappedName = "java:/eis/SocketAdapter")
      @Resource(name = "java:/eis/SocketAdapter")
        static RAConnectionFactory connectionFactory=null;
      static Context ctx = null;
      private static final String PKG_INTERFACES = "org.jboss.ejb.client.naming";
      //private static final String PKG_INTERFACES = "org.jboss.naming.org.jnp.interfaces";
      public static void main(String[] args) {

        //static Context ctx = null;
        // TODO Auto-generated method stub
        RAConnection connection=null;

        try{
        InitialContext initCtx = null;
            Object obj = null;
            try {
             Properties env = new Properties();
             env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
             env.put(Context.PROVIDER_URL,"remote://localhost:4447");
             env.put("jboss.naming.client.ejb.context", true);
             env.put(Context.URL_PKG_PREFIXES, PKG_INTERFACES);
             env.put(Context.SECURITY_PRINCIPAL, "phil2");
             env.put(Context.SECURITY_CREDENTIALS, "user");
              initCtx = new InitialContext(env);
              RAConnectionFactory ds = (RAConnectionFactory)initCtx.lookup("java:/eis/SocketAdapter");

       

      the startup of server is good

       

      20:19:57,773 INFOS [org.jboss.modules] JBoss Modules version 1.1.1.GA
      20:20:00,311 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA
      20:20:00,345 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
      20:20:03,354 INFO  [org.xnio] XNIO Version 3.0.3.GA
      20:20:03,354 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
      20:20:03,361 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
      20:20:03,366 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.3.GA
      20:20:03,524 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
      20:20:03,527 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
      20:20:03,536 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
      20:20:03,538 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
      20:20:03,539 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
      20:20:03,540 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
      20:20:03,557 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
      20:20:03,575 INFO  [org.jboss.as.security] (MSC service thread 1-3) JBAS013100: Current PicketBox version=4.0.7.Final
      20:20:03,591 INFO  [org.jboss.as.connector] (MSC service thread 1-14) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
      20:20:03,636 INFO  [org.jboss.as.naming] (MSC service thread 1-9) JBAS011802: Starting Naming Service
      20:20:03,651 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) JBAS015400: Bound mail session [java:jboss/mail/Default]
      20:20:03,693 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
      20:20:03,723 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-5) Démarrage de Coyote HTTP/1.1 sur http--0.0.0.0-8080
      20:20:04,070 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) JBAS010400: Bound data source [java:/MySQLDS]
      20:20:06,690 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-15) JBoss Web Services - Stack CXF Server 4.0.2.GA
      20:20:07,425 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) JBAS015012: Started FileSystemDeploymentService for directory E:\cours\java\eclipsejee\jboss-as-7.1.1.Final\standalone\deployments
      20:20:07,431 INFO  [org.jboss.as.remoting] (MSC service thread 1-7) JBAS017100: Listening on /127.0.0.1:9999
      20:20:07,431 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found SampleConnector1.rar in deployment directory. To trigger deployment create a file called SampleConnector1.rar.dodeploy
      20:20:07,431 INFO  [org.jboss.as.remoting] (MSC service thread 1-8) JBAS017100: Listening on /0.0.0.0:4447
      20:20:07,779 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
      JBAS014775:    New missing/unsatisfied dependencies:
            service jboss.jdbc-driver.h2 (missing) dependents: [service jboss.data-source.java:jboss/datasources/ExampleDS]

      20:20:07,799 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-12) JBAS015876: Starting deployment of "SampleConnector1.rar"
      20:20:08,022 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-12) JBAS010406: Registered connection factory java:/eis/socketAdapter
      20:20:08,096 INFO  [org.hibernate.validator.util.Version] (MSC service thread 1-12) Hibernate Validator 4.2.0.Final
      20:20:08,132 INFOS [SocketResourceAdapter] (MSC service thread 1-12) Resource Adapter bootstrap!
      20:20:08,133 INFO  [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-12) IJ020002: Deployed: file:/E:/cours/java/eclipsejee/jboss-as-7.1.1.Final/standalone/deployments/SampleConnector1.rar/
      20:20:08,135 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-9) JBAS010401: Bound JCA ConnectionFactory [java:/eis/socketAdapter]
      20:20:08,135 INFO  [org.jboss.as] (MSC service thread 1-12) JBAS015951: Admin console listening on http://127.0.0.1:9990
      20:20:08,136 ERROR [org.jboss.as] (MSC service thread 1-12) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 11422ms - Started 160 of 240 services (2 services failed or missing dependencies, 76 services are passive or on-demand)
      20:20:08,247 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "SampleConnector1.rar"

       

      the startup of client provide one exception:

       

      INFO: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@4fed0b75, receiver=Remoting connection EJB receiver [connection=Remoting connection <33b76edf>,channel=jboss.ejb,nodename=android_iphone_]} on channel Channel ID fab96097 (outbound) of Remoting connection 79ced32d to localhost/127.0.0.1:4447
      oct. 08, 2016 8:23:02 PM org.jboss.ejb.client.remoting.ChannelAssociation$ResponseReceiver handleMessage
      WARN: Unsupported message received with header 0xffffffff
      Error with context: javax.naming.NameNotFoundException: eis/socketAdapter -- service jboss.naming.context.java.jboss.exported.eis.socketAdapter

       

      can you help me for this problem

      thanks

        • 1. Re: problem jca
          maeste

          Please try with latest wildfly version and let me know if you still experience this problem

           

          regards

          S.

          • 2. Re: problem jca
            bessel1

            good morning

             

            i try with wildfly 8.1 eclipse luna and i have the next message:

             

            to the startup server:

            20:26:13,248 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final
            20:26:13,419 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final
            20:26:13,478 INFO  [org.jboss.as] (MSC service thread 1-6) JBAS015899: WildFly 8.1.0.Final "Kenny" starting
            20:26:14,252 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found wildconnector.rar in deployment directory. To trigger deployment create a file called wildconnector.rar.dodeploy
            20:26:14,266 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)
            20:26:14,282 INFO  [org.xnio] (MSC service thread 1-1) XNIO version 3.2.2.Final
            20:26:14,289 INFO  [org.xnio.nio] (MSC service thread 1-1) XNIO NIO Implementation Version 3.2.2.Final
            20:26:14,318 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 32) JBAS010280: Activating Infinispan subsystem.
            20:26:14,324 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 46) JBAS010153: Node identifier property is set to the default value. Please make sure it is unique.
            21:15:16,735 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final
            21:15:16,905 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final
            21:15:16,965 INFO  [org.jboss.as] (MSC service thread 1-7) JBAS015899: WildFly 8.1.0.Final "Kenny" starting
            21:15:17,755 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found wildconnector.rar in deployment directory. To trigger deployment create a file called wildconnector.rar.dodeploy
            21:15:17,767 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)
            21:15:17,777 INFO  [org.xnio] (MSC service thread 1-14) XNIO version 3.2.2.Final
            21:15:17,787 INFO  [org.xnio.nio] (MSC service thread 1-14) XNIO NIO Implementation Version 3.2.2.Final
            21:15:17,817 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 32) JBAS010280: Activating Infinispan subsystem.
            21:15:17,817 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 46) JBAS010153: Node identifier property is set to the default value. Please make sure it is unique.
            21:15:17,817 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 31) WFLYIO001: Worker 'default' has auto-configured to 16 core threads with 128 task threads based on your 8 available processors
            21:15:17,827 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 45) JBAS013171: Activating Security Subsystem
            21:15:17,837 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 40) JBAS011800: Activating Naming Subsystem
            21:15:17,837 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
            21:15:17,847 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 38) JBAS012615: Activated the following JSF Implementations: [main]
            21:15:17,857 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-12) JBAS010408: Starting JCA Subsystem (IronJacamar 1.1.5.Final)
            21:15:17,877 INFO  [org.jboss.as.security] (MSC service thread 1-16) JBAS013170: Current PicketBox version=4.0.21.Beta1
            21:15:17,877 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
            21:15:17,887 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017502: Undertow 1.0.15.Final starting
            21:15:17,887 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) JBAS017502: Undertow 1.0.15.Final starting
            21:15:17,887 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) JBAS010417: Started Driver service with driver-name = h2
            21:15:17,907 INFO  [org.jboss.as.naming] (MSC service thread 1-15) JBAS011802: Starting Naming Service
            21:15:17,907 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) JBAS015400: Bound mail session [java:jboss/mail/Default]
            21:15:18,097 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017527: Creating file handler for path E:\cours\java\eclipsejee\wildfly-8.1.0.Final/welcome-content
            21:15:18,107 INFO  [org.jboss.remoting] (MSC service thread 1-14) JBoss Remoting version 4.0.3.Final
            21:15:18,117 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-8) JBAS017525: Started server default-server.
            21:15:18,127 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-8) JBAS017531: Host default-host starting
            21:15:18,267 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-11) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
            21:15:18,347 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) JBAS015012: Started FileSystemDeploymentService for directory E:\cours\java\eclipsejee\wildfly-8.1.0.Final\standalone\deployments
            21:15:18,347 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Starting deployment of "wildconnector.rar" (runtime-name: "wildconnector.rar")
            21:15:18,367 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-12) JBAS017519: Undertow HTTP listener default listening on localhost/127.0.0.1:8080
            21:15:18,617 INFO  [org.jboss.ws.common.management] (MSC service thread 1-12) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.2.4.Final
            21:15:18,697 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-10) JBAS010406: Registered connection factory java:/eis/socketAdapter
            21:15:18,707 WARN  [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-10) IJ020016: Missing <recovery> element. XA recovery disabled for: java:/eis/socketAdapter
            21:15:18,727 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-10) HV000001: Hibernate Validator 5.1.0.Final
            21:15:18,807 INFO  [SocketResourceAdapter] (MSC service thread 1-10) Resource Adapter bootstrap!
            21:15:18,815 INFO  [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-10) IJ020002: Deployed: file:/E:/cours/java/eclipsejee/wildfly-8.1.0.Final/standalone/deployments/wildconnector.rar/
            21:15:18,816 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-4) JBAS010401: Bound JCA ConnectionFactory [java:/eis/socketAdapter]
            21:15:18,847 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "wildconnector.rar" (runtime-name : "wildconnector.rar")
            21:15:18,967 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
            21:15:18,967 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
            21:15:18,967 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.1.0.Final "Kenny" started in 2432ms - Started 222 of 277 services (89 services are lazy, passive or on-demand)

             

             

            for the startup client

            oct. 18, 2016 9:43:48 PM org.xnio.Xnio <clinit>
            INFO: XNIO version 3.2.2.Final
            oct. 18, 2016 9:43:48 PM org.xnio.nio.NioXnio <clinit>
            INFO: XNIO NIO Implementation Version 3.2.2.Final
            oct. 18, 2016 9:43:48 PM org.jboss.remoting3.EndpointImpl <clinit>
            INFO: JBoss Remoting version (unknown)
            Error with context: javax.naming.CommunicationException: Failed to connect to any server. Servers tried: [remote://localhost:4447 (java.net.ConnectException: Connection refused: no further information)]

             

            thanks

            best regards