[JBoss Messaging] - Piling thread count when it polls the queue.
by apk2072
For every 10 seconds my code calls the below method to poll for new messages, but the problem is, JBoss messaging implementation is internally creating a new thread whenever it executes the session.createConsumer(queue) statement. And thread count grows continuously as it polls, after some time it ends up with Out of Memory error.
Is it a bug in the JBM implementation or I am not doing it correctly? Please advice.
| public String pollForNewMsg() throws Exception
| {
| InitialContext ic = new InitialContext();
| ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
| Connection _jmsConn = cf.createConnection();
| Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
| Queue queue = (Queue)ic.lookup(queueName);
| javax.jms.MessageConsumer consumer = session.createConsumer(queue);
| conn.start();
| TextMessage msg = (TextMessage)consumer.receive(10);
| String text = msg.getText();
|
| consumer.close();
| conn.close();
|
| return text;
| }
|
-APK.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049739#4049739
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049739
17 years, 6 months
[Clustering/JBoss] - Could not crate JMS_MESSAGE table
by mpogra
Hi All,
I m new to jboss. i have just installed the jboss jboss-4.0.3SP1. it is running but i m getting below error in server.log file
java.sql.SQLException: Table already exists: JMS_MESSAGES in statement [CREATE CACHED TABLE JMS_MESSAGES]
at org.hsqldb.jdbc.Util.throwError(Unknown Source)
at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:227)
at org.jboss.mq.pm.jdbc2.PersistenceManager.createSchema(PersistenceManager.java:240)
at org.jboss.mq.pm.jdbc2.PersistenceManager.startService(PersistenceManager.java:1491)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:230)
at sun.reflect.GeneratedMethodAccessor2.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: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.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:428)
at org.jboss.system.ServiceController.start(ServiceController.java:446)
at org.jboss.system.ServiceController.start(ServiceController.java:446)
at org.jboss.system.ServiceController.start(ServiceController.java:446)
at org.jboss.system.ServiceController.start(ServiceController.java:446)
at org.jboss.system.ServiceController.start(ServiceController.java:446)
at sun.reflect.GeneratedMethodAccessor10.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: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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:285)
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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.JMXInvocationHandler.invoke(JMXInvocationHandler.java:273)
at $Proxy38.start(Unknown Source)
at org.jboss.deployment.XSLSubDeployer.start(XSLSubDeployer.java:185)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:989)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:790)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
at sun.reflect.GeneratedMethodAccessor19.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:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy9.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:265)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(Se
I have tried a lot to fine the DB setting but couldn't get that. Could anyone plz help me to resolve above error.
Tnx in advance.
Mahesh
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049735#4049735
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049735
17 years, 6 months
[JBoss Messaging] - deadlocks when stressing jms application on MS SQL 2005
by pkorros
I get several database deadlocks like the one bellow, when i am trying to stress my application.
I am using JBoss 4.0.5.GA with JBoss messaging 1.2.0GA configured to use MS SqlServer 2005 as a persistent storage.
2007-05-30 16:34:17,426 WARN [org.jboss.messaging.core.plugin.JDBCPersistenceManager] (JMS SessionPool Worker-6) SQLException caught - assuming deadlock detected, try:1
java.sql.SQLException: Transaction (Process ID 148) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:628)
at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:525)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:487)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:421)
at net.sourceforge.jtds.jdbcx.proxy.PreparedStatementProxy.executeUpdate(PreparedStatementProxy.java:75)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:251)
at org.jboss.messaging.core.plugin.JDBCPersistenceManager.updateWithRetry(JDBCPersistenceManager.java:3522)
at org.jboss.messaging.core.plugin.JDBCPersistenceManager.updateWithRetry(JDBCPersistenceManager.java:3394)
at org.jboss.messaging.core.plugin.JDBCPersistenceManager.commitPreparedTransaction(JDBCPersistenceManager.java:3063)
at org.jboss.messaging.core.plugin.JDBCPersistenceManager.handleBeforeCommit2PC(JDBCPersistenceManager.java:2349)
at org.jboss.messaging.core.plugin.JDBCPersistenceManager$TransactionCallback.beforeCommit(JDBCPersistenceManager.java:3781)
at org.jboss.messaging.core.tx.Transaction.commit(Transaction.java:208)
at org.jboss.jms.server.endpoint.ServerConnectionEndpoint.sendTransaction(ServerConnectionEndpoint.java:466)
at org.jboss.jms.server.endpoint.advised.ConnectionAdvised.org$jboss$jms$server$endpoint$advised$ConnectionAdvised$sendTransaction$aop(ConnectionAdvised.java:101)
at org.jboss.jms.server.endpoint.advised.ConnectionAdvised$sendTransaction_N3268650789275322226.invokeNext(ConnectionAdvised$sendTransaction_N3268650789275322226.java)
at org.jboss.jms.server.container.ServerLogInterceptor.invoke(ServerLogInterceptor.java:105)
at org.jboss.jms.server.endpoint.advised.ConnectionAdvised$sendTransaction_N3268650789275322226.invokeNext(ConnectionAdvised$sendTransaction_N3268650789275322226.java)
at org.jboss.jms.server.endpoint.advised.ConnectionAdvised.sendTransaction(ConnectionAdvised.java)
at org.jboss.jms.wireformat.ConnectionSendTransactionRequest.serverInvoke(ConnectionSendTransactionRequest.java:85)
at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:125)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734)
at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:101)
at org.jboss.remoting.Client.invoke(Client.java:1544)
at org.jboss.remoting.Client.invoke(Client.java:530)
at org.jboss.remoting.Client.invoke(Client.java:518)
at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:184)
at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:155)
at org.jboss.jms.client.delegate.ClientConnectionDelegate.org$jboss$jms$client$delegate$ClientConnectionDelegate$sendTransaction$aop(ClientConnectionDelegate.java:219)
at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N3268650789275322226.invokeNext(ClientConnectionDelegate$sendTransaction_N3268650789275322226.java)
at org.jboss.jms.client.container.FailoverValveInterceptor.invoke(FailoverValveInterceptor.java:91)
at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N3268650789275322226.invokeNext(ClientConnectionDelegate$sendTransaction_N3268650789275322226.java)
at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:171)
at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N3268650789275322226.invokeNext(ClientConnectionDelegate$sendTransaction_N3268650789275322226.java)
at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:71)
at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N3268650789275322226.invokeNext(ClientConnectionDelegate$sendTransaction_N3268650789275322226.java)
at org.jboss.jms.client.container.ClientLogInterceptor.invoke(ClientLogInterceptor.java:107)
at org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N3268650789275322226.invokeNext(ClientConnectionDelegate$sendTransaction_N3268650789275322226.java)
at org.jboss.jms.client.delegate.ClientConnectionDelegate.sendTransaction(ClientConnectionDelegate.java)
at org.jboss.jms.tx.ResourceManager.sendTransactionXA(ResourceManager.java:627)
at org.jboss.jms.tx.ResourceManager.commit(ResourceManager.java:383)
at org.jboss.jms.tx.MessagingXAResource.commit(MessagingXAResource.java:235)
at org.jboss.tm.TransactionImpl$Resource.commit(TransactionImpl.java:2253)
at org.jboss.tm.TransactionImpl.commitResources(TransactionImpl.java:1784)
at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:358)
at org.jboss.tm.TxManager.commit(TxManager.java:240)
at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:351)
at org.jboss.jms.client.remoting.MessageCallbackHandler.callOnMessage(MessageCallbackHandler.java:153)
at org.jboss.jms.client.container.SessionAspect.handleRun(SessionAspect.java:791)
at org.jboss.aop.advice.org.jboss.jms.client.container.SessionAspect14.invoke(SessionAspect14.java)
at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:171)
at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:71)
at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
at org.jboss.jms.client.container.ClientLogInterceptor.invoke(ClientLogInterceptor.java:107)
at org.jboss.jms.client.delegate.ClientSessionDelegate$run_N8003352271541955702.invokeNext(ClientSessionDelegate$run_N8003352271541955702.java)
at org.jboss.jms.client.delegate.ClientSessionDelegate.run(ClientSessionDelegate.java)
at org.jboss.jms.client.JBossSession.run(JBossSession.java:199)
at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
at java.lang.Thread.run(Thread.java:595)
2007-05-30 16:34:17,426 WARN [org.jboss.messaging.core.plugin.JDBCPersistenceManager] (JMS SessionPool Worker-20) Update worked after retry
2007-05-30 16:34:17,441 WARN [org.jboss.messaging.core.plugin.JDBCPersistenceManager] (JMS SessionPool Worker-22) Trying again after a pause
2007-05-30 16:34:17,441 WARN [org.jboss.messaging.core.plugin.JDBCPersistenceManager] (JMS SessionPool Worker-6) Trying again after a pause
2007-05-30 16:34:17,441 WARN [org.jboss.messaging.core.plugin.JDBCPersistenceManager] (JMS SessionPool Worker-17) Update worked after retry
2007-05-30 16:34:17,457 WARN [org.jboss.messaging.core.plugin.JDBCPersistenceManager] (JMS SessionPool Worker-18) Update worked after retry
2007-05-30 16:34:17,551 WARN [org.jboss.messaging.core.plugin.JDBCPersistenceManager] (JMS SessionPool Worker-15) Update worked after retry
2007-05-30 16:34:17,707 WARN [org.jboss.messaging.core.plugin.JDBCPersistenceManager] (JMS SessionPool Worker-23) Update worked after retry
2007-05-30 16:34:17,832 WARN [org.jboss.messaging.core.plugin.JDBCPersistenceManager] (JMS SessionPool Worker-22) Update worked after retry
2007-05-30 16:34:17,894 WARN [org.jboss.messaging.core.plugin.JDBCPersistenceManager] (JMS SessionPool Worker-21) Update worked after retry
2007-05-30 16:34:17,925 WARN [org.jboss.messaging.core.plugin.JDBCPersistenceManager] (JMS SessionPool Worker-6) Update worked after retry
This greatly hurts the performance of my application, any ideas on what is causing the problem?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049728#4049728
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049728
17 years, 6 months
[JBoss AOP] - Re: unable to resolve an AOP IllegalArgumentException
by kabir.khan@jboss.com
In my experience, this error cannot occur unless your classes have already been woven with a really old version of AOP (as in the IDE) and deployed in jboss with a different version. Two things to try to check if this is happening
1) Run with EnableLoadtimeWeaving=false. If you still get the same error, your classes have been woven.
2) Go to the root directory of where your compiled classes are/where they are put into the .war and execute:
$javap org.acme.Foo
(substituting org.acme.Foo with the name of one of your woven classes that you want to check). If the class implements the Advised interface it has already been woven.
I am not familiar with the AOP IDE and AOP Builder, but here's a thought you might have the AOPC'ed classes hanging around in your project's output folder, with no rebuild having been done after removing the AOP Builder. Do a Project/Clean in Eclipse and see if that helps.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049724#4049724
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049724
17 years, 6 months