Whe I don't get remote access on my ejb?I
peter_jaxy Oct 1, 2015 9:28 AMI get this error message, if my client app try to communicate with my server app:
Okt 01, 2015 3:06:02 PM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.13.GA-redhat-1
Okt 01, 2015 3:06:03 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.13.GA-redhat-1
Okt 01, 2015 3:06:03 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.3.4.Final-redhat-1
Okt 01, 2015 3:06:04 PM org.jboss.ejb.client.EJBClient <clinit>
INFO: JBoss EJB Client version 1.0.30.Final-redhat-1
Exception in thread "main" java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:HelloBean, moduleName:HelloBean-ejb, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@363ee3a2
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:747)
at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116)
at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186)
at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:255)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:200)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:183)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:146)
at com.sun.proxy.$Proxy2.hello(Unknown Source)
at examples.session.stateless.HelloClient.main(HelloClient.java:58)
Java Result: 1
I created a simple ejb "HelloBean.ear" with the following two files:
- Hello.java (The interface)
- HelloBean.java (implements my Interface)
The content of Hello.java is:
package examples.session.stateless; public interface Hello { public String hello(); }
The content of HelloBean.java is:
package examples.session.stateless; import javax.ejb.Stateless; import javax.ejb.Remote; @Stateless @Remote(Hello.class) public class HelloBean implements Hello{ @Override public String hello(){ String result; result = "Hallo!"; return result; } }
I successfully deployed my ejb on the jboss server. This is the output of the server's log file:
12:54:48,334 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starte Deployment von "HelloBean.ear" (runtime-name: "HelloBean.ear")
12:54:48,376 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015973: Starte Subdeployment (runtime-name: "HelloBean-ejb.jar")
12:54:48,384 INFO [org.jboss.as.pojo] (MSC service thread 1-3) JBAS017000: Veralteten Bean/Pojo Namespace: urn:jboss:bean-deployer:2.0 gefunden - es k�nnen xml-Features fehlen (potenzielle Ausnahmen).
12:54:48,403 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named HelloBean in deployment unit subdeployment "HelloBean-ejb.jar" of deployment "HelloBean.ear" are as follows:
java:global/HelloBean/HelloBean-ejb/HelloBean!examples.session.stateless.Hello
java:app/HelloBean-ejb/HelloBean!examples.session.stateless.Hello
java:module/HelloBean!examples.session.stateless.Hello
java:jboss/exported/HelloBean/HelloBean-ejb/HelloBean!examples.session.stateless.Hello
java:global/HelloBean/HelloBean-ejb/HelloBean
java:app/HelloBean-ejb/HelloBean
java:module/HelloBean
12:54:48,547 INFO [org.jboss.as.server] (HttpManagementService-threads - 43) JBAS015859: "HelloBean.ear" deployed (runtime-name: "HelloBean.ear")
Furthermore I created a client app with the following files:
- jboss-ejb-client.properties
- jndi.properties
- HelloClient.java
The content of the "jboss-ejb-client.properties"-file is: endpoint.name=client-endpoint remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false remote.connections=default remote.connection.default.host=10.7.97.48 remote.connection.default.port = 4447 remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false remote.connection.default.username=xxxxxx remote.connection.default.password=xxxxxx
The content of the "jndi.properties"-file is:
java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory java.naming.factory.url.pkgs=org.jboss.ejb.client.naming jboss.naming.client.ejb.context=true java.naming.provider.url=remote://10.7.97.48:4447 java.naming.security.principal=xxxxxxx java.naming.security.credentials=xxxxxxx
The content of the "HelloClient.java"-file is:
package examples.session.stateless; import java.util.Hashtable; import java.util.Properties; import javax.naming.*; import org.jboss.ejb.client.EJBClientContext; import org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration; import org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector; public class HelloClient{ public static void main(String[] args) throws Exception{ final String appName = "HelloBean"; final String moduleName = "HelloBean-ejb"; final String distinctName = ""; final String beanName = HelloBean.class.getSimpleName(); final String viewClassName = Hello.class.getName(); System.out.println("Looking EJB via JNDI "); String ejbName = "ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName; System.out.println(ejbName); final Hello ejb = (Hello) InitialContext.doLookup(ejbName); String result = ejb.hello(); System.out.println(result); } }
I can ping my server with the ip 10.7.97.48.
In my webbrowser I can see the application platform with the ip 10.7.97.48 and with the port 8081.
Why my client app don't get access on my ejb?