Hi Kristian,

The j2eeType and interface expected are part of the original GBeanInfo reference info and must be getting into the original abstract name query. When we construct the replacement abstract name query from config.xml we need to find that info and include it just as the original ANQ did. I don't think we need any more xml elements in config.xml.

thanks
david jencks

On Nov 21, 2007, at 12:15 PM, Kristian Köhler wrote:

Hi

I suspect a bug in the local attribute manager reference override. Note that the 3 (or more?) gbeans it found all have different j2eeType which makes me think there's something missing from the reference pattern setup in LAM. Fixing the bug would be great :-), opening a jira next best, and meanwhile deploying your own broker plan should work.

Ok, ok... I will try to fix it ;-) But how to specify the reference?
I think an easy way would be to add a 'generic' definition like this:

--- 8< --- (start)

<reference name="dataSource">
     <pattern>
       <name>MyDatasource</name>
       <j2eeType>Something</j2eeType>
       <someAtt>foo</someAtt>
     </pattern>
</reference>

--- 8< --- (end)

Currently only the elements: groupId, artifactId, version, type, module and name are allowed. There are no other 'name parts' available.

Other definition syntax might be:

--- 8< --- (start)

<reference name="dataSource">
     <pattern>
       <nameMap>
          <name>MyDatasource</name>
          <j2eeType>Something</j2eeType>
          <someAtt>foo</someAtt>
       </nameMap>
     </pattern>
</reference>

--- 8< --- (end)

This would break existing configs :-(

Kristian

If you want to shift the entire server to using mysql you can put a couple lines in artifact_aliases.properties to switch system- database to your database. As long as your datasources are named the same as in system-database everything should work.
thanks
david jencks
On Nov 20, 2007, at 4:01 AM, Kristian Köhler wrote:
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=n et.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,JCAManagedCon nectionFactory=MyDatasource,JCAResource=net.sourceforge.gaswerk.asse mblies/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

Reply via email to