Hi Scott,
The javax.naming.CommunicationException is the archtypical message but it can be
caused by various sources. Here's what I've tried
- not all of this *may* be necessary anymore, but I haven't seen an answer on this
question yet.
What I have here works on Beta Prod 1. But it's "folklore" as far as what is actually
required by FINAL.
1. On JBOSS, Ensure that both your RMI and JNDI hosts are set up (i.e. not set to
localhost). Earlier versions defaulted to
localhost. In the JBOSS FINAL version, the defaults are commented out. So you could
probably set the the hosts using -D.
Otherwise, just uncomment the lines and fill them out in:
jboss.properties:
java.rmi.server.hostname=myserver.xxxx.com
jndi.properties
java.naming.provider.url=myserver.xxxx.com
2. In the client, do a complete upcast for the lookup:
MyBeanHome ref = (MyBeanHome) ctx.lookup("MyBeanName");
Instead of
Object ref = ctx.lookup("MyBeanName");
The "connection refused to 127.0.0.1" message seems to come from not upcasting.
Also if you look in Zol:
zola/src/java/org/jboss/zol/testbean/client/EjbossClient.java (dated 9/25/00)
It does:
StatelessSessionHome statelessSessionHome =
(StatelessSessionHome) ctx.lookup("nextgen.StatelessSession");
There are some other clients in Zol - some of them are coded "Object ref =", but
most appear to be earlier than 9/25/00.
Let me know how it goes.
Regards,
Rich Katz
Scott M Stark wrote:
> This looks to be a problem with RedHat box not using the correct interface for the
> RMI objects and so the rmi://... urls in the JNDI namespace are referring to the
>localhost
> interface. Try passing -Djava.rmi.server.hostname=public_name on the RedHat
> box to ensure the rmi references are exported with the correct address.
> public_name is either the hostname or ip address of the interface
> the client is connecting to.
>
> <snip>
> OUTPUT:
> vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
> Got context
>
> javax.naming.CommunicationException [Root exception is java.rmi.ConnectException:
>Connection refused to host: 127.0.0.1; nested
> exception is:
> java.net.ConnectException: Connection refused: no further information]
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> So where did the 127.0.0.1 come from? I am a total newbie with jboss and am trying
>to figure out what I need to do to get the
> Interest application up and running.
>
> Thank You for Your Consideration,
> Bob Byron
> RAD Systems, Inc.
> www.radit.com
> (972)516-4256
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Problems?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]