I was wondering whether anyone can advice me on how to correctly
configure the datasource component within merlin. This is what I have
tried but I get an exception when I execute the block.

1. In the block.xml I use the include directive 

<container name="pep">
        :
        :
  <include name="jdbc-manager"
id="cornerstone-datasources:cornerstone-datasources-impl" version="1.0"
/>

</container>

2. In the config.xml I have the following

<targets>
  <target path="/pep/jdbc-manager/manager">
    <configuration>
      <data-sources>
        <data-source name="maindb"
class="org.apache.avalon.excalibur.datasource.JdbcDataSource">
          <pool-controller min="5" max="10" />
          <driver>org.gjt.mm.mysql.Driver</driver>
          <dburl>jdbc:mysql:/localhost/test</dburl>
          <user>mysql</user>
          <password>mysql</password>
          <auto-commit>true</auto-commit>
        </data-source>
      </data-sources>
    </configuration>
  </target>
   :
   :
</targets>

3. In one of my other services, I try to use the datasource like this

        DataSourceComponent ds =
(DataSourceComponent)_dsSelector.select("maindb");

But when this service executes I get the following error

java.lang.NullPointerException
        at
org.apache.avalon.activation.appliance.impl.DefaultBlock$BlockInvocation
Handler.invoke(DefaultBlock.java:996)
        at $Proxy3.select(Unknown Source)
        at
com.choreoworks.pep.loader.PEPLoader.testDataSource(PEPLoader.java:359)
        at
com.choreoworks.pep.loader.PEPLoader.start(PEPLoader.java:184)
        at
org.apache.avalon.activation.appliance.impl.DefaultAppliance.applyStart(
DefaultAppliance.java:998)
        at
org.apache.avalon.activation.appliance.impl.DefaultAppliance.access$1400
(DefaultAppliance.java:112)
        at
org.apache.avalon.activation.appliance.impl.DefaultAppliance$StandardFac
tory.newInstance(DefaultAppliance.java:1294)
        at
org.apache.avalon.activation.lifestyle.impl.SingletonLifestyleHandler.re
freshReference(SingletonLifestyleHandler.java:138
)
        at
org.apache.avalon.activation.lifestyle.impl.SingletonLifestyleHandler.re
solve(SingletonLifestyleHandler.java:88)
        at
org.apache.avalon.activation.appliance.impl.DefaultAppliance.resolve(Def
aultAppliance.java:566)
        at
org.apache.avalon.activation.appliance.impl.DefaultAppliance.deploy(Defa
ultAppliance.java:508)
        at
org.apache.avalon.activation.appliance.impl.DefaultBlock.deploy(DefaultB
lock.java:623)
        at
org.apache.avalon.activation.appliance.impl.BlockThread.run(BlockThread.
java:111)


Can anyone see any problems with my usage?

Has anyone used excalibur-datasource/cornerstone-datasources within
merlin?


cheers
</jima>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to