File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes Strange exception when migrating to HornetQ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Strange exception when migrating to HornetQ" Watch "Strange exception when migrating to HornetQ" New topic
Author

Strange exception when migrating to HornetQ

Michael Van
Ranch Hand

Joined: Nov 25, 2003
Posts: 33
I'm migrating an older application from JBoss 4.2.2 to JBoss 6.1.0.FINAL. I've worked through most of the issues, however there is one last JMS problem I'm seeing. After creating the hornetq-jms.xml file with all of my queues, and attempting to get the queues and injecting them into my jms template, I'm getting the following excepion:
12:32:26,133 ERROR [STDERR] javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
12:32:26,133 ERROR [STDERR] java.lang.ClassNotFoundException: org.jboss.mq.referenceable.ObjectRefAddr (no security manager: RMI class loader disabled)]]
12:32:26,134 ERROR [STDERR] at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1356)
12:32:26,134 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:819)
12:32:26,134 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
12:32:26,134 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:392)
12:32:26,134 ERROR [STDERR] at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)
12:32:26,134 ERROR [STDERR] at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
12:32:26,134 ERROR [STDERR] at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
12:32:26,135 ERROR [STDERR] at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
12:32:26,135 ERROR [STDERR] at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
12:32:26,135 ERROR [STDERR] at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
12:32:26,135 ERROR [STDERR] at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201)
12:32:26,135 ERROR [STDERR] at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187)
12:32:26,135 ERROR [STDERR] at com.myCompany.util.external.domainObject.patch.JmsTemplateFactory.init(JmsTemplateFactory.java:66)
12:32:26,135 ERROR [STDERR] at com.myCompany.util.external.domainObject.patch.JmsTemplateFactory.<init>(JmsTemplateFactory.java:43)
12:32:26,136 ERROR [STDERR] at com.myCompany.util.external.patch.ObjectMessageReceiver.start(ObjectMessageReceiver.java:53)
12:32:26,136 ERROR [STDERR] at com.myCompany.util.external.patch.ObjectMessageReceiver.run(ObjectMessageReceiver.java:37)
12:32:26,136 ERROR [STDERR] at org.jboss.resource.work.WorkWrapper.run(WorkWrapper.java:172)
12:32:26,136 ERROR [STDERR] at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)
12:32:26,136 ERROR [STDERR] at org.jboss.threads.CleanupExecutor.execute(CleanupExecutor.java:38)
12:32:26,136 ERROR [STDERR] at org.jboss.threads.CleanupExecutor.execute(CleanupExecutor.java:38)
12:32:26,137 ERROR [STDERR] at org.jboss.threads.QueuelessExecutor$Worker.run(QueuelessExecutor.java:614)
12:32:26,137 ERROR [STDERR] at java.lang.Thread.run(Thread.java:662)
12:32:26,137 ERROR [STDERR] at org.jboss.threads.JBossThread.run(JBossThread.java:122)
12:32:26,137 ERROR [STDERR] Caused by: javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
12:32:26,137 ERROR [STDERR] java.lang.ClassNotFoundException: org.jboss.mq.referenceable.ObjectRefAddr (no security manager: RMI class loader disabled)]
12:32:26,138 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:841)
12:32:26,138 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
12:32:26,138 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:392)
12:32:26,138 ERROR [STDERR] at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1350)
12:32:26,138 ERROR [STDERR] ... 22 more
12:32:26,139 ERROR [STDERR] Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
12:32:26,139 ERROR [STDERR] java.lang.ClassNotFoundException: org.jboss.mq.referenceable.ObjectRefAddr (no security manager: RMI class loader disabled)
12:32:26,139 ERROR [STDERR] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:178)
12:32:26,139 ERROR [STDERR] at org.jboss.ha.framework.server.HARMIServerImpl_Stub.invoke(Unknown Source)
12:32:26,139 ERROR [STDERR] at org.jboss.ha.framework.interfaces.HARMIClient.invokeRemote(HARMIClient.java:225)
12:32:26,139 ERROR [STDERR] at org.jboss.ha.framework.interfaces.HARMIClient.invoke(HARMIClient.java:327)
12:32:26,140 ERROR [STDERR] at $Proxy210.lookup(Unknown Source)
12:32:26,140 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728)
12:32:26,140 ERROR [STDERR] ... 25 more
12:32:26,140 ERROR [STDERR] Caused by: java.lang.ClassNotFoundException: org.jboss.mq.referenceable.ObjectRefAddr (no security manager: RMI class loader disabled)
12:32:26,141 ERROR [STDERR] at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:373)
12:32:26,141 ERROR [STDERR] at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:163)
12:32:26,141 ERROR [STDERR] at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
12:32:26,141 ERROR [STDERR] at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:91)
12:32:26,141 ERROR [STDERR] at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
12:32:26,141 ERROR [STDERR] at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
12:32:26,142 ERROR [STDERR] at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1574)
12:32:26,142 ERROR [STDERR] at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)
12:32:26,142 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)
12:32:26,142 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
12:32:26,142 ERROR [STDERR] at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1666)
12:32:26,142 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1322)
12:32:26,143 ERROR [STDERR] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
12:32:26,143 ERROR [STDERR] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
12:32:26,143 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
12:32:26,143 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
12:32:26,143 ERROR [STDERR] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
12:32:26,143 ERROR [STDERR] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
12:32:26,144 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
12:32:26,144 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
12:32:26,144 ERROR [STDERR] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
12:32:26,144 ERROR [STDERR] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
12:32:26,144 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
12:32:26,144 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
12:32:26,144 ERROR [STDERR] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
12:32:26,145 ERROR [STDERR] at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306)
12:32:26,145 ERROR [STDERR] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:155)
12:32:26,145 ERROR [STDERR] ... 30 more

My hornetq-jms.xml file is pretty standard:



The pertinent portions of my jmsTemplate102 implementation are:



Any idea why this is giving me the exception?

Mike Van
Apache Software Foundation Committer
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10289
    
168

The exception stacktrace has references to JBoss MQ (and not HornetQ) which is an indication that you are looking up the wrong JNDI name. I'm not sure why it didn't throw a NameNotFoundException for that JNDI name you are looking up (UIL2ConnectionFactory), since it shouldn't be available in first place. Perhaps the lookup is happening on some remote server where JBoss MQ related components are bound in JNDI? The provider url value in that JNDI properties of your code, is important to figure out where the lookup is directed to.

[My Blog] [JavaRanch Journal]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Strange exception when migrating to HornetQ