[EJB 3.0] - NullPointerException in SecurityContext.setRoles
by jefec
I'm using Embedded EJB3 and when I use in Stateless bean annotation @RolesAllowed({"someRole"}), then null pointer is thrown.
What is wrong?
Thanks.
Trace:
java.lang.NullPointerException
at org.jboss.security.SecurityContext.setRoles(SecurityContext.java:95)
at org.jboss.security.plugins.JBossAuthorizationManager.getCurrentRoles(JBossAuthorizationManager.java:583)
at org.jboss.security.plugins.JBossAuthorizationManager.doesUserHaveRole(JBossAuthorizationManager.java:241)
at org.jboss.security.plugins.JaasSecurityManager.doesUserHaveRole(JaasSecurityManager.java:384)
at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:143)
at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:108)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:211)
at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
at $Proxy18.save(Unknown Source)
at test.ejb.PersonDaoTest.testSave(PersonDaoTest.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:228)
at junit.framework.TestSuite.run(TestSuite.java:223)
at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047538#4047538
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047538
18 years, 11 months
[JBoss jBPM] - new instance
by ricardomarques
Someone see anything that could be wrong?
Process:
|
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition
| xmlns="urn:jbpm.org:jpdl-3.2"
| name="simple">
| <start-state name="start">
| <transition name="to_state" to="first">
| <action name="action" class="com.sample.action.MessageActionHandler">
| <message>Going to the first state!</message>
| </action>
|
|
| </transition>
| </start-state>
| <state name="first">
| <transition name="to_end" to="end">
| <action name="action" class="com.sample.action.MessageActionHandler">
| <message>About to finish!</message>
| </action>
| </transition>
| </state>
| <end-state name="end"></end-state>
| </process-definition>
|
|
Instanciation code:
|
| JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
| try {
|
| ProcessInstance processInstance = null;
| ProcessDefinition processDefinition = jbpmContext.getGraphSession().getProcessDefinition(15);
|
| processInstance = (ProcessInstance)processDefinition.createInstance();
| processInstance.signal();
|
| jbpmContext.save(processInstance);
|
| }
| catch (Exception e) {
| e.printStackTrace();
| }
| finally {
| jbpmContext.close();
| }
|
|
Exception:
|
| 12:07:30,093 ERROR [STDERR] org.jbpm.JbpmException: token 'Token(/)' can't be signalled cause it is currently not positioned in a node
| 12:07:30,093 ERROR [STDERR] at org.jbpm.graph.exe.Token.signal(Token.java:134)
| 12:07:30,093 ERROR [STDERR] at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:251)
| 12:07:30,093 ERROR [STDERR] at pep.workflow.console.servlets.UploadServlet.processRequest(UploadServlet.java:47)
| 12:07:30,093 ERROR [STDERR] at pep.workflow.console.servlets.UploadServlet.doGet(UploadServlet.java:80)
| 12:07:30,203 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
| 12:07:30,203 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| 12:07:30,203 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| 12:07:30,203 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| 12:07:30,203 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| 12:07:30,203 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| 12:07:30,203 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| 12:07:30,203 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| 12:07:30,203 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| 12:07:30,203 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| 12:07:30,203 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| 12:07:30,203 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| 12:07:30,203 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| 12:07:30,203 ERROR [STDERR] at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| 12:07:30,203 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| 12:07:30,203 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| 12:07:30,203 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| 12:07:30,203 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| 12:07:30,203 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| 12:07:30,203 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| 12:07:30,203 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
|
|
Help!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047536#4047536
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047536
18 years, 11 months