0

I'm using JBoss AS 7 Hornetq. Our standalone java application interacts with a queue and sends messages. We had the entire environment setup and it was working pretty smoothly. Suddenly, one fine day, our standalone application failed with the below exception:

Caused by: java.io.NotSerializableException: org.hornetq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy

Detailed exception stack trace is below

javax.naming.NamingException: Failed to lookup [Root exception is java.io.NotSerializableException: org.hornetq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy] at org.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:36) at org.jboss.naming.remote.protocol.v1.Protocol$1.execute(Protocol.java:104) at org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1.lookup(RemoteNamingStoreV1.java:79) at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:79) at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:83) at javax.naming.InitialContext.lookup(Unknown Source) at com.infosys.lbs.publishing.LocationProcessor.postMessageInQueue(LocationProcessor.java:377) at com.infosys.lbs.publishing.LocationProcessor.process(LocationProcessor.java:69) at com.infosys.lbs.publishing.main.Publisher.main(Publisher.java:34) Caused by: java.io.NotSerializableException: org.hornetq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:891) at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1063) at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1019) at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:885) at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1063) at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1019) at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:998) at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:885) at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:62) at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:119) at org.jboss.naming.remote.protocol.v1.Protocol$1$2.write(Protocol.java:138) at org.jboss.naming.remote.protocol.v1.WriteUtil.write(WriteUtil.java:61) at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:128) at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: an exception which occurred: in field loadBalancingPolicy in field serverLocator in object org.hornetq.jms.client.HornetQJMSConnectionFactory@ea074d

Exception was happening when the app was trying to lookup the connection factory

QueueConnectionFactory qcf = (QueueConnectionFactory)context.lookup("jms/RemoteConnectionFactory");

Below are the steps on how we resolved the issue

Pavan Kulkarni
  • 476
  • 5
  • 17

1 Answers1

1

There was almost zero help for resolving this issue. A web search on this exception returned next to nothing. However, this particular thread on JBoss AS Dev site spinned a thought in my head: RemoteConnectionFactory is not found when looking up in a remote client

The scenario mentioned in this thread was not same as ours. (In our app this is the first and the only lookup happening.) This thread got me thinking towards a possible connection factory initialization issue. While there is nothing I could do to debug or find the issue around it, I thought that if I could reinitialize it, that would help.

So I tried lookup with java:jboss/exported/jms/RemoteConnectionFactory As expected it failed with a NamingException. Hoping that this naming syntax (using java:/) would have resulted in a reinitialization, I tried lookup again with jms/RemoteConnectionFactory. And bingo!!! it worked!

Unfortunately, we still don't know why it happened, and if it is just a one-off case! Documenting it here just in case some mortal soul hits this issue.

Pavan Kulkarni
  • 476
  • 5
  • 17
  • The issue has reappeared and now doesn't get solved with the above trick (hence, I have unaccepted the answer). Any JBoss experts, pls? – Pavan Kulkarni Jul 31 '13 at 09:42
  • Just came across this question after encountering a similar problem. For your specific error, it looks like there's a related bug which is claimed to be fixed in JBoss 7.1.3 https://issues.jboss.org/browse/AS7-4217 Perhaps that fixes the problem? – Stan Kurdziel Nov 02 '13 at 00:35