on 02-23-2009 11:09 AM
Hello,
I am trying to list all session beans implementing a remote interface and bound to a particular JNDI registry. Lets say the remote interface is com.xyz.RemoteInterface. There are 2 session beans implementing the remote and deployed on the server. To list the 2 beans I am using the code of the type below -
I am using the code in the form below -
String JNDI = "ejb:/interfaceName=com.xyz.RemoteInterface, interfaceType=remote";
NamingEnumeration<javax.naming.Binding> bindings = getContext().listBindings(lookupName);
while(bindings.hasMoreElements()) {
System.out.println(bindings.nextElement().getName());
}
When I do this I get the following exception.
java.lang.UnsupportedOperationException: The class JNDIejbResolverContext serves for resolving the entries in the ejb scheme. It supports only the 'public Object lookup(String name) throws NamingException' operation.
at com.sap.engine.services.ejb3.runtime.impl.JNDIejbResolverContext.throwException(JNDIejbResolverContext.java:35)
at com.sap.engine.services.ejb3.runtime.impl.JNDIejbResolverContext.listBindings(JNDIejbResolverContext.java:107)
at javax.naming.InitialContext.listBindings(InitialContext.java:447)
at javax.naming.InitialContext.listBindings(InitialContext.java:447)
Can anyone guide me how can I achieve the listing if this doesnt work.
Best Regards,
Christopher
This feature is currently not supported but will likely be supported in a future release.
Regards,
\-- Vladimir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, I haven't said that listBindings is not supported in the current release. I said that this feature ("to list all session beans implementing a remote interface") is not supported.
From the javadoc:
listBindings(String name) -- Enumerates the names bound in the named context, along with the objects bound to them.
So, the param must be the name of a context. The EJB lookup string is not a name of a context.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.