[JNDI/Naming/Network] - Re: ClassCastException on remote calling of an EJB3.0
by broneo
Hello again,
after trying to establich a database connection i get the error i got before when using ClientBean/remote.
This is my source code:
Hashtable env = new Hashtable();
| env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
| env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
|
| final Context ic = new InitialContext(env);
| ClientRemote client = (ClientRemote)ic.lookup("ClientBean/remote");
| System.out.println("ClientBean is bound to: " + client);
| TemControlClient test = client.getClient(1);
| System.out.println("getClient returns: " + test);
| test = client.getClient(3);
| System.out.println("getClient returns: " + test);
and this is the output i got:
Exception in thread "main" javax.naming.NameNotFoundException: remote not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
at sun.reflect.GeneratedMethodAccessor81.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:613)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.planetactive.ejb.client.Main.main(Main.java:42)
Java Result: 1
The exception is thrwon in this line:
ClientRemote client = (ClientRemote)ic.lookup("ClientBean/remote");
So i think my program can`t find the JNDI Name.
Thnks for your help in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068788#4068788
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068788
18Â years, 8Â months
[Clustering/JBoss] - Using a WebServer and mod_jk 1.2.23 with Jboss 4.2.0GA
by egandt
I can setup Apache without issue and mod_jk is working there (ie jkstatus is working), and knows where it should connect to now the problem is setting up JBOSS 4.2.0GA to listen for a connection via ajp13.
First off I'm using the default Server instance
Next I edited the file: default/deploy/jboss-web.deployer/META-INF/jboss-service.xml I located:
false
and changes it to true :
true
Next I added a new Engine line to this file:
<Engine name=?jboss.web? defaultHost=?localhost? jvmRoute=?node1?>
where node1 is described in workers.properties
When I start up I get an error:
11:47:44,605 ERROR [STDERR] [Fatal Error] jboss-service.xml:145:20: Open quote is expected for attribute "name" associated with an element type "Engine".
11:47:44,608 ERROR [MainDeployer] Could not initialise deployment: file:/u01/software/Apps/701/jboss-4.2.0.GA/cs701_edit/server/default/deploy/jboss-web.deployer/
org.jboss.deployment.DeploymentException: Open quote is expected for attribute "name" associated with an element type "Engine".; - nested throwable: (org.xml.sax.SAXParseException: Open quote is expected for attribute "name" associated with an element type "Engine".)
at org.jboss.deployment.SARDeployer.init(SARDeployer.java:217)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:872)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:809)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
I looked at the existing documentation for setting up a cluster, but it all seems for 3.X or 4.0, the only reference I found for 4.2 was at http://www.hishboy.com/index.php/2007/06/19/jboss-420ga-clustering-on-ubu...
but these are the instructions that are causing problems. Since Apache starts I'm assuming that I do not care about that yet, I want JBOSS 4.2.0GA to start properly.
Thanks,
ERIC
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068786#4068786
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068786
18Â years, 8Â months