Aha, more information!
I removed web1 from being a target in the queue configuration and I got an error (couldn't find the queue). Which suprised me because I'm creating my initial context thus:
Properties props = new Properties();
props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory");
props.setProperty(Context.PROVIDER_URL,"iiop://enterprise1:33701");
props.setProperty("org.omg.CORBA.ORBInitialHost", "enterprise1");
props.setProperty("org.omg.CORBA.ORBInitialPort", "33701");
InitialContext ctx new InitialContext(props);
enterprise1 DOES have access to these queues (I checked with hermes), but web1 doesn't....so why would looking things up on this context still be querying the web1 context??? It's like glassfish is ignoring the properties I'm supplying to the initial context when I'm running it in a web container.
--- On Wed, 13/5/09, Adam Jenkins <adamjenkinstmpredirect@yahoo.com.au> wrote:
> From: Adam Jenkins <adamjenkinstmpredirect@yahoo.com.au>
> Subject: ARRGGH - Glassfish/JMS/Web Tier Crazy!
> To: users@glassfish.dev.java.net
> Received: Wednesday, 13 May, 2009, 8:16 AM
>
> Hi All,
>
> I have two glassfish instances (on the same machine for
> now) being managed by a node agent. One is called web1
> (web tier) the other is called enterprise1 (ejbs and message
> driven beans etc).
>
> I have a JMS queue that has both as the target...but when I
> put a message on the queue from enterprise1 (or when using
> hermes) it won't retrieve it in the web tier. The
> result from MessageConsumer.retrieve is a null object (which
> indicates that the connection may be being closed
> somewhere??).
>
> Interestingly, I changed my code so that, rather than
> injecting the queue and queueConnectionFactory using
> @Resource, I create a remote targetted InitialContext
> (pointing directly at enterprise1 and the associated port)
> by code and ran it...same thing happened...null Message.
>
> Then I took that remote code and copy and pasted it into a
> java test application (just a good old fashioned public
> static void main(...)) and it worked fine! It
> retrieved the text message off the queue.
>
> Can anyone suggest why there might be a problem here...it's
> not like it can't connect...I can lookup the
> QueueConnectionFactory, look up the Queue, create and start
> the Connection, create the session and try to retrieve the
> message...but the message is just null!
>
> Any help would be really appreciated, we're desperately
> trying to get an application that's been two years in
> developments, and tested extensively in a dev environment,
> deployed into production and keep hitting really odd things
> like this.
>
> Cheers
> Adam
>
>
> Need a Holiday? Win a $10,000 Holiday
> of your choice. Enter now.
http://us.lrd.yahoo.com/_ylc=X3oDMTJxN2x2ZmNpBF9zAzIwMjM2MTY2MTMEdG1fZG1lY2gDVGV4dCBMaW5rBHRtX2xuawNVMTEwMzk3NwR0bV9uZXQDWWFob28hBHRtX3BvcwN0YWdsaW5lBHRtX3BwdHkDYXVueg--/SIG=14600t3ni/**http%3A//au.rd.yahoo.com/mail/tagline/creativeholidays/*http%3A//au.docs.yahoo.com/homepageset/%3Fp1=other%26p2=au%26p3=mailtagline
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>