|
From: Leif M. <lei...@ta...> - 2009-01-27 15:37:34
|
Nathanael,
An ExceptionInInitializerError does not mean that the class could not be
found. This means that an exception of some sort was thrown from within
the TestClass init method. You should have method like this in your class:
public class TestClass {
static {
// An exception is being thrown here.
}
}
The original exception thrown will be wrapped within the
ExceptionInInitializerError and can be accessed using the e.getException()
method.
My guess is that you have some code that is trying to access Swing or
something that requires some libraries within X. Those are only available
if the WindowManager has been initialized and the current environment has
access to it.
You may need to have a second Java process that is started when a user logs
in that will have a presence in the tray. That process would then
communicate with the actual daemon process behind the scenes.
Cheers,
Leif
On Tue, Jan 27, 2009 at 10:47 PM, Nathanael Costa <nca...@gm...>wrote:
> Hi everyone,
>
> I have a java project using System Tray. I set up the Wrapper on system
> startup (i'm using linux), but, when the system initialize, the wrapper
> doesn't start my service. Wrapper.log has:
>
> WrapperSimpleApp: Unable to locate the class mypackage.TestClass:
> java.lang.ExceptionInInitializerError
>
> But if I start the service myself, no errors appears on wrapper.log and the
> tray works fine. And If I run my app (using java -jar), no errors appears on
> console and the tray works fine too.
>
> Anyone knows what could it be?
>
> --
> Nathanael de Castro Costa
> Programador
> NATI - Núcleo de Aplicação em Tecnologia da Informação
> UNIFOR - Universidade de Fortaleza
> Campus da Unifor - bloco M - sala M01
> Fone: (85) 3477-3360
>
>
|