[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] getResources in Servlet.init() - returns a resource twice


Ravi,

Please open a bug report for this if you have not already done so.  Thanks.

Tom





Ravindar Reddy <rroopreddy@xxxxxxxxx>
Sent by: equinox-dev-bounces@xxxxxxxxxxx

07/11/2006 12:41 AM

Please respond to
Ravindar Reddy <rroopreddy@xxxxxxxxx>; Please respond to
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>

To
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
cc
Subject
[equinox-dev] getResources in Servlet.init() - returns a resource        twice





The following code snippet is used to get a single resource URL that is packaged in the bundle jar. This code returns a single URL when invoked from BundleAcivator.activate() but returns two URLs when invoked from Servlet.init(). I printed out the classloader classes from these two invocations. I attached the test bundle to duplicate the issue. The BundleProxyClassLoader in servlet case is returning one through parent loader and one for 'this' loader. This seems like bug but I could be wrong. I am using the 3.2 release bundles for this test

       ClassLoader cl = Thread.currentThread().getContextClassLoader();
       Enumeration urls = cl.getResources("META-INF/helloworld.txt");
       System.out.println("Resources in bundle with classloader :" + cl);
       while(urls.hasMoreElements()) {
           URL url = "">            System.out.println(url);
       }

==> Output from BundleAcivator.activate()
Resources in bundle with classloader :org.eclipse.core.runtime.internal.adaptor.ContextFinder@17494c8
bundleresource://17/META-INF/helloworld.txt

==> Output from Servlet.init()
Resources in servlet with classloader :org.eclipse.equinox.servlet.bridge.http.internal.ServletRegistration$BundleProxyClassLoader@c0f1ec
bundleresource://17/META-INF/helloworld.txt
bundleresource://17/META-INF/helloworld.txt

Thanks,
-Ravi R[attachment "helloworld_1.0.0.jar" deleted by Thomas Watson/Austin/IBM]
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev