Hi John, When using OpenEJB in Tomcat, you don't need to set the openejb.embedded.remotable=true (it is automatically set). To access ejbs, you can connect to http://localhost:8080/openejb/ejb instead of ejb://...
The full documentation is available at http://openejb.apache.org/3.0/clients.html Jean-Louis John_canada wrote: > > Hi, > > This topic is similar as "deploy EJB on tomcat" in > http://www.nabble.com/deploy-EJB-on-tomcat-td22599057.html. > > However applying the above solution could not make a change in my case. > > I use tomcat 6, openejb 3.1.1, then copy openejb.war and myejb.jar into > tomcat6\webapps, also copy a file named system.properties (it just > contains "openejb.embedded.remotable=true") into tomcat6\conf and > myejb.jar\META-INF folders. > > the remote client (in same machine) as: > > Properties props = new Properties(); > props.put(Context.INITIAL_CONTEXT_FACTORY,"org.apache.openejb.client.RemoteInitialContextFactory"); > props.put(Context.PROVIDER_URL,"ejbd://127.0.0.1:4201"); > new InitialContext(props).lookup("myejb"); > > The exception is: > > WARNING: Failover: Cannot connect to server(s): ejbd://127.0.0.1:4201 > Exception: Cannot connect to server 'ejbd://127.0.0.1:4201'. Check that > the server is started and that the specified serverURL is correct.. > Trying next. > javax.naming.NamingException: Cannot lookup '/myejb'. [Root exception is > java.rmi.RemoteException: Unable to connect; nested exception is: > java.rmi.RemoteException: Cannot connect to any servers: Server #0: > ejbd://127.0.0.1:4201] > at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:239) > at javax.naming.InitialContext.lookup(InitialContext.java:392) > ... > > from http://localhost:8080/openejb/viewjndi.jsp, I know the ejb deployed > and it can be invoked (via the web-console and a my servlet deployed in > same tomcat). > > Can any one know how to fix it? > > Thanks > -- > John > -- View this message in context: http://www.nabble.com/deployed-in-tomcat%2C-remote-client-%3A-Cannot-connect-to-server-tp24561481p24564689.html Sent from the OpenEJB User mailing list archive at Nabble.com.
