-
1. Re: Exception while trying to rebind a temporary hornetq queue ..any solution
ataylor Dec 14, 2010 6:52 AM (in response to srimanta.maji)firstly, i don't understand why you want to add a temp queue to jndi, only the connections sessions that created it can create consumers on it?
-
2. Re: Exception while trying to rebind a temporary hornetq queue ..any solution
srimanta.maji Dec 14, 2010 7:19 AM (in response to ataylor)Actually we are developing a distributed system where each component can communicate with each other through messaging and here i need to create queue on the fly and bind these queue with autogenerated name which is used to create a publisher on those temprary queue from others component.
First i have to lookup with this name and then create publisher.That's why i need to rebind it after creating temporary queue.The same logic is working fine with jboss5.Now i am trying to replace the jboss5 with the jboss6 but has failed to do so.
Please suggest a better solution.
Thanks
-
3. Re: Exception while trying to rebind a temporary hornetq queue ..any solution
ataylor Dec 14, 2010 7:19 AM (in response to srimanta.maji)you need to bind the queue reference not the queu eitself, i.e. queue.getReference()
-
4. Re: Exception while trying to rebind a temporary hornetq queue ..any solution
srimanta.maji Dec 14, 2010 7:51 AM (in response to ataylor)Thanks for the reply.
Invoking queue.getReference() results in same exception.I am sending you the code block to create a temporary queue below .
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
p.put(Context.URL_PKG_PREFIXES, " org.jboss.naming:org.jnp.interfaces");
p.put(Context.PROVIDER_URL, "jnp://192.168.33.30:45447");
Context ic = javax.naming.InitialContext(p);ConnectionFactory cf = (ConnectionFactory) ic.lookup("/ConnectionFactory");
Connection connection= cf.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Queue queue = session.createTemporaryQueue();ic.rebind("TestQueue", queue);//generates exception
queue.getReference() // generates same exception.That's why i am not being able to use the reference.
-
5. Re: Exception while trying to rebind a temporary hornetq queue ..any solution
ataylor Dec 14, 2010 8:01 AM (in response to srimanta.maji)can you debug SerializableObjectRefAddr line 63 and get the underlying exception
-
6. Re: Exception while trying to rebind a temporary hornetq queue ..any solution
srimanta.maji Dec 14, 2010 8:13 AM (in response to ataylor)What i have understood that HornetQDestination implementaion has a reference of HornetQSession which is not serializable.
In both the cases it is attemting to create an object of SerializableObjectRefAddr which is taking instance of HornetQDestination and serialize it.
Thus generates exception.Can we consider it as a bug?
-
7. Re: Exception while trying to rebind a temporary hornetq queue ..any solution
ataylor Dec 14, 2010 8:39 AM (in response to srimanta.maji)The hornetqsession is transient so won't be serialized. can you post the underlying stack trace
-
8. Re: Exception while trying to rebind a temporary hornetq queue ..any solution
srimanta.maji Dec 14, 2010 8:47 AM (in response to ataylor)I am using jboss-6.0.0.20101110-CR1.I downloaded hornetq-2.1.1.Final-src and in this distribution hornetqsession is not transient.
I tried making it transient in the source and it has ran fine. -
9. Re: Exception while trying to rebind a temporary hornetq queue ..any solution
ataylor Dec 14, 2010 8:49 AM (in response to srimanta.maji)ok, i guess thats a bug thats already been fixed
-
10. Re: Exception while trying to rebind a temporary hornetq queue ..any solution
jaikiran Dec 14, 2010 8:50 AM (in response to srimanta.maji)Srimanta Maji wrote:
I am using jboss-6.0.0.20101110-CR1.I downloaded hornetq-2.1.1.Final-src and in this distribution hornetqsession is not transient.
6.0.0 CR1 JBoss AS, comes with 2.1.2 Final of HornetQ http://anonsvn.jboss.org/repos/jbossas/tags/6.0.0.20101110-CR1/component-matrix/pom.xml
<version.hornetq>2.1.2.Final</version.hornetq>