Hello all.
I'm having troubles using Excalibur Cache within Fortress. It's probably
something simple, but I can't seem to figure it out. Additionally as I've been
wrestling with this one, I've bumped into some other more general questions
that I hope someone can clarify for me.
Since the default FortressRoleManager already sets up roles for cache, I don't
have anything in my *.roles file. I do have a <cache> entry in my *.xconf file
since it seems that if I don't, there's no other way to get the
DefaultContainer to start up the cache component (is there another way?). So
my *.xconf file has something like this in it:
<cache>
<config>something</config>
</cache>
Cache doesn't implement configurable as far as I know, so I just have dummy
info there. This seems like a hack, so what's the proper way to initialize
something that doesn't take a Configuration or Parameters?
With this in my *.xconf file and the excalibur-cache-1.0a.jar file in my
classpath, the following returns true:
m_serviceManager.hasService(org.apache.excalibur.cache.Cache.class.getName());
(why doesn't Cache have a public ROLE variable?)
However, the container throws errors when it tries to start the cache
component:
ERROR 2003-02-13 05:08:38.927 [fortress.system.handler.] (): Unable to create
new instance
java.lang.InstantiationException: org.apache.excalibur.cache.impl.DefaultCache
at java.lang.Class.newInstance0(Class.java:291)
at java.lang.Class.newInstance(Class.java:259)
at
org.apache.avalon.fortress.impl.handler.ComponentFactory.newInstance(
ComponentFactory.java:169)
[snip...]
ERROR 2003-02-13 05:08:38.937 [fortress ] (): Could not
prepare
ComponentHandler
java.lang.InstantiationException: org.apache.excalibur.cache.impl.DefaultCache
at java.lang.Class.newInstance0(Class.java:291)
at java.lang.Class.newInstance(Class.java:259)
at
org.apache.avalon.fortress.impl.handler.ComponentFactory.newInstance(
ComponentFactory.java:169)
[snip...]
I can send the whole stack trace if necessary.
So my questions boil down to this:
1. What am I doing wrong starting the Cache component?
2. In general, how does one take advantage of the components hard-coded in
the FortressRoleManager. My guess is something like:
a. Include the component(s) in the classpath
b. Specify any config info in the *.xconf file
c. Access just like any other component
However, this approach doesn't work for me for the cache component
3. What's the "best practice" approach to starting up components which do not
need configured or parameterized? It seems that they still need an entry in
the *.xconf file for the DefaultContainer to pick them up and start them, but
there isn't any config info to give them in this file, so it feels like a bad
hack. How else can I get the DefaultContainer to start them?
Thanks for any insight!
jaaron
__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]