Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Equinox servlet bridge invalid code according to Servlet 3.0 specifications
Equinox servlet bridge invalid code according to Servlet 3.0 specifications [message #1706637] Fri, 28 August 2015 10:26 Go to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 243
Registered: March 2010
Location: France
Senior Member
Hello,

Since eclipse Mars, it seems servlet bridge is broken for weblogic 12c server.

Trying to deploy any war based application with servlet bridge, the application fails with above stack trace

According to Servlet Spec 3.0,http://download.oracle.com/otn-pub/jcp/servlet-3.0-fr-eval-oth-JSpec/servlet-3_0-final-spec.pdf, section 4.4, it seems servletContext.getServletRegistration can only be called from the contexInitialized method of a ServletContextListener implementation or from the onStartup method of a ServletContainerInitializer.
Currently it is called from the equinox starting background thread

This issue occurs in weblogic but could occurs in other app servers as well if they strictly respect servlet 3 specifications.

Quote:
java.lang.UnsupportedOperationException: [HTTP:101388]The ServletContext was passed to the ServletContextListener.contextInitialized method of a ServletContextListener that was neither declared in web.xml or web-fragment.xml, nor annotated with javax.servlet.annotation.WebListener.
at weblogic.servlet.internal.WebAppServletContext.checkNotifyDynamicContext(WebAppServletContext.java:3989)
at weblogic.servlet.internal.WebAppServletContext.getServletRegistration(WebAppServletContext.java:3871)
at org.eclipse.equinox.http.servlet.internal.Activator.getHttpServiceEndpoints(Activator.java:205)
at org.eclipse.equinox.http.servlet.internal.Activator.addingService(Activator.java:109)
at org.eclipse.equinox.http.servlet.internal.Activator.addingService(Activator.java:1)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:914)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)
at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)
at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:482)
at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:998)
at org.eclipse.equinox.http.servlet.internal.Activator.addProxyServlet(Activator.java:58)
at org.eclipse.equinox.http.servlet.internal.servlet.ProxyServlet.init(ProxyServlet.java:36)
at org.eclipse.equinox.servletbridge.BridgeServlet.registerServletDelegate(BridgeServlet.java:257)
at org.eclipse.equinox.http.servletbridge.internal.Activator.start(Activator.java:25)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:941)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:318)
at org.eclipse.osgi.container.Module.doStart(Module.java:571)
at org.eclipse.osgi.container.Module.start(Module.java:439)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

[Updated on: Fri, 28 August 2015 12:30]

Report message to a moderator

Re: Equinox servlet bridge invalid code according to Servlet 3.0 specifications [message #1706670 is a reply to message #1706637] Fri, 28 August 2015 14:36 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
It seems there is some disagreement on when it is appropriate to throw the exception. But we did provide a fix to work around this with https://bugs.eclipse.org/bugs/show_bug.cgi?id=472479

Please try the latest SR1 builds to see if it works for you.
Re: Equinox servlet bridge invalid code according to Servlet 3.0 specifications [message #1706673 is a reply to message #1706670] Fri, 28 August 2015 14:43 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 243
Registered: March 2010
Location: France
Senior Member
ok thanks for the infomation
Re: Equinox servlet bridge invalid code according to Servlet 3.0 specifications [message #1706677 is a reply to message #1706673] Fri, 28 August 2015 14:56 Go to previous messageGo to next message
Raymond Auge is currently offline Raymond AugeFriend
Messages: 10
Registered: August 2015
Junior Member
Another thing, the result of the fix will be that there will be no value set for

HttpServiceRuntimeConstants.HTTP_SERVICE_ENDPOINT ("osgi.http.endpoint")

which is perfectly legit.

However that can also make it difficult for the Http Whiteboard impl to root itself properly in some cases, and so as a work around for not being able to calculate a value, one can be set through init params on the servlet.

If the servlet is mapped to /foo/*, then you can set an init param on the servlet to:

<init-param><param-name>osgi.http.endpoint</param-name><param-value>/foo/</param-value></init-param>

* Note the entry must end with a slash (/)
Re: Equinox servlet bridge invalid code according to Servlet 3.0 specifications [message #1709797 is a reply to message #1706670] Thu, 01 October 2015 07:41 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 243
Registered: March 2010
Location: France
Senior Member
Thomas Watson wrote on Fri, 28 August 2015 16:36
It seems there is some disagreement on when it is appropriate to throw the exception. But we did provide a fix to work around this with https://bugs.eclipse.org/bugs/show_bug.cgi?id=472479

Please try the latest SR1 builds to see if it works for you.


It seems the fix is not included in Mars SR1, even it is supposed to. The bug is still reproducible with latest SR1 RC.

[Updated on: Thu, 01 October 2015 07:41]

Report message to a moderator

Re: Equinox servlet bridge invalid code according to Servlet 3.0 specifications [message #1709875 is a reply to message #1709797] Thu, 01 October 2015 16:19 Go to previous message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 243
Registered: March 2010
Location: France
Senior Member
I manually backport commit from the fix of https://bugs.eclipse.org/bugs/show_bug.cgi?id=472479.
the fix is not really working, because then in weblogic request.getContextPath() return empty string instead of the context path, so even initialization is not failing anymore ProxyServlet is still not properly initialized.
Shall I reopen the bug ?
Previous Topic:bundle native code in mainfest not working
Next Topic:Missing binaries when building rt.equinox.framework
Goto Forum:
  


Current Time: Tue Apr 16 11:55:56 GMT 2024

Powered by FUDForum. Page generated in 0.10214 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top