[jboss-user] Re: Create Queue Connection Error

samk at twinix.com samk at twinix.com
Mon Jun 15 05:28:48 EDT 2009


See Thread at: http://www.techienuggets.com/Detail?tx=80419 Posted on behalf of a User

Hi, 
I am using Jboss-5.0.0GA and my JBM in it is 1.4.1.GA . I have  a created a connection factory .From a stand alone program when I try get the connection factory it is succeeded but when getting the connection from the connection factory .I get the following exception
msConnectionFactory ---------->JBossConnectionFactory->ConnectionFactoryDelegate[jboss.messaging.connectionfactory:service=MyExampleConnectionFactory, SID=0]
2009 Jun 15 17:18:56 [main] ERROR org.jboss.remoting.transport.socket.SocketClientInvoker  - Got marshalling exception, exiting
java.io.IOException: EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap$Segment
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.writeArray(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
	at EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.java:1170)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
	at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
	at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.writeObject(Unknown Source)
	at org.jboss.jms.wireformat.SerializedPacket.write(SerializedPacket.java:80)
	at org.jboss.jms.wireformat.JMSWireFormat.write(JMSWireFormat.java:237)
	at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.versionedWrite(MicroSocketClientInvoker.java:956)
	at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:552)
	at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:269)
	at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
	at org.jboss.remoting.LeasePinger.sendClientPing(LeasePinger.java:283)
	at org.jboss.remoting.LeasePinger.addClient(LeasePinger.java:117)
	at org.jboss.remoting.MicroRemoteClientInvoker.establishLease(MicroRemoteClientInvoker.java:398)
	at org.jboss.remoting.Client.setupClientLease(Client.java:1504)
	at org.jboss.remoting.Client.connect(Client.java:1404)
	at org.jboss.remoting.Client.connect(Client.java:441)
	at org.jboss.jms.client.remoting.JMSRemotingConnection$1.run(JMSRemotingConnection.java:319)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.jboss.jms.client.remoting.JMSRemotingConnection.start(JMSRemotingConnection.java:315)
	at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:154)
	at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
	at org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:83)
	at org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect0.invoke(StateCreationAspect0.java)
	at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
	at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)
	at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)
	at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:87)
	at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:82)
	at com.jms.test.SimpleTestClient.main(SimpleTestClient.java:22)
2009 Jun 15 17:18:56 [main] WARN  org.jboss.remoting.LeasePinger  - LeasePinger[SocketClientInvoker[1c80b01, bisocket://127.0.0.1:4457](aaw19-i6j7nu-fvyz3zgo-1-fvyz3zse-6)] failed to ping to server: Failed to communicate.  Problem during marshalling/unmarshalling; nested exception is: 
	java.io.IOException: EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap$Segment
2009 Jun 15 17:19:06 [Timer-0] ERROR org.jboss.remoting.transport.socket.SocketClientInvoker  - Got marshalling exception, exiting
java.io.IOException: EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap$Segment
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.writeArray(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
	at EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.java:1170)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
	at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
	at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
	at java.io.ObjectOutputStream.writeObject(Unknown Source)
	at org.jboss.jms.wireformat.SerializedPacket.write(SerializedPacket.java:80)
	at org.jboss.jms.wireformat.JMSWireFormat.write(JMSWireFormat.java:237)
	at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.versionedWrite(MicroSocketClientInvoker.java:956)
	at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:552)
	at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:269)
	at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
	at org.jboss.remoting.LeasePinger.sendClientPing(LeasePinger.java:283)
	at org.jboss.remoting.LeasePinger.access$100(LeasePinger.java:20)
	at org.jboss.remoting.LeasePinger$LeaseTimerTask.run(LeasePinger.java:300)
	at java.util.TimerThread.mainLoop(Unknown Source)
	at java.util.TimerThread.run(Unknown Source)
2009 Jun 15 17:19:06 [Timer-0] WARN  org.jboss.remoting.LeasePinger  - LeasePinger[SocketClientInvoker[1c80b01, bisocket://127.0.0.1:4457](aaw19-i6j7nu-fvyz3zgo-1-fvyz3zse-6)] failed to ping to server: Failed to communicate.  Problem during marshalling/unmarshalling; nested exception is: 
	java.io.IOException: EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap$Segment
org.jboss.jms.exception.MessagingNetworkFailureException
	at org.jboss.jms.client.delegate.DelegateSupport.handleThrowable(DelegateSupport.java:245)
	at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:187)
	at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
	at org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:83)
	at org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect0.invoke(StateCreationAspect0.java)
	at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
	at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)
	at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)
	at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:87)
	at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:82)
	at com.jms.test.SimpleTestClient.main(SimpleTestClient.java:22)
Caused by: org.jboss.remoting.ConnectionFailedException: Timed out trying to create control socket
	at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.handleConnect(BisocketClientInvoker.java:273)
	at org.jboss.remoting.MicroRemoteClientInvoker.connect(MicroRemoteClientInvoker.java:294)
	at org.jboss.remoting.Client.connect(Client.java:1596)
	at org.jboss.remoting.Client.connect(Client.java:498)
	at org.jboss.remoting.callback.ServerInvokerCallbackHandler.connect(ServerInvokerCallbackHandler.java:166)
	at org.jboss.remoting.ServerInvoker.getCallbackHandler(ServerInvoker.java:2047)
	at org.jboss.remoting.ServerInvoker.handleInternalInvocation(ServerInvoker.java:1663)
	at org.jboss.remoting.transport.bisocket.BisocketServerInvoker.handleInternalInvocation(BisocketServerInvoker.java:863)
	at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:895)
	at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:742)
	at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:695)
	at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:549)
	at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:230)
	at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
	at org.jboss.remoting.Client.invoke(Client.java:1513)
	at org.jboss.remoting.Client.addCallbackListener(Client.java:1582)
	at org.jboss.remoting.Client.addListener(Client.java:885)
	at org.jboss.jms.client.remoting.JMSRemotingConnection.addInvokerCallbackHandler(JMSRemotingConnection.java:230)
	at org.jboss.jms.client.remoting.JMSRemotingConnection.start(JMSRemotingConnection.java:340)
	at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:154)
	... 9 more

Even I have turned off my firewall and checked , it is giving the same exception . 
Here is my remoting- service.xml file

<?xml version="1.0" encoding="UTF-8"?>

<!--
     Standard bisocket-based Remoting service deployment descriptor.

     $Id: remoting-bisocket-service.xml 3981 2008-03-28 18:00:41Z timfox $
 -->

<server>

   <!-- Standard bisocket connector - the bisocket transport only opens connection from client->server
        so can be used with firewalls where only outgoing connections are allowed.
        For examples of HTTP and SSL transports see docs/examples -->
   <mbean code="org.jboss.remoting.transport.Connector"
          name="jboss.messaging:service=Connector,transport=bisocket"
          display-name="Bisocket Transport Connector">
      <attribute name="Configuration">
         <config>
            <invoker transport="bisocket">
            
               <!-- There should be no reason to change these parameters - warning!
                    Changing them may stop JBoss Messaging working correctly -->            
               <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
               <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
               <attribute name="dataType" isParam="true">jms</attribute>
               <attribute name="socket.check_connection" isParam="true">false</attribute>               
               <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
               <attribute name="serverBindPort">4457</attribute>
               <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
               <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
	       
               <attribute name="numberOfCallRetries" isParam="true">1</attribute>
               <attribute name="pingFrequency" isParam="true">214748364</attribute>
               <attribute name="pingWindowFactor" isParam="true">10</attribute>
               <attribute name="onewayThreadPool">org.jboss.jms.server.remoting.DirectThreadPool</attribute>               
               <!-- End immutable parameters -->
               
               <attribute name="stopLeaseOnFailure" isParam="true">true</attribute>
               
               <!-- Periodicity of client pings. Server window by default is twice this figure -->                               
               <attribute name="clientLeasePeriod" isParam="true">10000</attribute>
               <attribute name="validatorPingPeriod" isParam="true">10000</attribute>
               <attribute name="validatorPingTimeout" isParam="true">5000</attribute>
               <attribute name="registerCallbackListener">false</attribute>
	       	       
	            <attribute name="timeout" isParam="true">0</attribute>

               <!-- Number of seconds to wait for a connection in the client pool to become free -->
	            <attribute name="connectionWait" isParam="true">10</attribute>

               <!-- Max Number of connections in client pool. This should be significantly higher than
                    the max number of sessions/consumers you expect -->
               <attribute name="JBM_clientMaxPoolSize" isParam="true">200</attribute>
               
               <!-- The maximum time to wait before timing out on trying to write a message to socket for delivery -->
               <attribute name="callbackTimeout">10000</attribute> 
               
               <!-- Use these parameters to specify values for binding and connecting control connections to 
                    work with your firewall/NAT configuration
               <attribute name="secondaryBindPort">xyz</attribute>                           
               <attribute name="secondaryConnectPort">abc</attribute>               
               -->
                          
            </invoker>
            <handlers>
               <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
            </handlers>
         </config>
      </attribute>
   </mbean>

</server>


Kindly help me to solve the issue .

Thank you 

Regards
Jai

 

In Response To: 

Hello, I am trying to use jms(jboss-messaging-1.4.0.SP3). When I started my application I have this problem :
Exception in thread "main" org.jboss.jms.exception.MessagingNetworkFailureException

This problem arrived when I execut this code :
conn = qcf.createQueueConnection();

All application cod:

  | 
  | import javax.jms.JMSException;
  | import javax.jms.Message;
  | import javax.jms.MessageListener;
  | import javax.jms.Queue;
  | import javax.jms.QueueConnection;
  | import javax.jms.QueueConnectionFactory;
  | import javax.jms.QueueReceiver;
  | import javax.jms.QueueSender;
  | import javax.jms.QueueSession;
  | import javax.jms.TextMessage;
  | import javax.naming.InitialContext;
  | import javax.naming.NamingException;
  | 
  | import EDU.oswego.cs.dl.util.concurrent.CountDown;
  | import org.apache.log4j.Logger;
  | 
  | /** 
  |  * A complete JMS client example program that sends a
  |  * TextMessage to a Queue and asynchronously receives the
  |  * message from the same Queue.
  |  * 
  |  * @author  Scott.noway at spam.com
  |  * @version $Revision: 1.2 $
  |  */
  | public class SendRecvClient
  | {
  |     static CountDown done = new CountDown(1);
  |     QueueConnection conn;
  |     QueueSession session;
  |     Queue que;
  |     
  |     public static class ExListener 
  |         implements MessageListener
  |     {
  |         public void onMessage(Message msg)
  |         {
  |             done.release();
  |             TextMessage tm = (TextMessage) msg;
  |             try {
  |                 System.out.println("onMessage, recv text=" + tm.getText());
  |             } catch(Throwable t) {
  |                 t.printStackTrace();
  |             }
  |         }
  |     }
  |                 
  |     public void setupPTP()
  |         throws JMSException, 
  |                NamingException
  |     {
  |         InitialContext iniCtx = new InitialContext();
  |         Object tmp = iniCtx.lookup("ConnectionFactory");
  |         QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
  |         conn = qcf.createQueueConnection();
  |         que = (Queue) iniCtx.lookup("queue/DLQ");
  |         session = conn.createQueueSession(false,
  |                                           QueueSession.AUTO_ACKNOWLEDGE);
  |         conn.start();
  |     }
  |     
  |     public void sendRecvAsync(String text)
  |         throws JMSException,
  |                NamingException
  |     {
  |         System.out.println("Begin sendRecvAsync");
  |         // Setup the PTP connection, session
  |         setupPTP();
  | 
  |         // Set the async listener
  |         QueueReceiver recv = session.createReceiver(que);
  |         recv.setMessageListener(new ExListener());
  | 
  |         // Send a text msg
  |         QueueSender send = session.createSender(que);
  |         TextMessage tm = session.createTextMessage(text);
  |         send.send(tm);
  |         System.out.println("sendRecvAsync, sent text=" + tm.getText());
  |         send.close();
  |         System.out.println("End sendRecvAsync");
  |     }
  |                 
  |     public void stop()
  |         throws JMSException
  |     {
  |         conn.stop(); 
  |         session.close();
  |         conn.close();
  |     }
  |     
  |     public static void main(String args[])
  |         throws Exception
  |     {
  |         SendRecvClient client = new SendRecvClient();
  |         client.sendRecvAsync("A text msg");
  |         client.done.acquire();
  |         client.stop();
  |         System.exit(0);
  |     }
  | }
  | 
Someone can help me, please.

Jboss 5.0.0
jboss-messaging-1.4.0.SP3





More information about the jboss-user mailing list