geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: JMS Connection Factory / JNDI Naming
Date Mon, 20 Mar 2006 22:56:34 GMT

On Mar 20, 2006, at 2:29 PM, Oli Kessler wrote:

>>
>
>> Jndi won't work within a gbean, you should use a gbean reference.
>> Here's an example from the system datasource plan, and the gbean
>> referenced can show you how to code it.  The reference to emulate
>> here is ManagedConnectionFactoryWrapper
>>
>> <gbean name="NonTransactionalThreadPooledTimer"
>> class="org.apache.geronimo.timer.jdbc.JDBCStoreThreadPooledNonTransac 
>> tio
>>  nalTimer"> <reference
>> name="TransactionContextManager"><moduleType>J2EEModule</
>> moduleType><module>geronimo/j2ee-server/${pom.currentVersion}/car</
>> module><name>TransactionContextManager</name></reference> <reference
>>  name="ManagedConnectionFactoryWrapper"><moduleType>JCAResource</
>> moduleType><name>SystemDatasource</name></reference> <reference
>> name="ThreadPool"><moduleType>J2EEModule</
>> moduleType><module>geronimo/j2ee-server/${pom.currentVersion}/car</
>> module><name>DefaultThreadPool</name></reference> <!--TODO
remove
>> moduleType when gbeans get the moduleType of the plan they are in -->
>>  <reference name="DerbySystem"><moduleType>J2EEModule</
>> moduleType><name>DerbySystem</name></reference> </gbean>
>>
>> thanks david jencks
>
> Thanks for your help, david. However I'm apparently still missing
> something..
>
> My connector information is:
>
> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/ 
> connector-1.0"
>   configId="ncodeTopicConnectionFactory"
>   parentId="geronimo/activemq-broker/1.0/car">
>   <resourceadapter>		
>     <resourceadapter-instance>		
>       <resourceadapter-name>ncodeJMS</resourceadapter-name>
>         <config-property-setting name="ServerUrl">
>           vm://localhost
>         </config-property-setting>
>         <config-property-setting name="UserName">not needed
>          </config-property-setting>
>         <config-property-setting name="Password">not needed
>           </config-property-setting>
> 	<workmanager>
>           <gbean-link>DefaultWorkManager</gbean-link>
>         </workmanager>
>      </resourceadapter-instance>
>      <!-- defines a ConnectionFactory -->
>      <outbound-resourceadapter>
>        <connection-definition>
>          <connectionfactory-interface>
>             javax.jms.TopicConnectionFactory
>          </connectionfactory-interface>
>          <connectiondefinition-instance>					
> <name>ncodeTopicConnectionFactory</name>
>              <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>
>           </connectiondefinition-instance>
>           </connection-definition>
>        </outbound-resourceadapter>
>     </resourceadapter>
>
>      <!-- defines a Topic -->
>       <adminobject>		
>        <adminobject-interface>javax.jms.Topic</adminobject-interface>	
>        <adminobject-class>
>          org.activemq.message.ActiveMQTopic
>        </adminobject-class>
>        <adminobject-instance>		
>        <message-destination-name>
>         jms/ncodeInputTopic</message-destination-name>
>        <config-property-setting
>         name="PhysicalName">
>         jms/ncodeInputTopic
>        </config-property-setting>
>        </adminobject-instance>
>       </adminobject>
> </connector>
>
>
> I deploy it with:
>
>   java -jar bin/deployer.jar redeploy PATH_TO_THIS/jms-connector.xml
>      repository/activemq/rars/activemq-ra-3.2.1.rar
>
> This works as the console shows under "Services" -> "JMS"
>
>
> My GBean is deployed with the following plan:
>
> <configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xmlns="http://geronimo.apache.org/xml/ns/deployment-1.0"
>  configId="ncode/Syslog"
>  parentId="ncodeTopicConnectionFactory">
>
>   <dependency>
>     <uri>ncode/Syslog-GBean/0.0.1/jar</uri>
>   </dependency>
>   <dependency>
>     <uri>commons-lang/commons-lang/2.0/jar</uri>
>   </dependency>
>
>   <gbean name="ncode.SyslogServer"
>       class="ch.ncode.logquest.syslog.SyslogGBean">
>
>     <!-- reference the JMS here  -->
>     <reference  name="managedConnectionFactoryWrapper">
>       <moduleType>JCAResource</moduleType>
>
>        <!-- will this work ?? -->
>        <name>ncodeTopicConnectionFactory</name>
>      </reference>
>
>      <!-- attributes for this GBean -->
>      <attribute name="port">5144</attribute>
> 	
>    </gbean>
> </configuration>
>
>
> However, when deploying, the server can not find the reference:
>
> 23:05:23,724 DEBUG [GBeanSingleReference] Waiting to start
> geronimo.server:name=ncode.SyslogServer,J2EEServer=geronimo,J2EEApplic 
> ation=null,j2eeType=GBean,J2EEModule=ncode/Syslog
> because no targets are running for reference
> managedConnectionFactoryWrapper matching the patterns
> geronimo.server:J2EEApplication=null,J2EEServer=geronimo,JCAResource=n 
> code/ 
> Syslog,j2eeType=JCAManagedConnectionFactory,name=ncodeTopicConnectionF 
> actory

At this point I look in var/log/geronimo.log and try to find the  
actual name the managed connection factory is deployed under.

I suspect the problem is that you need
<module>ncodeTopicConnectionFactory</module> in your reference, but  
I'm not entirely sure.

hope this gets you farther :-)
david jencks

>
>
> Thanks for your help!
> oli kessler
>
>
>
>
>
>
>
>
>
>


Mime
View raw message