users@glassfish.java.net

Re: Problem running standalone Glassfish client as Eclipse plugin

From: <glassfish_at_javadesktop.org>
Date: Mon, 25 Jan 2010 06:07:44 PST

Further investigation of the Problem has shown, that Glassfishv3 relies on a public method `findResources(java.lang.String)` of the `java.lang.Classloader`.

    package com.sun.enterprise.module.single;
    [...]
    public class ManifestProxy extends Manifest {
        [...]
        public ManifestProxy(ClassLoader cl, List<SeparatorMappings> mappings) throws IOException {
            try {
               [...]
                Method met = cl.getClass().getMethod("findResources", String.class);
                Enumeration<URL> urls=null;
                try {
                    met.setAccessible(true);
                    urls = (Enumeration<URL>) met.invoke(cl, JarFile.MANIFEST_NAME);

But this method is protected in the Classloader class itself. When running the client as standalone java application the derived classloader `sun.misc.Launcher$AppClassLoader` is used which overrides this method and declares it public.
But when running as Eclipse plugin the classloader `org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader` does not override the `findResource`-Method which leaves it protected and inaccessible in the ManifestProxy class.

Has anyone successfully connected from a Eclipse plugin as standalone client to a EJB on Glassfishv3?
[Message sent by forum member 'dmt_' (dominik.morent_at_knime.ch)]

http://forums.java.net/jive/thread.jspa?messageID=382773