5 Replies Latest reply on Jun 28, 2007 3:13 PM by Tim Fox

    Problems with concurrent.jar

    Karl Koster Newbie

      I know this is not directly related to JBoss Messaging, but since it came up during its usage I thought this would be a good place to post this problem. It seems that the ConcurrentHashMap's inner Segment class is not marked as Serializable (it is in the Doug Lea's source code) and is causing problems with messaging. The concurrent.jar that is being used is in the latest AOP (1.5.5.GA) release in the either the lib or lib-50 directory. The version in the lib directory of JAS is marked as serializable and when switching to that version, the exceptions stopped.

      Below is a stack trace of the exceptions being thrown by the messaging client when using the AOP version of concurrent.jar:

      11:41:03,751 ERROR [JMSWireFormat] Failed to write packet
      java.io.NotSerializableException: EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap$Segment
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
       at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
       at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:391)
       at EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.java:1170)
       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:917)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
       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:969)
       at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:557)
       at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:339)
       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:1541)
       at org.jboss.remoting.Client.connect(Client.java:1441)
       at org.jboss.remoting.Client.connect(Client.java:444)
       at org.jboss.jms.client.remoting.JMSRemotingConnection.start(JMSRemotingConnection.java:271)
       at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:146)
       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.container.ClusteringAspect.handleCreateConnectionDelegate(ClusteringAspect.java:131)
       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 org.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:121)
       at org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientClusteredConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
       at org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate.createConnectionDelegate(ClientClusteredConnectionFactoryDelegate.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 org.kdr.jms.BasicContentSynchManager.getConnection(BasicContentSynchManager.java:93)
       at org.kdr.jms.BasicContentSynchManager.start(BasicContentSynchManager.java:191)
       at org.kdr.jms.TestContentSynchManager.<init>(TestContentSynchManager.java:41)
       at org.kdr.jms.TestContentSynchManager.main(TestContentSynchManager.java:63)
      11:41:03,766 ERROR [SocketClientInvoker] Got marshalling exception, exiting
      java.io.IOException: EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap$Segment
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
       at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
       at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:391)
       at EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.java:1170)
       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:917)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
       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:969)
       at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:557)
       at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:339)
       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:1541)
       at org.jboss.remoting.Client.connect(Client.java:1441)
       at org.jboss.remoting.Client.connect(Client.java:444)
       at org.jboss.jms.client.remoting.JMSRemotingConnection.start(JMSRemotingConnection.java:271)
       at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:146)
       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.container.ClusteringAspect.handleCreateConnectionDelegate(ClusteringAspect.java:131)
       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 org.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:121)
       at org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientClusteredConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
       at org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate.createConnectionDelegate(ClientClusteredConnectionFactoryDelegate.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 org.kdr.jms.BasicContentSynchManager.getConnection(BasicContentSynchManager.java:93)
       at org.kdr.jms.BasicContentSynchManager.start(BasicContentSynchManager.java:191)
       at org.kdr.jms.TestContentSynchManager.<init>(TestContentSynchManager.java:41)
       at org.kdr.jms.TestContentSynchManager.main(TestContentSynchManager.java:63)
      11:41:03,766 WARN [LeasePinger] LeasePinger[SocketClientInvoker[7981d5, bisocket://10.10.100.10:4457](aa2s2v-2r2fch-f3helqsj-1-f3helrmh-5)] 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
      


        • 1. Re: Problems with concurrent.jar
          Tim Fox Master

          I don't understand what the issue is here.

          The userguide explicitly states which jars you need on your classpath, and where to obtain them, and what versions you require:

          See http://labs.jboss.com/file-access/default/members/jbossmessaging/freezone/docs/userguide-1.3.0.GA/html/installation.html#inst.remoteclient

          concurrent.jar is inside jbossall-client.jar

          Are you saying that you get problems when using the jars specified in the userguide?

          Or are you saying that you are having problems when you use a different set of jars on the client to what is specified in the guide?

          • 2. Re: Problems with concurrent.jar
            Karl Koster Newbie

            Tim, as I said at the outset, this is not necessarily a JBoss Messaging issue. However, that said, the use of AOP with or independently of the JBoss AS (4.2.0.GA BTW) should not break the implementation of messaging since the jar in question is provided externally to Red Hat (Doug Lea's concurrency utilities) Since JBoss AS (4.2.X) is using this version of AOP anyway, why should the jar's be different.

            Also, there have been many conversations of the evils of using jbossall-client.jar if you would care to search the lists for them. It has been repeatedly recommended that explicit collection of client jars required be used for deployment. This allows significantly more flexibility when moving part of the container to newer versions.

            This is more of a request to the AOP team to get the concurrent.jar in line with everything else.

            Regards,
            Karl

            • 3. Re: Problems with concurrent.jar
              Tim Fox Master

               

              "kkoster" wrote:
              Tim, as I said at the outset, this is not necessarily a JBoss Messaging issue.


              That much, at least, you're right about.

              However, that said, the use of AOP with or independently of the JBoss AS (4.2.0.GA BTW) should not break the implementation of messaging since the jar in question is provided externally to Red Hat (Doug Lea's concurrency utilities) Since JBoss AS (4.2.X) is using this version of AOP anyway, why should the jar's be different.


              The jars you should use for JBM are clearly specified in the userguide.

              If you're using a different jar, don't blame me if it doesn't work. Nothing would be broken if you were using the jars we test against, verify and specify in the guide.


              Also, there have been many conversations of the evils of using jbossall-client.jar


              The version of concurrent.jar in jbossall-client.jar is the same as the one in the JBoss AS client dir, you can use that one if you don't like jbossall-client.jar, it's the same jar


              This is more of a request to the AOP team to get the concurrent.jar in line with everything else.


              If this is a request to the AOP team, why are you posting it on the JBM user forum? ;)

              • 4. Re: Problems with concurrent.jar
                Karl Koster Newbie

                Tim, this post did not start out as a rant against JBoss Messaging and as stated in the initial post this was not, necessarily, a messaging issue. It is simply that the problem appeared (and yes it is a problem although not monumental) during the use of messaging. I and probably most of the user community view JBoss as a set of complementary unified components that should work together in a cohesive fashion. My post was to simply point out that there seems to be a difference between an external library of code used fairly extensively throughout the JBoss suite that was causing issues with messaging. Messaging, however, is not the center of the universe, at least not in ours. It is a basic component to a larger whole. All of the JBoss components are important to us and there is a certain expectation of consistency with usage of common code. I am sorry you cannot understand this nor accept this post as an effort to point out this inconsistency instead of a complaint against JBoss messaging.

                I do not blame you for nor JBoss for the particular errors that occurred, but merely attempted to lend a hand in pointing out a, probable, deployment issue of one of the independent components in the JBoss suite. If your only answers are patterned after Microsoft (accurate but useless) and colored with condescension then perhaps it would be best for me not burden you with any additional attempts to offer constructive comments regarding your product suite.

                Regards,
                Karl

                • 5. Re: Problems with concurrent.jar
                  Tim Fox Master

                  We use *exactly* the same jars (yes exactly) as JBoss AS 4.2.0, which is what our dependencies are aligned.

                  If the JBoss AOP distro contains a different version of the jar to what you expect, then you need to take that up with the JBoss AOP team.

                  Now quite whining and give me a break, or this thread is going in "usless rants".