-
1. Re: Getting NullPointerException from HornetQConnectionFactory.finalize
ataylor Apr 25, 2013 8:04 AM (in response to petal1)can you provied more information about what you are doing to create each exception
-
2. Re: Getting NullPointerException from HornetQConnectionFactory.finalize
petal1 Apr 26, 2013 5:11 AM (in response to ataylor)Hi,
I wrote a simple test program to illustrate the issue that prompted my move to JBoss 6.1.0:
001 InitialContext context = new InitialContext();
002 QueueConnectionFactory factory = (QueueConnectionFactory)context.lookup("ConnectionFactory");
003 QueueConnection connection = factory.createQueueConnection();
004 QueueSessionm_session = connection.createQueueSession(true, 0);
005 Queue queue = session.createTemporaryQueue();
006 context.bind("queue/myTestQueue", queue);
Line 006 throws this:
javax.naming.NamingException: Failed to serialize object:HornetQTemporaryQueue[3894ac6b-4326-4323-8460-192f9bd13da8], org.hornetq.jms.client.HornetQSession
at org.hornetq.jms.referenceable.SerializableObjectRefAddr.<init>(SerializableObjectRefAddr.java:63)
at org.hornetq.jms.client.HornetQDestination.getReference(HornetQDestination.java:254)
at org.jnp.interfaces.NamingContext.bind(NamingContext.java:634)
at org.jnp.interfaces.NamingContext.bind(NamingContext.java:613)
at javax.naming.InitialContext.bind(InitialContext.java:400)
at HornetQTest2.bindToReceiver(HornetQTest2.java:54)
at HornetQTest2.runTest1(HornetQTest2.java:29)
at HornetQTest2.main(HornetQTest2.java:77)
This error does not occur on JBoss 6.1.0.Final.
But on JBoss 6.1.0 I get other errors, one of which is the one I posted. The full stack trace is this:
java.lang.NullPointerException
at org.hornetq.jms.client.HornetQConnectionFactory.finalize(HornetQConnectionFactory.java:725)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
This error appears over and over again. None of our classes are on the stack trace. It is not easy for me to determine what is causing this error. I cannot easliy recompile and deploy our code with debug diagnostic lines, but I will try my best to write a test that reproduces the error. However, given the stacktrace, I was hoping that someone would be able to offer guidance as to what the likely cause of the error is?
Thanks,
Paul
-
3. Re: Getting NullPointerException from HornetQConnectionFactory.finalize
petal1 Apr 29, 2013 10:14 AM (in response to petal1)I wrote a simple test program and was able to reproduce the finalize error. As I suspected it was resolved when ensuring the JMS client was using the same version of the HornetQ jars as were deployed in JBoss.