2009/8/3 Witold Szczerba <[email protected]>:
> Hi there,
> I have standalone application. Today I tried to deploy it using
> WebStart and it does not work, I am getting exceptions that class this
> or that is not visible from class loader (stack trace attached).
>
> The launch.jnlp has <security> <all-permissions/> </security> and all
> JARs are signed.
> I am using Guice 2.0, but the same was happening with 1.0 (I switched
> today thinking maybe it was some bug related to 1.0, but as you can
> see, Guice 2.0 does not work as well).
>
> Do you know what is the problem, any ideas?
>
> Thanks,
> Witold Szczerba
>

Hello again!
I found the problem - it has nothing to do with Guice :)
The offending part of my code was my own wrapper for EJB3 remote
objects. Guice was trying to inject remote service, and I have created
special provider which has (had as now it is corrected) method like
this:
    @Override
    public T get() {
        Object proxy = Proxy.newProxyInstance(
                ClassLoader.getSystemClassLoader(),
                beanInterfaces,
                new EjbInvocationHandler());
        return remoteInterface.cast(proxy);
    }

Now, instead of system class loader I use:
remoteInterface.getClassLoader() and everything work just fine.

The version with system class loader works without WebStart - I
suppose this is because when one starts application like java -jar
SomeJar.jar, then all the class-path is loaded using system class
loader.

When, on the other hand, one creates launch.jnlp descriptor and
launches using WebStart, then every resource described in jnlp
descriptor are loaded using WebStart class loader, so nothing of that
is visible from system class loader point of view.

Regards,
Witold Szczerba

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to