[JBoss Cache: Core Edition] - is it possible for MVCCInvocationContext to have null mvccTC
by dukehoops
I have a JBC 3 cache instance configured to use a JTA transactionManager. Assuming that I have configured the cache instance properly, is it possible for a MVCCInvocationContext NOT to have reference to MVCCTransactionContext while thread of execution is inside MVCCInvocationContext.lookUpNode(fqn)?
Specifically, a thread is inside MVCCInvocationContext.lookUpNode(fqn) and mvccTx is (sometimes) null. See sample call stack below.
If this is NOT a valid state, does that mean that JBC isn't "seeing" my JTA txManager - ie I have a config problem?
If it is a valid state, please explain why so.
Here's a call stack:
anonymous wrote :
| org.jboss.cache.invocation.MVCCInvocationContext.lookUpNode(MVCCInvocationContext.java:64)
| org.jboss.cache.commands.write.PutKeyValueCommand.perform(PutKeyValueCommand.java:78)
| org.jboss.cache.interceptors.CallInterceptor.invokeCommand(CallInterceptor.java:108)
| org.jboss.cache.interceptors.CallInterceptor.handleAlterCacheMethod(CallInterceptor.java:173)
| org.jboss.cache.interceptors.CallInterceptor.visitPutForExternalReadCommand(CallInterceptor.java:137)
| org.jboss.cache.commands.write.PutForExternalReadCommand.acceptVisitor(PutForExternalReadCommand.java:72)
| org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
| org.jboss.cache.interceptors.MVCCLockingInterceptor.handlePutForExternalReadCommand(MVCCLockingInterceptor.java:110)
| org.jboss.cache.interceptors.base.PrePostProcessingCommandInterceptor.visitPutForExternalReadCommand(PrePostProcessingCommandInterceptor.java:101)
| org.jboss.cache.commands.write.PutForExternalReadCommand.acceptVisitor(PutForExternalReadCommand.java:72)
| org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
| org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:131)
| org.jboss.cache.commands.AbstractVisitor.visitPutForExternalReadCommand(AbstractVisitor.java:70)
| org.jboss.cache.commands.write.PutForExternalReadCommand.acceptVisitor(PutForExternalReadCommand.java:72)
| org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
| org.jboss.cache.interceptors.TxInterceptor.attachGtxAndPassUpChain(TxInterceptor.java:261)
| org.jboss.cache.interceptors.TxInterceptor.handleDefault(TxInterceptor.java:250)
| org.jboss.cache.commands.AbstractVisitor.visitPutForExternalReadCommand(AbstractVisitor.java:70)
| org.jboss.cache.commands.write.PutForExternalReadCommand.acceptVisitor(PutForExternalReadCommand.java:72)
| org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
| org.jboss.cache.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:108)
| org.jboss.cache.interceptors.CacheMgmtInterceptor.visitPutForExternalReadCommand(CacheMgmtInterceptor.java:102)
| org.jboss.cache.commands.write.PutForExternalReadCommand.acceptVisitor(PutForExternalReadCommand.java:72)
| org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
| org.jboss.cache.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:178)
| org.jboss.cache.interceptors.InvocationContextInterceptor.visitPutForExternalReadCommand(InvocationContextInterceptor.java:76)
| org.jboss.cache.commands.write.PutForExternalReadCommand.acceptVisitor(PutForExternalReadCommand.java:72)
| org.jboss.cache.interceptors.InterceptorChain.invoke(InterceptorChain.java:287)
| org.jboss.cache.invocation.CacheInvocationDelegate.putForExternalRead(CacheInvocationDelegate.java:459)
| org.hibernate.cache.jbc2.util.CacheHelper.putForExternalRead(CacheHelper.java:295)
| org.hibernate.cache.jbc2.util.CacheHelper.putForExternalRead(CacheHelper.java:268)
| org.hibernate.cache.jbc2.access.TransactionalAccessDelegate.putFromLoad(TransactionalAccessDelegate.java:80)
| org.hibernate.cache.jbc2.collection.TransactionalAccess.putFromLoad(TransactionalAccess.java:98)
| org.hibernate.engine.loading.CollectionLoadContext.addCollectionToCache(CollectionLoadContext.java:333)
| org.hibernate.engine.loading.CollectionLoadContext.endLoadingCollection(CollectionLoadContext.java:279)
| org.hibernate.engine.loading.CollectionLoadContext.endLoadingCollections(CollectionLoadContext.java:245)
| org.hibernate.engine.loading.CollectionLoadContext.endLoadingCollections(CollectionLoadContext.java:218)
| org.hibernate.loader.Loader.endCollectionLoad(Loader.java:900)
| org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:888)
| org.hibernate.loader.Loader.doQuery(Loader.java:752)
| org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
| org.hibernate.loader.Loader.loadCollection(Loader.java:2015)
| org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:59)
| org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:587)
| org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)
| org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1743)
| org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:366)
| org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108)
| org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:131)
| org.hibernate.collection.PersistentSet.isEmpty(PersistentSet.java:169)
| com.doppelganger.domain.User.getCurrentUserSession(User.java:306)
| com.doppelganger.framework.cache.LocalCacheTest$1.doInTransactionWithException(LocalCacheTest.java:62)
| com.doppelganger.test.service.impl.DgTxAnnotationDependingTemplate.executeWithException(DgTxAnnotationDependingTemplate.java:22)
| sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java)
| sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| java.lang.reflect.Method.invoke(Method.java:597)
| org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
| org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
| org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
| org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
| org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
| org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)
| com.doppelganger.service.tx.TxRetryAspect.doRetryIfNeeded(TxRetryAspect.java:114)
| com.doppelganger.service.tx.TxRetryAspect.retryIfNeededForTxAnnotation(TxRetryAspect.java:90)
| sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java)
| sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| java.lang.reflect.Method.invoke(Method.java:597)
| org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
| org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
| org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:64)
| org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:160)
| org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
| org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
| org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
| $Proxy182.executeWithException
| com.doppelganger.framework.cache.LocalCacheTest.testPutForExternalPutRemoveInTx1_readInTx2(LocalCacheTest.java:56)
| sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java)
| sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| java.lang.reflect.Method.invoke(Method.java:597)
| junit.framework.TestCase.runTest(TestCase.java:168)
| junit.framework.TestCase.runBare(TestCase.java:134)
| org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76)
| junit.framework.TestResult$1.protect(TestResult.java:110)
|
thanks
-nikita
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215969#4215969
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215969
15 years, 10 months
[Security & JAAS/JBoss] - Re: SecurityAssociationCallback returns NULL-Principal in 5.
by Arakasi69
Ok, i've tried it with new jboss 5.0.1.GA with same result above.
Please look at the TRACE-log. Normaly there shoud be not the unauthenticated principal, but the principal how tries to login is not in the SecurityAssociation.
On client side all looks ok, i've debugged from my custom login module to the jboss client login modul, and it has a valid principal.
By the way i'can't find any resource which describe to 'use security context approach'.
Anils blog http://anil-identity.blogspot.com/2008/12/as5-pluggable-access-control-ej... says that i've nothing to change to run the normal authorization stack.
Anybody, how can help me out ?
00:37:36,310 WARN [SecurityAssociation] You are using deprecated api to getPrincipal. Use security context based approach
| 00:37:36,311 WARN [SecurityAssociation] You are using deprecated api to getCredential. Use security context based approach
| 00:37:36,391 TRACE [SecurityRolesAssociation] Setting threadlocal:null
| 00:37:36,396 TRACE [SecurityRolesAssociation] Setting threadlocal:null
| 00:37:44,413 TRACE [SecurityRolesAssociation] Setting threadlocal:{}
| 00:37:44,430 TRACE [lisa] Begin isValid, principal:null, cache info: org.jboss.security.plugins.auth.JaasSecurityManagerBase$DomainInfo@b6023d[Subject(32542938).principals=org.jboss.security.SimplePrincipal@10428909(LisaUnauthenticated)org.jboss.security.SimpleGroup(a)18997348(LisaUser(members)),credential.class=null,expirationTime=1236470796304]
| 00:37:44,431 TRACE [lisa] Begin validateCache, info=org.jboss.security.plugins.auth.JaasSecurityManagerBase$DomainInfo@b6023d[Subject(32542938).principals=org.jboss.security.SimplePrincipal@10428909(LisaUnauthenticated)org.jboss.security.SimpleGroup(a)18997348(LisaUser(members)),credential.class=null,expirationTime=1236470796304];credential.class=null
| 00:37:44,431 TRACE [lisa] End validateCache, isValid=true
| 00:37:44,431 TRACE [lisa] End isValid, true
| 00:37:44,432 TRACE [LogAuditProvider] [Success]Source=org.jboss.security.javaee.EJBAuthenticationHelper;principal=null;method=create;
| 00:37:44,432 TRACE [SecurityRolesAssociation] Setting threadlocal:{}
| 00:37:44,433 TRACE [JBossAuthorizationContext] Control flag for entry:org.jboss.security.authorization.config.AuthorizationModuleEntry{org.jboss.security.authorization.modules.DelegatingAuthorizationModule:{}REQUIRED}is:[REQUIRED]
| 00:37:44,434 TRACE [EJBPolicyModuleDelegate] method=public abstract de.ebcot.bsctool.ejb.ManagerRemote de.ebcot.bsctool.ejb.ManagerRemoteHome.create(java.lang.String,int,java.lang.Integer) throws javax.ejb.CreateException,javax.security.auth.login.LoginException,java.rmi.RemoteException,de.ebcot.tools.util.LoginTwiceException, interface=Home, requiredRoles=Roles(LisaUser,)
| 00:37:44,434 TRACE [EJBPolicyModuleDelegate] Exception:Insufficient method permissions, principal=admin, ejbName=Manager, method=create, interface=Home, requiredRoles=Roles(LisaUser,), principalRoles=Roles()
| 00:37:44,435 TRACE [JBossAuthorizationContext] REQUIRED failed for Name=org.jboss.security.authorization.modules.DelegatingAuthorizationModule:subject=Betreff:
| Principal: LisaUnauthenticated
| Principal: LisaUser(members)
| :role=Roles()
| 00:37:44,436 TRACE [JBossAuthorizationContext] Error in authorize:
| org.jboss.security.authorization.AuthorizationException: Authorization Failed:
| at org.jboss.security.plugins.authorization.JBossAuthorizationContext.invokeAuthorize(JBossAuthorizationContext.java:263)
| at org.jboss.security.plugins.authorization.JBossAuthorizationContext.access$000(JBossAuthorizationContext.java:67)
| at org.jboss.security.plugins.authorization.JBossAuthorizationContext$1.run(JBossAuthorizationContext.java:152)
| at java.security.AccessController.doPrivileged(Native Method)
| at org.jboss.security.plugins.authorization.JBossAuthorizationContext.authorize(JBossAuthorizationContext.java:148)
| at org.jboss.security.plugins.JBossAuthorizationManager.internalAuthorization(JBossAuthorizationManager.java:474)
| at org.jboss.security.plugins.JBossAuthorizationManager.authorize(JBossAuthorizationManager.java:124)
| at org.jboss.security.plugins.javaee.EJBAuthorizationHelper.authorize(EJBAuthorizationHelper.java:116)
| at org.jboss.ejb.plugins.SecurityActions$14.run(SecurityActions.java:557)
| at org.jboss.ejb.plugins.SecurityActions$14.run(SecurityActions.java:555)
| at java.security.AccessController.doPrivileged(Native Method)
| at org.jboss.ejb.plugins.SecurityActions.authorize(SecurityActions.java:553)
| at org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityContext(SecurityInterceptor.java:361)
| at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:243)
| at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:205)
| at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:187)
| at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invokeHome(StatefulSessionInstanceInterceptor.java:148)
| at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:56)
| at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:125)
| at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
| at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:161)
| at org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(PreSecurityInterceptor.java:136)
| at org.jboss.ejb.plugins.security.PreSecurityInterceptor.invokeHome(PreSecurityInterceptor.java:88)
| at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:132)
| at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107)
| at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:639)
| at org.jboss.ejb.Container.invoke(Container.java:1046)
| 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:597)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
| at org.jboss.invocation.http.server.HttpInvoker.invoke(HttpInvoker.java:154)
| 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:597)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
| at org.jboss.invocation.http.servlet.InvokerServlet.processRequest(InvokerServlet.java:162)
| at org.jboss.invocation.http.servlet.InvokerServlet.doPost(InvokerServlet.java:224)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
| at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
| at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:619)
| 00:37:44,441 TRACE [EJBAuthorizationHelper] Error in authorization:
| org.jboss.security.authorization.AuthorizationException: Authorization Failed:
| at org.jboss.security.plugins.authorization.JBossAuthorizationContext.invokeAuthorize(JBossAuthorizationContext.java:263)
| at org.jboss.security.plugins.authorization.JBossAuthorizationContext.access$000(JBossAuthorizationContext.java:67)
| at org.jboss.security.plugins.authorization.JBossAuthorizationContext$1.run(JBossAuthorizationContext.java:152)
| at java.security.AccessController.doPrivileged(Native Method)
| at org.jboss.security.plugins.authorization.JBossAuthorizationContext.authorize(JBossAuthorizationContext.java:148)
| at org.jboss.security.plugins.JBossAuthorizationManager.internalAuthorization(JBossAuthorizationManager.java:474)
| at org.jboss.security.plugins.JBossAuthorizationManager.authorize(JBossAuthorizationManager.java:124)
| at org.jboss.security.plugins.javaee.EJBAuthorizationHelper.authorize(EJBAuthorizationHelper.java:116)
| at org.jboss.ejb.plugins.SecurityActions$14.run(SecurityActions.java:557)
| at org.jboss.ejb.plugins.SecurityActions$14.run(SecurityActions.java:555)
| at java.security.AccessController.doPrivileged(Native Method)
| at org.jboss.ejb.plugins.SecurityActions.authorize(SecurityActions.java:553)
| at org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityContext(SecurityInterceptor.java:361)
| at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:243)
| at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:205)
| at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:187)
| at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invokeHome(StatefulSessionInstanceInterceptor.java:148)
| at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:56)
| at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:125)
| at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
| at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:161)
| at org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(PreSecurityInterceptor.java:136)
| at org.jboss.ejb.plugins.security.PreSecurityInterceptor.invokeHome(PreSecurityInterceptor.java:88)
| at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:132)
| at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107)
| at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:639)
| at org.jboss.ejb.Container.invoke(Container.java:1046)
| 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:597)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
| at org.jboss.invocation.http.server.HttpInvoker.invoke(HttpInvoker.java:154)
| 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:597)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
| at org.jboss.invocation.http.servlet.InvokerServlet.processRequest(InvokerServlet.java:162)
| at org.jboss.invocation.http.servlet.InvokerServlet.doPost(InvokerServlet.java:224)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
| at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
| at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:619)
| 00:37:44,448 TRACE [LogAuditProvider] [Error]Source=org.jboss.security.plugins.javaee.EJBAuthorizationHelper;Exception:=Authorization Failed: ;Resource:=[org.jboss.security.authorization.resources.EJBResource:contextMap={policyRegistration=org.jboss.security.plugins.JBossPolicyRegistration@1dc3dfb}:method=public abstract de.ebcot.bsctool.ejb.ManagerRemote de.ebcot.bsctool.ejb.ManagerRemoteHome.create(java.lang.String,int,java.lang.Integer) throws javax.ejb.CreateException,javax.security.auth.login.LoginException,java.rmi.RemoteException,de.ebcot.tools.util.LoginTwiceException:ejbMethodInterface=Home:ejbName=Manager:ejbPrincipal=admin:MethodRoles=Roles(LisaUser,):securityRoleReferences=null:callerSubject=Betreff:
| Principal: LisaUnauthenticated
| Principal: LisaUser(members)
| :callerRunAs=null:callerRunAs=null:ejbRestrictionEnforcement=false:ejbVersion=null];policyRegistration=org.jboss.security.plugins.JBossPolicyRegistration@1dc3dfb;
| 00:37:44,449 ERROR [SecurityInterceptor] Error in Security Interceptor
| java.lang.SecurityException: Denied: caller with subject=Betreff:
| Principal: LisaUnauthenticated
| Principal: LisaUser(members)
| and security context post-mapping roles=null: ejbMethod=public abstract de.ebcot.bsctool.ejb.ManagerRemote de.ebcot.bsctool.ejb.ManagerRemoteHome.create(java.lang.String,int,java.lang.Integer) throws javax.ejb.CreateException,javax.security.auth.login.LoginException,java.rmi.RemoteException,de.ebcot.tools.util.LoginTwiceException
| at org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityContext(SecurityInterceptor.java:368)
| at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:243)
| at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:205)
| at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:187)
| at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invokeHome(StatefulSessionInstanceInterceptor.java:148)
| at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:56)
| at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:125)
| at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
| at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:161)
| at org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(PreSecurityInterceptor.java:136)
| at org.jboss.ejb.plugins.security.PreSecurityInterceptor.invokeHome(PreSecurityInterceptor.java:88)
| at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:132)
| at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107)
| at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:639)
| at org.jboss.ejb.Container.invoke(Container.java:1046)
| 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:597)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
| at org.jboss.invocation.http.server.HttpInvoker.invoke(HttpInvoker.java:154)
| 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:597)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
| at org.jboss.invocation.http.servlet.InvokerServlet.processRequest(InvokerServlet.java:162)
| at org.jboss.invocation.http.servlet.InvokerServlet.doPost(InvokerServlet.java:224)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
| at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
| at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:619)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215967#4215967
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215967
15 years, 10 months
[Tomcat, HTTPD, Servlets & JSP] - JSP build problem with JBoss AS 5.0.x
by SkyBeam
Hi all,
I am quite new to web development and run into problems using JBoss AS 5.0.x.
It seems that JBoss Web is not building the servlet class correctly when generating servlets from JSP. According to the specification it is allowed to put page directives at any location within a JSP (or its statically included files). Unfortunately it looks like JBoss 5 is not adding these includes to the header of the generated _jsp.java and therefore is unable to compile it.
A simple example:
WebContent/index.jsp:
<h1>Hello World</h1>
WebContent/WEB-INF/includes/header.jspf
<%@ page import='java.util.Vector'%>
|
| <html>
| <head>
| <title>Test</title>
| </head>
| <body>
| <p>
| <%! boolean test=true; %>
| <%
| Vector v = new Vector();
| v.add(new Integer(2));
| %>
| Value: <%= v.get(0).toString() %>
| </p>
WebContent/WEB-INF/includes/footer.jspf
</body>
| </html>
WebContent/WEB-INF/web.xml
<?xml version="1.0" encoding="UTF-8"?>
| <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
| xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
| id="WebApp_ID" version="2.5">
| <display-name>Test</display-name>
|
| <jsp-config>
| <jsp-property-group>
| <display-name>Test</display-name>
| <url-pattern>/index.jsp</url-pattern>
| <include-prelude>/WEB-INF/includes/header.jspf</include-prelude>
| <include-coda>/WEB-INF/includes/footer.jspf</include-coda>
| </jsp-property-group>
| </jsp-config>
| </web-app>
So far so good. Now I run the code (packed to a .war file) on JBoss 5.0.1.GA-jdk6. As soon as I access index.jsp JBoss starts to compile it. Unfortunately it terminates with the following exception:
<?xml version="1.0" encoding="UTF-8"?>
| <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
| xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
| id="WebApp_ID" version="2.5">
| <display-name>Test</display-name>
|
| <jsp-config>
| <jsp-property-group>
| <display-name>Test</display-name>
| <url-pattern>/index.jsp</url-pattern>
| <include-prelude>/WEB-INF/includes/header.jspf</include-prelude>
| <include-coda>/WEB-INF/includes/footer.jspf</include-coda>
| </jsp-property-group>
| </jsp-config>
| </web-app>
So it seems to be unable to locate the "Vector" class which is imported within the header.
Looking at the generated index_jsp.java file reveals the following:
package org.apache.jsp;
|
| import javax.servlet.*;
| import javax.servlet.http.*;
| import javax.servlet.jsp.*;
|
| public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
| implements org.apache.jasper.runtime.JspSourceDependent {
|
| boolean test=true;
| private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
|
| private static java.util.List _jspx_dependants;
|
| static {
| _jspx_dependants = new java.util.ArrayList(2);
| _jspx_dependants.add("/WEB-INF/includes/header.jspf");
| _jspx_dependants.add("/WEB-INF/includes/footer.jspf");
| }
| ...
As you can see the class variable "test" of type boolean has been inserted but not the include.
I did not manage yet to find a work-around to this problem.
I tried JBoss 5.0.0.GA and 5.0.1.GA (both "normal" and "jdk6" editions). The same code runs perfectly on JBoss 4.2.3.
The code also works Tomcat 6.0.18.
As I am new to JBoss development somebody might point me the right direction to solve the problem or confirm that it is a bug.
Work-arounds or tryout versions of JBoss-Web are welcome too.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215959#4215959
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215959
15 years, 10 months