Bugs item #762045, was opened at 2003-06-27 12:12
Message generated for change (Comment added) made by starksm
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=762045&group_id=22866
Category: JBossServer
Group: v3.2
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Dan Ciarniello (dciarnie)
>Assigned to: Scott M Stark (starksm)
Summary: Cannot get EJB Home interface from Remote interface
Initial Comment:
One cannot get an EJB home interface from a remote
interface (using getEJBHome()) when the JNDI connection
properties are not set in the System property space.
The following code fragment illustrates the problem:
==============================
Properties props = new Properties();
props.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
// host must be remote, not local
props.setProperty(Context.PROVIDER_URL,"remotehost:1099");
props.setProperty(Context.URL_PKG_PREFIXES,"org.jboss.naming");
InitialContext ctx = new InitialContext(props);
FooHome foohome = (FooHome)ctx.lookup("ejb/foohome");
Foo foo = foo.findByPrimaryKey(id);
EJBHome home = foo.getEJBHome();
==============================
The last line will fail with a
java.lang.reflect.UndeclaredThrowableException caused
by a java.net.SocketTimeoutException.
I have traced the problem to
org.jboss.proxy.ejb.GenericEJBInterceptor.getEJBHome(Invocation).
which has the line
InitialContext iniCtx = new InitialContext();
and therein lies the problem. This assumes that the
JNDI connection properties have been set in the System
property space which is not the case in the above example.
The remote interface must have explicit access to the
JNDI properties used to retrieve it in the first place.
It cannot assume that these properties have been set
in the System property space.
Note that this problem also exists in v3.2. It does
not exist in 2.4.x.
----------------------------------------------------------------------
>Comment By: Scott M Stark (starksm)
Date: 2003-08-05 14:27
Message:
Logged In: YES
user_id=175228
The home is taken from the proxy context which was created
on the server and now has no reliance on the client side
naming environment.
----------------------------------------------------------------------
Comment By: Dan Ciarniello (dciarnie)
Date: 2003-08-05 09:30
Message:
Logged In: YES
user_id=529841
Changing group to 3.2 since no one is responding to it
marked as 3.0 and it still exists in 3.2.2.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=762045&group_id=22866
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development