Chinaunix首页 | 论坛 | 博客
  • 博客访问: 485022
  • 博文数量: 66
  • 博客积分: 2125
  • 博客等级: 大尉
  • 技术积分: 704
  • 用 户 组: 普通用户
  • 注册时间: 2005-03-08 13:42
个人简介

空气中的尘埃

文章分类

全部博文(66)

文章存档

2019年(1)

2017年(4)

2016年(2)

2015年(4)

2014年(4)

2013年(2)

2012年(5)

2011年(6)

2010年(9)

2009年(8)

2008年(12)

2007年(6)

2006年(2)

2005年(1)

我的朋友

分类: Java

2015-02-27 17:00:01


web.xml 原配置

点击(此处)折叠或打开

  1. <taglib>
  2. <taglib-uri>struts</taglib-uri>
  3. <taglib-location>
  4. /WEB-INF/lib/struts2-core-2.0.14.jar
  5. </taglib-location>
  6. </taglib>


启动tomcat7 出现:

点击(此处)折叠或打开

  1. 2015-2-27 16:55:07 org.apache.tomcat.util.digester.Digester fatalError
  2. 严重: Parse Fatal Error at line 1 column 1: Content is not allowed in prolog.
  3. org.xml.sax.SAXParseException: Content is not allowed in prolog.
  4. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
  5. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
  6. at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
  7. at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1411)
  8. at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1038)
  9. at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
  10. at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
  11. at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
  12. at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
  13. at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
  14. at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
  15. at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
  16. at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
  17. at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
  18. at org.apache.catalina.startup.TldConfig.tldScanStream(TldConfig.java:540)
  19. at org.apache.catalina.startup.TldConfig.tldScanWebXml(TldConfig.java:349)
  20. at org.apache.catalina.startup.TldConfig.execute(TldConfig.java:262)
  21. at org.apache.catalina.startup.TldConfig.lifecycleEvent(TldConfig.java:565)
  22. at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
  23. at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
  24. at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5380)
  25. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  26. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
  27. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
  28. at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
  29. at java.util.concurrent.FutureTask.run(FutureTask.java:138)
  30. at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
  31. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
  32. at java.lang.Thread.run(Thread.java:619)
  33. 2015-2-27 16:55:07 org.apache.catalina.startup.TldConfig tldScanWebXml
  34. 警告: Failed to process TLD with path [/WEB-INF/lib/struts2-core-2.0.14.jar] and URI [struts]
  35. java.io.IOException: org.xml.sax.SAXParseException: Content is not allowed in prolog.
  36. at org.apache.catalina.startup.TldConfig.tldScanStream(TldConfig.java:543)
  37. at org.apache.catalina.startup.TldConfig.tldScanWebXml(TldConfig.java:349)
  38. at org.apache.catalina.startup.TldConfig.execute(TldConfig.java:262)
  39. at org.apache.catalina.startup.TldConfig.lifecycleEvent(TldConfig.java:565)
  40. at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
  41. at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
  42. at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5380)
  43. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  44. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
  45. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
  46. at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
  47. at java.util.concurrent.FutureTask.run(FutureTask.java:138)
  48. at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
  49. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
  50. at java.lang.Thread.run(Thread.java:619)
  51. Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
  52. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
  53. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
  54. at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
  55. at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1411)
  56. at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1038)
  57. at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
  58. at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
  59. at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
  60. at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
  61. at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
  62. at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
  63. at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
  64. at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
  65. at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
  66. at org.apache.catalina.startup.TldConfig.tldScanStream(TldConfig.java:540)
  67. ... 14 more
  68. 2015-2-27 16:55:07 org.apache.catalina.startup.TaglibUriRule bod


解压 struct2 core 包。拷贝struts2-core-2.0.14\META-INF\struts-tags.tld 到web-inf\tld 下


更改web.xml:

点击(此处)折叠或打开

  1. <taglib>
  2. <taglib-uri>struts</taglib-uri>
  3. <taglib-location>
  4. /WEB-INF/tld/struts-tags.tld
  5. </taglib-location>
  6. </taglib>



重新启动解决。

阅读(4538) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~