views:

23

answers:

1

I have a a number of jar files that perform rmi. These are all working except one, the problematic one attempts to look up a remote slsb in a different project.

So the code is the same here:

machineNameOrAddress = args[0];
jndiPortNumber = args[1];
action = args[2];
    Properties properties = new Properties();
    properties.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
    properties.setProperty("java.naming.provider.url", "jnp://" + machineNameOrAddress + ":" + jndiPortNumber);
    properties.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
    try {

    initialContext = new InitialContext(properties);

But then the difference occurs; this is OK:

IEmailNotificationSLSBRemote notificationSLSBRemote = (IEmailNotificationSLSBRemote) initialContext.lookup("ProjectOne/EmailNotificationSLSB/remote");

This is not OK:

IEmailNotificationSLSBRemote notificationSLSBRemote = (IEmailNotificationSLSBRemote) initialContext.lookup("ProjectTwo/EmailNotificationSLSB/remote");

Everythign compiles everythign else works OK, I think have set everythign up ok (well almost everything).

This is the error, it is the same client directory. The rmi's are being invoked in the same place.

javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: my.path.ProjTwo.client.interfaces.IEmailNotificationSLSBRemote (no security manager: RMI class loader disabled)]
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:786)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
        at javax.naming.InitialContext.lookup(Unknown Source)
        at uk.co.tpplc.hands.client.utils.EmailNotificationUtil.main(EmailNotificationUtil.java:47)
Caused by: java.lang.ClassNotFoundException: uk.co.tpplc.hands.client.interfaces.IEmailNotificationSLSBRemote (no security manager: RMI class loader disabled)
        at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
        at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
        at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
        at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source)
        at java.io.ObjectInputStream.readProxyDesc(Unknown Source)
        at java.io.ObjectInputStream.readClassDesc(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        at java.rmi.MarshalledObject.get(Unknown Source)
        at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:710)
        ... 3 more

Any help greatly appreciated. The slsbs are present in both projects, they do almost the same thing. The jar files compile fine and a located in same location. And both a present and correct in jmx console jboss.j2ee:

ear=ProjectOne.ear,jar=ProjectOne-ejb.jar,name=EmailNotificationSLSB,service=EJB3

ear=ProjectTwo.ear,jar=ProjectTwo-ejb.jar,name=EmailNotificationSLSB,service=EJB3
A: 

ProjectTwo jar file needed to be copied to the directory containing the calling jars.

NimChimpsky