geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Köhler <Kristian.Koeh...@dmc.de>
Subject How to change the ActiveMQ DataSource?
Date Tue, 20 Nov 2007 12:01:02 GMT
Hi

I'm trying to reconfigure the DataSource used by the ActiveMQ broker service (from derby to
mysql). For that I created a DataSource config (CAR) with a simple plan pointing to my MySQL
Database. The configuration for the database works fine. I can access the Connection Pool
and execute SQL statements... ;-)

Here is my db plan file:

--- 8< --- plan.xml --- (start)
<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-${geronimoSchemaVersion}">
    <resourceadapter>
        <outbound-resourceadapter>
            <connection-definition>
                <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
                <connectiondefinition-instance>
                    <name>MyDatasource</name>
                    <config-property-setting name="Driver">com.mysql.jdbc.Driver</config-property-setting>
                    <config-property-setting name="ConnectionURL">jdbc:mysql://localhost:3306/ode</config-property-setting>
                    <config-property-setting name="UserName">root</config-property-setting>
			  <connectionmanager>
				<local-transaction/>
                        <single-pool>
                            <max-size>100</max-size>
                            <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
                            <select-one-assume-match/>
                        </single-pool>
                    </connectionmanager>
                </connectiondefinition-instance>
            </connection-definition>
        </outbound-resourceadapter>
    </resourceadapter>
</connector>
--- 8< --- plan.xml --- (end)

I have also added a dependency to my database CAR from the ActiveMQ config and "recompiled"
the configuration. 

But when I specify the "database reference" within the ActiveMQBrokerGBean (config.xml) I'm
getting the following exception: "More than one match to referencePatterns in parent configurations"

--- 8< --- config.xml --- (start)

    <gbean name="ActiveMQ">
        <attribute name="useShutdownHook">false</attribute>
        <attribute name="dataDirectory">var/activemq</attribute>
        <reference name="dataSource">
				<pattern>
					<name>MyDatasource</name>
				</pattern>
        </reference>
	...

--- 8< --- config.xml --- (end)

--- 8< --- full exception --- (start)

Caused by: org.apache.geronimo.kernel.GBeanNotFoundException: More than one match to referencePatterns
in parent configurations: [net.sourceforge.gaswerk.assemblies/gaswerk-my-database/0.9.2-SNAPSHOT/car?J2EEApplication=null,JCAResource=net.sourceforge.gaswerk.assemblies/gaswerk-my-database/0.9.2-SNAPSHOT/car,ResourceAdapter=net.sourceforge.gaswerk.assemblies/gaswerk-my-database/0.9.2-SNAPSHOT/car,ResourceAdapterModule=net.sourceforge.gaswerk.assemblies/gaswerk-my-database/0.9.2-SNAPSHOT/car,j2eeType=JCAConnectionFactory,name=MyDatasource,
net.sourceforge.gaswerk.assemblies/gaswerk-my-database/0.9.2-SNAPSHOT/car?J2EEApplication=null,JCAConnectionFactory=MyDatasource,JCAResource=net.sourceforge.gaswerk.assemblies/gaswerk-my-database/0.9.2-SNAPSHOT/car,ResourceAdapter=net.sourceforge.gaswerk.assemblies/gaswerk-my-database/0.9.2-SNAPSHOT/car,ResourceAdapterModule=net.sourceforge.gaswerk.assemblies/gaswerk-my-database/0.9.2-SNAPSHOT/car,j2eeType=JCAManagedConnectionFactory,name=MyDatasource,
net.sourceforge.gaswerk.assemblies/gaswerk-my-database/0.9.2-SNAPSHOT/car?J2EEApplication=null,JCAConnectionFactory=MyDatasource,JCAManagedConnectionFactory=MyDatasource,JCAResource=net.sourceforge.gaswerk.assemblies/gaswerk-my-database/0.9.2-SNAPSHOT/car,ResourceAdapter=net.sourceforge.gaswerk.assemblies/gaswerk-my-database/0.9.2-SNAPSHOT/car,ResourceAdapterModule=net.sourceforge.gaswerk.assemblies/gaswerk-my-database/0.9.2-SNAPSHOT/car,j2eeType=JCAConnectionManager,name=MyDatasource]:
[?name=MyDatasource#]

--- 8< --- full exception --- (start)

How do I have to specify this reference? Is this possible to do it that way??
Or do I have to use an (external) activemq.xml file?

Thanks


Kristian



--
GASwerk SOA Stack
http://gaswerk.sourceforge.net

Mime
View raw message