I did set all the JNDI properties like this:
private String J2EE_BEAN_INITIAL_CONTEXT = "org.jnp.interfaces.NamingContextFactory";
private String J2EE_SERVER = "maloja:1099";
private String J2EE_SERVER_USER = "username";
private String J2EE_SERVER_PASSWORD = "password";
private Context getInitialContext()throws NamingException{
Properties p = new Properties();
p.put("java.naming.factory.initial", J2EE_BEAN_INITIAL_CONTEXT);
p.put("java.naming.provider.url", J2EE_SERVER);
if (J2EE_SERVER_USER != null) {
p.put(Context.SECURITY_PRINCIPAL, J2EE_SERVER_USER);
if (J2EE_SERVER_PASSWORD == null){
J2EE_SERVER_PASSWORD = "";
}
p.put(Context.SECURITY_CREDENTIALS, J2EE_SERVER_PASSWORD);
}
return new InitialContext(p);
}
The lookup went fine, but as soon as i called the getEJBMetaData().getEJBHome() method on the looked up home interface , the Exception occured.
What's weird is that since i restarted JBoss, the getEJBMetaData().getHomeInterfaceClass() and getEJBMetaData().getRemoteInterfaceClass() work fine and
return the "real" home and remote interface names.
Thanks
Lorenzo
Maurice le Rutte wrote:
013901c11102$85d1f1e0$d9a0bc86@pc1mplr">I have tried the getEJBMetaData().getHomeInterfaceClass() method in
JBoss, but all i am getting here is the "$Proxy2" class name again,
so i suspect that the mentioned method returns the class that implements
the Home interface.The $Proxy2 is a class that is dynamically generated and wraps the home
interface methods. See java.lang.reflect.Proxy for more information. I think
you can use introspection to query the interfaces it implements, this should
include the name of the home interface class.There is also the getEJBMetaData().getEJBHome(), but when i call thismethod,an exception like this is thrown:
javax.naming.NoInitialContextException: Need to specify class name
in environment or system property, or as an applet parameter, or in
an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:646)
[...]Have you specified all needed configuration parameters? Easiest is to have a
jndi.properties in your classpath containing the following properties.
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming
Of course, you might need to change the java.naming.provider.url to fit your
local configuration needs.
Maurice.
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user