[JNDI/Naming/Network] - getInitialContext with Stateful session bean throws exceptio
by JoeArmstrong
I am running JBoss 4.0.4.GA using Java 1.6 and am getting the following exception:
Exception in thread "main" java.lang.RuntimeException: javax.naming.NamingException: Could not dereference object [Root exception is java.lang.reflect.UndeclaredThrowableException]
at com.titan.clients.TravelAgentShell.getAgent(TravelAgentShell.java:35)
at com.titan.clients.TravelAgentShell.cabin(TravelAgentShell.java:163)
at com.titan.clients.TravelAgentShell.processCommand(TravelAgentShell.ja
va:94)
at com.titan.clients.TravelAgentShell.shell(TravelAgentShell.java:70)
at com.titan.clients.TravelAgentShell.main(TravelAgentShell.java:22)
Caused by: javax.naming.NamingException: Could not dereference object [Root exception is java.lang.reflect.UndeclaredThrowableException]
at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingC
ontext.java:1150)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:705)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.titan.clients.TravelAgentShell.getAgent(TravelAgentShell.java:33)
... 4 more
Caused by: java.lang.reflect.UndeclaredThrowableException
at $Proxy1.createProxy(Unknown Source)
at org.jboss.ejb3.JndiProxyFactory.getObjectInstance(JndiProxyFactory.java:52)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:3
04)
at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java
:1125)
at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingC
ontext.java:1142)
... 8 more
Caused by: java.lang.ClassNotFoundException: [Lorg.jboss.aop.advice.Interceptor;
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
[rest of stack deleted for brevity]
The client code segment I have is:
private TravelAgentRemote getAgent()
{
try
{
agent = (TravelAgentRemote)getInitialContext().lookup("TravelAgentRemote");
}
catch (Exception ex){ throw new RuntimeException(ex);}
return agent;
}
and the session bean definition is:
@Stateful
@RemoteBinding(jndiBinding="TravelAgentRemote")
public class TravelAgentBean implements TravelAgentRemote {...}
If I change the session bean to be Stateless the client code works fine - what is different in JNDI naming for Stateless vs. Stateful session beans ?
Also, it has been reported to me (although not verified) that this code works fine with Java 1.5.
If you want to see the whole set of source, it is the source from Chpt. 11.4 from the O'reilly book "Enterprise Java Beans 3.0" by Burke & Monson-Haefel (ISBN-13: 978-0-596-00978-6).
Any insights would be appreciated.
Thanks.
Joe
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4109094#4109094
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4109094
18 years, 4 months
[JBoss Portal] - Page security not working in 2.6.2GA?
by nollie
Hello
I'm working with jboss-portal-2.6.2.GA-bundled on Windows. I have unzipped and started the server. I haven't changed a single config file.
When I try to apply page level security constraints through the Admin portlet, I don't see any difference in behavior. I have restricted the weather page to only allow Admin users to view, viewrecursive, personalize, and personalizerecursive, yet when I try to view that portlet as a user who has not logged in, I can still see the page and the portlet.
When I apply the same settings to the portlet instance, I immediately see the results I am expecting: the page opens but the weather portlet is absent.
Is this a bug or am I doing it wrong? I've been through the manual and the reference but I don't see my mistake. I really want to be able to restrict access to a page and send people to the default homepage when they try to access that page.
Nollie
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4109093#4109093
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4109093
18 years, 4 months