5 Replies Latest reply on Oct 2, 2012 6:56 AM by ochaloup

    Which *.properties file should I use ?

    caraldel

      Hi,

       

      I'm trying to connect from my local aplication (not in server) to a remote ejb in Jboss 7.1.1 server. My question is which file *.properties should I use ? jboss-ejb-client.properties or jndi.properties or both ?

       

      Thank you.

       

      These are the ones I'm using now:

       

      jboss-ejb-client.properties:

       

      endpoint.name=client-endpoint

      remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false

       

      remote.connections=default

       

      remote.connection.default.host=localhost

      remote.connection.default.port=4447

       

      remote.connection.default.username=ejb

      remote.connection.default.password=test

       

       

      remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

      remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false

       

       

      remote.clusters=ejb

       

       

      remote.cluster.ejb.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

      remote.cluster.ejb.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false

      remote.cluster.ejb.username=ejb

      remote.cluster.ejb.password=test

       

       

      jndi.poperties:

       

      jboss.naming.client.ejb.context=true

      java.naming.factory.url.pkgs=org.jboss.ejb.client.naming

      java.naming.provider.url=remote://localhost:4447

      java.naming.security.principal=ejb

      java.naming.security.credentials=test

      java.naming.security.authentification=none


       

      With this both files I have this stack trace whe I run the aplication with Junit:

       

      PROPIEDADES = {remote.connection.default.port=4447, remote.cluster.ejb.password=test, remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false, remote.cluster.ejb.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false, endpoint.name=client-endpoint, remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false, remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false, remote.connection.default.host=localhost, remote.connection.default.username=ejb, remote.clusters=ejb, remote.connections=default, remote.cluster.ejb.username=ejb, remote.cluster.ejb.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false, remote.connection.default.password=test}

      DEBUG [main] (InitialContextFactory.java:64) - Logging Provider: org.jboss.logging.Log4jLoggerProvider

      DEBUG [main] (InitialContextFactory.java:314) - Looking for jboss-naming-client.properties using classloader sun.misc.Launcher$AppClassLoader@11b86e7

      DEBUG [main] (InitialContextFactory.java:266) - jboss.naming.client.endpoint.create.options. has the following options {}

      DEBUG [main] (InitialContextFactory.java:266) - jboss.naming.client.remote.connectionprovider.create.options. has the following options {}

      INFO [main] (Xnio.java:63) - XNIO Version 3.0.3.GA

      INFO [main] (NioXnio.java:55) - XNIO NIO Implementation Version 3.0.3.GA

      INFO [main] (EndpointImpl.java:70) - JBoss Remoting version 3.2.3.GA

      DEBUG [Remoting "config-based-naming-client-endpoint" read-1] (WorkerThread.java:88) - Started channel thread 'Remoting "config-based-naming-client-endpoint" read-1', selector sun.nio.ch.WindowsSelectorImpl@b61fd1

      DEBUG [Remoting "config-based-naming-client-endpoint" write-1] (WorkerThread.java:88) - Started channel thread 'Remoting "config-based-naming-client-endpoint" write-1', selector sun.nio.ch.WindowsSelectorImpl@e2dae9

      DEBUG [main] (InitialContextFactory.java:266) - jboss.naming.client.connect.options. has the following options {}

      DEBUG [main] (EJBClientPropertiesLoader.java:101) - Looking for jboss-ejb-client.properties using classloader sun.misc.Launcher$AppClassLoader@11b86e7

      DEBUG [main] (EJBClientPropertiesLoader.java:105) - Found jboss-ejb-client.properties using classloader sun.misc.Launcher$AppClassLoader@11b86e7

      DEBUG [main] (PropertiesBasedEJBClientConfiguration.java:177) - endpoint.create.options. has the following options {}

      TRACE [main] (PropertiesBasedEJBClientConfiguration.java:207) - Options {} have been merged with defaults {org.xnio.Options.THREAD_DAEMON=>true} to form {org.xnio.Options.THREAD_DAEMON=>true}

      DEBUG [main] (PropertiesBasedEJBClientConfiguration.java:177) - remote.connectionprovider.create.options. has the following options {org.xnio.Options.SSL_ENABLED=>false}

      TRACE [main] (PropertiesBasedEJBClientConfiguration.java:207) - Options {org.xnio.Options.SSL_ENABLED=>false} have been merged with defaults {} to form {org.xnio.Options.SSL_ENABLED=>false}

      DEBUG [main] (PropertiesBasedEJBClientConfiguration.java:177) - remote.connection.default.connect.options. has the following options {org.xnio.Options.SASL_POLICY_NOANONYMOUS=>false,org.xnio.Options.SASL_POLICY_NOPLAINTEXT=>false}

      TRACE [main] (PropertiesBasedEJBClientConfiguration.java:207) - Options {org.xnio.Options.SASL_POLICY_NOANONYMOUS=>false,org.xnio.Options.SASL_POLICY_NOPLAINTEXT=>false} have been merged with defaults {org.xnio.Options.SASL_PROPERTIES=>[org.xnio.Property@4bb25ec],org.xnio.Options.SASL_POLICY_NOPLAINTEXT=>false} to form {org.xnio.Options.SASL_POLICY_NOANONYMOUS=>false,org.xnio.Options.SASL_POLICY_NOPLAINTEXT=>false,org.xnio.Options.SASL_PROPERTIES=>[org.xnio.Property@4bb25ec]}

      DEBUG [main] (PropertiesBasedEJBClientConfiguration.java:177) - remote.connection.default.channel.options. has the following options {}

      DEBUG [main] (PropertiesBasedEJBClientConfiguration.java:412) - Connection org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration$RemotingConnectionConfigurationImpl@110003 successfully created for connection named default

      DEBUG [main] (PropertiesBasedEJBClientConfiguration.java:177) - remote.cluster.ejb.connect.options. has the following options {org.xnio.Options.SASL_POLICY_NOANONYMOUS=>false,org.xnio.Options.SASL_POLICY_NOPLAINTEXT=>false}

      TRACE [main] (PropertiesBasedEJBClientConfiguration.java:207) - Options {org.xnio.Options.SASL_POLICY_NOANONYMOUS=>false,org.xnio.Options.SASL_POLICY_NOPLAINTEXT=>false} have been merged with defaults {org.xnio.Options.SASL_PROPERTIES=>[org.xnio.Property@4bb25ec],org.xnio.Options.SASL_POLICY_NOPLAINTEXT=>false} to form {org.xnio.Options.SASL_POLICY_NOANONYMOUS=>false,org.xnio.Options.SASL_POLICY_NOPLAINTEXT=>false,org.xnio.Options.SASL_PROPERTIES=>[org.xnio.Property@4bb25ec]}

      DEBUG [main] (PropertiesBasedEJBClientConfiguration.java:177) - remote.cluster.ejb.channel.options. has the following options {}

      DEBUG [main] (PropertiesBasedEJBClientConfiguration.java:249) - Cluster configuration for cluster ejb successfully created

      DEBUG [Remoting "client-endpoint" read-1] (WorkerThread.java:88) - Started channel thread 'Remoting "client-endpoint" read-1', selector sun.nio.ch.WindowsSelectorImpl@1ff0dde

      DEBUG [Remoting "client-endpoint" write-1] (WorkerThread.java:88) - Started channel thread 'Remoting "client-endpoint" write-1', selector sun.nio.ch.WindowsSelectorImpl@1e78fc6

      WARN [main] (ConfigBasedEJBClientContextSelector.java:133) - Could not register a EJB receiver for connection to remote://localhost:4447

      java.lang.RuntimeException: Operation failed with status WAITING

                at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:93)

                at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:121)

                at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.<init>(ConfigBasedEJBClientContextSelector.java:78)

                at org.jboss.ejb.client.EJBClientContext.<clinit>(EJBClientContext.java:77)

                at org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector.setupSelector(RemoteNamingEjbClientContextSelector.java:18)

                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.naming.remote.client.InitialContextFactory.setupEjbContext(InitialContextFactory.java:420)

                at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:115)

                at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)

                at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)

                at javax.naming.InitialContext.init(InitialContext.java:223)

                at javax.naming.InitialContext.<init>(InitialContext.java:197)

                at es.uv.irtic.lisitt.incitar.Utiles.utilesConfiguracion.Configuracion.getCtx(Configuracion.java:52)

                at es.uv.irtic.lisitt.incitar.configuracion.TestConfiguracion.accesoEJBRemoto(TestConfiguracion.java:39)

                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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

                at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

                at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

                at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

                at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)

                at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)

                at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

                at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

                at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

                at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

                at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

                at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

                at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

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

                at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

                at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

      DEBUG [main] (ConfigBasedEJBClientContextSelector.java:137) - Registered a reconnect handler in EJB client context org.jboss.ejb.client.EJBClientContext@55e55f for remote://localhost:4447

      DEBUG [main] (ConfigBasedEJBClientContextSelector.java:142) - Registered 0 remoting EJB receivers for EJB client context org.jboss.ejb.client.EJBClientContext@55e55f

      DEBUG [Remoting "config-based-naming-client-endpoint" task-1] (RemotingConnectionEJBReceiver.java:145) - Channel Channel ID ec253b33 (outbound) of Remoting connection 01b15692 to /XXX.XXX.XXX.XXX opened for context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@811c88, receiver=Remoting connection EJB receiver [connection=Remoting connection <126f75b>,channel=jboss.ejb,nodename=cordon2]} Waiting for version handshake message from server

      INFO [Remoting "config-based-naming-client-endpoint" task-2] (VersionReceiver.java:101) - Received server version 1 and marshalling strategies [river]

      INFO [main] (RemotingConnectionEJBReceiver.java:162) - Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@811c88, receiver=Remoting connection EJB receiver [connection=Remoting connection <126f75b>,channel=jboss.ejb,nodename=cordon2]} on channel Channel ID ec253b33 (outbound) of Remoting connection 01b15692 to /XXX.XXX.XXX.XXX:4447

      TRACE [Remoting "config-based-naming-client-endpoint" task-3] (ChannelAssociation.java:388) - Received message with header 0x8

      DEBUG [Remoting "config-based-naming-client-endpoint" task-3] (RemotingConnectionEJBReceiver.java:427) - Received module availability report for 10 modules

      ...

      INFO [main] (EJBClient.java:42) - JBoss EJB Client version 1.0.5.Final

      DEBUG [Thread-2] (AutoConnectionCloser.java:91) - Closing endpoint "client-endpoint" <5dcec6>

      INFO [Remoting "config-based-naming-client-endpoint" task-4] (ChannelAssociation.java:370) - Channel Channel ID ec253b33 (outbound) of Remoting connection 01b15692 to /XXX.XXX.XXX.XXX:4447 can no longer process messages

      DEBUG [Thread-1] (RemotingConnectionEJBReceiver.java:141) - Closing channelChannel ID ec253b33 (outbound) of Remoting connection 01b15692 to /XXX.XXX.XXX.XXX:4447

      DEBUG [Thread-1] (ChannelAssociation.java:105) - Closing channel Channel ID ec253b33 (outbound) of Remoting connection 01b15692 to /XXX.XXX.XXX.XXX:4447

      ERROR [Remoting "config-based-naming-client-endpoint" task-1] (RemoteNamingStoreV1.java:222) - Channel end notification received, closing channel Channel ID a7b321e1 (outbound) of Remoting connection 01b15692 to /XXX.XXX.XXX.XXX:4447