Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Web bundle does not start when url-pattern=*
Web bundle does not start when url-pattern=* [message #872035] Tue, 15 May 2012 10:52 Go to next message
Thorsten Schlathölter is currently offline Thorsten SchlathölterFriend
Messages: 312
Registered: February 2012
Location: Düsseldorf
Senior Member
I would like to share my experience with an incorrect url-pattern inside the web.xml of a web bundle. Playing around with virgo and web bundles I set the following url pattern by mistake.

 <servlet-mapping>
    <servlet-name>testws</servlet-name>
    <url-pattern>*</url-pattern>
  </servlet-mapping>


The result is that the bundle never reaches the started stage. After 300 seconds there is a warning, that the bundle did not start in the expected time period. That's all.

In the logging you can see that the bundle is installed and started:
[2012-05-15 11:35:25.036]  TCP Connection(6)-127.0.0.1 <DE0000I> Installing par 'TestWS.par' version '1.0.0'. 
[2012-05-15 11:35:25.036]  TCP Connection(6)-127.0.0.1 <DE0000I> Installing bundle 'TestWS.par-1-TestWS' version '2.5.0'. 
[2012-05-15 11:35:25.473] fs-watcher                   <HD0001I> Hot deployer processing 'INITIAL' event for file 'org.eclipse.virgo.apps.admin-3.0.3.RELEASE.plan'. 
[2012-05-15 11:35:25.661]  TCP Connection(6)-127.0.0.1 <DE0001I> Installed bundle 'TestWS.par-1-TestWS' version '2.5.0'. 
[2012-05-15 11:35:25.661]  TCP Connection(6)-127.0.0.1 <DE0001I> Installed bundle 'TestWS.par-1-synthetic.context' version '1.0.0'. 
[2012-05-15 11:35:25.661]  TCP Connection(6)-127.0.0.1 <DE0001I> Installed par 'TestWS.par' version '1.0.0'. 
[2012-05-15 11:35:25.708]  TCP Connection(6)-127.0.0.1 <DE0004I> Starting par 'TestWS.par' version '1.0.0'. 
[2012-05-15 11:35:25.957] fs-watcher                   <DE0000I> Installing plan 'org.eclipse.virgo.apps.admin.plan' version '3.0.3'. 
[2012-05-15 11:35:25.957]  TCP Connection(6)-127.0.0.1 <DE0004I> Starting bundle 'TestWS.par-1-TestWS' version '2.5.0'. 
[2012-05-15 11:35:25.973]  TCP Connection(6)-127.0.0.1 <DE0004I> Starting bundle 'TestWS.par-1-synthetic.context' version '1.0.0'. 
[2012-05-15 11:35:25.989] start-signalling-1           <WE0000I> Starting web bundle 'TestWS.par-1-TestWS' version '2.5.0' with context path '/testws'. 
[2012-05-15 11:35:25.989] start-signalling-2           <DE0005I> Started bundle 'TestWS.par-1-synthetic.context' version '1.0.0'. 


After 300 seconds:
[2012-05-15 11:44:34.423]  TCP Connection(4)-127.0.0.1 <DE0502E> Start of par 'TestWS.par' version '1.0.0' has taken longer than the configured timeout of '300' seconds. 


It's really hard to spot that the following lines never show up:
[2012-05-15 11:37:15.582] start-signalling-1           <WE0001I> Started web bundle 'TestWS.par-1-TestWS' version '2.5.0' with context path '/testws'. 
[2012-05-15 11:37:15.582] start-signalling-1           <DE0005I> Started bundle 'TestWS.par-1-TestWS' version '2.5.0'. 
[2012-05-15 11:37:15.582] start-signalling-1           <DE0005I> Started par 'TestWS.par' version '1.0.0'. 


I am not sure whether this can be considered a bug. At least it is very hard to find out that the bundle was not started and if you finally get to know that, it's again hard to find out the reason.

Regards,
Thorsten
Re: Web bundle does not start when url-pattern=* [message #872515 is a reply to message #872035] Wed, 16 May 2012 09:02 Go to previous messageGo to next message
Violeta Georgieva is currently offline Violeta GeorgievaFriend
Messages: 278
Registered: October 2010
Senior Member
Hi,

Basically that mapping is not correct

Here is what the Servlet specification says:

Quote:
Specification of Mappings
In the Web application deployment descriptor, the following syntax is used to define
mappings:
■ A string beginning with a '/' character and ending with a '/*' suffix is used for
path mapping.
■ A string beginning with a '*.' prefix is used as an extension mapping.
■ The empty string ("") is a special URL pattern that exactly maps to the
application's context root, i.e., requests of the form http://host:port/<contextroot>/.
In this case the path info is '/' and the servlet path and context path is
empty string ("").
■ A string containing only the '/' character indicates the "default" servlet of the
application. In this case the servlet path is the request URI minus the context path
and the path info is null.
■ All other strings are used for exact matches only.

Regards
Violeta
Re: Web bundle does not start when url-pattern=* [message #872521 is a reply to message #872515] Wed, 16 May 2012 09:08 Go to previous messageGo to next message
Thorsten Schlathölter is currently offline Thorsten SchlathölterFriend
Messages: 312
Registered: February 2012
Location: Düsseldorf
Senior Member
Yes - like I said I set it by mistake. Anyway - the problem is that in this wrong case the bundle is not started without much notice. It took me a couple of hours to figure out what was wrong.
Re: Web bundle does not start when url-pattern=* [message #872543 is a reply to message #872521] Wed, 16 May 2012 10:01 Go to previous messageGo to next message
Violeta Georgieva is currently offline Violeta GeorgievaFriend
Messages: 278
Registered: October 2010
Senior Member
Is it possible to provide a simple example that can be used for reproducing the issue?
Re: Web bundle does not start when url-pattern=* [message #872573 is a reply to message #872543] Wed, 16 May 2012 11:31 Go to previous messageGo to next message
Thorsten Schlathölter is currently offline Thorsten SchlathölterFriend
Messages: 312
Registered: February 2012
Location: Düsseldorf
Senior Member
Hi Violeta,
find attached a simple bundle that can be used to reproduce the issue. I am running on Windows, Eclipse 3.7.2, Virgo 3.0.3 and I have installed the required tools 2 days ago. So everything should be up to date.

Checking the example I realized that the test bundle does not go off silently. There is a dump which is created. Must have overseen that the last time.

I have simply added the test.web bundle to the virgo server configuration. If I start the server the following test.web related output is generated:
[2012-05-16 13:14:17.018]  TCP Connection(4)-127.0.0.1 <DE0000I> Installing bundle 'test.web' version '1.0.0'. 
[2012-05-16 13:14:17.033]  TCP Connection(4)-127.0.0.1 <DE0001I> Installed bundle 'test.web' version '1.0.0'. 
[2012-05-16 13:14:17.080]  TCP Connection(4)-127.0.0.1 <DE0004I> Starting bundle 'test.web' version '1.0.0'. 
[2012-05-16 13:14:17.080] start-signalling-2           <WE0000I> Starting web bundle 'test.web' version '1.0.0' with context path '/testweb'. 
[2012-05-16 13:14:17.143] fs-watcher                   <HD0001I> Hot deployer processing 'INITIAL' event for file 'org.eclipse.virgo.apps.admin-3.0.3.RELEASE.plan'. 
[2012-05-16 13:14:17.252] fs-watcher                   <DE0000I> Installing plan 'org.eclipse.virgo.apps.admin.plan' version '3.0.3'. 
[2012-05-16 13:14:19.205] fs-watcher                   <DE0000I> Installing bundle 'org.eclipse.virgo.apps.admin.core' version '3.0.3.RELEASE'. 
[2012-05-16 13:14:19.518] start-signalling-2           <ME0003I> Dump 'serviceability\dump\2012-05-16-13-14-393' generated 


And 5 minutes later:
[2012-05-16 13:19:17.085]  TCP Connection(4)-127.0.0.1 <DE0502E> Start of bundle 'test.web' version '1.0.0' has taken longer than the configured timeout of '300' seconds. 



Regards,
Thorsten
  • Attachment: test.web.zip
    (Size: 2.90KB, Downloaded 286 times)

[Updated on: Wed, 16 May 2012 11:32]

Report message to a moderator

Re: Web bundle does not start when url-pattern=* [message #872792 is a reply to message #872573] Wed, 16 May 2012 20:42 Go to previous messageGo to next message
Eduardo Frazão is currently offline Eduardo FrazãoFriend
Messages: 123
Registered: January 2012
Senior Member
Try "/*"
I use here, and it works

<servlet-mapping>
		<servlet-name>MainApplication</servlet-name>
		<url-pattern>/*</url-pattern>
</servlet-mapping>

[Updated on: Wed, 16 May 2012 20:45]

Report message to a moderator

Re: Web bundle does not start when url-pattern=* [message #885308 is a reply to message #872792] Tue, 12 June 2012 19:31 Go to previous message
Violeta Georgieva is currently offline Violeta GeorgievaFriend
Messages: 278
Registered: October 2010
Senior Member
Hi,

This is really strange.
I tried your example with VTS 3.0.3, but standalone i.e. I started Virgo from the terminal and not from the tooling.
I copied your example to pickup folder and I received the following:

console log
[2012-06-12 22:19:43.461] fs-watcher                   <DE0000I> Installing bundle 'test.web' version '1.0.0'. 
[2012-06-12 22:19:43.468] fs-watcher                   <DE0001I> Installed bundle 'test.web' version '1.0.0'. 
[2012-06-12 22:19:43.473] fs-watcher                   <DE0004I> Starting bundle 'test.web' version '1.0.0'. 
[2012-06-12 22:19:43.475] start-signalling-4           <WE0000I> Starting web bundle 'test.web' version '1.0.0' with context path '/testweb'. 
[2012-06-12 22:19:44.701] start-signalling-4           <ME0003I> Dump 'serviceability/dump/2012-06-12-22-19-526' generated


and then in <Virgo-Home>/serviceability/logs/virgo-server/log.log
[2012-06-12 22:19:43.475] INFO  start-signalling-4           org.eclipse.virgo.medic.eventlog.default                         WE0000I Starting web bundle 'test.web' version '1.0.0' with context path '/testweb'. 
[2012-06-12 22:19:43.525] ERROR start-signalling-4           org.apache.catalina.core.ContainerBase                            ContainerBase.addChild: start:  org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/testweb]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
	at org.eclipse.gemini.web.tomcat.internal.TomcatServletContainer.startWebApplication(TomcatServletContainer.java:122)
	at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:91)
	at org.eclipse.virgo.web.core.internal.WebBundleLifecycleListener.onStarted(WebBundleLifecycleListener.java:122)
	at org.eclipse.virgo.kernel.install.artifact.internal.StandardArtifactStateMonitor.onStarted(StandardArtifactStateMonitor.java:247)
	at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.asyncStartSucceeded(AbstractInstallArtifact.java:294)
	at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.access$0(AbstractInstallArtifact.java:291)
	at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact$StateMonitorSignal.signalSuccessfulCompletion(AbstractInstallArtifact.java:229)
	at org.eclipse.virgo.kernel.core.internal.BundleStartTracker$1.run(BundleStartTracker.java:143)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.IllegalArgumentException: Invalid <url-pattern> * in servlet mapping
	at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3208)
	at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3183)
	at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1302)
	at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1357)
	at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:855)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:345)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	... 14 common frames omitted

[2012-06-12 22:19:44.702] INFO  start-signalling-4           org.eclipse.virgo.medic.eventlog.default                         ME0003I Dump 'serviceability/dump/2012-06-12-22-19-526' generated 


Regards
Violeta
Previous Topic:OSGi case study
Next Topic:Greenpages H2 DB Locked
Goto Forum:
  


Current Time: Thu Apr 18 20:51:48 GMT 2024

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

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

Back to the top