HAJNDI Lookup problem
stevehel Aug 11, 2009 9:50 AMHi,
I have a problem when doing a EJB lookup from my client application (outside the AS). There is the exception :
com.asis.x2010.fmk.util.exception.FmkException: com.asis.x2010.fmk.util.exception.FmkException: javax.naming.CommunicationException [Root exception is java.rmi.RemoteException: Service unavailable.] at com.asis.x2010.fmk.business.initialisation.InitialisationTest.<init>(InitialisationTest.java:167) at com.asis.x2010.fmk.persistence.AbstractTestCaseEntity.setUp(AbstractTestCaseEntity.java:279) at junit.framework.TestCase.runBare(TestCase.java:128) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:228) at junit.framework.TestSuite.run(TestSuite.java:223) at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: com.asis.x2010.fmk.util.exception.FmkException: javax.naming.CommunicationException [Root exception is java.rmi.RemoteException: Service unavailable.] at com.asis.x2010.fmk.persistence.AbstractTestCaseEntity.getBean(AbstractTestCaseEntity.java:239) at com.asis.x2010.fmk.persistence.AbstractTestCaseEntity.getBeanRemote(AbstractTestCaseEntity.java:246) at com.asis.x2010.fmk.business.initialisation.InitialisationTest.<init>(InitialisationTest.java:163) ... 15 more Caused by: javax.naming.CommunicationException [Root exception is java.rmi.RemoteException: Service unavailable.] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:724) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589) at javax.naming.InitialContext.lookup(InitialContext.java:351) at com.asis.x2010.fmk.persistence.AbstractTestCaseEntity.getBean(AbstractTestCaseEntity.java:236) ... 17 more Caused by: java.rmi.RemoteException: Service unavailable. at org.jboss.ha.framework.interfaces.HARMIClient.invokeRemote(HARMIClient.java:213) at org.jboss.ha.framework.interfaces.HARMIClient.invoke(HARMIClient.java:267) at $Proxy45.lookup(Unknown Source) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627) ... 20 more
The jndi.properties from the client side :
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces java.naming.provider.url=jnp://ip_address_of_the_server:1200 jnp.discoveryGroup=228.1.2.4
And the HAJNDI configuration from the server side :
<mbean code="org.jboss.ha.jndi.HANamingService"
name="jboss:service=HAJNDI">
<!-- We now inject the partition into the HAJNDI service instead
of requiring that the partition name be passed -->
<depends optional-attribute-name="ClusterPartition"
proxy-type="attribute">jboss:service=${jboss.partition.name:DefaultPartition}</depends>
<!-- Bind address of bootstrap and HA-JNDI RMI endpoints -->
<attribute name="BindAddress">${jboss.bind.address}</attribute>
<!-- Port on which the HA-JNDI stub is made available -->
<attribute name="Port">1100</attribute>
<!-- RmiPort to be used by the HA-JNDI service once bound. 0 => auto. -->
<attribute name="RmiPort">1101</attribute>
<!-- Accept backlog of the bootstrap socket -->
<attribute name="Backlog">50</attribute>
<!-- The thread pool service used to control the bootstrap and
auto discovery lookups -->
<depends optional-attribute-name="LookupPool"
proxy-type="attribute">jboss.system:service=ThreadPool</depends>
<!-- A flag to disable the auto discovery via multicast -->
<attribute name="DiscoveryDisabled">false</attribute>
<!-- Set the auto-discovery bootstrap multicast bind address. If not
specified and a BindAddress is specified, the BindAddress will be used. -->
<attribute name="AutoDiscoveryBindAddress">${jboss.bind.address}</attribute>
<!-- Multicast Address and group port used for auto-discovery -->
<attribute name="AutoDiscoveryAddress">${jboss.partition.udpGroup:230.0.0.4}</attribute>
<attribute name="AutoDiscoveryGroup">1102</attribute>
<!-- The TTL (time-to-live) for autodiscovery IP multicast packets -->
<attribute name="AutoDiscoveryTTL">16</attribute>
<!-- The load balancing policy for HA-JNDI -->
<attribute name="LoadBalancePolicy">org.jboss.ha.framework.interfaces.RoundRobin</attribute>
<!-- Client socket factory to be used for client-server
RMI invocations during JNDI queries
<attribute name="ClientSocketFactory">custom</attribute>
-->
<!-- Server socket factory to be used for client-server
RMI invocations during JNDI queries
<attribute name="ServerSocketFactory">custom</attribute>
-->
</mbean>
JBoss is started with these parameters :
wrapper.app.parameter.1=org.jboss.Main wrapper.app.parameter.2=-c wrapper.app.parameter.3=prodNode1 wrapper.app.parameter.4=-g wrapper.app.parameter.5=MyCluster wrapper.app.parameter.6=-b wrapper.app.parameter.7=0.0.0.0 wrapper.app.parameter.8=-u wrapper.app.parameter.9=228.1.2.4
Via JNDIView, I can find the EJB I'm trying to lookup.
Any idea why this exception is thrown ?
Thanks in advance for your help,
Steve