Announcement Announcement Module
Collapse
No announcement yet.
Context Initialization Failed Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Context Initialization Failed

    Hi,

    I tried to deploy a simple application by following Spring MVC step-by-step pdf. I have done all the things mentioned over there. But only difference, i have deployed in weblogic 8.1. I am not able to continue. Bean is not getting created.

    I am getting the following exceptions while starting the server.

    Jun 7, 2008 8:46:32 PM org.springframework.web.context.ContextLoader initWebApplicationContext
    SEVERE: Context initialization failed
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name '/hello.htm' defined in ServletContext resource [/WEB-INF/springapp-se
    rvlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [springa
    pp.web.HelloController]: Constructor threw exception; nested exception is java.lang.NullPointerException
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateBean(Abstrac tAutowireCapableBeanFactory.java:881)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBeanInstance(Abst ractAutowireCapableBeanFactory.java:837)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:440)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 64)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:220)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:261 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:429)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:729)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:381)
    at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:255)
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:199)
    at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 45)
    at weblogic.servlet.internal.WebAppServletContext$Fir eContextListenerAction.run(WebAppServletContext.ja va:7110)
    at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.not ifyCreated(WebAppServletContext.java:1757)
    at weblogic.servlet.internal.WebAppServletContext.pre loadResources(WebAppServletContext.java:3378)
    at weblogic.servlet.internal.WebAppServletContext.set Started(WebAppServletContext.java:6262)
    at weblogic.servlet.internal.WebAppModule.start(WebAp pModule.java:892)
    at weblogic.j2ee.J2EEApplicationContainer.start(J2EEA pplicationContainer.java:2181)
    at weblogic.j2ee.J2EEApplicationContainer.activate(J2 EEApplicationContainer.java:2222)
    at weblogic.j2ee.J2EEApplicationContainer.activate(J2 EEApplicationContainer.java:2169)
    at weblogic.management.deploy.slave.SlaveDeployer$App lication.setActivation(SlaveDeployer.java:3111)
    at weblogic.management.deploy.slave.SlaveDeployer.set ActivationStateForAllApplications(SlaveDeployer.ja va:1769)
    at weblogic.management.deploy.slave.SlaveDeployer.res ume(SlaveDeployer.java:352)
    at weblogic.management.deploy.DeploymentManagerServer LifeCycleImpl.resume(DeploymentManagerServerLifeCy cleImpl.java:229)
    at weblogic.t3.srvr.SubsystemManager.resume(Subsystem Manager.java:136)
    at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:965)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:360)
    at weblogic.Server.main(Server.java:32)
    Caused by: org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [springapp.web.HelloController]: Constructor threw exceptio
    n; nested exception is java.lang.NullPointerException
    at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:111)
    at org.springframework.beans.factory.support.SimpleIn stantiationStrategy.instantiate(SimpleInstantiatio nStrategy.java:61)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateBean(Abstrac tAutowireCapableBeanFactory.java:875)
    ... 34 more
    Caused by: java.lang.NullPointerException
    at java.util.Hashtable.get(Hashtable.java:333)
    at org.apache.commons.logging.impl.LogFactoryImpl.get Instance(LogFactoryImpl.java:334)
    at org.apache.commons.logging.impl.LogFactoryImpl.get Instance(LogFactoryImpl.java:310)
    at org.apache.commons.logging.LogFactory.getLog(LogFa ctory.java:685)
    at springapp.web.HelloController.<init>(HelloControll er.java:22)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Construc tor.java:274)
    at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:96)
    ... 36 more
    <Jun 7, 2008 8:46:32 PM GMT> <Warning> <HTTP> <BEA-101162> <User defined listener org.springframework.web.context.ContextLoaderListe ner failed: org.springfra
    mework.beans.factory.BeanCreationException: Error creating bean with name '/hello.htm' defined in ServletContext resource [/WEB-INF/springapp-servlet.xml]: I
    nstantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [springapp.web.HelloC
    ontroller]: Constructor threw exception; nested exception is java.lang.NullPointerException.>
    <Jun 7, 2008 8:46:32 PM GMT> <Warning> <HTTP> <BEA-101162> <User defined listener org.springframework.web.context.ContextLoaderListe ner failed: org.springfra
    mework.beans.factory.BeanCreationException: Error creating bean with name '/hello.htm' defined in ServletContext resource [/WEB-INF/springapp-servlet.xml]: I
    nstantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [springapp.web.HelloC
    ontroller]: Constructor threw exception; nested exception is java.lang.NullPointerException.>
    <Jun 7, 2008 8:46:32 PM GMT> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application _appsdir_SpringProj_dir.
    weblogic.management.ApplicationException: start() failed.
    {
    Module Name: SpringProj, Error: weblogic.management.DeploymentException: Error creating bean with name '/hello.htm' defined in ServletContext resource [/WEB-
    INF/springapp-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bea
    n class [springapp.web.HelloController]: Constructor threw exception; nested exception is java.lang.NullPointerException - with nested exception:
    [java.lang.NullPointerException]
    }
    at weblogic.j2ee.J2EEApplicationContainer.start(J2EEA pplicationContainer.java:2188)
    at weblogic.j2ee.J2EEApplicationContainer.activate(J2 EEApplicationContainer.java:2222)
    at weblogic.j2ee.J2EEApplicationContainer.activate(J2 EEApplicationContainer.java:2169)
    at weblogic.management.deploy.slave.SlaveDeployer$App lication.setActivation(SlaveDeployer.java:3111)
    at weblogic.management.deploy.slave.SlaveDeployer.set ActivationStateForAllApplications(SlaveDeployer.ja va:1769)
    at weblogic.management.deploy.slave.SlaveDeployer.res ume(SlaveDeployer.java:352)
    at weblogic.management.deploy.DeploymentManagerServer LifeCycleImpl.resume(DeploymentManagerServerLifeCy cleImpl.java:229)
    at weblogic.t3.srvr.SubsystemManager.resume(Subsystem Manager.java:136)
    at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:965)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:360)
    at weblogic.Server.main(Server.java:32)
    >
    <Jun 7, 2008 8:46:33 PM GMT> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "myserver" for domain "mydomain" running in Development Mo
    de>
    <Jun 7, 2008 8:46:33 PM GMT> <Notice> <WebLogicServer> <BEA-000355> <Thread "ListenThread.Default" listening on port 7001, ip address *.*>
    <Jun 7, 2008 8:46:33 PM GMT> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>



    Pls advise....

  • #2
    When posting code please use the [ code][/code ] tags. Next to that you seem to have a problem in your class called 'HelloController'. You probably try to access something in the controller which isn't set yet.

    Comment

    Working...
    X