cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Markus Heussen" <>
Subject [flow] cocoon.createObject() problem
Date Thu, 15 Apr 2004 14:57:04 GMT
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

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 datasource =
		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:
For additional commands, e-mail:

View raw message