Hi Tom,

On Mon, 9 Dec 2002 04:58, Tom Dietz wrote:
> Is there someone out there that is using IDEA (or any GUI debugger) that
> can give me a brief explanation of how I can debug everything.   I have
> had IDEA for about a month now, so I am very new to that, but is there a
> main project file that can contain all the other projects.

If you want to debug the phoenix source code, you'll need to download the 
phoenix source. I *think* this is the right place to get the source version 
which matches the Phoenix version in James.

http://jakarta.apache.org/builds/jakarta-avalon-phoenix/release/v4.0.1/

I'm not sure if the Avalon-Framework source is included. If not, you'll 
probably also want to get:
http://jakarta.apache.org/builds/jakarta-avalon/release/framework/latest/

In both cases, you'll want the file marked ".src.zip".

>
> The main reason for this (among other important ones) is I still don't
> understand how phoenix loads James.   I have look at the run.bat (I am
> Windows) and see that it passes in a special loader class, but what
> happens then?  Is everything dynamically loaded based upon XML file
> configurations?

Once you have the Phoenix source, you should be able to debug the entire 
startup process.

> The last reason why I would like to debug (at least the startup) is I am
> trying to add a very basic mailet (as described in this arcticle:
>
> http://www.javaworld.com/javaworld/jw-10-2001/jw-1026-jamesmail_p.html
>
> And can't james to start in the debugger when my mailet is included in
> the config.xml (it starts fine without it).
>
> I traced it down to this error in phoenix's log:
>
> 1039373134293 [ERROR  ] (Phoenix.kernel.james.lifecycle): Block named
> "spoolmanager" failed to pass through the Initialization stage. (Reason:
> java.lang.NoClassDefFoundError: org/apache/mailet/GenericMailet).

If I'm not mistaken, it looks like you're putting your Mailet class files (or 
jar) into the lib or ext directory of the Phoenix install. What's happening 
is that Phoenix can find your mailet fine, but Mailet.jar is not visible in 
the same classloader as your Mailet is loaded. (Mailet.jar is loaded by a 
James-specific classloader, which is a child of the Phoenix classloader, 
where your Mailet is loaded). When loading your Mailet, Phoenix is looking 
for GenericMailet.class, and can't find it, so throws this exception. 

It could also be more complex than this - I haven't looked at Phoenix for 
ages, and I think the classloader stuff has had some significant changes.

As far as I'm aware, the only way to get your Mailet to run is to bundle it up 
into the James.sar file. You should be able to add your MyMailet.jar to the 
lib directory of James.sar, or just add the class files directly to 
James.jar. (I haven't tried the former, but it should work). 

Have a look at the "sar" target of build.xml to get an idea of how to bundle 
everything into a sar file.

I know this is a less than perfect solution, and probably something we'll want 
to address in James3.

> I have made sure mailet.jar is in (and high) in the classpath, but still
> get this error.

What exactly are you doing? Phoenix used to ignore the user-defined classpath 
- probably still does. Have you tried putting mailet.jar in the same location 
as mymailet.jar? 

> I hope this all makes sense.

Absolutely. I hope this all helps.

-- 
ciao,
Daz

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

Reply via email to