Schaible, J�rg wrote:
Hello Berin,
ClassCastException?
It seems odd that would happen rather than a general error in
initialization.
So, why not? In the roles I define the class of the role and of the
handle. Why should anyone care, if they are the same? At least I have
seen nothing inthe code that prevents this. Good design ignored .. :)
(Could you manually wrap your lines--it is somewhat anoying to have to
select the "rewrap" function in Mozilla every time I respond).
When I have a ClassCastException, the first thing I do is find out
what the object I have is. Try this:
Object myComponent = m_manager.lookup(HelloWorld.ROLE);
System.out.println( myComponent );
System.out.println( myComponent.getClass().getName() );
Let's see what we have going on here.
Another question arises with the logging.
Although I used the same xlog for my ServletContainer as in the
example and I initialize also the context and home
directories (what
is the exact definition here for Fortress ?) to the same path,
but the only log information I get is on the console (before the
LogManager of the app is enabled) and the log file itself is not
craeted at all. How can I switch the Factory in the xlog
to a Console
logger?
The FortressConfig is what is used to assign those locations. I
personally set the Context root to be the Servlet's context root,
and the work directory to be where the Servlet's work directory.
In a servlet environment, you don't want a Console logger. You
want to send log events to the Servlet's log() command. That is
done via the LoggerManager.
Ahem. Currently I would really like to have a console logger, since
anything of the console is nicely captured in Eclipse - just to learn
what is invoked in which sequence. Stepping through the code is much
easier then, if you know what you're searching for. :)
In your logger manager configuration file, use a stream log target:
<stream/> <!-- defaults to System.err -->
<stream>System.out</stream> <!-- use System.out -->
Realistically speaking though, you want to reduce as many calls to
the Servlet's log() command as possible--and just send them to a
file. That would give you the ability to go back and determine
what (if anything) went wrong.
That is the current configuration, but the log file is not written.
Maybe just because the thrown Exception prevents the file from being
flushed?
No. I capture exceptions all the time, and I get the log file.
The best thing to help would be a copy of the logger manager
configuration file.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]