Hello Berin,

> Fortress *does* attempt to proxy components.  What we have here should
> be better rendered:
> 
> public interface HelloWorld
> {
>      String ROLE = HelloWorld.class.getName();
> 
>      String getHelloWorld();
> }
> 
> public class DefaultHelloWorld
>      extends AbstractLogEnabled implements HelloWorld
> {
>      public String getHelloWorld()
>      {
>          return "Hello World!";
>      }
> }

Well, I already switched to this solution, but have the same CastException at the same 
place as before. I also import now the Translator component of the sample, but this 
works and I do not find the causing difference :(

> This allows Fortress (and Merlin) to do what it needs to do behind the
> scenes.  What you were writing before was a JavaBean, not a component.
> 
> The general rule of thumb is that all Components have a separate
> interface from the implementation.  CORBA components are no exception
> because the interface is defined--just in a neutral IDL.

As general implementation rule, yes.

>  > =========== snap ==========
>  >
>  >
>  > The initialisation in the ServletContainer, that tries to retrieve
>  > the component rising the CastException: =========== snip 
> ========== 
> public void initialize(  ) throws Exception { super.initialize(  ); 
> m_HelloWorld = (HelloWorld) m_serviceManager.lookup( HelloWorld.ROLE
>  > ); } =========== snap ==========
> 
> 
> 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 .. :)

>  > 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. :)

> 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?

Regards,
J�rg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to