Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Running a compiled JSP servlet via Servlet extensionpoints

Hi,
actually the problem was caused by various library bundles not having included the relevant imports. However, I see a problem there when creating library bundles, since you don't know which runtime classes that willbe needed of a jar without consulting the source, and the error messages on the classloading do not include the current loading context (bundle etc). Would it be possible to improve the error messages instead having to dig down to debugging the import classloader resolving?

Thanks for the great help anyway!

/peter
On May 5, 2006, at 6:35 PM, BJ Hargrave wrote:

If your problem is indeed what Tom suggests, then it is not a bug in
Eclipse, but an side effect of using Eclipse-LazyStart: true. In this case your bundle can be started by a class load from your bundle. So if your
activator tries to load (directly or indirectly) the same class which
triggered the start of your bundle, you will hit the circularity error.

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
hargrave@xxxxxxxxxx
Office: +1 407 849 9117 Mobile: +1 386 848 3788



Peter Neubauer <peter@xxxxxxxxxxx>
Sent by: equinox-dev-bounces@xxxxxxxxxxx
2006-05-05 12:18 PM
Please respond to
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>


To
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
cc

Subject
Re: [equinox-dev] Running a compiled JSP servlet via Servlet
extensionpoints






Nah,
that is what I have been thinking, too, it seems it is that deep bug in
Eclipse that Thomas was hinting at. Will try to use a
IExtensioPointFactory instead to delay the instantiation of the servlet
and see how that works. Hope to get back with results then.
/peter
On May 5, 2006, at 5:35 PM, Kaegi, Simon wrote:

Hi Peter,

It's hard without seeing the bundles you're using, but if I had to take a
wild guess...
I think it might be that your Jasper bundle isn't importing the
javax.servlet stuff.

-Simon


From: equinox-dev-bounces@xxxxxxxxxxx [
mailto:equinox-dev-bounces@xxxxxxxxxxx] On Behalf Of Peter Neubauer
Sent: Friday, May 05, 2006 8:00 AM
To: equinox-dev@xxxxxxxxxxx
Subject: [equinox-dev] Running a compiled JSP servlet via Servlet
extensionpoints

Hi,
not sure this is the right forum but since I am using only equinox
incubator projects to get this running ...

Basically, I'm trying to register a basic JspServlet, like
package org.apache.jsp;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.jasper.runtime.HttpJspBase;

public class TestJsp extends HttpJspBase {

@Override
public void _jspService(HttpServletRequest arg0, HttpServletResponse arg1)
throws ServletException, IOException {
arg1.getOutputStream().println("hello jsp");
arg1.getOutputStream().flush();

}

}
via the org.eclipse.equinox.servlet.ext registry extension points. Usual servlets in the same bundle are no problem to load and register using the
plugin.xml.
However, having imported all jasper and javax.servlet packages from other
library bundles into the current bundle, still on instantiating the
servlet I get the stacktrace below. I'm running on Eclipse 3.2RC2 and with
the servlet.ext from CVS, plus some other jars exposing the different
LIBs.
Any hints on this? I'm thinking this should be a normal servlet after all, and for the others the javax.servlet.Servlet is found too? But I have no
experiences with jasper stuff.
Cheers
/peter

org.eclipse.core.runtime.CoreException: Plug-in web.workbench was unable
to load class org.apache.jsp.TestJsp.
at
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwExce ption(
RegistryStrategyOSGI.java:165)
at
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExe cutableExtension(
RegistryStrategyOSGI.java:151)
at
org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableE xtension(
ExtensionRegistry.java:759)
at
org.eclipse.core.internal.registry.ConfigurationElement.createExecutab leExtension(
ConfigurationElement.java:243)
at
org.eclipse.core.internal.registry.ConfigurationElementHandle.createEx ecutableExtension(
ConfigurationElementHandle.java:51)
at org.eclipse.equinox.servlet.ext.ServletManager.added(
ServletManager.java:72)
at org.eclipse.equinox.servlet.ext.ExtensionPointTracker.open(
ExtensionPointTracker.java:66)
at org.eclipse.equinox.servlet.ext.ServletManager.start(
ServletManager.java:51)
at org.eclipse.equinox.servlet.ext.HttpServiceCustomizer.addingService(
HttpServiceCustomizer.java:43)
at org.osgi.util.tracker.ServiceTracker$Tracked.trackAdding(
ServiceTracker.java:1011)
at org.osgi.util.tracker.ServiceTracker$Tracked.trackInitialServices(
ServiceTracker.java:875)
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:282)
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:221)
at org.eclipse.equinox.servlet.ext.ExtActivator.start (ExtActivator.java:27
)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(
BundleContextImpl.java:995)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActiva tor(
BundleContextImpl.java:989)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(
BundleContextImpl.java:970)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(
BundleHost.java:317)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(
AbstractBundle.java:329)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(
Framework.java:1037)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundl es(
StartLevelManager.java:573)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(
StartLevelManager.java:495)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartL evel(
StartLevelManager.java:275)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEve nt(
StartLevelManager.java:455)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(
EventManager.java:189)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(
EventManager.java:291)
org.eclipse.core.runtime.CoreException[1]: java.lang.NoClassDefFoundError:
javax/servlet/Servlet
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(
DefaultClassLoader.java:160)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(
ClasspathManager.java:491)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(
ClasspathManager.java:461)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImp l(
ClasspathManager.java:420)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(
ClasspathManager.java:403)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClas s(
DefaultClassLoader.java:188)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(
BundleLoader.java:339)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(
BundleLoader.java:391)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(
BundleLoader.java:352)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(
DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(
DefaultClassLoader.java:160)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(
ClasspathManager.java:491)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(
ClasspathManager.java:461)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImp l(
ClasspathManager.java:420)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(
ClasspathManager.java:403)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClas s(
DefaultClassLoader.java:188)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(
BundleLoader.java:339)
at org.eclipse.osgi.framework.internal.core.SingleSourcePackage.loadClass (
SingleSourcePackage.java:37)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(
BundleLoader.java:379)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(
BundleLoader.java:352)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(
DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(
DefaultClassLoader.java:160)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(
ClasspathManager.java:491)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(
ClasspathManager.java:461)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImp l(
ClasspathManager.java:420)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(
ClasspathManager.java:403)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClas s(
DefaultClassLoader.java:188)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(
BundleLoader.java:339)
at org.eclipse.osgi.framework.internal.core.SingleSourcePackage.loadClass (
SingleSourcePackage.java:37)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(
BundleLoader.java:379)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(
BundleLoader.java:352)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(
DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(
DefaultClassLoader.java:160)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(
ClasspathManager.java:491)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(
ClasspathManager.java:461)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImp l(
ClasspathManager.java:420)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(
ClasspathManager.java:403)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClas s(
DefaultClassLoader.java:188)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(
BundleLoader.java:339)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(
BundleLoader.java:391)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(
BundleLoader.java:352)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(
DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(
BundleLoader.java:276)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(
BundleHost.java:227)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(
AbstractBundle.java:1245)
at
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExe cutableExtension(
RegistryStrategyOSGI.java:147)
at
org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableE xtension(
ExtensionRegistry.java:759)
at
org.eclipse.core.internal.registry.ConfigurationElement.createExecutab leExtension(
ConfigurationElement.java:243)
at
org.eclipse.core.internal.registry.ConfigurationElementHandle.createEx ecutableExtension(
ConfigurationElementHandle.java:51)
at org.eclipse.equinox.servlet.ext.ServletManager.added(
ServletManager.java:72)
at org.eclipse.equinox.servlet.ext.ExtensionPointTracker.open(
ExtensionPointTracker.java:66)
at org.eclipse.equinox.servlet.ext.ServletManager.start(
ServletManager.java:51)
at org.eclipse.equinox.servlet.ext.HttpServiceCustomizer.addingService(
HttpServiceCustomizer.java:43)
at org.osgi.util.tracker.ServiceTracker$Tracked.trackAdding(
ServiceTracker.java:1011)
at org.osgi.util.tracker.ServiceTracker$Tracked.trackInitialServices(
ServiceTracker.java:875)
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:282)
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:221)
at org.eclipse.equinox.servlet.ext.ExtActivator.start (ExtActivator.java:27
)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(
BundleContextImpl.java:995)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActiva tor(
BundleContextImpl.java:989)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(
BundleContextImpl.java:970)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(
BundleHost.java:317)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(
AbstractBundle.java:329)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(
Framework.java:1037)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundl es(
StartLevelManager.java:573)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(
StartLevelManager.java:495)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartL evel(
StartLevelManager.java:275)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEve nt(
StartLevelManager.java:455)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(
EventManager.java:189)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(
EventManager.java:291)

This message may contain privileged and/or confidential information.
If you have received this e-mail in error or are not the intended
recipient, you may not use, copy, disseminate or distribute it; do not
open any attachments, delete it immediately from your system and notify
the sender promptly by e-mail that you have done so.  Thank you.
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev





Back to the top