[JBoss-user] [EJB/JBoss] - Re: Problem using remote interface

2004-09-26 Thread jgbargar
First, let me clarify that the client is on the same machine - just not in the 
container (they're junit tests).  It is this attempt to get the remote interface that 
is proving problematic.  Using local interfaces from a web app deployed in JBoss as 
well as inter-EJB calls are working fine.  Both remote and local interfaces are 
deploying without error in JBoss and they are appearing fine in the jmx console JNDI 
listing:

 +- com.pixelfixx.service.WebManager (proxy: $Proxy60 implements interface 
com.pixelfixx.service.WebManagerRemoteHome,interface javax.ejb.Handle)
 +- local (class: org.jnp.interfaces.NamingContext)
  |   +- com.pixelfixx.service.WebManager (proxy: $Proxy40 implements interface 
com.pixelfixx.service.WebManagerLocalHome)

The only invokers I can see deployed are http and jmx, which as far as I know aren't a 
factor here.  Please let me know what I should look for if I am wrong on this.

RE: initial context values, what information would be useful beyond the environment 
info that I've already included in the code posting?  With the initial context I can 
list the bindings, but (again AFAIK) that is pretty much what I've listed above from 
the JNDI listing in jmx console.

One final comment about the theory that JBoss thinks the caller is local.  If I am 
specifically looking up the remote interface by jndi name, why would JBoss still 
return the local interface?

Feedback is much appreciated,

Jeremy

View the original post : 
http://www.jboss.org/index.html?module=bbop=viewtopicp=3849566#3849566

Reply to the post : 
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3849566


---
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB/JBoss] - Problem using remote interface

2004-09-25 Thread jgbargar
Hello there,

Our application (in a bold new use of J2EE technology ;)) has Session EJBs that are 
called remotely.  I am having a problem where I am able to successfully lookup the 
Home but then the create() method is failing.  I have confirmed that the Session bean 
in question is deploying successfully by watching the console at deploy time as well 
as looking at the jmx-console.  Additionally, the lookup listen port is correct as 
confirmed by a telnet.  Any insight on this would be greatly appreciated as I am stuck 
on something that I feel should be routine, and am unable to move forward on the 
project I am working on.


calling code:


public void testLookup() throws Throwable {

String method = testLookup;
assertTrue(getHome() != null);

WebManagerRemote wmr = getHome().create();

log(getHome().toString());
}


helper method code:


WebManagerRemoteHome getHome() throws Throwable {

Hashtable env = new Hashtable();


env.put(Context.INITIAL_CONTEXT_FACTORY,org.jnp.interfaces.NamingContextFactory);
env.put(Context.URL_PKG_PREFIXES, org.jboss.naming:org.jnp.interfaces);
env.put(Context.PROVIDER_URL, 127.0.0.1:1099);

String jndiName = com.pixelfixx.service.WebManager;

// Obtain initial context
javax.naming.InitialContext initialContext = new 
javax.naming.InitialContext(env);
Class narrowTo = com.pixelfixx.service.WebManagerRemoteHome.class;

Object objRef;

try {
   objRef = initialContext.lookup(jndiName);
   // only narrow if necessary
   if (narrowTo.isInstance(java.rmi.Remote.class))
  objRef = javax.rmi.PortableRemoteObject.narrow(objRef, narrowTo);
} finally {
   initialContext.close();
}

return (com.pixelfixx.service.WebManagerRemoteHome) objRef;
}


error


[junit] java.lang.IndexOutOfBoundsException: Index: 14, Size: 14
[junit] at java.util.ArrayList.RangeCheck(ArrayList.java:507)
[junit] at java.util.ArrayList.get(ArrayList.java:324)
[junit] at 
org.jboss.invocation.InvocationKey.readResolve(InvocationKey.java:118)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[junit] at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[junit] at 
java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:925)
[junit] at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1655)
[junit] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
[junit] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
[junit] at java.util.HashMap.readObject(HashMap.java:1005)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[junit] at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[junit] at 
java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838)
[junit] at 
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
[junit] at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
[junit] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
[junit] at 
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
[junit] at 
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
[junit] at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
[junit] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
[junit] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
[junit] at 
org.jboss.proxy.ClientContainer.readExternal(ClientContainer.java:109)
[junit] at 
java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1686)
[junit] at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1644)
[junit] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
[junit] at 
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
[junit] at 
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
[junit] at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
[junit] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
[junit] at