当前位置: 技术问答>java相关
关于JSP,XML,XSLT的一个问题:Element type "taglib" must be declared.
来源: 互联网 发布时间:2015-08-09
本文导语: 小弟初学,向各位大侠请教。 步骤如下: 1、安装jdk,Tomcat ,设置好TOMCAT_HOME 和JAVA_HOME 2、能启动Tomcat,浏览 http://localhost:8080 也正常 3、在TOMCAT_HOME/webapps下自建目录: xslt xslt/xml xslt/WEB-INF xslt/WEB-INF/lib ...
小弟初学,向各位大侠请教。
步骤如下:
1、安装jdk,Tomcat ,设置好TOMCAT_HOME 和JAVA_HOME
2、能启动Tomcat,浏览 http://localhost:8080 也正常
3、在TOMCAT_HOME/webapps下自建目录:
xslt
xslt/xml
xslt/WEB-INF
xslt/WEB-INF/lib
4、放置 xerces.jar, xalan.jar, bsf.jar,xsl.jar 到 xslt/WEB-INF/lib
放置xsl.tld 到 xslt/WEB-INF
5、建文件xslt/WEB-INF/web.xml:
http://jakarta.apache.org/taglibs/xsl-1.0
/WEB-INF/xsl.tld
6、重启动Tomcat 时发现错误:Element type "taglib" must be declared.
7、错误日志如下:
2002-08-19 11:03:25 ContextConfig[/xslt] Parse error in application web.xml
org.xml.sax.SAXParseException: Element type "taglib" must be declared.
at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1213)
at org.apache.xerces.validators.common.XMLValidator.reportRecoverableXMLError(XMLValidator.java:1807)
at org.apache.xerces.validators.common.XMLValidator.validateElementAndAttributes(XMLValidator.java:3633)
at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1229)
at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:938)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:314)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:89)
at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:275)
at org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:256)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:824)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:224)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3371)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:478)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:738)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:300)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:638)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
at org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
2002-08-19 11:03:25 ContextConfig[/xslt]: Occurred at line 1 column 9
2002-08-19 11:03:25 ContextConfig[/xslt]: Marking this application unavailable due to previous error(s)
2002-08-19 11:03:25 StandardContext[/xslt]: Error initializing naming context for context /xslt
2002-08-19 11:03:25 StandardContext[/xslt]: Context startup failed due to previous errors
2002-08-19 11:03:25 StandardContext[/xslt]: Error initializing naming context for context /xslt
请各位大侠帮忙!
步骤如下:
1、安装jdk,Tomcat ,设置好TOMCAT_HOME 和JAVA_HOME
2、能启动Tomcat,浏览 http://localhost:8080 也正常
3、在TOMCAT_HOME/webapps下自建目录:
xslt
xslt/xml
xslt/WEB-INF
xslt/WEB-INF/lib
4、放置 xerces.jar, xalan.jar, bsf.jar,xsl.jar 到 xslt/WEB-INF/lib
放置xsl.tld 到 xslt/WEB-INF
5、建文件xslt/WEB-INF/web.xml:
http://jakarta.apache.org/taglibs/xsl-1.0
/WEB-INF/xsl.tld
6、重启动Tomcat 时发现错误:Element type "taglib" must be declared.
7、错误日志如下:
2002-08-19 11:03:25 ContextConfig[/xslt] Parse error in application web.xml
org.xml.sax.SAXParseException: Element type "taglib" must be declared.
at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1213)
at org.apache.xerces.validators.common.XMLValidator.reportRecoverableXMLError(XMLValidator.java:1807)
at org.apache.xerces.validators.common.XMLValidator.validateElementAndAttributes(XMLValidator.java:3633)
at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1229)
at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:938)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:314)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:89)
at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:275)
at org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:256)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:824)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:224)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3371)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:478)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:738)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:300)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:638)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
at org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
2002-08-19 11:03:25 ContextConfig[/xslt]: Occurred at line 1 column 9
2002-08-19 11:03:25 ContextConfig[/xslt]: Marking this application unavailable due to previous error(s)
2002-08-19 11:03:25 StandardContext[/xslt]: Error initializing naming context for context /xslt
2002-08-19 11:03:25 StandardContext[/xslt]: Context startup failed due to previous errors
2002-08-19 11:03:25 StandardContext[/xslt]: Error initializing naming context for context /xslt
请各位大侠帮忙!
|
web.xml::::::::::::
http://jakarta.apache.org/taglibs/xsl-1.0
/WEB-INF/xsl.tld
http://jakarta.apache.org/taglibs/xsl-1.0
/WEB-INF/xsl.tld
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。