Hi Laurant, thanks for your answer. But there is a jdbc connection described in the datasource section of my cocoon.xconf and the poolId (see method below -> this.poolId) is the jdbc name of this connection pool.
If I use log.debug() in my User class I also get an exception, a NullPointerException, although I have implemented the LogEnabled Avalong interface. So I guess it has something to do with the flow. It seems that I cannot access the avalon components. I don't know. I'm not really a java / cocoon guru ;-( Any hints? Markus -----Original Message----- From: Sent: Thursday, April 15, 2004 5:06 PM To: [EMAIL PROTECTED] Subject: Re: [flow] cocoon.createObject() problem Hi Markus , I think that it has nothing to do with flow but I already received such a message when using a component that I created and that has to use a datasource. This datasource has to be defined in cocoon.xconf and if he can not open it you will get an error hope it could help Laurent "Markus Heussen" 15/04/2004 16:57 Please respond to users To: <[EMAIL PROTECTED]> cc: Subject: [flow] cocoon.createObject() problem Hi Friends! I've written a java class "User" which stores user data selecting from a database. I want to use the cocoon datasource defined in the cocoon.xconf and the logging for it and I need to use the class within my flowscript. How can I manage this? Searching a while I found the cocoon.createObject() flow function that may help me but I don't understand how to use it. I tried something like this var user = cocoon.createObject("some.package.User"); which returns the User object. but calling the function user.load("username", "password"); // (see below) throws the following exception: org.apache.avalon.framework.component.ComponentException: Could not find component (key [org.apache.avalon.excalibur.datasource.DataSourceComponent]) (Key='org.apache.avalon.excalibur.datasource.DataSourceComponent') (key [org.apache.avalon.excalibur.datasource.DataSourceComponent]) The User class looks like the following: public class User implements LogEnabled, Composable { ... public boolean load(String authUsername, String authPassword) { ... ComponentSelector selector = (ComponentSelector) manager.lookup DataSourceComponent.ROLE); DataSourceComponent datasource = (DataSourceComponent)selector.select(this.poolId); Connection con = datasource.getConnection(); ... } ... What am I doing wrong? Can somebody help me please? I really need it. I'm using the current CVS head and SDK 1.4.2. Thanks a lot! Greetings, Markus --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]