avalon-apps-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Zoller" <gzol...@hotmail.com>
Subject How to add Stores to Phoenix App
Date Wed, 08 May 2002 13:13:33 GMT
Hello...

I have a question about adding a new block to an existing Phoenix
application (James).  I've written code that implements a new Store
and Repository.  I compiled them into a jar file and changed the
application's .xinfo file (James.xinfo) to include the dependency:

    <dependency>
       <service name="com.metriclcs.CrmStore" version="1.0"/>
    </dependency>

I bundle that all up into a jar file (crm.jar) and put it into
the Phoenix lib directory.

Then I fire up the app.  Looking at the phoenix log I can
see that it does pick up the dependency and tries to initialize
my component.  However it gets this error:

Fri Mar 01 12:50:49 EST 2002 [ERROR  ] (Phoenix.james): There was an error 
running phase "startup" for Block named "crm-store". (Reason: Block named 
"crm-store" failed to pass through the Initialization stage. (Reason: 
org/apache/avalon/cornerstone/services/datasource/DataSourceSelector).).
org.apache.avalon.framework.CascadingException: Block named "crm-store" 
failed to pass through the Initialization stage. (Reason: 
org/apache/avalon/cornerstone/services/datasource/DataSourceSelector).
	at 
org.apache.avalon.phoenix.components.application.LifecycleHelper.fail(LifecycleHelper.java:269)
	at 
org.apache.avalon.phoenix.components.application.LifecycleHelper.startup(LifecycleHelper.java:140)
	at 
org.apache.avalon.phoenix.components.application.DefaultServerApplication.runPhase(DefaultServerApplication.java:276)
	at 
org.apache.avalon.phoenix.components.application.DefaultServerApplication.start(DefaultServerApplication.java:135)
	at 
org.apache.avalon.phoenix.components.kernel.AbstractKernel.startEntry(AbstractKernel.java:165)
	at 
org.apache.avalon.phoenix.components.kernel.AbstractKernel.postAdd(AbstractKernel.java:107)
	at 
org.apache.avalon.excalibur.container.AbstractContainer.add(AbstractContainer.java:39)
rethrown from
java.lang.NoClassDefFoundError: 
org/apache/avalon/cornerstone/services/datasource/DataSourceSelector
	at com.metriclcs.AbstractJdbcCrmRepository.compose(Unknown Source)
	at com.metriclcs.AvalonCrmStore.initialize(Unknown Source)
	at 
org.apache.avalon.phoenix.components.application.LifecycleHelper.startup(LifecycleHelper.java:119)
	at 
org.apache.avalon.phoenix.components.application.DefaultServerApplication.runPhase(DefaultServerApplication.java:276)
	at 
org.apache.avalon.phoenix.components.application.DefaultServerApplication.start(DefaultServerApplication.java:135)
	at 
org.apache.avalon.phoenix.components.kernel.AbstractKernel.startEntry(AbstractKernel.java:165)
	at 
org.apache.avalon.phoenix.components.kernel.AbstractKernel.postAdd(AbstractKernel.java:107)
Fri Mar 01 12:50:49 EST 2002 [WARN   ] (Phoenix): Failed to start 
application james.
org.apache.avalon.framework.CascadingException: Block named "crm-store" 
failed to pass through the Initialization stage. (Reason: 
org/apache/avalon/cornerstone/services/datasource/DataSourceSelector).
	at 
org.apache.avalon.phoenix.components.application.LifecycleHelper.fail(LifecycleHelper.java:269)
	at 
org.apache.avalon.phoenix.components.application.LifecycleHelper.startup(LifecycleHelper.java:140)
	at 
org.apache.avalon.phoenix.components.application.DefaultServerApplication.runPhase(DefaultServerApplication.java:276)
	at 
org.apache.avalon.phoenix.components.application.DefaultServerApplication.start(DefaultServerApplication.java:135)
	at 
org.apache.avalon.phoenix.components.kernel.AbstractKernel.startEntry(AbstractKernel.java:165)
	at 
org.apache.avalon.phoenix.components.kernel.AbstractKernel.postAdd(AbstractKernel.java:107)
	at 
org.apache.avalon.excalibur.container.AbstractContainer.add(AbstractContainer.java:39)
rethrown from
java.lang.NoClassDefFoundError: 
org/apache/avalon/cornerstone/services/datasource/DataSourceSelector
	at com.metriclcs.AbstractJdbcCrmRepository.compose(Unknown Source)
	at com.metriclcs.AvalonCrmStore.initialize(Unknown Source)
	at 
org.apache.avalon.phoenix.components.application.LifecycleHelper.startup(LifecycleHelper.java:119)
	at 
org.apache.avalon.phoenix.components.application.DefaultServerApplication.runPhase(DefaultServerApplication.java:276)
	at 
org.apache.avalon.phoenix.components.application.DefaultServerApplication.start(DefaultServerApplication.java:135)
	at 
org.apache.avalon.phoenix.components.kernel.AbstractKernel.startEntry(AbstractKernel.java:165)
	at 
org.apache.avalon.phoenix.components.kernel.AbstractKernel.postAdd(AbstractKernel.java:107)

Anyone have any idea what might cause this?  James has other Store 
components
defined/configured (as far as I can tell) exactly like mine, using
org/apache/avalon/cornerstone/services/datasource/DataSourceSelector.
They work fine.  Any idea why it can't seem to load this class for my 
component?

Here are the relevant entries in the app's config files:

=== assembly.xml ===
  <!-- The James block  -->
  <block class="org.apache.james.James" name="James" >

    <!-- Specify which components will provide the services required by this
    block. The roles are specified in the code and the .xinfo file. The 
names
    here must match the names specified for  a Block in this xml file.   -->
    <provide name="dnsserver" role="org.apache.james.services.DNSServer"/>
    <provide name="mailstore" role="org.apache.james.services.MailStore"/>
    <provide name="users-store" 
role="org.apache.james.services.UsersStore"/>
    <provide name="crm-store" role="com.metriclcs.CrmStore"/>  <!-- ADDED MY 
NEW COMPONENT HERE -->
    <provide name="sockets"
             
role="org.apache.avalon.cornerstone.services.sockets.SocketManager"/>
    <provide name="connections"
             
role="org.apache.avalon.cornerstone.services.connection.ConnectionManager"/>
    <provide name="scheduler"
             
role="org.apache.avalon.cornerstone.services.scheduler.TimeScheduler"/>
    <provide name="database-connections"
             
role="org.apache.avalon.cornerstone.services.datasource.DataSourceSelector" 
/>
  </block>

	(---clip---)

  <!-- The Crm Storage block -->
  <block class="com.metriclcs.AvalonCrmStore" name="crm-store" >
    <!-- Configure file based user store here, defaults should be fine -->
    <provide name="objectstorage"
             role="org.apache.avalon.cornerstone.services.store.Store"/>
    <provide name="database-connections"
             
role="org.apache.avalon.cornerstone.services.datasource.DataSourceSelector" 
/>
  </block>

=== config.xml ===
  <!-- The Crm Storage block -->
  <crm-store>
      <repository name="CRM"
                  class="com.metriclcs.CrmJdbcRepository"
                  destinationURL="db://maildb/crmes/crmUid">
          <sqlFile>file://conf/sqlResources.xml</sqlFile>
      </repository>
  </crm-store>

Thanks in advance.
Greg


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


--
To unsubscribe, e-mail:   <mailto:avalon-apps-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-apps-dev-help@jakarta.apache.org>


Mime
View raw message