[JBoss Messaging] - Re: JBoss connection issue
by bnraju1
In case you are interested, here is the client code:
QueueConnection connection = null;
try {
//send the file into JMS Queue
InitialContext jndiContext = new InitialContext();
//lookup connectinonFactory through JNDI
QueueConnectionFactory connectionFactory = (QueueConnectionFactory) jndiContext.lookup("java:comp/env/jms/ConnectionFactory");
UserTransaction userTran = (UserTransaction)jndiContext.lookup("java:comp/UserTransaction");
userTran.begin();
//lookup queue name
log.debug("looking up FileConnectQueue...");
Queue testQueue = (Queue) jndiContext.lookup("java:comp/env/jms/TestQueue");
//create a connection
connection = connectionFactory.createQueueConnection();
connection.start();
//create a session
log.debug("creating session...");
QueueSession qSession = connection.createQueueSession(true, -1);
//create sender
log.debug("creating sender...");
QueueSender sender = qSession.createSender(testQueue);
//compose Metadata
Map metadata = new HashMap();
metadata.put(MetadataKey.TEST, "test");
TestFile testFile = new TestFile(new byte[]{});
testFile.loadMetadata(metadata);
//convert fcFile into MapMessage
Message message = this.toMessage(qSession, testFile);
sender.send(message);
userTran.commit();
} catch (RuntimeException e) {
log.error("RuntimeException", e);
} catch (Exception ex) {
log.error("Exception caught " + ex);
} finally{
if (connection != null) {
try {
log.debug("closing connection...");
connection.close();
} catch (JMSException e) {
log.error("Unable to close the queue connection.");
}
}
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006979#4006979
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006979
19 years, 2 months
[JBoss Messaging] - Re: JBoss connection issue
by bnraju1
I have one more client that runs in WebSphere application server. It does not use spring JMSTemplate. I noticed the below error in the log files of this client too. Does this mean something is wrong with WebSphere to JBoss communication?
org.jboss.aop.NotFoundInDispatcherException: Object with oid: -2147476478 was not found in the Dispatcher
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:85)
at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:127)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:1014)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:508)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:645)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:293)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java(Compiled Code))
at org.jboss.remoting.Client.invoke(Client.java:607)
at org.jboss.remoting.Client.invoke(Client.java:599)
at org.jboss.jms.client.delegate.DelegateSupport.invoke(DelegateSupport.java:111)
at org.jboss.jms.client.delegate.ClientConnectionDelegate$stop_N2856118408655404442.invokeNext(ClientConnectionDelegate$stop_N2856118408655404442.java)
at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:182)
at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:117)
at org.jboss.jms.client.delegate.ClientConnectionDelegate$stop_N2856118408655404442.invokeNext(ClientConnectionDelegate$stop_N2856118408655404442.java)
at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:69)
at org.jboss.jms.client.delegate.ClientConnectionDelegate$stop_N2856118408655404442.invokeNext(ClientConnectionDelegate$stop_N2856118408655404442.java)
at org.jboss.jms.client.container.ClientLogInterceptor.invoke(ClientLogInterceptor.java:107)
at org.jboss.jms.client.delegate.ClientConnectionDelegate$stop_N2856118408655404442.invokeNext(ClientConnectionDelegate$stop_N2856118408655404442.java)
at org.jboss.jms.client.delegate.ClientConnectionDelegate.stop(ClientConnectionDelegate.java)
at org.jboss.jms.client.JBossConnection.stop(JBossConnection.java:126)
at com.ibm.ejs.jms.JMSManagedConnection.cleanup(JMSManagedConnection.java:705)
at com.ibm.ejs.j2c.MCWrapper.cleanup(MCWrapper.java:1179)
at com.ibm.ejs.j2c.poolmanager.FreePool.removeParkedConnection(FreePool.java:543)
at com.ibm.ejs.j2c.poolmanager.PoolManager.serverShutDown(PoolManager.java:911)
at com.ibm.ejs.j2c.ConnectionServerShutDownFactoryImpl.shutdown(ConnectionServerShutDownFactoryImpl.java:82)
at com.ibm.ws.runtime.component.ConnMgrImpl.stop(ConnMgrImpl.java:92)
at com.ibm.ws.runtime.component.ContainerImpl.stopComponents(ContainerImpl.java:577)
at com.ibm.ws.runtime.component.ContainerImpl.stop(ContainerImpl.java:417)
at com.ibm.ws.runtime.component.ApplicationServerImpl.stop(ApplicationServerImpl.java:176)
at com.ibm.ws.runtime.component.ContainerImpl.stopComponents(ContainerImpl.java:577)
at com.ibm.ws.runtime.component.ContainerImpl.stop(ContainerImpl.java:417)
at com.ibm.ws.runtime.component.ServerImpl.stop(ServerImpl.java:265)
at com.ibm.ws.runtime.component.ServerCollaborator$1.run(ServerCollaborator.java:456)
at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:2317)
at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:2194)
at com.ibm.ws.runtime.component.ServerCollaborator$ShutdownHook.run(ServerCollaborator.java:439)
at com.ibm.ws.runtime.component.ServerCollaborator$StopAction.alarm(ServerCollaborator.java:416)
at com.ibm.ejs.util.am._Alarm.run(_Alarm.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006974#4006974
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006974
19 years, 2 months
[JBoss Messaging] - Re: Memory Leak with EJB3 ?
by dunks80
JBoss 4.0.5.GA
JBoss Messaging 1.0.1
Jboss TS 4.2.2
MS-SQL 2000 w/jtds driver
I'm seeing the same problem. Tenured gen is filling up with org.jboss.jms.tx.TxState and org.jboss.jms.tx.LocalTx when processing messages using an EJB3 MDB. I am debugging through the org.jboss.jms.tx.MessagingXAResource and here is what I'm seeing...
In public void start(Xid xid, int flags) throws XAException A new TxState is put into the ResourceManager's map of transactions.
In public void end(Xid xid, int flags) throws XAException Another new TxState is put into the map of transactions b/c of the call to unsetCurrentTransactionId.
| // Don't unset the xid if it has previously been suspended. The session could have been
| // recycled
| if (xid.equals(sessionState.getCurrentTxId()))
| {
| sessionState.setCurrentTxId(rm.createLocalTx());
| }
|
which is called no matter what the outcome of the transaction based on this code...
| public void end(Xid xid, int flags) throws XAException
| {
| if (trace) { log.trace(this + " ending " + xid + ", flags: " + flags); }
|
| synchronized (this)
| {
| switch (flags)
| {
| case TMSUSPEND :
| unsetCurrentTransactionId(xid);
| rm.suspendTx(xid);
| break;
| case TMFAIL :
| unsetCurrentTransactionId(xid);
| rm.endTx(xid, false);
| break;
| case TMSUCCESS :
| unsetCurrentTransactionId(xid);
| rm.endTx(xid, true);
| break;
| }
| }
| }
|
I'm not by any means an expert in the TX code...but this unsetCurrentTransactionId seems to be what's causing the problem...the xid is always equal to the currentTxId so a new TxState is added to the ResourceManager's map of transactions. Is this correct? Why? This results in two TxState objects being put into the transaction map for each transaction...and only one gets removed when commit is called...causing the heap to grow.
In public void commit(Xid xid, boolean onePhase) throws XAException the first TxState is removed from the map of transactions.
Is there something I've done wrong to cause this behavior? TransactionAttribute settings? Some setting in JBoss Messaging? Of is this a genuine bug?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006965#4006965
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006965
19 years, 2 months