You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Gareth Coltman <ga...@majorband.co.uk> on 2002/03/21 15:40:07 UTC

ComponentLoader problem

Hi,

I am using t-2.2, and am trying to use some fulcrum based services I have
written. I am having a problem because the ComponentLoader which is meant to
load fulcrum services defined in the fulcrum properties file, won't load
anything.

When I try to use the service, the TurbineServiceBroker returns an "unknown
service" error.

The component loader also wont log because it requires a log4j appender, and
log4j is not used this way in t2.2.

I dont think it is even finding my Fulcrum.properties file. But without
logging this is difficult to determine.

The component loader is defined in my tr-props as:

	${webappRoot}/WEB-INF/conf/Fulcrum.properties

Has anybody managed to use a fulcrum style service with 2.2 sucessfully?
Please help!

Gareth


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ComponentLoader problem

Posted by Eric Dobbs <er...@dobbse.net>.
Again, I haven't actually tried this stuff so these
suggestions are educated guesses...

On Thursday, March 21, 2002, at 08:45  AM, Gareth Coltman wrote:

> At the moment in my code I am getting an instance of the service by:
>
> return (IntakeService)TurbineServices
>             .getInstance().getService(IntakeService.SERVICE_NAME);
>
> Should I be using the fulcrum.Fulcrum class instead?

I think that's correct.  Something like this:

import org.apache.fulcrum.Fulcrum;
import org.apache.fulcrum.intake.IntakeService;
...
return (IntakeService)Fulcrum
             .getInstance().getService(IntakeService.SERVICE_NAME);


> None of the services in my Fulcrum properties file appear in the 
> services
> initialisation section of the turbine.log.

My guess here is that the Fulcrum.properties file might
have different logging levels set.  Or perhaps that there
is something about the path to the log file that's missing.

-Eric

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: ComponentLoader problem

Posted by Gareth Coltman <ga...@majorband.co.uk>.
Here is a stack trace from turbine.log:

	Exception:  org.apache.turbine.util.TurbineException: Instantiation failed
for com.majorband.project.tool.IntakeTool: ServiceBroker: Unknown Service
'IntakeService' requested
	Stack Trace follows:
	org.apache.fulcrum.InstantiationException: ServiceBroker: Unknown Service
'IntakeService' requested
	at org.apache.fulcrum.BaseServiceBroker.getServiceInstance(Unknown Source)
	at org.apache.fulcrum.BaseServiceBroker.getService(Unknown Source)
	at
com.majorband.project.services.intake.ProjectIntake.getService(ProjectIntake
.java:253)

I have created an intake like pull tool of my own, and from this pool tool,
I am calling the service I have created (which worked succesfully in t3).

At the moment in my code I am getting an instance of the service by:

return (IntakeService)TurbineServices
            .getInstance().getService(IntakeService.SERVICE_NAME);

Should I be using the fulcrum.Fulcrum class instead?

None of the services in my Fulcrum properties file appear in the services
initialisation section of the turbine.log.

Any help would be greatly appreciated.

Gareth

> -----Original Message-----
> From: Eric Dobbs [mailto:eric@dobbse.net]
> Sent: 21 March 2002 15:32
> To: Turbine Developers List
> Subject: Re: ComponentLoader problem
>
>
> On Thursday, March 21, 2002, at 08:25  AM, Gareth Coltman wrote:
>
> > I know now (from debugging the ComponentLoader) that it is working
> > perfectly
> > and loading the component.
>
> good news.
>
>
> > So I must be doing something wrong.
> >
> > I assumed that services within the fulcrum.properties file would just be
> > exposed as normal services, but clearly this is not correct.
> >
> > How should I use fulcrum services within my code???? (in t-2.2)
>
> I haven't actually tried to use fulcrum services from T2 yet, but
> I think the usual access through the services static facade methods
> should work.  Either that, or through the Fulcrum class's static
> methods.  I have several other things I need to get to first, but
> I'll try to take a look this afternoon unless you figure it out
> before I get to it.
>
> -Eric
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ComponentLoader problem

Posted by Eric Dobbs <er...@dobbse.net>.
On Thursday, March 21, 2002, at 08:25  AM, Gareth Coltman wrote:

> I know now (from debugging the ComponentLoader) that it is working 
> perfectly
> and loading the component.

good news.


> So I must be doing something wrong.
>
> I assumed that services within the fulcrum.properties file would just be
> exposed as normal services, but clearly this is not correct.
>
> How should I use fulcrum services within my code???? (in t-2.2)

I haven't actually tried to use fulcrum services from T2 yet, but
I think the usual access through the services static facade methods
should work.  Either that, or through the Fulcrum class's static
methods.  I have several other things I need to get to first, but
I'll try to take a look this afternoon unless you figure it out
before I get to it.

-Eric


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: ComponentLoader problem

Posted by Gareth Coltman <ga...@majorband.co.uk>.
Ok.

I know now (from debugging the ComponentLoader) that it is working perfectly
and loading the component.

So I must be doing something wrong.

I assumed that services within the fulcrum.properties file would just be
exposed as normal services, but clearly this is not correct.

How should I use fulcrum services within my code???? (in t-2.2)

Gareth

> -----Original Message-----
> From: Gareth Coltman [mailto:gareth_coltman@majorband.co.uk]
> Sent: 21 March 2002 14:40
> To: Turbine Developers List
> Subject: ComponentLoader problem
>
>
> Hi,
>
> I am using t-2.2, and am trying to use some fulcrum based services I have
> written. I am having a problem because the ComponentLoader which
> is meant to
> load fulcrum services defined in the fulcrum properties file, won't load
> anything.
>
> When I try to use the service, the TurbineServiceBroker returns
> an "unknown
> service" error.
>
> The component loader also wont log because it requires a log4j
> appender, and
> log4j is not used this way in t2.2.
>
> I dont think it is even finding my Fulcrum.properties file. But without
> logging this is difficult to determine.
>
> The component loader is defined in my tr-props as:
>
> 	${webappRoot}/WEB-INF/conf/Fulcrum.properties
>
> Has anybody managed to use a fulcrum style service with 2.2 sucessfully?
> Please help!
>
> Gareth
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>