[JBoss Cache: Core Edition] - Re: Should be able to use ClusteredCacheLoader with CacheMod
by manik.surtani@jboss.com
Well, basically the reason you have a cache loader is so that you have a place to store state that would otherwise be in memory. As such, state in the cache loader would always be state that is relevant to the node in question. E.g., if you were using a file-based cache loader, any state on node A would be in CL-A.
Now with a CCL this still makes sense if you are using replication, since any state on A is replicated to B and C. So when you look up the cache loader on A for this state, it is accurate to what was originally in A.
Now if the cluster is not replicated, nodes A, B and C would have different state, potentially using the same Fqns. And using a CCL here could result in meaningless state retrieval.
E.g.,
| cacheA.put("/a/b/c", "key", "ValueA"); // does not replicate
| cacheB.put("/a/b/c", "key", "ValueB"); // does not replicate
|
| // cache A evicts /a/b/c
|
| // am expecting ValueA if I was using a file cache loader
| // but a CCL will get me ValueB!
| cacheA.get("/a/b/c", "key");
|
HTH!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147476#4147476
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147476
17 years, 11 months
[JBoss Portal] - problem while implementing portal identity API with a jndi l
by loucs
hello,
I will try to expose my situation in details :
I'm working on a project using jboss-portal.
i've got an ear archive deployed which contains portlets for jboss portal, and a lot of entity beans mapped with JPA.
I'm trying to reimplement portal Identity API (HibernateUserModule, HibernateUserProfileModule, etc...) to map users and roles in my custom database. So i've done a jar file containing my implementation of this modules. this jar isn't in my main ear package where entity beans are, but is deployed in the lib dir of jboss-portal.sar.
So the thing i'm trying to do is :
- from my implementation of HibernateUserModule (in the jar contained in lib dir of portal), i'm trying to access an ejb session from my ear package via jndi lookup. ((NameOfEJBLocalInterface) new InitialContext().lookup('/myproj-ear/NameOfEJB/local') ). my implementation is only extending the original HibernateUserModule for testing purpose. I have just overrided a fonction where i do the jndi lookup.(findUserByUserName). I've modified correctly the identity-config file of portal for it to use my implementation.
- I verified in the jboss jmx console that my ejb session is correctly mapped in the jndi context, and it is in the global jndi namespace under myproj-ear/NameOfEJB/local.
additional infos :
JBoss version : 4.2.0 GA
Portal version : 2.6.4 GA
EJB3
now here comes my problem: :)
i got this exception at the execution of the lookup :
java.lang.IllegalStateException: Wrong tx on thread: expected TransactionImple < ac, BasicAction: -3f57fe93:cf77:4816ea73:38b status: ActionStatus.ABORT_ONLY >, actual TransactionImple < ac, BasicAction: -3f57fe93:cf77:4816ea73:395 status: ActionStatus.RUNNING >
at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:162)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
at org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:262)
at org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
at org.jboss.portal.core.aspects.server.TransactionInterceptor.invoke(TransactionInterceptor.java)
at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
at org.jboss.portal.server.aspects.LockInterceptor$InternalLock.invoke(LockInterceptor.java:69)
at org.jboss.portal.server.aspects.LockInterceptor.invoke(LockInterceptor.java:130)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
at org.jboss.portal.server.servlet.PortalServlet.service(PortalServlet.java:250)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
i tested that with different semantics with intentional mistakes in the jndiName, and i got "namingException : myMistakeName not bound".
so i figure it means i'm doing the lookup in the good way, but it seems to be a problem of transaction management (ie: the exception).
The bean extending HibernateUserModule in my jar is a POJO, so i think i'll have to deal with transaction management myself. (but i don't really know about this subject). I will continue my investigations but any clues would be really appreciable :)
Regards,
--
Lucas
Montes
ps: if you need some other information on the project i'll answer with pleasure :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147475#4147475
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147475
17 years, 11 months
[JNDI/Naming/Network] - transaction exception while jndi lookup
by loucs
hello,
I will try to expose my situation in details :
I'm working on a project using jboss-portal.
i've got an ear archive deployed which contains portlets for jboss portal, and a lot of entity beans mapped with JPA.
I'm trying to reimplement portal Identity API (HibernateUserModule, HibernateUserProfileModule, etc...) to map users and roles in my custom database. So i've done a jar file containing my implementation of this modules. this jar isn't in my main ear package where entity beans are, but is deployed in the lib dir of jboss-portal.sar.
So the thing i'm trying to do is :
- from my implementation of HibernateUserModule (in the jar contained in lib dir of portal), i'm trying to access an ejb session from my ear package via jndi lookup. ((NameOfEJBLocalInterface) new InitialContext().lookup('/myproj-ear/NameOfEJB/local') ). my implementation is only extending the original HibernateUserModule for testing purpose. I have just overrided a fonction where i do the jndi lookup.(findUserByUserName). I've modified correctly the identity-config file of portal for it to use my implementation.
- I verified in the jboss jmx console that my ejb session is correctly mapped in the jndi context, and it is in the global jndi namespace under myproj-ear/NameOfEJB/local.
additional infos :
JBoss version : 4.2.0 GA
Portal version : 2.6.4 GA
EJB3
now here comes my problem: :)
i got this exception at the execution of the lookup :
java.lang.IllegalStateException: Wrong tx on thread: expected TransactionImple < ac, BasicAction: -3f57fe93:cf77:4816ea73:38b status: ActionStatus.ABORT_ONLY >, actual TransactionImple < ac, BasicAction: -3f57fe93:cf77:4816ea73:395 status: ActionStatus.RUNNING >
at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:162)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
at org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:262)
at org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
at org.jboss.portal.core.aspects.server.TransactionInterceptor.invoke(TransactionInterceptor.java)
at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
at org.jboss.portal.server.aspects.LockInterceptor$InternalLock.invoke(LockInterceptor.java:69)
at org.jboss.portal.server.aspects.LockInterceptor.invoke(LockInterceptor.java:130)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
at org.jboss.portal.server.servlet.PortalServlet.service(PortalServlet.java:250)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
i tested that with different semantics with intentional mistakes in the jndiName, and i got "namingException : myMistakeName not bound".
so i figure it means i'm doing the lookup in the good way, but it seems to be a problem of transaction management (ie: the exception).
The bean extending HibernateUserModule in my jar is a POJO, so i think i'll have to deal with transaction management myself. (but i don't really know about this subject). I will continue my investigations but any clues would be really appreciable :)
Regards,
--
Lucas
Montes
ps: if you need some other information on the project i'll answer with pleasure :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147474#4147474
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147474
17 years, 11 months
[JBoss jBPM] - jBPM-3.2.2 JBOSS-4.2.2.GA Clustering environment issue
by anudeep20
Hi,
I am trying to setup the Clustering environment for the jBPM (jbpm-console.war).
I have two nodes in the cluster. But when load balancer contacts the first node, an error is coming while browsing through the web application:
It seems the NodeHashMap in the gravel-14.jar is not Serializable. And it clearly seen from the error that the value for this variable is put in the session.
I would appreciate if some pointer could be given to resolve this error.
Regards,
Deepak
Also my jboss-web.xml contains the following:
<replication-config>
<replication-trigger>SET_AND_GET</replication-trigger>
<replication-granularity>SESSION</replication-granularity>
<replication-field-batch-mode>true</replication-field-batch-mode>
</replication-config>
Error is following:
14:55:41,721 ERROR [JBossCacheService] externalizeSession(): exception occurred externalizing session SessionBasedCluste
redSession[id: YJPescoYO7Lrn7wFFaKnng**.node2 lastAccessedTime: 1209461140289 version: 3 lastOutdated: 0]
java.io.NotSerializableException: org.jboss.gravel.common.util.NodeHashMap
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
at java.util.HashMap.writeObject(HashMap.java:985)
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 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
at java.util.HashMap.writeObject(HashMap.java:985)
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 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
at java.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.java:1380)
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 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
at org.jboss.web.tomcat.service.session.SessionBasedClusteredSession.writeExternal(SessionBasedClusteredSession.
java:175)
at org.jboss.web.tomcat.service.session.JBossCacheService.externalizeSession(JBossCacheService.java:1027)
at org.jboss.web.tomcat.service.session.JBossCacheService.putSession(JBossCacheService.java:316)
at org.jboss.web.tomcat.service.session.JBossCacheClusteredSession.processSessionRepl(JBossCacheClusteredSession
.java:121)
at org.jboss.web.tomcat.service.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:1097)
at org.jboss.web.tomcat.service.session.JBossCacheManager.storeSession(JBossCacheManager.java:652)
at org.jboss.web.tomcat.service.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:49)
at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:98)
at org.jboss.web.tomcat.service.session.JvmRouteValve.invoke(JvmRouteValve.java:84)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
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:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
14:55:47,248 ERROR [JBossCacheService] externalizeSession(): exception occurred externalizing session SessionBasedCluste
redSession[id: YJPescoYO7Lrn7wFFaKnng**.node2 lastAccessedTime: 1209461141971 version: 4 lastOutdated: 0]
java.io.NotSerializableException: org.jboss.gravel.common.util.NodeHashMap
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
at java.util.HashMap.writeObject(HashMap.java:985)
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 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
at java.util.HashMap.writeObject(HashMap.java:985)
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 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
at java.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.java:1380)
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 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
at org.jboss.web.tomcat.service.session.SessionBasedClusteredSession.writeExternal(SessionBasedClusteredSession.
java:175)
at org.jboss.web.tomcat.service.session.JBossCacheService.externalizeSession(JBossCacheService.java:1027)
at org.jboss.web.tomcat.service.session.JBossCacheService.putSession(JBossCacheService.java:316)
at org.jboss.web.tomcat.service.session.JBossCacheClusteredSession.processSessionRepl(JBossCacheClusteredSession
.java:121)
at org.jboss.web.tomcat.service.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:1097)
at org.jboss.web.tomcat.service.session.JBossCacheManager.storeSession(JBossCacheManager.java:652)
at org.jboss.web.tomcat.service.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:49)
at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:98)
at org.jboss.web.tomcat.service.session.JvmRouteValve.invoke(JvmRouteValve.java:84)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
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:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147470#4147470
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147470
17 years, 11 months