Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 29802 invoked from network); 15 Apr 2004 15:17:01 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 15 Apr 2004 15:17:01 -0000 Received: (qmail 91052 invoked by uid 500); 15 Apr 2004 15:16:24 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 90999 invoked by uid 500); 15 Apr 2004 15:16:23 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: users@cocoon.apache.org Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 90926 invoked from network); 15 Apr 2004 15:16:23 -0000 Received: from unknown (HELO smtp?relay.marinepower.com) (212.166.25.142) by daedalus.apache.org with SMTP; 15 Apr 2004 15:16:23 -0000 Received: from MPEWEB1.MARINEPOWER.COM - 10.9.0.6 by smtp_relay.marinepower.com with Microsoft SMTPSVC(5.5.1774.114.11); Thu, 15 Apr 2004 17:20:20 +0200 In-Reply-To: To: users@cocoon.apache.org Subject: Re: [flow] cocoon.createObject() problem MIME-Version: 1.0 X-Mailer: Lotus Notes Release 6.0 September 26, 2002 Message-ID: From: laurent_rorive@marinepower.com Date: Thu, 15 Apr 2004 17:06:04 +0200 X-MIMETrack: Serialize by Router on MPEWEB1/MARINEPOWER(Release 6.0|September 26, 2002) at 15/04/2004 17:06:04, Serialize complete at 15/04/2004 17:06:04 Content-Type: multipart/alternative; boundary="=_alternative 00536A1BC1256E77_=" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --=_alternative 00536A1BC1256E77_= Content-Type: text/plain; charset="US-ASCII" 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: 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: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org --=_alternative 00536A1BC1256E77_= Content-Type: text/html; charset="US-ASCII"
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" <heussen@asspaxx.de>

15/04/2004 16:57
Please respond to users

       
        To:        <users@cocoon.apache.org>
        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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


--=_alternative 00536A1BC1256E77_=--