geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sami Dalouche <sko...@free.fr>
Subject Re: Creating JMS Topics + JNDI
Date Sat, 30 Jul 2005 05:00:58 GMT
OK, some news regarding my previous problem :

- I found a sample Ressource Adapter configuration file, so I can now deploy my
resource adapter without any exception.  (under the name weather/Topics).
so, it should have deployes 2 topics :
 jms/weatherTopic and jms/weatherRequestsTopic

- However, when I lookup  "jms/weatherTopic" or  "jms/weatherRequestsTopic"
through my Spring-acquired JNDI context, it says
javax.naming.NameNotFoundException: jms/weatherRequestsTopic


So I'm wondering :
- Is there a waay to check that some JNDI entry is actually present ?
- Does activeMq register the names under something else as what we specify ?
- Any idea regarding this problem ?

Thanks a lot

Here's the log
00:48:20,455 DEBUG [Configuration] ClassPath for weather/Topics resolved to
[file:/D:/geronimo/config-store/24/rar/activemq-ra-3.1-SNAPSHOT.jar,
file:/D:/geronimo/config-store/24/rar/activemq-core-3.1-SNAPSHOT.jar,
file:/D:/geronimo/config-store/24/rar/activemq-optional-3.1-SNAPSHOT.jar,
file:/D:/geronimo/config-store/24/rar/xstream-SNAPSHOT.jar,
file:/D:/geronimo/config-store/24/rar/jmdns-0.2.jar,
file:/D:/geronimo/config-store/24/rar/activecluster-1.1-SNAPSHOT.jar,
file:/D:/geronimo/config-store/24/rar/spring-1.1.jar,
file:/D:/geronimo/config-store/24/rar/activeio-1.0.jar,
file:/D:/geronimo/config-store/24/rar/derby-10.0.2.1.jar,
file:/D:/geronimo/config-store/24/rar/commons-logging-1.0.3.jar,
file:/D:/geronimo/config-store/24/rar/concurrent-1.3.4.jar]
00:48:20,549 INFO  [Configuration] Started configuration weather/Topics
00:48:20,549 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.config:name="weather/Topics" State changed from starting to running
00:48:20,549 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.server:name=weather/Topics,J2EEServer=geronimo,J2EEApplication=null,j2eeType=ResourceAdapter,ResourceAdapterModule=weather/Topics
State changed from stopped to starting
00:48:20,549 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.server:name=weather/Topics,J2EEServer=geronimo,J2EEApplication=null,j2eeType=ResourceAdapter,ResourceAdapterModule=weather/Topics
State changed from starting to running
00:48:20,549 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.server:name=weather/Topics,J2EEServer=geronimo,J2EEApplication=null,j2eeType=JCAResource,ResourceAdapter=weather/Topics
State changed from stopped to starting
00:48:20,549 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.server:name=weather/Topics,J2EEServer=geronimo,J2EEApplication=null,j2eeType=JCAResource,ResourceAdapter=weather/Topics
State changed from starting to running
00:48:20,549 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.server:JCAResource=weather/Topics,name=jms/weatherTopic,J2EEServer=geronimo,J2EEApplication=null,j2eeType=JCAAdminObject
State changed from stopped to starting
00:48:20,549 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.server:JCAResource=weather/Topics,name=jms/weatherTopic,J2EEServer=geronimo,J2EEApplication=null,j2eeType=JCAAdminObject
State changed from starting to running
00:48:20,549 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.server:JCAResource=weather/Topics,name=ActiveMQ
RA,J2EEServer=geronimo,J2EEApplication=null,j2eeType=JCAResourceAdapter State
changed from stopped to starting
00:48:20,564 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.server:JCAResource=weather/Topics,name=ActiveMQ
RA,J2EEServer=geronimo,J2EEApplication=null,j2eeType=JCAResourceAdapter State
changed from starting to running
00:48:20,564 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.server:JCAResource=weather/Topics,name=ConnectionFactory,J2EEServer=geronimo,J2EEApplication=null,j2eeType=JCAManagedConnectionFactory
State changed from stopped to starting
00:48:20,564 DEBUG [GBeanSingleReference] Waiting to start
geronimo.server:JCAResource=weather/Topics,name=ConnectionFactory,J2EEServer=geronimo,J2EEApplication=null,j2eeType=JCAManagedConnectionFactory
because no targets are running for reference ConnectionManagerContainer matching
the patternspatterns
geronimo.server:J2EEApplication=null,J2EEServer=geronimo,JCAResource=weather/Topics,j2eeType=JCAConnectionManager,name=ConnectionFactory
00:48:20,564 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.server:JCAResource=weather/Topics,name=jms/weatherRequestsTopic,J2EEServer=geronimo,J2EEApplication=null,j2eeType=JCAAdminObject
State changed from stopped to starting
00:48:20,564 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.server:JCAResource=weather/Topics,name=jms/weatherRequestsTopic,J2EEServer=geronimo,J2EEApplication=null,j2eeType=JCAAdminObject
State changed from starting to running
00:48:20,564 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.server:JCAResource=weather/Topics,name=ConnectionFactory,J2EEServer=geronimo,J2EEApplication=null,j2eeType=JCAConnectionFactory
State changed from stopped to starting
00:48:20,564 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.server:JCAResource=weather/Topics,name=ConnectionFactory,J2EEServer=geronimo,J2EEApplication=null,j2eeType=JCAConnectionFactory
State changed from starting to running
00:48:20,564 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.server:JCAResource=weather/Topics,name=ConnectionFactory,J2EEServer=geronimo,J2EEApplication=null,j2eeType=JCAConnectionManager
State changed from stopped to starting
00:48:20,564 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.server:JCAResource=weather/Topics,name=ConnectionFactory,J2EEServer=geronimo,J2EEApplication=null,j2eeType=JCAConnectionManager
State changed from starting to running
00:48:20,564 DEBUG [ManagedConnectionFactoryWrapper] Registered
managedConnectionFactory with ResourceAdapter
[org.apache.geronimo.connector.ResourceAdapterWrapper$$EnhancerByCGLIB$$4d33a03a:
geronimo.server:JCAResource=weather/Topics,name=ActiveMQ
RA,J2EEServer=geronimo,J2EEApplication=null,j2eeType=JCAResourceAdapter]
00:48:20,564 DEBUG [ManagedConnectionFactoryWrapper] Bound connection factory
into global 'ger:' context at jms/ConnectionFactory
00:48:20,564 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.server:JCAResource=weather/Topics,name=ConnectionFactory,J2EEServer=geronimo,J2EEApplication=null,j2eeType=JCAManagedConnectionFactory
State changed from starting to running
00:48:20,580 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.server:name=weather/Topics,J2EEServer=geronimo,J2EEApplication=null,j2eeType=ResourceAdapterModule
State changed from stopped to starting
00:48:20,580 DEBUG [GBeanInstanceState] GBeanInstanceState for:
geronimo.server:name=weather/Topics,J2EEServer=geronimo,J2EEApplication=null,j2eeType=ResourceAdapterModule
State changed from starting to running

Here is my relevant spring config file

    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
        <property name="environment">
            <props>
                <prop
key="java.naming.factory.initial">${jms.jndiContextFactory}</prop>
                <prop
key="java.naming.provider.url">${jms.jndiProviderUrl}</prop>
            </props>
        </property>
    </bean>

    <!-- Internal JMS Queue Connection Factory -->
    <bean id="internalJmsQueueConnectionFactory"
        class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiTemplate">
            <ref bean="jndiTemplate"/>
        </property>
        <property name="jndiName">
            <value>${jms.connectionFactoryName}</value>
        </property>
    </bean>

	<bean id="weatherRequestTopic"
		class="org.springframework.jndi.JndiObjectFactoryBean"
		singleton="true">
        <property name="jndiTemplate">
            <ref bean="jndiTemplate"/>
        </property>
        <property name="jndiName">
            <value>${jms.weatherRequestsTopic}</value>
        </property>
	</bean>


Selon David Jencks <djencks@gluecode.com>:

> comments inline
> On Jul 29, 2005, at 7:05 PM, Sami Dalouche wrote:
>
> >
> >
> > Hi,
> >
> > I'm currently trying to
> >
> > 1) Create some JMS Topics
> > 2) Expose a ConnectionFactory + the Topics through JNDI
> >
> > ->
> >
> > I'm using the following RA
> > <connector
> >     xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector"
> >     version="1.5"
> >     configId="weather/jms/TopicsConfiguration"
> >     parentId="org/apache/geronimo/System">
> >
> >   <resourceadapter>
> >     <!-- how to connect to the JMS Server -->
> >     <resourceadapter-instance>
> >       <resourceadapter-name>My JMS Resources</resourceadapter-name>
> >       <config-property-setting
> > name="ServerUrl">tcp://localhost:61616</config-property-setting>
> >       <config-property-setting
> > name="UserName">system</config-property-setting>
> >       <config-property-setting
> > name="Password">manager</config-property-setting>
> >       <workmanager-name>DefaultWorkManager</workmanager-name>
> >     </resourceadapter-instance>
> >     <!-- defines a ConnectionFactory -->
> >     <outbound-resourceadapter>
> >       <connection-definition>
> >
> > <connectionfactory-interface>javax.jms.ConnectionFactory</
> > connectionfactory-interface>
> >         <connectiondefinition-instance>
> >           <name>ConnectionFactory</name>
> >
> > <implemented-interface>javax.jms.QueueConnectionFactory</implemented-
> > interface>
> >
> > <implemented-interface>javax.jms.TopicConnectionFactory</implemented-
> > interface>
> >           <connectionmanager>
> >             <xa-transaction>
> >               <transaction-caching />
> >             </xa-transaction>
> >             <single-pool>
> >               <max-size>10</max-size>
> >               <min-size>0</min-size>
> >               <blocking-timeout-milliseconds>
> >                 5000
> >               </blocking-timeout-milliseconds>
> >               <idle-timeout-minutes>
> >                 0
> >               </idle-timeout-minutes>
> >               <match-one/>
> >             </single-pool>
> >           </connectionmanager>
> >           <global-jndi-name>
> >             jms/ConnectionFactory
> >           </global-jndi-name>
> >         </connectiondefinition-instance>
> >       </connection-definition>
> >     </outbound-resourceadapter>
> >   </resourceadapter>
> >   <!-- defines a Topic -->
> >   <adminobject>
> >     <adminobject-interface>
> >       javax.jms.Topic
> >     </adminobject-interface>
> >     <adminobject-class>
> >       org.codehaus.activemq.message.ActiveMQTopic
> >     </adminobject-class>
> >     <adminobject-instance>
> >
> > <message-destination-name>jms/weatherTopic</message-destination-name>
> >       <config-property-setting
> > name="PhysicalName">jms/weatherTopic</config-property-setting>
> >     </adminobject-instance>
> >   </adminobject>
> >     <adminobject>
> >     <adminobject-interface>
> >       javax.jms.Topic
> >     </adminobject-interface>
> >
> > <adminobject-class>org.codehaus.activemq.message.ActiveMQTopic</
> > adminobject-class>
> >     <adminobject-instance>
> >
> > <message-destination-name>jms/weatherRequestsTopic</message-
> > destination-name>
> >       <config-property-setting
> > name="PhysicalName">jms/weatherRequestsTopic</config-property-setting>
> >     </adminobject-instance>
> >   </adminobject>
> > </connector>
> >
> > and deploy it using :
> > D:\geronimo>java -jar bin\deployer.jar deploy
> > d:\projects\weather\src\resources\
> > geronimo-activemq.xml
> > repository\activemq\rars\activemq-ra-3.1-SNAPSHOT.rar
> > Username: system
> > Password: manager
>
> What is the output from this command?
> >
> > Nothing appears in the Geronimo logs.
>
> If you have geronimo running when you run the command above, you should
> see something in geronimo.log.  If you don't, you should see something
> in deployer.log.
>
> >  I tried to brows Geronimo's JMX with MC4J,
> > and the only thing I could find was a DefaultActiveMQConnectionFactory
> > My factory + topics don't seem to appear through JMX.
>
> You might try the debug console.  I haven't tried MC4J myself.
>
> >
> > I also wrote a client :
> > I'm using Spring to get a reference to the Factory and get
> > javax.naming.NameNotFoundException: /jms/weatherRequestsTopic not found
> > 	at org.openejb.client.JNDIContext.lookup(JNDIContext.java:257)
> > 	at javax.naming.InitialContext.lookup(Unknown Source)
> > 	at
> > org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:
> > 123)
> >
> > so, it looks like my topic is not exposed through JNDI ? Or even not
> > created ?
> >
> > I'm using the latest geronimo snapshot, and use the openejb 2.0
> > snapshot for my
> > client library (only this jar). Do I need something else ?
>
> Is this a standalone non-j2ee client?  If so you will have to use
> instructions from activemq to use activemq.  In particular, the openejb
> jndi implementation only exposes ejbs, not any other resources.  If you
> have a j2ee app client, and you wish to use jms, you need to deploy a
> copy of the activemq adapter on the client.  You can then use the j2ee
> java:comp/env context to find your stuff.
>
> Have you looked at the developerworks article?
>
> http://www-128.ibm.com/developerworks/opensource/library/os-ag-jmsbeans/
>
> I believe it has examples of both j2ee and non j2ee clients.
>
> thanks
> david jencks
>
> >
> > Thank you very much for your help,
> > Sami Dalouche
> >
> > ----------------------------------------------------------------
> > This message was sent using IMP, the Internet Messaging Program.
> >
>
>




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Mime
View raw message