avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Stary <jsta6...@artax.karlin.mff.cuni.cz>
Subject Re: new to avalon -- problems
Date Tue, 15 Jan 2002 10:23:52 GMT
On Dec 28 17:01:41, Patrick Hess wrote:
:Berin Loritsch wrote:
:
:> Are you calling the lookup like this:
:> manager.lookup( DataSourceComponent.ROLE + "Selector" ); //?
:
:No - I didn't! :-) Thank you very much - I got the example working!

Hi,

the very same code doesn't work for me:

<role-list>
  <role
    name="org.apache.avalon.excalibur.datasource.DataSourceComponentSelector"
    shorthand="datasources"
    default-class="org.apache.avalon.excalibur.component.ExcaliburComponentSelector">
     <hint shorthand="jdbc"
       class="org.apache.avalon.excalibur.datasource.JdbcDataSource"/>
  </role>
  <role
    name="org.apache.bizserver.docs.DocumentRepository"
    shorthand="repository"
    default-class="org.apache.bizserver.docs.DatabaseDocumentRepository"/>
</role-list>


<my-system>
  <datasources>
  <jdbc name="documents">
	 <pool-controller min="3" max="10"/>
	 <!--<auto-commit>false</auto-commit>-->
	 <driver>org.gjt.mm.mysql.Driver</driver>
	 <dburl>jdbc:mysql://localhost/casopis</dburl>
	 <user>dbuzivatel</user>
	 <password>heslo</password>
  </jdbc>
  </datasources>
  <repository>
      <dbpool>documents</dbpool>
  </repository>
</my-system>


and when compiling

public class Hans implements Component, Composable, Disposable {
	ComponentManager manager;
	JdbcDataSource datasrc;

    public void compose(ComponentManager manager) {
		if(this.manager == null) {
			this.manager = manager;
			datasrc = this.manager.lookup(
				DataSourceComponent.ROLE + "Selector");
		}
	}
}


I get 

    [javac] /home/hans/casopis/src/org/apache/bizserver/docs/Hans.java:19: incompatible types
    [javac] found   : org.apache.avalon.framework.component.Component
    [javac] required: org.apache.avalon.excalibur.datasource.JdbcDataSource
    [javac] 			datasrc = this.manager.lookup(
    [javac]                                                      ^
    [javac] 1 error


Am I missing something?

Thank you

Jan



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


Mime
View raw message