-
1. Re: NoSuchObjectException
delkant Nov 29, 2005 6:11 AM (in response to sksiazek)can you give us a description of your files?
what version of jboss you are using? -
2. Re: NoSuchObjectException
sksiazek Nov 29, 2005 10:15 AM (in response to sksiazek)We are currently using version 4.0.0, although I will be migrating to version 4.03 once I fix an unrelated problem in another module.
Here is the JNDI section of the conf/jboss-service.xml file :
<!-- ==================================================================== -->
<!-- JNDI -->
<!-- ==================================================================== -->
<!-- The call by value mode. true if all lookups are unmarshalled using
the caller's TCL, false if in VM lookups return the value by reference.
-->
true
<!-- The listening port for the bootstrap JNP service. Set this to -1
to run the NamingService without the JNP invoker listening port.
-->
1099
<!-- The bootstrap JNP server bind address. This also sets the default
RMI service bind address. Empty == all addresses
${jboss.bind.address}
-->
<!-- The port of the RMI naming service, 0 == anonymous -->
1098
<!-- The RMI service bind address. Empty == all addresses
${jboss.bind.address}
-->
<!-- The thread pool service used to control the bootstrap lookups -->
<depends optional-attribute-name="LookupPool"
proxy-type="attribute">jboss.system:service=ThreadPool
<mbean code="org.jboss.naming.JNDIView"
name="jboss:service=JNDIView"
xmbean-dd="resource:xmdesc/JNDIView-xmbean.xml">
Here is the method (slightly modified) that performs the context lookup :
public static FubarRemote getServerFubar() {
FubarRemote remoteFubar = null;
String serverName = "remoteserver";
Context serverContext;
String contextFactory = "org.jnp.interfaces.NamingContextFactory";
String contextURL = "jnp://" + serverName + ":1099";
Properties p = new Properties();
p.put("java.naming.factory.initial", contextFactory);
p.put("java.naming.provider.url", contextURL);
p.put("java.naming.factory.url.pkgs", "org.jboss.naming.org.jnp.interfaces");
try {
serverContext = new InitialContext(p);
Object ref = serverContext.lookup("Fubar");
FubarHome home =
(FubarrHome) PortableRemoteObject.narrow(ref, FubarHome.class);
remoteFubar = home.create();
} catch (NamingException e) {
e.printStackTrace();
} catch (RemoteException e) {
e.printStackTrace();
} catch (CreateException e) {
e.printStackTrace();
}
return remoteFubar;
}