[JNDI/Naming/Network] - Shutdown exception...javax.naming.CommunicationException...
by adymlincoln
Hi all,
I've been working away at this issue for 4 hours now, and still can't find a solution. My JBoss server won't shutdown properly, receiving the following exception when I try and shutdown:
[exception]
Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 [Ro
ot exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.Serv
iceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused
: connect]]]
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1416)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:596)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at org.jboss.Shutdown.main(Shutdown.java:214)
Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUn
availableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: con
nect]]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1387)
... 4 more
[/exception]
The original issue started out during startup, the NamingContext could not obtain port 1099. I've since done the following:
- Reconfigured jboss-service.xml to use ports 2099/2098
- Set the jndi.properties file with java.naming.provider.url=http://localhost:2099
- Using Tcpview to monitor port usage on my Windoze laptop.
This fixed the startup cycle, and you can even see in the server log the NamingContext grab the 2099 during startup.
However, even with those fixes, the shutdown cycle continues to throw exceptions like the above. I thought the issue might be related to the linkage between Eclipse Ganymede and the JBoss server, but a test using the command line tools for JBoss proves that not to be the case...I ran the JBoss server via the command line (run.bat) and then opened a second command console and issued a shutdown -S and got the same exception. It almost appears like there is a hard-coded value stored somewhere that I can't get to...
Any help would be greatly appreciated...
tia,
adym
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4186106#4186106
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4186106
16 years, 5 months
[EJB 3.0] - ClassCastException after JNDI lookup
by tperrigo
I've got a very simple stateless session bean:
| @Stateless
| @Remote(ProcessAdminRemote.class)
| public class ProcessAdminEJB implements ProcessAdmin {
| ...
| }
|
...with the following business and Remote interfaces (no local interface):
| public interface ProcessAdmin {
| ...
| }
|
| public interface ProcessAdminRemote extends ProcessAdmin {
| }
|
|
Everything seems to deploy just fine, but when I try to do the following JNDI lookup, I get a ClassCastException:
| InitialContext ctx = new InitialContext();
| final String jndiName = "ProcessAdminEJB/remote";
| Object o = ctx.lookup(jndiName);
| if ( o == null ) {
| System.err.println("unable to find " + jndiName);
| } else {
| System.out.println("retrieved instance of "+o.getClass().getName());
| }
| // the following line causes the ClassCastException...
| ProcessAdmin ejb = (ProcessAdmin)o;
|
When I print out the name of the instance returned by the JNDI lookup, I find that it is an instance of javax.naming.Reference.
I really have no idea what I'm doing wrong...I've found a couple example EJB3 stateless session beans, and they are pretty much exactly the same as my setup. I'm using JBossAS 5.0.0.CR2. This is driving me nuts...any help would be extremely appreciated!
Thanks in advance,
Tim
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4186100#4186100
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4186100
16 years, 5 months