java.lang.IllegalStateException: Root context attribute is not of type WebApplicationContext: org.springframework.web.context.support.XmlWebApplicationContext: display name [Root WebApplicationContext]; startup date [Wed Jul 27 10:37:34 EEST 2005]; root of context hierarchy; config locations [/WEB-INF/bug-servlet.xml]

Spring JIRA | Ivo Mägi | 1 decade ago
  1. 0

    I am developing a spring application for Weblogic Server 8.1SP4. Currently having the following problem: Defining ContextLoaderListener in web.xml for reloading resources as following: <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/envreg-servlet.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> results in a classcast exception in development while weblogic automatically redeploys webapp an exploded webapp after recompilation. Stacktrace follows: java.lang.IllegalStateException: Root context attribute is not of type WebApplicationContext: org.springframework.web.context.support.XmlWebApplicationContext: display name [Root WebApplicationContext]; startup date [Wed Jul 27 10:37:34 EEST 2005]; root of context hierarchy; config locations [/WEB-INF/bug-servlet.xml] at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:64) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:249) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:219) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:111) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:1028) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:904) ... I have provided a minimal testcase for the issue which can be downloaded from http://ivo.webmedia.ee/bug.zip Steps to reproduce: 1. Have a Weblogic Server 8.1SP4 running in development mode. 2. unzip bug.zip 3. deploy war folder (exploded .war file) 4. Open browser for URL http://localhost:7001/bug/. You should see a "Hello world" message. 5. Change ee.bug.HelloController.java file and recompile it to the WEB-INF/classes folder. ant compile target should do it. 6. Refresh the browser window. Stacktrace should be displayed to you. Alternate scenarios: - redeploy webapp from weblogic console before hitting the URL - everything works - remove following from the web.xml. Now everything works even without redeployment from console. <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> - put to the server's classpath all the supporting libraries from WEB-INF/lib (common-log, spring, jstl) and remove those from WEB-INF/lib. Everything works now. Business effect for the issue: notable development slowdown due to the need of manual redeployment after each change in class files. I have previously opened a case in BEA support environment, but their claim was it to be a spring problem, most likely a classloader issue (inforrect static reference somewhere?) Case can be reproduced with at least Spring versions 1.2.2 and 1.2.3 - tried countries sample application - after switching the sample app also to the exploded format (slightly modifying build scripts as compiling everything to the WEB-INF/classes and removing counties.jar from WEB-INF/lib) the same exception occured: java.lang.IllegalStateException: Root context attribute is not of type WebApplicationContext: org.springframework.web.context.support.XmlWebApplicationContext: display name [Root WebApplicationContext]; startup date [Wed Jul 27 12:05:51 EEST 2005]; root of context hierarchy; config locations [/WEB-INF/applicationContext.xml] at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:64) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:249) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:219) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:111) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:1028) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:904) at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:883) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:822) Seems like an issue related to WLS 8.1 classloading and spring initialization - checked the provided code with tomcat 5.0.28 with automatic redeployment flags turned on and it works.

    Spring JIRA | 1 decade ago | Ivo Mägi
    java.lang.IllegalStateException: Root context attribute is not of type WebApplicationContext: org.springframework.web.context.support.XmlWebApplicationContext: display name [Root WebApplicationContext]; startup date [Wed Jul 27 10:37:34 EEST 2005]; root of context hierarchy; config locations [/WEB-INF/bug-servlet.xml]
  2. 0

    I am developing a spring application for Weblogic Server 8.1SP4. Currently having the following problem: Defining ContextLoaderListener in web.xml for reloading resources as following: <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/envreg-servlet.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> results in a classcast exception in development while weblogic automatically redeploys webapp an exploded webapp after recompilation. Stacktrace follows: java.lang.IllegalStateException: Root context attribute is not of type WebApplicationContext: org.springframework.web.context.support.XmlWebApplicationContext: display name [Root WebApplicationContext]; startup date [Wed Jul 27 10:37:34 EEST 2005]; root of context hierarchy; config locations [/WEB-INF/bug-servlet.xml] at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:64) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:249) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:219) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:111) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:1028) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:904) ... I have provided a minimal testcase for the issue which can be downloaded from http://ivo.webmedia.ee/bug.zip Steps to reproduce: 1. Have a Weblogic Server 8.1SP4 running in development mode. 2. unzip bug.zip 3. deploy war folder (exploded .war file) 4. Open browser for URL http://localhost:7001/bug/. You should see a "Hello world" message. 5. Change ee.bug.HelloController.java file and recompile it to the WEB-INF/classes folder. ant compile target should do it. 6. Refresh the browser window. Stacktrace should be displayed to you. Alternate scenarios: - redeploy webapp from weblogic console before hitting the URL - everything works - remove following from the web.xml. Now everything works even without redeployment from console. <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> - put to the server's classpath all the supporting libraries from WEB-INF/lib (common-log, spring, jstl) and remove those from WEB-INF/lib. Everything works now. Business effect for the issue: notable development slowdown due to the need of manual redeployment after each change in class files. I have previously opened a case in BEA support environment, but their claim was it to be a spring problem, most likely a classloader issue (inforrect static reference somewhere?) Case can be reproduced with at least Spring versions 1.2.2 and 1.2.3 - tried countries sample application - after switching the sample app also to the exploded format (slightly modifying build scripts as compiling everything to the WEB-INF/classes and removing counties.jar from WEB-INF/lib) the same exception occured: java.lang.IllegalStateException: Root context attribute is not of type WebApplicationContext: org.springframework.web.context.support.XmlWebApplicationContext: display name [Root WebApplicationContext]; startup date [Wed Jul 27 12:05:51 EEST 2005]; root of context hierarchy; config locations [/WEB-INF/applicationContext.xml] at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:64) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:249) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:219) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:111) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:1028) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:904) at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:883) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:822) Seems like an issue related to WLS 8.1 classloading and spring initialization - checked the provided code with tomcat 5.0.28 with automatic redeployment flags turned on and it works.

    Spring JIRA | 1 decade ago | Ivo Mägi
    java.lang.IllegalStateException: Root context attribute is not of type WebApplicationContext: org.springframework.web.context.support.XmlWebApplicationContext: display name [Root WebApplicationContext]; startup date [Wed Jul 27 10:37:34 EEST 2005]; root of context hierarchy; config locations [/WEB-INF/bug-servlet.xml]
  3. 0

    I am developing a spring application for Weblogic Server 8.1SP4. Currently having the following problem: Defining ContextLoaderListener in web.xml for reloading resources as following: <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/envreg-servlet.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> results in a classcast exception in development while weblogic automatically redeploys webapp an exploded webapp after recompilation. Stacktrace follows: java.lang.IllegalStateException: Root context attribute is not of type WebApplicationContext: org.springframework.web.context.support.XmlWebApplicationContext: display name [Root WebApplicationContext]; startup date [Wed Jul 27 10:37:34 EEST 2005]; root of context hierarchy; config locations [/WEB-INF/bug-servlet.xml] at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:64) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:249) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:219) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:111) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:1028) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:904) ... I have provided a minimal testcase for the issue which can be downloaded from http://ivo.webmedia.ee/bug.zip Steps to reproduce: 1. Have a Weblogic Server 8.1SP4 running in development mode. 2. unzip bug.zip 3. deploy war folder (exploded .war file) 4. Open browser for URL http://localhost:7001/bug/. You should see a "Hello world" message. 5. Change ee.bug.HelloController.java file and recompile it to the WEB-INF/classes folder. ant compile target should do it. 6. Refresh the browser window. Stacktrace should be displayed to you. Alternate scenarios: - redeploy webapp from weblogic console before hitting the URL - everything works - remove following from the web.xml. Now everything works even without redeployment from console. <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> - put to the server's classpath all the supporting libraries from WEB-INF/lib (common-log, spring, jstl) and remove those from WEB-INF/lib. Everything works now. Business effect for the issue: notable development slowdown due to the need of manual redeployment after each change in class files. I have previously opened a case in BEA support environment, but their claim was it to be a spring problem, most likely a classloader issue (inforrect static reference somewhere?) Case can be reproduced with at least Spring versions 1.2.2 and 1.2.3 - tried countries sample application - after switching the sample app also to the exploded format (slightly modifying build scripts as compiling everything to the WEB-INF/classes and removing counties.jar from WEB-INF/lib) the same exception occured: java.lang.IllegalStateException: Root context attribute is not of type WebApplicationContext: org.springframework.web.context.support.XmlWebApplicationContext: display name [Root WebApplicationContext]; startup date [Wed Jul 27 12:05:51 EEST 2005]; root of context hierarchy; config locations [/WEB-INF/applicationContext.xml] at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:64) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:249) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:219) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:111) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:1028) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:904) at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:883) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:822) Seems like an issue related to WLS 8.1 classloading and spring initialization - checked the provided code with tomcat 5.0.28 with automatic redeployment flags turned on and it works.

    Spring JIRA | 1 decade ago | Ivo Mägi
    java.lang.IllegalStateException: Root context attribute is not of type WebApplicationContext: org.springframework.web.context.support.XmlWebApplicationContext: display name [Root WebApplicationContext]; startup date [Wed Jul 27 10:37:34 EEST 2005]; root of context hierarchy; config locations [/WEB-INF/bug-servlet.xml]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I am developing a spring application for Weblogic Server 8.1SP4. Currently having the following problem: Defining ContextLoaderListener in web.xml for reloading resources as following: <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/envreg-servlet.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> results in a classcast exception in development while weblogic automatically redeploys webapp an exploded webapp after recompilation. Stacktrace follows: java.lang.IllegalStateException: Root context attribute is not of type WebApplicationContext: org.springframework.web.context.support.XmlWebApplicationContext: display name [Root WebApplicationContext]; startup date [Wed Jul 27 10:37:34 EEST 2005]; root of context hierarchy; config locations [/WEB-INF/bug-servlet.xml] at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:64) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:249) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:219) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:111) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:1028) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:904) ... I have provided a minimal testcase for the issue which can be downloaded from http://ivo.webmedia.ee/bug.zip Steps to reproduce: 1. Have a Weblogic Server 8.1SP4 running in development mode. 2. unzip bug.zip 3. deploy war folder (exploded .war file) 4. Open browser for URL http://localhost:7001/bug/. You should see a "Hello world" message. 5. Change ee.bug.HelloController.java file and recompile it to the WEB-INF/classes folder. ant compile target should do it. 6. Refresh the browser window. Stacktrace should be displayed to you. Alternate scenarios: - redeploy webapp from weblogic console before hitting the URL - everything works - remove following from the web.xml. Now everything works even without redeployment from console. <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> - put to the server's classpath all the supporting libraries from WEB-INF/lib (common-log, spring, jstl) and remove those from WEB-INF/lib. Everything works now. Business effect for the issue: notable development slowdown due to the need of manual redeployment after each change in class files. I have previously opened a case in BEA support environment, but their claim was it to be a spring problem, most likely a classloader issue (inforrect static reference somewhere?) Case can be reproduced with at least Spring versions 1.2.2 and 1.2.3 - tried countries sample application - after switching the sample app also to the exploded format (slightly modifying build scripts as compiling everything to the WEB-INF/classes and removing counties.jar from WEB-INF/lib) the same exception occured: java.lang.IllegalStateException: Root context attribute is not of type WebApplicationContext: org.springframework.web.context.support.XmlWebApplicationContext: display name [Root WebApplicationContext]; startup date [Wed Jul 27 12:05:51 EEST 2005]; root of context hierarchy; config locations [/WEB-INF/applicationContext.xml] at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:64) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:249) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:219) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:111) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:1028) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:904) at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:883) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:822) Seems like an issue related to WLS 8.1 classloading and spring initialization - checked the provided code with tomcat 5.0.28 with automatic redeployment flags turned on and it works.

    Spring JIRA | 1 decade ago | Ivo Mägi
    java.lang.IllegalStateException: Root context attribute is not of type WebApplicationContext: org.springframework.web.context.support.XmlWebApplicationContext: display name [Root WebApplicationContext]; startup date [Wed Jul 27 10:37:34 EEST 2005]; root of context hierarchy; config locations [/WEB-INF/bug-servlet.xml]
  6. 0

    Spring MVC Tutorial – Hibernate Integration | Himu\'s Attempt at Blogging

    wordpress.com | 2 months ago
    java.lang.IllegalStateException: Context attribute is not of type WebApplicationContext: org.springframework.web.context.support.XmlWebApplicationContext@16c79d7: display name [Root WebApplicationContext]; startup date [Tue Aug 23 19:21:28 IST 2011]; root of context hierarchy

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Root context attribute is not of type WebApplicationContext: org.springframework.web.context.support.XmlWebApplicationContext: display name [Root WebApplicationContext]; startup date [Wed Jul 27 10:37:34 EEST 2005]; root of context hierarchy; config locations [/WEB-INF/bug-servlet.xml]

      at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext()
    2. Spring
      WebApplicationContextUtils.getWebApplicationContext
      1. org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:64)
      1 frame
    3. Spring MVC
      HttpServletBean.init
      1. org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:249)
      2. org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:219)
      3. org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:111)
      3 frames
    4. JavaServlet
      GenericServlet.init
      1. javax.servlet.GenericServlet.init(GenericServlet.java:258)
      1 frame
    5. Atmosphere weblogic
      ServletStubImpl$ServletInitAction.run
      1. weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:1028)
      1 frame
    6. weblogic.security.acl
      AuthenticatedSubject.doAs
      1. weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      1 frame
    7. weblogic.security.service
      SecurityManager.runAs
      1. weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
      1 frame
    8. Atmosphere weblogic
      ServletStubImpl.createServlet
      1. weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:904)
      1 frame