Results 1 to 10 of 10

Thread: org.springframework.web.struts.ContextLoaderPlugIn - Context initialization failed

  1. #1

    Default org.springframework.web.struts.ContextLoaderPlugIn - Context initialization failed

    Hi All.

    In our project I am using Spring as a plugin to Struts.
    This project is online at client side and the same source code I am trying to make online at our side, So I am getting below error.


    ----------------------------------------------
    (ContextLoaderPlugIn.java:229) ERROR org.springframework.web.struts.ContextLoaderPlugIn - Context initialization failed
    java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
    at java.util.Properties.loadConvert(Unknown Source)
    at java.util.Properties.load(Unknown Source)
    at org.springframework.util.DefaultPropertiesPersiste r.load(DefaultPropertiesPersister.java:70)
    at org.springframework.core.io.support.PropertiesLoad erSupport.loadProperties(PropertiesLoaderSupport.j ava:181)
    at org.springframework.core.io.support.PropertiesLoad erSupport.mergeProperties(PropertiesLoaderSupport. java:151)
    at org.springframework.beans.factory.config.PropertyR esourceConfigurer.postProcessBeanFactory(PropertyR esourceConfigurer.java:69)
    at org.springframework.context.support.AbstractApplic ationContext.invokeBeanFactoryPostProcessors(Abstr actApplicationContext.java:373)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:295)
    at org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:139)
    at org.springframework.web.struts.ContextLoaderPlugIn .createWebApplicationContext(ContextLoaderPlugIn.j ava:353)
    at org.springframework.web.struts.ContextLoaderPlugIn .initWebApplicationContext(ContextLoaderPlugIn.jav a:296)
    at org.springframework.web.struts.ContextLoaderPlugIn .init(ContextLoaderPlugIn.java:225)
    at org.apache.struts.action.ActionServlet.initModuleP lugIns(ActionServlet.java:869)
    at org.apache.struts.action.ActionServlet.init(Action Servlet.java:336)
    at javax.servlet.GenericServlet.init(GenericServlet.j ava:211)
    at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1029)
    at org.apache.catalina.core.StandardWrapper.load(Stan dardWrapper.java:862)
    at org.apache.catalina.core.StandardContext.loadOnSta rtup(StandardContext.java:4013)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4357)
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:823)
    at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:807)
    at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:595)
    at org.apache.catalina.core.StandardHostDeployer.inst all(StandardHostDeployer.java:277)
    at org.apache.catalina.core.StandardHost.install(Stan dardHost.java:832)
    at org.apache.catalina.startup.HostConfig.deployWARs( HostConfig.java:625)
    at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:431)
    at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:983)
    at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:349)
    at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1091)
    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:789)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1083)
    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:478)
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:480)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:2313)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:556)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:287)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:425)
    May 14, 2007 4:27:21 PM org.apache.catalina.core.StandardHostDeployer install
    ----------------------------------------------------------------------

    If any one can help in this regard.

    Regards,

    Maulik

  2. #2

    Default ERROR org.springframework.web.struts.ContextLoaderPlugIn - Context initialization fai

    Hi,
    Few things I would like to add.
    This error is coming when I am trying to deploy my project war file over Tomcat 5.0.28 web server.

    Maulik

  3. #3
    Join Date
    Nov 2006
    Location
    Bangalore
    Posts
    24

    Default

    Hi,

    In the Web.xml load please write this statmenet


    <listener>
    <listener-class>org.springframework.web.util.IntrospectorCle anupListener</listener-class>
    </listener>

    import javax.servlet.ServletContext;
    import javax.servlet.ServletContextEvent;

    import org.springframework.beans.factory.BeanFactory;
    import org.springframework.beans.factory.xml.XmlBeanFacto ry;
    import org.springframework.context.ApplicationContext;
    import org.springframework.context.support.ClassPathXmlAp plicationContext;
    import org.springframework.web.context.ContextLoaderListe ner;
    import org.springframework.web.context.support.WebApplica tionContextUtils;


    //import com.mercury.mf.fw.spring.AppContext;
    import com.mercury.mf.pos.policy.dao.hibernate.AgencyActi vityDaoHibernate;

    public class POSStartupListener extends ContextLoaderListener{


    public void contextInitialized(ServletContextEvent event) {
    super.contextInitialized(event);
    ServletContext context = event.getServletContext();
    setupContext(context);
    }

    public static void setupContext(ServletContext context) {



    ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("D:/projects/POSAppWeb/applicationContext-hibernate.xml");


    Or else

    give the path correctly....................

  4. #4

    Default

    Hi Saranga.
    Thanks for your reply.I got to solve above error. I have changed '\' with '/' in my property file and this error was solved, but I was getting another error.

    It is,

    (ContextLoaderPlugIn.java:229) ERROR org.springframework.web.struts.ContextLoaderPlugIn - Context initialization failed
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'authenticationServiceSelf' defined in ServletContext resource [/WEB-INF/applicationcontext.xml]: Cannot resolve reference to bean 'authenticationServiceTarget' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'authenticationServiceTarget' defined in ServletContext resource [/WEB-INF/applicationcontext.xml]: Cannot resolve reference to bean 'constantsService' while setting bean property 'constantsBusinessService'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'constantsService' defined in ServletContext resource [/WEB-INF/applicationcontext.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException: null
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'authenticationServiceTarget' defined in ServletContext resource [/WEB-INF/applicationcontext.xml]: Cannot resolve reference to bean 'constantsService' while setting bean property 'constantsBusinessService'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'constantsService' defined in ServletContext resource [/WEB-INF/applicationcontext.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException: null
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'constantsService' defined in ServletContext resource [/WEB-INF/applicationcontext.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException: null
    java.lang.NullPointerException
    at com.trilogy.mobilechurn.services.constants.Constan tsServiceImpl.populateSPRegions(ConstantsServiceIm pl.java:348)
    at com.trilogy.mobilechurn.services.constants.Constan tsServiceImpl.initialize(ConstantsServiceImpl.java :132)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeCustomInitMethod( AbstractAutowireCapableBeanFactory.java:1133)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1095)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:396)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:233)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:145)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:186)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:106)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1046)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:857)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:378)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:233)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:145)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:186)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:106)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1046)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:857)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:378)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:233)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:145)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:277)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:313)
    at org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:139)
    at org.springframework.web.struts.ContextLoaderPlugIn .createWebApplicationContext(ContextLoaderPlugIn.j ava:353)
    at org.springframework.web.struts.ContextLoaderPlugIn .initWebApplicationContext(ContextLoaderPlugIn.jav a:296)
    at org.springframework.web.struts.ContextLoaderPlugIn .init(ContextLoaderPlugIn.java:225)
    at org.apache.struts.action.ActionServlet.initModuleP lugIns(ActionServlet.java:869)
    at org.apache.struts.action.ActionServlet.init(Action Servlet.java:336)
    at javax.servlet.GenericServlet.init(GenericServlet.j ava:211)
    at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1029)
    at org.apache.catalina.core.StandardWrapper.load(Stan dardWrapper.java:862)
    at org.apache.catalina.core.StandardContext.loadOnSta rtup(StandardContext.java:4013)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4357)
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:823)
    at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:807)
    at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:595)
    at org.apache.catalina.core.StandardHostDeployer.inst all(StandardHostDeployer.java:277)
    at org.apache.catalina.core.StandardHost.install(Stan dardHost.java:832)
    at org.apache.catalina.startup.HostConfig.deployWARs( HostConfig.java:625)
    at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:431)
    at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:983)
    at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:349)
    at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1091)
    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:789)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1083)
    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:478)
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:480)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:2313)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:556)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:287)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:425)

  5. #5
    Join Date
    Nov 2006
    Location
    Bangalore
    Posts
    24

    Default

    HI,

    Can u send u r applicationcontext.xml file ..................

    please specify the getter and setter method in "authenticationServiceTarget" which the property "target"

    Bascially in u r class add getter and setter methods of the "target"

  6. #6

    Default

    Just one thing I would like to add this project is online and we are doing current enhancement in the project.
    So I dont feel any programming bug is possible.
    I cant send applicationcontext.xml as it's posting is too large.
    I can mail you the file if you dont mind.
    Here is the bean entry in applicationcontext.xml

    <bean id="authenticationServiceSelf" parent="baseTransactionProxy">
    <property name="target">
    <ref bean="authenticationServiceTarget" />
    </property>

    <property name="transactionAttributes">
    <props>
    <!-- Rollback the AddNewUser Service if the AuthenticationServiceException is thrown -->
    <prop key="*">PROPAGATION_REQUIRED,-com.trilogy.mobilechurn.services.authentication.Au thenticationServiceException</prop>
    </props>
    </property>
    </bean>

    <!--
    The actual AuthenticationService instance.
    -->
    <bean id="authenticationServiceTarget" class="com.trilogy.mobilechurn.services.authentica tion.AuthenticationServiceImpl" init-method="initialize">
    <property name="transactionManager">
    <ref bean="transactionManager" />
    </property>

    <property name="userDataService">
    <ref bean="userDataService" />
    </property>

    <property name="regionDataService">
    <ref bean="regionDataService"/>
    </property>

    <property name="constantsBusinessService">
    <ref bean="constantsService" />
    </property>

    <property name="networkDataService">
    <ref bean="networkDataService" />
    </property>

    <property name="constantDataService">
    <ref bean="constantsDataService" />
    </property>
    </bean>

  7. #7

    Default

    NullPointerException at com.trilogy.mobilechurn.services.constants.Constan tsServiceImpl.populateSPRegions(ConstantsServiceIm pl.java:348)

    is I feel is a root cause of the error, coz in ConstantsServiceImpl.java there is one line,
    assert (m_spRegions != null) : "Regions not populated";

    So here we are getting some error like,

    assert should not be used as an identifier, since it is a reserved keyword from source level 1.4 on".
    Any Idea how to patch it up ?

  8. #8
    Join Date
    Nov 2006
    Location
    Bangalore
    Posts
    24

    Default

    hi,

    please trace back ConstantsServiceIm pl.java .......

    how u are calling this................ are u calling like
    ConstantsServiceImpl clmple = new ConstantsServiceImpl();


    then this nullpointer will throww..........please

    remove all the new Objects() i am sure this is of this error...............

  9. #9
    Join Date
    Nov 2006
    Location
    Bangalore
    Posts
    24

    Default

    this is related to nullpointer exception.

    NullPointerException at com.trilogy.mobilechurn.services.constants.Constan tsServiceImpl.populateSPRegions(ConstantsServiceIm pl.java:348)


    But i dont know about the assert key

    assert should not be used as an identifier, since it is a reserved keyword from source level 1.4 on".


    remove all the new Object where ever u r calling..............
    as per u r application context file ..............

  10. #10

    Default

    Ok. I m trying for it and I'll get back to you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •