commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james_strac...@yahoo.co.uk>
Subject Re: messenger: running on caucho resin
Date Wed, 22 Jan 2003 12:03:52 GMT
I got some more information on this from Tim Anderson who works on OpenJMS,
for details of how to create a connection by hand...

> . name - the name of the proxy class.
> . env  - properties used by the proxy to connect to the OpenJMS server
>
> Both vary depending on the connector (rmi, tcp, http, etc) being used, the
> details
> of which should be considered opaque.
>
> The recommended way is to obtain the factory via JNDI. Eg, for the
> rmi connector:
> Hashtable properties = new Hashtable();
> properties.put(Context.PROVIDER_URL, "rmi://myhost:1099/JndiServer");
> properties.put(Context.INITIAL_CONTEXT_FACTORY,
>
> "org.exolab.jms.jndi.rmi.RmiJndiInitialContextFactory");
>
> Context context = new InitialContext(properties);
> TopicConnectionFactory factory =
> context.lookup("JmsTopicConnectionFactory");
>
> The Messenger JNDISessionFactory class would work with the above
properties.

James
-------
http://radio.weblogs.com/0112098/
----- Original Message -----
From: "James Strachan" <james_strachan@yahoo.co.uk>
To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
Sent: Tuesday, January 21, 2003 10:25 AM
Subject: Re: messenger: running on caucho resin


> I don't know OpenJMS very well but it looks like there's an issue with
their
> JmsTopicConnectionFactory. e.g.
>
> java.lang.NullPointerException
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:115)
>         at org.exolab.jms.client.JmsConnectionFactory.getProxy(Unknown
> Source)
>         at org.exolab.jms.client.JmsConnection.<init>(Unknown Source)
>         at org.exolab.jms.client.JmsTopicConnection.<init>(Unknown
> Source)
>         at
> org.exolab.jms.client.JmsTopicConnectionFactory.createTopicConnection
> (Unknown Source)
>
> From a quick look at the code...
>
>
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/openjms/openjms/src/main/org/
> exolab/jms/client/
>
> It looks like the JmsTopicConnectionFactory needs to be initialised with
the
> constructor passing in a class name of some sort. It might be an idea to
> fire off a mail to the OpenJMS list to ask for an example of how the
> JmsTopicConnectionFactory can be used from Java code to create a
> TopicConnection. (It might also be useful to patch the default constructor
> to default a useful className or at least add a more descriptive error
> check).
>
> James
> -------
> http://radio.weblogs.com/0112098/
>
>
> From: "Ryan Vanderwerf" <rvanderwerf@metrowerks.com>
> To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
> Sent: Monday, January 20, 2003 9:48 PM
> Subject: RE: messenger: running on caucho resin
>
>
> James, I tried your suggestion and got a little farther with another
> error:
>
> [2003-01-20 15:34:40,897] DEBUG [main] [messenger.SessionFactory] About
> to create a connection from:
> org.exolab.jms.client.JmsTopicConnectionFactory@2acc65
> java.lang.NullPointerException
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:115)
>         at org.exolab.jms.client.JmsConnectionFactory.getProxy(Unknown
> Source)
>         at org.exolab.jms.client.JmsConnection.<init>(Unknown Source)
>         at org.exolab.jms.client.JmsTopicConnection.<init>(Unknown
> Source)
>         at
> org.exolab.jms.client.JmsTopicConnectionFactory.createTopicConnection
> (Unknown Source)
>         at
> org.exolab.jms.client.JmsTopicConnectionFactory.createTopicConnection
> (Unknown Source)
>         at
> org.apache.commons.messenger.SessionFactory.createTopicConnection(Ses
> sionFactory.java:253)
>         at
> org.apache.commons.messenger.SessionFactory.createConnection(SessionF
> actory.java:107)
>         at
> org.apache.commons.messenger.SessionFactory.getConnection(SessionFact
> ory.java:128)
>         at
> org.apache.commons.messenger.DefaultMessenger.getConnection(DefaultMe
> ssenger.java:79)
>         at
> org.apache.commons.messenger.DefaultMessenger.createSession(DefaultMe
> ssenger.java:157)
>         at
> org.apache.commons.messenger.DefaultMessenger.borrowSession(DefaultMe
> ssenger.java:130)
>         at
> org.apache.commons.messenger.MessengerSupport.toString(MessengerSuppo
> rt.java:101)
>         at java.lang.String.valueOf(String.java:1942)
>         at java.lang.StringBuffer.append(StringBuffer.java:365)
>         at
> org.apache.commons.digester.SetNextRule.end(SetNextRule.java:238)
>         at
> org.apache.commons.digester.Digester.endElement(Digester.java:1036)
>         at
> org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1403)
>         at
> org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLVa
> lidator.java:1385)
>         at
> org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.disp
> atch(XMLDocumentScanner.java:1260)
>         at
> org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
> canner.java:381)
>         at
> org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952)
>         at
> org.apache.commons.digester.Digester.parse(Digester.java:1552)
>         at
> org.apache.commons.messenger.MessengerManager.load(MessengerManager.j
> ava:57)
>         at
> org.apache.commons.messagelet.ManagerServlet.createMessengerManager(M
> anagerServlet.java:278)
>         at
> org.apache.commons.messagelet.ManagerServlet.init(ManagerServlet.java
> :95)
>         at javax.servlet.GenericServlet.init(GenericServlet.java:82)
>         at
> com.caucho.server.http.Application.createServlet(Application.java:310
> 1)
>         at
> com.caucho.server.http.Application.loadServlet(Application.java:3052)
>
>         at
> com.caucho.server.http.Application.initServlets(Application.java:1915
> )
>         at
> com.caucho.server.http.Application.init(Application.java:1828)
>         at com.caucho.server.http.VirtualHost.init(VirtualHost.java:720)
>         at
> com.caucho.server.http.ServletServer.initHosts(ServletServer.java:853
> )
>         at
> com.caucho.server.http.ServletServer.initInternal(ServletServer.java:
> 698)
>         at
> com.caucho.server.http.ServletServer.init(ServletServer.java:509)
>         at com.caucho.server.http.ResinServer.init(ResinServer.java:375)
>         at
> com.caucho.server.http.ResinServer.main(ResinServer.java:1131)
>         at com.caucho.server.http.HttpServer.main(HttpServer.java:103)
> [2003-01-20 15:34:40,927] DEBUG [main] [digester.Digester]
> [SetNextRule]{manager
> /messenger} Call
> org.apache.commons.messenger.MessengerManager.addMessenger(org.
> apache.commons.messenger.DefaultMessenger@7fc686 session:
> javax.jms.JMSException
> : Failed to create proxy b/c java.lang.NullPointerException)
> --------------------------
> Perhaps it's not as simple as extending SessionFactory and over-riding
> the constructor for createConnectionFactory?
>
>
> Ryan
>
> -----Original Message-----
> From: James Strachan [mailto:james_strachan@yahoo.co.uk]
> Sent: Thursday, January 09, 2003 12:22 PM
> To: Jakarta Commons Users List
> Subject: Re: messenger: running on caucho resin
>
> FWIW you only need to construct a ConnectionFactory instance. So you
> don't
> need to mess around creating Topic/QueueSessions or
> Topic/QueueConnections
> or any of that stuff.
> Literally alll you need to do is something like...
>
> import org.exolab.jms.client.JmsTopicConnectionFactory;
> import org.apache.commons.messenger.SessionFactory;
>
> public OpenJMSTopicSessionFactory extends SessionFactory {
>     protected ConnectionFactory createConnectionFactory() throws
> JMSException {
>         return new JmsTopicConnectionFactory();
>     }
> }
>
> And it should just work irrespective of JNDI.
>
> Though I'm sure there's a way to get OpenJMS working with Caucho's JNDI
> provider since the connection factories implement java.io.Externalizable
> and
> javax.naming.Referenceable
>
> James
> -------
> http://radio.weblogs.com/0112098/
> ----- Original Message -----
> From: "Ryan Vanderwerf" <rvanderwerf@metrowerks.com>
> To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
> Sent: Thursday, January 09, 2003 5:04 PM
> Subject: RE: messenger: running on caucho resin
>
>
> Thanks for the response! Yes I've used OpenJMS with Caucho Resin the
> past without a problem, however I did write my own session management
> class - it was very messy though - which is the reason messenger looks
> so appealing :)
>
> I'll look into writing my own SessionFactory implementation which at
> least gives me a more organized structure to do it in.
>
> What is weird is it's talking to OpenJMS in some way now, if my OpenJMS
> isn't running it tells me so in the debug log. I'm not sure how to get a
> better stack trace out of the debug stuff. It doesn't look hard to make
> my own session factory anyways.
>
> Ryan
>
> -----Original Message-----
> From: James Strachan [mailto:james_strachan@yahoo.co.uk]
> Sent: Thursday, January 09, 2003 8:35 AM
> To: Jakarta Commons Users List
> Subject: Re: messenger: running on caucho resin
>
> Knowing the stack trace of the underlying NotSerializableException would
> help some. From what you've given it looks like Messenger is trying to
> lookup a JMS TopicConnectionFactory from JNDI and failing with a
> Resin-generated NotSerializableException message.
>
> First off; can you get OpenJMS to work with Resin at all? i.e. lookup an
> OpenJMS TopicConnectionFactory in Resin's JNDI?
>
> What could well be easier for you is to write a plugin for Messenger, a
> SessionFactory implementation...
>
> http://jakarta.apache.org/commons/sandbox/messenger/apidocs/org/apache/c
> ommons/messenger/SessionFactory.html
>
> which explicitly creates OpenJMS connections. Then you don't need to
> worry about JNDI. All you need to do is implement the
> createConnectionFactory() method to create an OpenJMS specific
> ConnectionFactory and you're away.
>
> FWIW SpiritWave comes with its own Messenger factory to avoid the need
> to use JNDI to create JMS connections with Messenger; I'm sure the same
> could be done for OpenJMS.
>
> James
> -------
> http://radio.weblogs.com/0112098/
>   ----- Original Message -----
>   From: Ryan Vanderwerf
>   To: commons-user@jakarta.apache.org
>   Sent: Wednesday, January 08, 2003 10:20 PM
>   Subject: messenger: running on caucho resin
>
>
>   Hi, I'm a newbie to the messenger sandbox project, and had a couple
> questions on getting it running with Cacho Resin 2.1.6. I'm running the
> latest OpenJMS server, running with the default queue in rmi_jms.xml and
> the pre-packaged Messenger.xml that comes with messenger for OpenJMS.
>
>
>
>   My problem is when I start the managerServlet everything seems to run
> fine except for an NotSerializable error I get on startup - this is the
> debug info it spits out:
>
>
>
>   [2003-01-08 16:05:32,739] DEBUG [main] [digester.Digester]
> [SetNextRule]{manager
>
>   /messenger} Call
> org.apache.commons.messenger.MessengerManager.addMessenger(org.
>
>   apache.commons.messenger.DefaultMessenger@7fc686 session:
> javax.jms.JMSException
>
>   : Failed to lookup: JmsTopicConnectionFactory using JNDI.
> javax.naming.NamingExc
>
>   eption: error marshalling arguments; nested exception is:
>
>           java.io.NotSerializableException:
> com.caucho.util.ClassLoaderLocal [Root
>
>    exception is java.rmi.MarshalException: error marshalling arguments;
> nested exc
>
>   eption is:
>
>           java.io.NotSerializableException:
> com.caucho.util.ClassLoaderLocal])
>
>
>
>
>
>
>
>   Does anyone that uses messenger lead me in the right direction? It
> looks like a very slick app, in the past I've had to write all the
> connection management stuff for JMS manually which was plenty of work -
> messenger seems to take care of all that. I'm just wondering what I am
> missing here, or if it just doesn't work on resin (I don't see why it
> wouldn't) especially if I am using the build in JNDI server in OpenJMS.
>
>
>
>   Ryan
>
>
>
>
>
>   More debug info that it spat out attached:
>
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------
> ------
>
>
>   --
>   To unsubscribe, e-mail:
> <mailto:commons-user-unsubscribe@jakarta.apache.org>
>   For additional commands, e-mail:
> <mailto:commons-user-help@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
> <mailto:commons-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> mailto:commons-user-help@jakarta.apache.org
>
> __________________________________________________
>
> Do You Yahoo!?
>
> Everything you'll ever need on one web page
>
> from News and Sport to Email and Music Charts
>
> http://uk.my.yahoo.com
>
>
> --
> To unsubscribe, e-mail:
> <mailto:commons-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:commons-user-help@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:commons-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:commons-user-help@jakarta.apache.org>
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
>
> --
> To unsubscribe, e-mail:
<mailto:commons-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:commons-user-help@jakarta.apache.org>
>

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

Mime
View raw message