problem jca
bessel1 Oct 9, 2016 7:09 AMGood 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