java - SEVERE: Context initialization failed /WEB-INF/applicationContext.xml is invalid -


i deploying war archive on server, spring project, i've got above error.

below applicationcontext.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:aop="http://www.springframework.org/schema/aop"        xmlns:tx="http://www.springframework.org/schema/tx"        xmlns:ws="http://jax-ws.dev.java.net/spring/core"        xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"      xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd http://jax-ws.dev.java.net/spring/core http://jax-ws.java.net/spring/core.xsd http://jax-ws.dev.java.net/spring/servlet http://jax-ws.java.net/spring/servlet.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd"     default-lazy-init="true">      <wss:binding url="/olb">         <wss:service>             <ws:service bean="#olbprocessorws"/>         </wss:service>     </wss:binding>       <bean id="olbprocessorws" class="com.adi.olbprocessorwsimpl">            </bean>   </beans> 

below complete stack trace:

info: loading xml bean definitions servletcontext resource [/web-inf/applicationcontext.xml] jan 24, 2016 3:19:51 pm org.springframework.web.context.contextloader initwebapplicationcontext severe: context initialization failed org.springframework.beans.factory.xml.xmlbeandefinitionstoreexception: line 1 in xml document servletcontext resource [/web-inf/applicationcontext.xml] invalid; nested exception org.xml.sax.saxparseexception; systemid: http://jax-ws.java.net/spring/servlet.xsd; linenumber: 1; columnnumber: 1; premature end of file.         @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.doloadbeandefinitions(xmlbeandefinitionreader.java:404)         @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.loadbeandefinitions(xmlbeandefinitionreader.java:342)         @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.loadbeandefinitions(xmlbeandefinitionreader.java:310)         @ org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:143)         @ org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:178)         @ org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:149)         @ org.springframework.web.context.support.xmlwebapplicationcontext.loadbeandefinitions(xmlwebapplicationcontext.java:124)         @ org.springframework.web.context.support.xmlwebapplicationcontext.loadbeandefinitions(xmlwebapplicationcontext.java:92)         @ org.springframework.context.support.abstractrefreshableapplicationcontext.refreshbeanfactory(abstractrefreshableapplicationcontext.java:123)         @ org.springframework.context.support.abstractapplicationcontext.obtainfreshbeanfactory(abstractapplicationcontext.java:422)         @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:352)         @ org.springframework.web.context.contextloader.createwebapplicationcontext(contextloader.java:255)         @ org.springframework.web.context.contextloader.initwebapplicationcontext(contextloader.java:199)         @ org.springframework.web.context.contextloaderlistener.contextinitialized(contextloaderlistener.java:45)         @ org.apache.catalina.core.standardcontext.listenerstart(standardcontext.java:5077)         @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5591)         @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150)         @ org.apache.catalina.core.containerbase.addchildinternal(containerbase.java:901)         @ org.apache.catalina.core.containerbase.addchild(containerbase.java:877)         @ org.apache.catalina.core.standardhost.addchild(standardhost.java:652)         @ org.apache.catalina.startup.hostconfig.deploywar(hostconfig.java:1095)         @ org.apache.catalina.startup.hostconfig$deploywar.run(hostconfig.java:1957)         @ java.util.concurrent.executors$runnableadapter.call(executors.java:511)         @ java.util.concurrent.futuretask.run(futuretask.java:266)         @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142)         @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:617)         @ java.lang.thread.run(thread.java:745) caused by: org.xml.sax.saxparseexception; systemid: http://jax-ws.java.net/spring/servlet.xsd; linenumber: 1; columnnumber: 1; premature end of file. 

there 2 reasons.

  1. there problem .xml file
  2. the file character encoding not understood parser or not valid

Comments