Re: ConnectionFactory.createConnection returns null

Tim Anderson <[email protected]> Mon, 04 Jun 2007 09:22:07 +1000
Newsgroups gmane.comp.java.openjms.user
Message-ID <[email protected]>
There are no circumstances in 0.7.7 where
ConnectionFactory.createConnection() will return null.
You have some other issue. Without seeing the stack trace, I can't say
what it might be.

-Tim


George H wrote:
> Hi,
>
> I've struggled a bit with similar problems. First off I'd say make
> sure your program is reading your jndi.properties file correctly
> (maybe it's not in your class path?) or maybe it is not setup right?
> using the standard tcp, also noticed that the OpenJMS server must
> listen on both TCP and RMI ports for it to actually work. I once
> turned off the RMI listener and nothing worked.
>
> On 5/26/07, Judd Bourgeois <[email protected]> wrote:
>   
>> I have a small application that has run fine in the past using Sun MQ 3.6.
>> The MQ server is being replaced so I decided to try out OpenJMS as a
>> potential replacement.
>>
>> I'm able to connect to OpenJMS and create a ConnectionFactory (CF) but my CF
>> does not appear to create connections properly.  It simply returns null when
>> I call createConnection() and does not throw any exceptions.  Here's a code
>> snippet:
>>
>> // set up initial context
>> Properties prop = new Properties();
>> prop.put(Context.INITIAL_CONTEXT_FACTORY, CTX);
>> prop.put(Context.PROVIDER_URL, PROV_URL);
>> Context ictx = new InitialContext(prop);
>>
>> ConnectionFactory cf = (ConnectionFactory) ictx.lookup(MYQCF_LOOKUP_NAME);
>> Connection cnx = cf.createConnection("admin", "openjms");
>> Session sess = cnx.createSession(true, 0); /* Null pointer exception thrown
>> here */
>>
>> I'm a little stumped.  There's nothing in the OpenJMS log that offers any
>> clues.
>>
>> Thanks-
>> J
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/
>> _______________________________________________
>> openjms-user mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/openjms-user
>>     


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/