WebService之CXF注解报错(一)

WebService之CXF注解


1、详细报错例如以下

usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ]  { -help | start | stop }
2014-5-4 22:42:12 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.1.27 using APR version 1.4.6.
2014-5-4 22:42:12 org.apache.catalina.core.AprLifecycleListener init
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2014-5-4 22:42:14 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized (OpenSSL 1.0.1d 5 Feb 2013)
2014-5-4 22:42:15 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-apr-8686"]
2014-5-4 22:42:15 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-apr-8009"]
2014-5-4 22:42:15 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 4063 ms
2014-5-4 22:42:15 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
2014-5-4 22:42:15 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.41
2014-5-4 22:42:16 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(D:\MyEclipse\workspace\Webservice\WebRoot\WEB-INF\lib\geronimo-servlet_2.5_spec-1.1.2.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
2014-5-4 22:42:16 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(D:\MyEclipse\workspace\Webservice\WebRoot\WEB-INF\lib\geronimo-servlet_3.0_spec-1.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
2014-5-4 22:42:16 org.apache.tomcat.util.digester.Digester fatalError
严重: Parse Fatal Error at line 26 column 3: The markup in the document following the root element must be well-formed.
org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
	at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1411)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$TrailingMiscDriver.next(XMLDocumentScannerImpl.java:1418)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
	at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
	at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1883)
	at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1252)
	at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
2014-5-4 22:42:16 org.apache.catalina.startup.ContextConfig parseWebXml
严重: Parse error in application web.xml file at jndi:/localhost/Webservice/WEB-INF/web.xml
org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
	at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1411)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$TrailingMiscDriver.next(XMLDocumentScannerImpl.java:1418)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
	at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
	at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1883)
	at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1252)
	at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
2014-5-4 22:42:16 org.apache.catalina.startup.ContextConfig parseWebXml
严重: Occurred at line 26 column 3
2014-5-4 22:42:17 org.apache.catalina.startup.ContextConfig configureStart
严重: Marking this application unavailable due to previous error(s)
2014-5-4 22:42:17 org.apache.catalina.core.StandardContext startInternal
严重: Error getConfigured
2014-5-4 22:42:17 org.apache.catalina.util.SessionIdGenerator createSecureRandom
信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [173] milliseconds.
2014-5-4 22:42:17 org.apache.catalina.core.StandardContext startInternal
严重: Context [/Webservice] startup failed due to previous errors
2014-5-4 22:42:17 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\apache-tomcat-7.0.41\webapps\docs
2014-5-4 22:42:17 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\apache-tomcat-7.0.41\webapps\examples
2014-5-4 22:42:18 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2014-5-4 22:42:18 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2014-5-4 22:42:18 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: attributeAdded(‘org.apache.jasper.compiler.TldLocationsCache‘, ‘org.apache.jasper.compiler.TldLocationsCache@1efc208‘)
2014-5-4 22:42:18 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\apache-tomcat-7.0.41\webapps\host-manager
2014-5-4 22:42:18 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\apache-tomcat-7.0.41\webapps\manager
2014-5-4 22:42:18 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\apache-tomcat-7.0.41\webapps\ROOT
2014-5-4 22:42:18 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-apr-8686"]
2014-5-4 22:42:18 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
2014-5-4 22:42:18 org.apache.catalina.startup.Catalina start
信息: Server startup in 3269 ms

2、错误原因

     有两个关闭标签

</web-app>  
</web-app>


3、解决方法

    去掉一个关闭标签

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。