Hi,
I'm trying to run a client on a different pc to the jboss server but
something is going wrong.
On the client, I've set the classpath to include jboss-client.jar,
jnp-client.jar, ejb.jar and jndi.jar, all from the jBoss client directory. I
also include a file called Managers.jar, which is the jar that is deployed
on the JBoss server and contains all my classes, beans etc.
Running the following client code...
import javax.naming.*;
import javax.rmi.PortableRemoteObject;
import java.util.Properties;
class ClientTestGlobalManager
{
public static void main(String[] args)
{
if ( args.length != 1 ) {
System.out.println("USAGE: java
com.rubus.cms.itemmgr.beans.globalmanager.ClientTestGlobalManager url");
return;
}
String url = args[0];
try {
// Get a naming context
System.out.println("Set url = " + url + ": Getting initial
context...");
Properties sysProps = System.getProperties();
sysProps.put("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
sysProps.put("java.naming.provider.url", url);
InitialContext jndiContext = new InitialContext();
// Get a reference to a Manager Home
System.out.println("Getting remote reference...");
Object ref = jndiContext.lookup("itemmgr/GlobalManager");
// Get a reference from this to the Bean's Remote interface
GlobalManagerHome home = (GlobalManagerHome)
PortableRemoteObject.narrow (ref,
GlobalManagerHome.class);
GlobalManagerRemote globalManager = home.create();
// Make a simple call
globalManager.createNewItem("Category");
System.out.println("Done");
}
catch ( Exception e ) {
System.out.println(e.toString());
e.printStackTrace();
}
}
}
with a command line of "java
com.rubus.cms.itemmgr.beans.globalmanager.ClientTestGlobalManager
10.1.1.255:1099" gives me the following output and exception.
Set url = 10.1.1.255:1099: Getting initial context...
Getting remote reference...
javax.naming.CommunicationException [Root exception is
java.io.StreamCorruptedExce
ption: Type code out of range, is 125]
javax.naming.CommunicationException. Root exception is
java.io.StreamCorruptedExc
eption: Type code out of range, is 125
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Exception.java:42)
at java.io.IOException.<init>(IOException.java:47)
at
java.io.ObjectStreamException.<init>(ObjectStreamException.java:29)
at
java.io.StreamCorruptedException.<init>(StreamCorruptedException.java:3
0)
at java.io.ObjectInputStream.peekCode(Compiled Code)
at java.io.ObjectInputStream.readObject(Compiled Code)
at java.io.ObjectInputStream.readObject(Compiled Code)
at java.io.ObjectInputStream.inputObject(Compiled Code)
at java.io.ObjectInputStream.readObject(Compiled Code)
at java.io.ObjectInputStream.readObject(Compiled Code)
at java.rmi.MarshalledObject.get(MarshalledObject.java:142)
at org.jnp.interfaces.NamingContext.lookup(Compiled Code)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:279)
at javax.naming.InitialContext.lookup(InitialContext.java:354)
at
com.rubus.cms.itemmgr.beans.globalmanager.ClientTestGlobalManager.main(
ClientTestGlobalManager.java:30)
The same client running on the PC that is hosting the jBoss server works
perfectly. Anyone know what I'm doing wrong?
Cheers,
Ian.
______________________________________________
Ian Priest
t +44 (0) 1344 644162 | m +44 (0) 7970 243401 | f +44 (0) 1344 644190
a Rubus Court | Eastern Road | Bracknell | Berkshire RG12 2UP | UK
Rubus provides e-business solutions that turn innovative ideas
into practical business reality.
______________________________________________
:: rubus | www.rubus.com
Any views or opinions presented are solely those of the author
and do not necessarily represent those of Rubus.
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]