[JBoss Seam] - Re: Manager.switchConversation via Ajax4JSF actionListener d
by objectbay
Forget the previous post, didn't work either.
However, I found out that the cases in which the ce.lock() call fails is when the thread trying the ce.lock() is not the ConversationEntry's lock owner. I guess that's exactly the point of this whole locking story, but I don't understand why there are two threads in play here.
For example, the Debug View shows that the active thread is:
Daemon Thread [http-0.0.0.0-8080-2] (Suspended (breakpoint at line 802 in org.jboss.seam.core.Manager)),
while the Variables view shows that ce.lock.sync.owner is Thread[http-0.0.0.0-8080-3,5,jboss]
Wouldn't that mean that my browser was using two threads to (concurrently) access my web application (forcing Tomcat to accept the second client thread's request on another server thread) and that the second thread tried to ce.lock() a conversation entry that was not yet unlocked by the first thread?
Karl
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120469#4120469
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120469
18 years, 5 months
[Security & JAAS/JBoss] - java.lang.SecurityException: Insufficient method permissions
by carcophan
Hi,
I checked the FAQ but couldn't find anything to solve my problem.
I am using JBoss 4.0.3 with Java 1.5_06 and am developing a web-application frontend with struts for a fully implemented EJB application layer running on JBOSS. I have a lot of experience writing stand-alone Tomcat applications but virtually no experience with EJBs and JBoss.
Anyway heres the problem:
I implemented an HttpSessionListener that does certain final cleaning-up jobs just before the http-session is about to expire/invalidate. When the user logs off by clicking the logoff button in the frontend, session.invalidate() is called, the public void sessionDestroyed(HttpSessionEvent event) method in my SessionListener class is executed as expected and everything is fine. In the "sessionDestroyed" method I access a cleanup(int id) method that I call from the remoteInterface provided by the application-layer.
However if the user doesn't actively log off but waits for his http-session to expire by timeout, I get the following exception when the sessionDestroyed() method in the SessionListener class tries to do its work:
java.lang.SecurityException: Insufficient method permissions, principal=null, ejbName=AppLayerEJB, method=cleanup, interface=REMOTE, requiredRoles=[superuser, basicuser], principalRoles=[]
| at org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityAssociation(SecurityInterceptor.java:258)
| at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:143)
| at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
| at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
| at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
| at org.jboss.ejb.Container.invoke(Container.java:873)
| at sun.reflect.GeneratedMethodAccessor98.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
| at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
| at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
| at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
| at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
| at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
| at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
| at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
| at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
What really puzzles me is that this only works from the SessionListener when the user logs-off normally but not at session-timeout. The application layer seems to "forget" the user even though the HttpSession is still existent and the id passed to cleanup(int id) can be accessed and is existent.
please help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120464#4120464
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120464
18 years, 5 months
[JBossWS] - Re: EntityManager injection in Webservice
by froden
I have a similar problem.
The interface for the EJB:
package services;
|
| import javax.ejb.Local;
|
| @Local
| public interface TestServiceInterface {
| public String getString();
| }
The EJB itself:
package services;
|
| import javax.ejb.Stateless;
| import javax.jws.WebMethod;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
|
| @Stateless
| @WebService
| @SOAPBinding(style=SOAPBinding.Style.RPC)
| public class TestService implements TestServiceInterface {
|
| @PersistenceContext
| private EntityManager em;
|
| @WebMethod
| public String getString() {
| System.out.println("em: " + em);
| return "Quite frankly, it gives me the heebie jeebies.";
| }
| }
The web service is defined in my web.xml like this:
<servlet>
| <servlet-name>TestService</servlet-name>
| <servlet-class>services.TestService</servlet-class>
| </servlet>
| <servlet-mapping>
| <servlet-name>TestService</servlet-name>
| <url-pattern>/TestService.ws</url-pattern>
| </servlet-mapping>
| </servlet>
The web service works like it should, but the EntityManager is not injected. System.out.println("em: " + em); in the webmethod always prints a null.
Any clues?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120463#4120463
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120463
18 years, 5 months