java.lang.IllegalStateException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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.
    via by Ivo Mägi,
  • 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.
    via by Ivo Mägi,
  • 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.
    via by Ivo Mägi,
  • 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.
    via by Ivo Mägi,
  • Deploying a spring web app within a view. Certain spring jars are being picked up from /usr/lib/ambari-server as opposed to my web app's WEB-INF/lib directory. For example, when my view web app gets instantiated (when the web.xml is processed), classes from the jar spring-context are loaded from: {code} Latest exception from my view: IllegalAccessError: tried to access class org.springframework.core.convert.support.NumberToNumberConverterFactory from class org.springframework.core.convert.support.DefaultConversionService at org.springframework.core.convert.support.DefaultConversionService.addScalarConverters(DefaultConversionService.java:79) at org.springframework.core.convert.support.DefaultConversionService.addDefaultConverters(DefaultConversionService.java:63) at org.springframework.core.convert.support.DefaultConversionService.<init>(DefaultConversionService.java:50) at org.springframework.data.solr.core.convert.SolrConverterBase.<init>(SolrConverterBase.java:33) at org.springframework.data.solr.core.convert.MappingSolrConverter.<init>(MappingSolrConverter.java:73) at org.springframework.data.solr.core.SolrTemplate.getDefaultSolrConverter(SolrTemplate.java:480) at org.springframework.data.solr.core.SolrTemplate.afterPropertiesSet(SolrTemplate.java:529) at org.springframework.data.solr.repository.support.SolrRepositoryFactory.createTemplate(SolrRepositoryFactory.java:88) at org.springframework.data.solr.repository.support.SolrRepositoryFactory.<init>(SolrRepositoryFactory.java:76) at hortonworks.hdp.refapp.ecm.service.core.indexstore.SolrIndexStore.initialize(SolrIndexStore.java:54) at hortonworks.hdp.refapp.ecm.registry.ECMBeanRefresher.refreshIndexStoreInAppContext(ECMBeanRefresher.java:40) at hortonworks.hdp.refapp.ecm.registry.ECMBeanRefresher.refreshBeans(ECMBeanRefresher.java:28) at hortonworks.hdp.refapp.ecm.view.DocumentManagementViewService.createAppContext(DocumentManagementViewService.java:138) at hortonworks.hdp.refapp.ecm.view.DocumentManagementViewService.initialize(DocumentManagementViewService.java:53) at hortonworks.hdp.refapp.ecm.view.DocumentManagementViewService.getDocumentService(DocumentManagementViewService.java:109) at hortonworks.hdp.refapp.ecm.view.DocumentManagementViewService.search(DocumentManagementViewService.java:94) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) {code}
    via by Tom Beerbower,
  • XFire web services help
    via by sylvia lin,
    • 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)
    No Bugmate found.