So I'm using the Reference Implementation on Solaris where everything is
fine. I can deploy the App to the server and the following client code works
fine when running on the same host as the J2EE server. I can use the initial
context to find my EJB and make calls on it successfully.
Properties lProps = new Properties();
// I know the following line is redundant because it's what J2EE Ref Impl
// uses by default anyway
lProps.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.enterprise.naming.EJBInitialContextFactory");
lProps.put(Context.PROVIDER_URL, "iiop://oxygen/");
Context initial = new InitialContext(lProps);
However, when running on a different machine (which, though it may not be
important, is running NT), I get the following exception:
Caught an unexpected exception!
javax.naming.NamingException: Error accessing repository: Cannot connect to
ORB
at com.sun.enterprise.naming.EJBCtx.<init>(EJBCtx.java:51)
at
com.sun.enterprise.naming.EJBInitialContextFactory.getInitialContext(EJBInit
ialContextFactory.java:62)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:672)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:250)
at javax.naming.InitialContext.init(InitialContext.java:226)
at javax.naming.InitialContext.<init>(InitialContext.java:202)
at client.ConverterClient.main(ConverterClient.java:21)
So My guess is that the PROVIDER_URL I'm giving is wrong. I've tried it with
IP address instead of DNS name. I've tried different schemes ("rmi://" and
"iiop://") and have tried specifying the port explicitly
("iiop://oxygen:1050"). None of these seems to work so I guess I have a few
questions:
1. Is the ORB running on port 1050 using IIOP?
2. Am I specifying the PROVIDER_URL correctly?
3. Am I missing something obvious/doing this completely wrongly?
Any help would be appreciated.
Noel O'Sullivan
> So My guess is that the PROVIDER_URL I'm giving is wrong. I've tried it
with
> IP address instead of DNS name. I've tried different schemes ("rmi://" and
> "iiop://") and have tried specifying the port explicitly
> ("iiop://oxygen:1050"). None of these seems to work so I guess I have a
few
> questions:
>
> 1. Is the ORB running on port 1050 using IIOP?
> 2. Am I specifying the PROVIDER_URL correctly?
> 3. Am I missing something obvious/doing this completely wrongly?
Well, when I do an nslookup on the name "oxygen" there are no 'A' records,
I suspect you need to replace "oxygen" (which is probably an internal
machine name in whatever department compiled the W32 version ) with the
address that the Solaris version uses (seeing as that works )
If that has the same address, then see if you can do an nslookup on "oxygen"
from your location, and replace the address with whatver IP you get
returned.
_____________________________________
Frank Pitt
Tutor / Consultant
Software Education Associates Ltd
Cnr The Esplanade & Nevis St, Petone
Wellington New Zealand
Voice +64 4 568 7806 Fax +64 4 568 7920
Email fra...@softed.com
Web http://www.softed.com
Thanks, Frank. But to requote myself (what you already quoted):
>> I've tried it with IP address instead of DNS name. I've tried different
schemes
>> ("rmi://" and "iiop://") and have tried specifying the port explicitly
>> ("iiop://oxygen:1050"). None of these seems to work ...
I should probably have mentioned that I have tried all combinations of the
above too. I'm 99.99% sure this isn't a machine lookup problem.
Any other ideas/similar problems? Has anyone got this to work in a similar
set-up?
Noel