[JBossCache] - JBoss Cache 1.4.1 SP3 | Eviction Policy
by sg283
We are using JBoss Cache 1.4.1 SP3 and getting following warning.
25 Jul 07 09:52:34, WARN org.jboss.cache.TreeCache:setEvictionPolicyProvider:1594 Using deprecated configuration element 'EvictionPolicyProvider'. This is only provided for 1.2.x backward compatibility and may disappear in future releases.
We are using org.jboss.cache.loader.JDBCCacheLoader cache loader and MySql as database. We are using synchronous cache loader write usting false. However, we have noticed that if a cache node is supposed to be eviceted after certain amount of time the node still exist in the db table. It behaves erratically.
Is this happening because we are using the deprecated configuration element 'EvictionPolicyProvider'?
I read that in version 2.0 there are some changes how the eviction policy is defined but not in 1.4.1.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067779#4067779
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4067779
18Â years, 9Â months
[Remoting] - JBOSS RMI OBJECT ACCESSING - IN A CLUSTERED ENVIRONMENT
by yogendra_g
I have configured a jboss cluster with two nodes in it.
My application deployed on it contains a session bean.
An RMI object is registered in the HA-JNDI.
There is one client program that lookup the session bean and executes its methods.
The session bean has following business login in it:
1. When the client sends first request to the bean, it generates a unique token(string) and creates a new instance of a DTO and stores this token(key)-DTO(value) in the remote object which has a hashmap.
The token is returned to the client program.
2. When the client sends second request to the bean along with the earlier token string, the bean lookup the RMI object and retrieve the DTO object from it using this token.
This DTO itself is a remote object and stores anonther such key-value pair of another unique token and another DTO. The inner most DTO is not a remote object.
Thus in the first place when i create the outer DTO object and store it in the RMI object, i am actually storing the stub of it.
My problem is when the first request goes to first server, it stores the DTO stub; but when second request goes to second server and it retrieves the stub of the DTO and invokes the method on it, it throws the Connection refused to host exception with following details.
java.rmi.ConnectException: Connection refused to host: 172.20.72.92; nested exception is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)
at com.rainbow.core.session.SessionHandlerRemoteImpl_Stub.getApplicationSession(Unknown Source)
at com.rainbow.core.session.SessionHandler.getApplicationSession(SessionHandler.java:1104)
at com.rainbow.orchestrator.startup.OrchestratorLookupManager.lookupApplication(OrchestratorLookupManager.java:1115)
at com.rainbow.orchestrator.ejb.OrchestratorBean.validateSessions(OrchestratorBean.java:517)
at com.rainbow.orchestrator.ejb.OrchestratorBean.processRequest(OrchestratorBean.java:178)
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:324)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
at org.jboss.ws.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:64)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:954)
at sun.reflect.GeneratedMethodAccessor112.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.invocation.jrmp.server.JRMPInvokerHA.invoke(JRMPInvokerHA.java:177)
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:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at java.net.Socket.(Socket.java:309)
at java.net.Socket.(Socket.java:124)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
... 46 more
Everything is fine when i have only one node in the cluster.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067778#4067778
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4067778
18Â years, 9Â months
[JBossCache] - JBoss Cache 1.4.1 SP3 | NodeLockingScheme
by sg283
We are using JBoss AS 4.0.3 SP1 and JBoss Cache 1.4.1 SP3 and MySQL Server 50.18. We are using PESSIMISTIC NodeLockingScheme currently.
We are getting various cache exceptions:-
1- DataVersioning
2- Duplicate Key
3- ReadWriteLock
Because of these errors, our production system gets down.
Here is the exception stack trace:-
ReadWriteLock Exception
26 Jul 07 08:05:36, INFO org.jboss.cache.interceptors.TxInterceptor:invoke:161 There was a problem handling this request
java.lang.InterruptedException
at EDU.oswego.cs.dl.util.concurrent.NullSync.attempt(NullSync.java:38)
at org.jboss.cache.lock.IdentityLock.acquireReadLock(IdentityLock.java:248)
at org.jboss.cache.Node.acquireReadLock(Node.java:417)
at org.jboss.cache.Node.acquire(Node.java:384)
at org.jboss.cache.interceptors.PessimisticLockInterceptor.lock(PessimisticLockInterceptor.java:231)
at org.jboss.cache.interceptors.PessimisticLockInterceptor.invoke(PessimisticLockInterceptor.java:160)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.CacheStoreInterceptor.invoke(CacheStoreInterceptor.java:186)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.CacheLoaderInterceptor.invoke(CacheLoaderInterceptor.java:197)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.UnlockInterceptor.invoke(UnlockInterceptor.java:32)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(TxInterceptor.java:345)
at org.jboss.cache.interceptors.TxInterceptor.invoke(TxInterceptor.java:156)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.CacheMgmtInterceptor.invoke(CacheMgmtInterceptor.java:157)
at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:5520)
at org.jboss.cache.TreeCache.put(TreeCache.java:3678)
at com.tg.cache.manager.FareCacheProviderImpl.addToCache(FareCacheProviderImpl.java:104)
at com.tg.ws.abacus.AbacusFareService.putResponseInCache(AbacusFareService.java:615)
at com.tg.ws.abacus.AbacusFareService_1_5.getFaresFromCacheOrWSForRequest(AbacusFareService_1_5.java:189)
at com.tg.ws.abacus.FarePoolHandler.execute(FarePoolHandler.java:29)
at com.tg.ws.abacus.FarePoolHandler.execute(FarePoolHandler.java:15)
at com.tg.parallel.concurrent.JavaConcurrentPoolExecutor$CallableAdapter.call(JavaConcurrentPoolExecutor.java:93)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Duplicate Key Exception
26 Jul 07 08:38:23, ERROR org.jboss.cache.loader.JDBCCacheLoader:insertNode:981 Failed to insert node: Duplicate entry '/fare/JDH/UDR/3' for key 1
com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '/fare/JDH/UDR/3' for key 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1160)
at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:685)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1400)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1314)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1299)
at org.jboss.cache.loader.JDBCCacheLoader.insertNode(JDBCCacheLoader.java:969)
at org.jboss.cache.loader.JDBCCacheLoader.put(JDBCCacheLoader.java:321)
at org.jboss.cache.interceptors.CacheStoreInterceptor.invoke(CacheStoreInterceptor.java:216)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.CacheLoaderInterceptor.invoke(CacheLoaderInterceptor.java:197)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.UnlockInterceptor.invoke(UnlockInterceptor.java:32)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(TxInterceptor.java:345)
at org.jboss.cache.interceptors.TxInterceptor.invoke(TxInterceptor.java:156)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.CacheMgmtInterceptor.invoke(CacheMgmtInterceptor.java:157)
at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:5520)
at org.jboss.cache.TreeCache.put(TreeCache.java:3678)
at com.tg.cache.manager.FareCacheProviderImpl.addToCache(FareCacheProviderImpl.java:104)
at com.tg.ws.abacus.AbacusFareService.putResponseInCache(AbacusFareService.java:615)
at com.tg.ws.abacus.AbacusFareService_1_5.getFaresFromCacheOrWSForRequest(AbacusFareService_1_5.java:187)
at com.tg.ws.abacus.FarePoolHandler.execute(FarePoolHandler.java:29)
at com.tg.ws.abacus.FarePoolHandler.execute(FarePoolHandler.java:15)
at com.tg.parallel.concurrent.JavaConcurrentPoolExecutor$CallableAdapter.call(JavaConcurrentPoolExecutor.java:93)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Data Versioning Exception
26 Jul 07 05:36:30, ERROR org.jboss.cache.transaction.DummyTransaction:notifyBeforeCompletion:251 beforeCompletion() failed for tx=org.jboss.cache.transaction.DummyTransaction@b2e747, handlers=[TxInterceptor.LocalSynchronizationHandler(gtx=GlobalTransaction::202712, tx=org.jboss.cache.transaction.DummyTransaction@b2e747)]
java.lang.RuntimeException:
at org.jboss.cache.interceptors.TxInterceptor$LocalSynchronizationHandler.beforeCompletion(TxInterceptor.java:1091)
at org.jboss.cache.interceptors.OrderedSynchronizationHandler.beforeCompletion(OrderedSynchronizationHandler.java:75)
at org.jboss.cache.transaction.DummyTransaction.notifyBeforeCompletion(DummyTransaction.java:247)
at org.jboss.cache.transaction.DummyTransaction.commit(DummyTransaction.java:54)
at org.jboss.cache.transaction.DummyBaseTransactionManager.commit(DummyBaseTransactionManager.java:61)
at org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(TxInterceptor.java:349)
at org.jboss.cache.interceptors.TxInterceptor.invoke(TxInterceptor.java:156)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.CacheMgmtInterceptor.invoke(CacheMgmtInterceptor.java:157)
at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:5520)
at org.jboss.cache.TreeCache.put(TreeCache.java:3678)
at com.tg.cache.manager.FareCacheProviderImpl.addToCache(FareCacheProviderImpl.java:104)
at com.tg.ws.abacus.AbacusFareService.putResponseInCache(AbacusFareService.java:615)
at com.tg.ws.abacus.AbacusFareService_1_5.getFaresFromCacheOrWSForRequest(AbacusFareService_1_5.java:189)
at com.tg.ws.abacus.FarePoolHandler.execute(FarePoolHandler.java:29)
at com.tg.ws.abacus.FarePoolHandler.execute(FarePoolHandler.java:15)
at com.tg.parallel.concurrent.JavaConcurrentPoolExecutor$CallableAdapter.call(JavaConcurrentPoolExecutor.java:93)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.jboss.cache.CacheException: DataNode [/fare/DEL/MAA/8/15/07 12:00 AM] version Ver=3 is newer than workspace node Ver=2
at org.jboss.cache.interceptors.OptimisticValidatorInterceptor.simpleValidate(OptimisticValidatorInterceptor.java:127)
at org.jboss.cache.interceptors.OptimisticValidatorInterceptor.validateNodes(OptimisticValidatorInterceptor.java:101)
at org.jboss.cache.interceptors.OptimisticValidatorInterceptor.invoke(OptimisticValidatorInterceptor.java:66)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.OptimisticLockingInterceptor.invoke(OptimisticLockingInterceptor.java:95)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.CacheStoreInterceptor.invoke(CacheStoreInterceptor.java:135)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.CacheLoaderInterceptor.invoke(CacheLoaderInterceptor.java:197)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.TxInterceptor.runPreparePhase(TxInterceptor.java:804)
at org.jboss.cache.interceptors.TxInterceptor$LocalSynchronizationHandler.beforeCompletion(TxInterceptor.java:1069)
... 21 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067774#4067774
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4067774
18Â years, 9Â months
[EJB 3.0] - BMT does not work the expected way.
by sumantkb
I am trying to persist data through a BMT. The code is as shown below:
package com.titan.travelagent;
import javax.ejb.Stateless;
import javax.ejb.TransactionManagement;
import javax.ejb.TransactionManagementType;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.transaction.UserTransaction;
@Stateless
@TransactionManagement(TransactionManagementType.BEAN)
public class TravelAgentBean {
private static EntityManagerFactory factory = Persistence
.createEntityManagerFactory("titan");
public void createCabin(Cabin cabin) {
EntityManager manager = factory.createEntityManager();
try {
UserTransaction utx;
try {
utx = (UserTransaction) ((new InitialContext())
.lookup("UserTransaction"));
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
utx.begin();
manager.persist(cabin);
utx.commit();
} catch (Exception e) {
e.printStackTrace();
} finally {
manager.close();
}
}
}
If I do "createCabin" it does not throw an exception , but I do not find the data persisted into the database. If I change the private static EntityManagerFactory factory = Persistence
.createEntityManagerFactory("titan");
to
@PersistenceContext(unitName="titan")
private EntityManager manager;
It starts working. But as far I understand @PersistenceContext(unitName="titan")
private EntityManager manager; is supposed to be used for CMT.
Could someone please help and clarify if any thing else is required.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067769#4067769
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4067769
18Â years, 9Â months
[JBoss Seam] - Re: Progress bar for fileUpload
by zaya
Thanks shane.
Do you mean a user will upload several files in a _single_ multipart request, or upload several files simultaneously in different tabs of browser in the same user session but _separated_ multipart requests?
If what you means is the first. I guess it's just not possible to distinguish individually how much each file is uploaded since in http, fields are serialized and it doesn't make sense to distinguish so. Just use session variable to store how much the total bytes the multipart request is, and how much bytes currently the filter has received, that should be perfectly enough, at least for our use case.
If what you mean it the second one, I think it's much better to store variables in conversation scoped components, and these variables will not interfere each other because they are isolated by conversion. This is a very interesting feature I admit, and if seam can implement it it would be very nice.
Before jira can solve this issue, I'd like to come up to some quick solutions. Now I have two scenarios:
1. Build a servlet myself and use that servlet to process file uploads.
2. Extends SeamFilter
The second one should be cleaner, but I don't how difficulte it would be.
Both need to put some variables( eventually, total bytes for a request and currently processed bytes for that request) somewhere. And both require to access seam component (of course, I can use session but it's not clean anyway) in servlet or servlet filter. Is there way to access seam component in servlets or filters? Then I can find them using a4j or seam remoting.
Cheers,
Zaya
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067765#4067765
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4067765
18Â years, 9Â months