Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Web app fails to start when including ContextLoaderListener in web.xml
Web app fails to start when including ContextLoaderListener in web.xml [message #721407] Thu, 01 September 2011 16:48 Go to next message
pinkfloyd_360 is currently offline pinkfloyd_360
Messages: 15
Registered: August 2011
Junior Member
Hi,

I'm building a web application as a demo for all the virgo OSGi bundles and services that I created. I'm having a problem with the web application. I based my code on the virgo splash and admin web bundles.

I have a splash page (working fine with no problems) and within it I have two links: one to the admin console (working fine) and the other to a "demo" link, which points to my 'demo' web application (based on the virgo 'admin' application').

I build a PAR file, which includes those two web apps, in addition to at least 20 other modules. All are working correctly with the following exception:

1. if I include the following in the demo web.xml file, the entire PAR file doesn't deploy:

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>


Here's the fail message:

[2011-09-01 09:36:40.960] start-signalling-12          <DE0006E> Start failed for bundle 'framework-0.0.1-com.sample.web.demo' version '0.0.1'. org.eclipse.virgo.kernel.deployer.core.DeploymentException: Web application failed to start
	at org.eclipse.virgo.web.core.internal.WebBundleLifecycleListener.onStarted(WebBundleLifecycleListener.java:132)
	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: org.eclipse.gemini.web.core.WebApplicationStartFailedException: org.eclipse.gemini.web.core.spi.ServletContainerException: Web application at '/demo' failed to start. Check the logs for more details.
	at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:108)
	at org.eclipse.virgo.web.core.internal.WebBundleLifecycleListener.onStarted(WebBundleLifecycleListener.java:122)
	... 8 common frames omitted
Caused by: org.eclipse.gemini.web.core.spi.ServletContainerException: Web application at '/demo' failed to start. Check the logs for more details.
	at org.eclipse.gemini.web.tomcat.internal.TomcatServletContainer.startWebApplication(TomcatServletContainer.java:125)
	at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:91)
	... 9 common frames omitted



2. If I remove or comment the above code from web.xml file, everything loads correctly. I'm able to access the splash page and then when I try to connect to the 'demo' page I get a 404 HTTP Error. I suspect I have incorrect url-mapping for that one.

In the next few posts, I'll attach copies of my current files.

(I'm running virgo 3.0.0.RELEASE)

[Updated on: Thu, 01 September 2011 17:01]

Report message to a moderator

Re: Web app fails to start when including ContextLoaderListener in web.xml [message #721408 is a reply to message #721407] Thu, 01 September 2011 16:58 Go to previous messageGo to next message
pinkfloyd_360 is currently offline pinkfloyd_360
Messages: 15
Registered: August 2011
Junior Member

    web.xml


<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        version="2.5">


    <display-name>Sample Web Demo</display-name>

    <description>Sample Web Console</description>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>


    <!-- CONFIGURE A PARENT APPLICATION CONTEXT -->

    <context-param>
        <param-name>contextClass</param-name>
        <param-value>org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext</param-value>
    </context-param>


    <!-- Here's the declaration that is causing the problem -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>


    <!-- DISPATCHER SERVLET CONFIG -->
    <servlet>
        <servlet-name>demo</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    </servlet>


    <servlet-mapping>
        <servlet-name>demo</servlet-name>
        <url-pattern>/web/*</url-pattern>
    </servlet-mapping>


    <!-- SECURITY CONFIG -->

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Sample Web Console</web-resource-name>
            <url-pattern>/web/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>admin</role-name>
        </auth-constraint>
    </security-constraint>

    <login-config>
        <auth-method>BASIC</auth-method>
        <realm-name>Sample Web Console</realm-name>
    </login-config>


    <security-role>
        <role-name>admin</role-name>
    </security-role>

</web-app>




    demo-servlet.xml


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="
                                http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                                http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" />


    <context:component-scan base-package="com.sample.web.demo" />


    <!-- VIEW CONFIG  -->

    <bean id="topViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/jsp/" />
        <property name="suffix" value=".jsp" />
    </bean>

    <bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
        <property name="exceptionMappings">
            <props>
                <prop key="java.lang.Exception">error</prop>
            </props>
        </property>
        <property name="warnLogCategory" value="com.sample.web.demo" />
    </bean>

</beans>





    MANIFEST.MF


Manifest-Version: 1.0
Bundle-ClassPath: WEB-INF/classes
Bundle-Version: 0.0.1
Tool: Bundlor 1.1.0.BUILD-20101220120024
Bundle-Name: Sample Web Screens
Bundle-ManifestVersion: 2
Bundle-SymbolicName: com.sample.web.demo
Web-ContextPath: /demo
Import-Package:
 org.springframework.web;version="[3.0.6.RELEASE,3.0.6.RELEASE]",
 org.springframework.web.servlet.mvc;version="[3.0.5, 3.1.0)",
 org.springframework.web.servlet.view;version="[3.0.5, 3.1.0)",
 org.springframework.web.servlet.handler;version="[3.0.5, 3.1)",
 org.springframework.web.servlet;version="[3.0.5, 3.1)",
 org.springframework.web.servlet.support;version="[3.0.5, 3.1)",
 org.springframework.web.context.support;version="[2.5.6, 3.1)",
 org.springframework.beans.factory.xml;version="[3.0.5, 3.1.0)",
 org.springframework.context.config;version="[3.0.5, 3.1.0)",
 org.springframework.context.support;version="[3.0.5, 3.1.0)",
 org.springframework.web.multipart.commons;version="[3.0.5, 3.1.0)",
 org.eclipse.virgo.web.dm;version="[2.0.0, 4.0.0)",
 javax.servlet.jsp.jstl.core;version="[1.2.0, 2.0.0)",
 javax.servlet.http;version="[2.5.0, 4.0.0)"




    DemoController.java


package com.sample.web.demo;

import java.util.Map;
import java.util.TreeMap;

import org.springframework.stereotype.Controller;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.bind.annotation.RequestMapping;


@Controller
public final class DemoController {


  /**
   *
   */
  @RequestMapping("/info/overview.htm")
  public ModelAndView overview() {

    return
    new ModelAndView("info-overview").addObject("properties", this.getDemoProperties());
  }

  private Map<String, String> getDemoProperties() {

    Map<String, String> props = new TreeMap<String, String>();


    props.put("Test1", "Value1");
    props.put("Test2", "Value2");
    props.put("Test3", "Value3");


    return props;
  }
}

[Updated on: Thu, 01 September 2011 17:03]

Report message to a moderator

Re: Web app fails to start when including ContextLoaderListener in web.xml [message #721412 is a reply to message #721408] Thu, 01 September 2011 17:15 Go to previous messageGo to next message
pinkfloyd_360 is currently offline pinkfloyd_360
Messages: 15
Registered: August 2011
Junior Member
Finally, here's the template.mf file:

Manifest-Version: 1.0
Bundle-Name: Sample Demo Web Bundle
Bundle-Version: 0.0.1
Bundle-ManifestVersion: 2
Bundle-SymbolicName: com.sample.web.demo
Bundle-ClassPath: WEB-INF/classes
Web-ContextPath: /
Import-Template: 
 org.springframework.*;version="[3.0.5, 3.1)",
 javax.servlet.http.*;version="3.0.4",
 org.osgi.framework.*;version="0"
Excluded-Exports: *
Import-Package: 
 org.springframework.web;version="[3.0.6.RELEASE,3.0.6.RELEASE]",
 org.springframework.web.servlet.mvc;version="[3.0.5, 3.1.0)",
 org.springframework.web.servlet.view;version="[3.0.5, 3.1.0)",
 org.springframework.web.servlet.handler;version="[3.0.5, 3.1)",
 org.springframework.web.servlet;version="[3.0.5, 3.1)",
 org.springframework.web.servlet.support;version="[3.0.5, 3.1)",
 org.springframework.web.context.support;version="[2.5.6, 3.1)",
 org.springframework.beans.factory.xml;version="[3.0.5, 3.1.0)",
 org.springframework.context.config;version="[3.0.5, 3.1.0)",
 org.springframework.context.support;version="[3.0.5, 3.1.0)",
 org.springframework.web.multipart.commons;version="[3.0.5, 3.1.0)",
 org.eclipse.virgo.web.dm;version="[2.0.0, 4.0.0)",
 javax.servlet.jsp.jstl.core;version="[1.2.0, 2.0.0)",
 javax.servlet.http;version="[2.5.0, 4.0.0)"



I"m quite new to Spring MVC so I wouldn't be surprised if I made many mistakes. However, I've been comparing the code and the configuration to those of the virgo splash and admin apps and have not been able to identify the issues.

I would appreciate any assistance on this.

Thanks Smile
Re: Web app fails to start when including ContextLoaderListener in web.xml [message #721436 is a reply to message #721412] Thu, 01 September 2011 18:49 Go to previous messageGo to next message
Violeta Georgieva is currently offline Violeta Georgieva
Messages: 238
Registered: October 2010
Senior Member
Hi,

From the exception above we can see that the application cannot be started.
Can you please check <Virgo-Home>/serviceability/logs and tell us what is the cause for the failure. (exception or something else)

Regards
Violeta
Re: Web app fails to start when including ContextLoaderListener in web.xml [message #721470 is a reply to message #721436] Thu, 01 September 2011 20:41 Go to previous messageGo to next message
pinkfloyd_360 is currently offline pinkfloyd_360
Messages: 15
Registered: August 2011
Junior Member
Violeta Georgieva wrote on Thu, 01 September 2011 11:49
Hi,

From the exception above we can see that the application cannot be started.
Can you please check <Virgo-Home>/serviceability/logs and tell us what is the cause for the failure. (exception or something else)

Regards
Violeta


Thanks for your quick response Violeta. In fact, this is part of my frustration, the log files don't have any additional information. The log has exactly the same exception that I attached above.

Thanks.
Re: Web app fails to start when including ContextLoaderListener in web.xml [message #721706 is a reply to message #721470] Fri, 02 September 2011 16:02 Go to previous messageGo to next message
Tin N/A is currently offline Tin N/A
Messages: 46
Registered: December 2010
Member
From my experience - you're not looking back far enough into the log.log file. The lines preceding the error you quoted usually contain the exception that caused deployment failure - probably a class not found (i.e. you're using a class whose package you didn't import through MANIFEST.MF) or some similar error.
Re: Web app fails to start when including ContextLoaderListener in web.xml [message #723850 is a reply to message #721706] Fri, 09 September 2011 16:40 Go to previous messageGo to next message
pinkfloyd_360 is currently offline pinkfloyd_360
Messages: 15
Registered: August 2011
Junior Member
My experience has been quite the opposite actually. The log file doesn't provide much help. Most of the error messages are very obscure and this makes debugging much harder than it should be. I was helping a developer the other day with a very generic error message that he spent few days trying to track. The error message was: "Failed to execute goal com.springsource.bundlor:com.springsource.bundlor.maven:1.0.0.RELEASE". Since I came across that previously and I also took me few hours to resolve, I told him to check his template.mf file for any additional trailing spaces or extra lines. It turned out to be exactly that. Now, wouldn't you agree that reporting a more helpful message while parsing the file can be more helpful?

I'm very excited about OSGi technology and I'm having a heck of a time trying to sell it to my development teams, who keep complaining to the executives about how hard it is and that they are spending far more time debugging instead of actually writing code. I'm sorry to say, to a large degree this is true.
Re: Web app fails to start when including ContextLoaderListener in web.xml [message #723895 is a reply to message #723850] Fri, 09 September 2011 19:29 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 272
Registered: January 2010
Senior Member
pinkfloyd_360,

Can you try to repackage your war with Import-Library for the spring vs. individual packages. If that helps, you can start cutting dependencies from there.

What might be happening - there is a deep dependency from lets say some class used in the <context:component-scan /> xml stanza that is not imported. As an example - you do not have any imports for org.sf.aop - and classes from that package are used a lot internally in spring.
With library you get much more - but you are sure to get everything Smile


Try that. If you are still having issues - ping back and we will examine it further.

Dmitry
Re: Web app fails to start when including ContextLoaderListener in web.xml [message #724120 is a reply to message #723895] Sat, 10 September 2011 22:03 Go to previous messageGo to next message
pinkfloyd_360 is currently offline pinkfloyd_360
Messages: 15
Registered: August 2011
Junior Member
Hi Dmitry,

Thanks for your advice. At this point, I'm not really concerned about optimization so if I can include entire libraries that would be fine for now and later, once I get this prototype working, I can go back and figure out what are the exact dependencies.

I added two libs but I'm still getting errors. Here's an updated copy of my MANIFEST file:


Manifest-Version: 1.0
Bundle-Name: Sample Web Bundle
Bundle-Version: 0.0.1
Bundle-ManifestVersion: 2
Bundle-SymbolicName: com.sample.web.demo
Bundle-ClassPath: .,WEB-INF/classes,WEB-INF/lib
Web-ContextPath: /demo
Import-Bundle: org.springframework.web;version="[3.0.6.RELEASE,3.0.6.RELEASE]"
Import-Template:
 javax.management.*;version=0,
 javax.servlet.*;version="[2.5.0, 4.0.0)",
 javax.xml.stream.*;version="0",
 org.eclipse.virgo.apps.admin.*;version="[3.0.0, 3.0.1)",
 org.eclipse.virgo.kernel.*;version="[3.0.0, 3.0.1)",
 org.eclipse.virgo.util.*;version="[3.0.0, 3.0.1)",
 org.eclipse.virgo.web.*;version="[3.0.0, 3.0.1)",
 org.osgi.framework.*;version="0",
 org.osgi.service.cm.*;version="0",
 org.slf4j;version="[1.6.1, 2.0.0)",
 org.springframework.*;version="[3.0.5, 3.1)"
Require-TldBundle: org.apache.taglibs.standard.glassfish
Import-Library:
 org.springframework.spring;version="[3.0.6.RELEASE,3.0.6.RELEASE]",
 org.springframework.osgi;version="[1.1.0,1.1.0]"
Import-Package:
 org.apache.taglibs.standard;version="[1.1.2,2.0.0)",
 org.apache.taglibs.standard.extra.spath;version="[1.1.2,2.0.0)",
 org.apache.taglibs.standard.functions;version="[1.1.2,2.0.0)",
 org.apache.taglibs.standard.lang.jstl;version="[1.1.2,2.0.0)",
 org.apache.taglibs.standard.lang.jstl.parser;version="[1.1.2,2.0.0)",
 org.apache.taglibs.standard.lang.jstl.test;version="[1.1.2,2.0.0)",
 org.apache.taglibs.standard.lang.jstl.test.beans;version="[1.1.2,2.0.0)",
 org.apache.taglibs.standard.lang.support;version="[1.1.2,2.0.0)",
 org.apache.taglibs.standard.resources;version="[1.1.2,2.0.0)",
 org.apache.taglibs.standard.tag.common.core;version="[1.1.2,2.0.0)",
 org.apache.taglibs.standard.tag.common.fmt;version="[1.1.2,2.0.0)",
 org.apache.taglibs.standard.tag.common.sql;version="[1.1.2,2.0.0)",
 org.apache.taglibs.standard.tag.common.xml;version="[1.1.2,2.0.0)",
 org.apache.taglibs.standard.tag.el.core;version="[1.1.2,2.0.0)",
 org.apache.taglibs.standard.tag.el.fmt;version="[1.1.2,2.0.0)",
 org.apache.taglibs.standard.tag.el.sql;version="[1.1.2,2.0.0)",
 org.apache.taglibs.standard.tag.el.xml;version="[1.1.2,2.0.0)",
 org.apache.taglibs.standard.tei;version="[1.1.2,2.0.0)",
 org.apache.taglibs.standard.tlv;version="[1.1.2,2.0.0)",
 org.springframework.web;version="[3.0.6.RELEASE,3.0.6.RELEASE]",
 org.springframework.web.servlet.mvc;version="[3.0.5, 3.1.0)",
 org.springframework.web.servlet.view;version="[3.0.5, 3.1.0)",
 org.springframework.web.servlet.handler;version="[3.0.5, 3.1)",
 org.springframework.web.servlet;version="[3.0.5, 3.1)",
 org.springframework.web.servlet.support;version="[3.0.5, 3.1)",
 org.springframework.web.context.support;version="[2.5.6, 3.1)",
 org.springframework.beans.factory.xml;version="[3.0.5, 3.1.0)",
 org.springframework.context.config;version="[3.0.5, 3.1.0)",
 org.springframework.context.support;version="[3.0.5, 3.1.0)",
 org.springframework.web.multipart.commons;version="[3.0.5, 3.1.0)",
 org.eclipse.virgo.web.dm;version="[2.0.0, 3.0.0)",
 javax.servlet.jsp.jstl.core;version="[1.2.0, 2.0.0)",
 javax.servlet.http;version="[2.5.0, 4.0.0)"
Excluded-Exports: *
Excluded-Imports: org.junit,
  org.eclipse.virgo.teststubs.*,
  org.springframework.mock.*



I'm still having a problem with dependencies, this is the error that I'm getting now:


Hot re-deploy failed for file 'framework-0.0.1.par'. org.eclipse.virgo.kernel.deployer.core.DeploymentException: Unsatisfied dependency detected when expanding imports for [bundle 'framework-0.0.1-com.sample.web.demo' version '0.0.1' in scope 'framework-0.0.1',
Re: Web app fails to start when including ContextLoaderListener in web.xml [message #725506 is a reply to message #724120] Thu, 15 September 2011 01:42 Go to previous messageGo to next message
pinkfloyd_360 is currently offline pinkfloyd_360
Messages: 15
Registered: August 2011
Junior Member
This is another attempt ... I see that this topic has been viewed more than 6,500 times and yet I can't find anybody who has seen this problem before?

Simply stated, the main problem is in this code in web.xml file:

 <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>


If I remove this code or comment it, the file gets deployed with no problem (of course the servlet itself does not work). If the code is present in web.xml, the file cannot be deployed, I get the following error:

[2011-09-14 18:33:52.043] start-signalling-13          <DE0006E> Start failed for bundle 'framework-0.0.1-com.sample.web.demo' version '0.0.1'. org.eclipse.virgo.kernel.deployer.core.DeploymentException: Web application failed to start
        at org.eclipse.virgo.web.core.internal.WebBundleLifecycleListener.onStarted(WebBundleLifecycleListener.java:132)
        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: org.eclipse.gemini.web.core.WebApplicationStartFailedException: org.eclipse.gemini.web.core.spi.ServletContainerException: Web application at '/demo' failed to start. Check the logs for more details.
        at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:108)
        at org.eclipse.virgo.web.core.internal.WebBundleLifecycleListener.onStarted(WebBundleLifecycleListener.java:122)
        ... 8 common frames omitted
Caused by: org.eclipse.gemini.web.core.spi.ServletContainerException: Web application at '/demo' failed to start. Check the logs for more details.
        at org.eclipse.gemini.web.tomcat.internal.TomcatServletContainer.startWebApplication(TomcatServletContainer.java:125)
        at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:91)
        ... 9 common frames omitted



I posted all my code. I compared it to the 'admin' web module that's shipped with virgo, as well as with the greenpages.web module. I can't see any difference in the configuration files (web.xml, applicationContext.xml and demo-servlet.xml).

Can I get help with these problem, please.

Thanks.

[Updated on: Thu, 15 September 2011 01:42]

Report message to a moderator

Re: Web app fails to start when including ContextLoaderListener in web.xml [message #725519 is a reply to message #724120] Thu, 15 September 2011 04:18 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 272
Registered: January 2010
Senior Member
Sorry for delay in response.

Have you manually upgraded Spring Framework version to 3.0.6.RELEASE (http://wiki.eclipse.org/Virgo/FAQ#How_can_I_change_the_version_of_Spring_framework_in_the_user_region.3F) ? If not, Virgo 3.x ships with 3.0.5.RELEASE. So if you have not upgraded to 3.0.6 change your import version range for spring framework library to 3.0.5.RELEASE.

If you are still having problems and would not mind sharing your source code, I will take a look at it. Github it or just PM/email me (dmitry at dsklyut dot com) with the source archive.

Re: Web app fails to start when including ContextLoaderListener in web.xml [message #727383 is a reply to message #725519] Wed, 21 September 2011 06:44 Go to previous messageGo to next message
Tin N/A is currently offline Tin N/A
Messages: 46
Registered: December 2010
Member
Has the original poster managed to solve this problem? Yesterday I ran into the same thing, so I reconfigured serviceability to tracing, and this is what it says in the logs:

[2011-09-21 08:17:55.405] DEBUG fs-watcher                   o.s.osgi.extender.internal.activator.ContextLoaderListener        Processing bundle event [STARTED] for bundle [test] 
[2011-09-21 08:17:55.405] DEBUG fs-watcher                   o.s.osgi.extender.internal.activator.ContextLoaderListener        Scanning bundle [test bundle (test)] for configurations... 
[2011-09-21 08:17:55.405] DEBUG fs-watcher                   o.s.osgi.extender.internal.activator.ContextLoaderListener        Creating an application context for bundle [test bundle (test)] 
[2011-09-21 08:17:55.405] TRACE fs-watcher                   o.s.osgi.extender.support.ApplicationContextConfiguration         Configuration: AppCtxCfg [Bundle=test]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s 
[2011-09-21 08:17:55.405] TRACE fs-watcher                   o.s.osgi.extender.support.DefaultOsgiApplicationContextCreator    Created configuration AppCtxCfg [Bundle=test]isSpringBundle=false|async=true|wait-for-deps=true|publishCtx=true|timeout=300s for bundle test bundle (test) 
[2011-09-21 08:17:55.405] DEBUG fs-watcher                   o.s.osgi.extender.internal.activator.ContextLoaderListener        No application context created for bundle [test bundle (test)]
...
[2011-09-21 08:17:55.418] TRACE Thread-42                    org.springframework.osgi.util.DebugUtils                          Could not find class [org.springframework.web.context.request.RequestContextListener] required by [test bundle(test)] scanning available bundles
[2011-09-21 08:17:55.474] ERROR start-signalling-6           org.eclipse.gemini.web.internal.StandardWebApplication            Failed to start web application at bundleContext
 path '/test' org.eclipse.gemini.web.core.spi.ServletContainerException: Web application at '/test' failed to start. Check the logs for more details.


It might not be the same cause as the original, but the setup and symptoms are the same: it's a Spring MVC web bundle, containing all the required manifest headers, and it fails to start without any detailed info. Now, from what can be seen above, some of the log lines I quoted are quite critical, yet they are logged using debug or trace levels. I have yet to confirm the quoted lines indicate all of the problems that prevent my application from starting, but they do indicate some problems so shouldn't they be logged using warn or error log levels?

[Updated on: Wed, 21 September 2011 07:11]

Report message to a moderator

Re: Web app fails to start when including ContextLoaderListener in web.xml [message #727578 is a reply to message #727383] Wed, 21 September 2011 14:47 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 272
Registered: January 2010
Senior Member
canobix,

Can you please attach your test war/wab file here - I will try to figure out why it is faling for you?

Regards,
Dmitry
Re: Web app fails to start when including ContextLoaderListener in web.xml [message #727612 is a reply to message #727578] Wed, 21 September 2011 16:11 Go to previous messageGo to next message
Tin N/A is currently offline Tin N/A
Messages: 46
Registered: December 2010
Member
No need, thanks! I managed to resolve all the errors. The example I sent was posted to illustrate how a critical error could be missed if you have the default log level (info). In my case, if I hadn't reconfigured the logging level to trace, it would be very difficult to find out that I was missing an import for org.springframework.web.context.request and conclude that's the reason why the web application is failing to start.
So, as a note to the original poster - change your log level, reserve some patience (trace logs are really long) and you should be able to find the exact cause for your application failing to start.
And a note to the Virgo developers - it looks like log levels for logging some of the errors detected could do with receiving a bit higher severity Very Happy
Re: Web app fails to start when including ContextLoaderListener in web.xml [message #728261 is a reply to message #725519] Thu, 22 September 2011 20:02 Go to previous messageGo to next message
pinkfloyd_360 is currently offline pinkfloyd_360
Messages: 15
Registered: August 2011
Junior Member
Hi Dmitry,

I'm very sorry for the late response, I was out on a business trip. I'm still having the same issue since I didn't have much time to investigate further. Let me check with canobix first if I can leverage from his experience since he has been getting the same error. Otherwise, I'll email you the code for further help.

I really appreciate your help on this.
Re: Web app fails to start when including ContextLoaderListener in web.xml [message #728262 is a reply to message #727612] Thu, 22 September 2011 20:03 Go to previous messageGo to next message
pinkfloyd_360 is currently offline pinkfloyd_360
Messages: 15
Registered: August 2011
Junior Member
canobix wrote on Wed, 21 September 2011 09:11
No need, thanks! I managed to resolve all the errors. The example I sent was posted to illustrate how a critical error could be missed if you have the default log level (info). In my case, if I hadn't reconfigured the logging level to trace, it would be very difficult to find out that I was missing an import for org.springframework.web.context.request and conclude that's the reason why the web application is failing to start.
So, as a note to the original poster - change your log level, reserve some patience (trace logs are really long) and you should be able to find the exact cause for your application failing to start.
And a note to the Virgo developers - it looks like log levels for logging some of the errors detected could do with receiving a bit higher severity Very Happy


Hi canobix,

Would it be possible if you can post your MANIFEST.MF or template.mf file? I'm already importing org.springframework.web.context.request.

Thanks.
Re: Web app fails to start when including ContextLoaderListener in web.xml [message #728750 is a reply to message #728262] Fri, 23 September 2011 20:24 Go to previous messageGo to next message
Tin N/A is currently offline Tin N/A
Messages: 46
Registered: December 2010
Member
pinkfloyd_360 wrote on Thu, 22 September 2011 22:03

Would it be possible if you can post your MANIFEST.MF or template.mf file? I'm already importing org.springframework.web.context.request.

Thanks.


Well I doubt it will help you, my MANIFEST.MF is quite a simple one and doesn't have any additional headers compared to the one you posted. The only difference in the headers is how I spell "Bundle-Classpath" (the "P" is normal, not capital) and that's it, and I really don't think this is the problem.
So I would still suggest you edit your serviceability.xml and raise the log level to TRACE. Then after deploying your bundle, search the logs for the error you quoted and examine the messages that precede it - they should provide you with a hint on what's wrong.
Re: Web app fails to start when including ContextLoaderListener in web.xml [message #728753 is a reply to message #728750] Fri, 23 September 2011 20:35 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 272
Registered: January 2010
Senior Member
Bundle-Classpath is not a valid OSGi header: http://wiki.osgi.org/wiki/Bundle-ClassPath

Re: Web app fails to start when including ContextLoaderListener in web.xml [message #729038 is a reply to message #728753] Sat, 24 September 2011 20:55 Go to previous messageGo to next message
Tin N/A is currently offline Tin N/A
Messages: 46
Registered: December 2010
Member
Dmitry Sklyut wrote on Fri, 23 September 2011 22:35
Bundle-Classpath is not a valid OSGi header: http://wiki.osgi.org/wiki/Bundle-ClassPath


It works though - probably the header parsing is not case sensitive.
Re: Web app fails to start when including ContextLoaderListener in web.xml [message #773143 is a reply to message #721706] Sat, 31 December 2011 16:49 Go to previous messageGo to next message
borobudur Missing name is currently offline borobudur Missing name
Messages: 15
Registered: March 2010
Junior Member
canobix wrote on Fri, 02 September 2011 12:02
From my experience - you're not looking back far enough into the log.log file. The lines preceding the error you quoted usually contain the exception that caused deployment failure - probably a class not found (i.e. you're using a class whose package you didn't import through MANIFEST.MF) or some similar error.

Solved my problem to look back in the log .. thanks!
Re: Web app fails to start when including ContextLoaderListener in web.xml [message #1221726 is a reply to message #773143] Wed, 18 December 2013 09:56 Go to previous messageGo to next message
Sana Aiman is currently offline Sana Aiman
Messages: 2
Registered: December 2013
Junior Member
i changed the logger level to trace in the serviceability.xml. The log file reads the following error,
[2013-12-18 14:52:30.466] ERROR start-signalling-1 System.err Failed to instantiate [ch.qos.logback.classic.LoggerContext]
[2013-12-18 14:52:30.467] ERROR start-signalling-1 System.err Reported exception:
[2013-12-18 14:52:30.467] ERROR start-signalling-1 System.err java.lang.NoSuchMethodException: org.eclipse.virgo.medic.log.logback.DelegatingContextSelector.<init>(ch.qos.logback.classic.LoggerContext)
[2013-12-18 14:52:30.468] ERROR start-signalling-1 System.err at java.lang.Class.getConstructor0(Class.java:2800)
[2013-12-18 14:52:30.468] ERROR start-signalling-1 System.err at java.lang.Class.getConstructor(Class.java:1708)
[2013-12-18 14:52:30.468] ERROR start-signalling-1 System.err at ch.qos.logback.classic.util.ContextSelectorStaticBinder.dynamicalContextSelector(ContextSelectorStaticBinder.java:98)

I have attached the log file for complete reference.
can anyone help?
  • Attachment: log.log
    (Size: 174.44KB, Downloaded 53 times)
Re: Web app fails to start when including ContextLoaderListener in web.xml [message #1221728 is a reply to message #773143] Wed, 18 December 2013 09:57 Go to previous message
Sana Aiman is currently offline Sana Aiman
Messages: 2
Registered: December 2013
Junior Member
i changed the logger level to trace in the serviceability.xml. The log file reads the following error,
[2013-12-18 14:52:30.466] ERROR start-signalling-1 System.err Failed to instantiate [ch.qos.logback.classic.LoggerContext]
[2013-12-18 14:52:30.467] ERROR start-signalling-1 System.err Reported exception:
[2013-12-18 14:52:30.467] ERROR start-signalling-1 System.err java.lang.NoSuchMethodException: org.eclipse.virgo.medic.log.logback.DelegatingContextSelector.<init>(ch.qos.logback.classic.LoggerContext)
[2013-12-18 14:52:30.468] ERROR start-signalling-1 System.err at java.lang.Class.getConstructor0(Class.java:2800)
[2013-12-18 14:52:30.468] ERROR start-signalling-1 System.err at java.lang.Class.getConstructor(Class.java:1708)
[2013-12-18 14:52:30.468] ERROR start-signalling-1 System.err at ch.qos.logback.classic.util.ContextSelectorStaticBinder.dynamicalContextSelector(ContextSelectorStaticBinder.java:98)

I have attached the log file for complete reference.
can anyone help?
Previous Topic:Vrigo tooling does not copy static resources to 'work' after change
Next Topic:No Handler for type forms.widgets.ToggleHyperlink
Goto Forum:
  


Current Time: Wed Sep 17 07:41:37 GMT 2014

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

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