发了贴没人回,是不是看不起初学者阿!

04-06-04 big1980
好像是我的web.xml文件有问题,jboss服务器上报的错为:
org.xml.sax.SAXParseException: The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:232)
at org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:173)
at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:362)
at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:296)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2959)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:918)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.handleEndElement(XMLDocumentFragmentScannerImpl.java:1145)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:988)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1446)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)
at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:529)
at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:585)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1148)
。。。。。。。。。。
我的web.xml的内容为:
===============================web.xml===========================
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>

<servlet>
<servlet-name>ShaServlet</servlet-name>
<servlet-class>jp.co.nec.ome.servlet.OmEJBControlServlet</servlet-class>
<init-param>
<param-name>StartPageName</param-name>
<param-value>/Sha/Shasys/LOGIN.JSP</param-value>
</init-param>
<init-param>
<param-name>Encode</param-name>
<param-value>none</param-value>
</init-param>
<init-param>
<param-name>CharSet</param-name>
<param-value>GB2312</param-value>
</init-param>
<init-param>
<param-name>EJBCertificateHomeName</param-name>
<param-value>sha.shasys.lg.lg010.lg010g01</param-value>
</init-param>
<init-param>
<param-name>LogFilePath</param-name>
<param-value>C:/JBOSS/server/default/log/sha.log</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>ShaServlet</servlet-name>
<url-pattern>/SHA/SHAController/*</url-pattern>
</servlet-mapping>

</web-app>
=================================================================
那位可以帮我看看吗?banq那里去了,为啥要屏蔽掉尖括弧……

difficult
2004-06-04 11:16
朋友报错信息不是说清楚了,你的web.xml有错误。
本来想看web.xml什么错误,但你发的web.xml连标记都没有了,也帮不了你了

big1980
2004-06-04 13:27

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE web-app PUBLIC
	"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
	"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>

  <servlet>
    <servlet-name>ShaServlet</servlet-name>
    <servlet-class>jp.co.nec.ome.servlet.OmEJBControlServlet</servlet-class>
    <init-param>
      <param-name>StartPageName</param-name>
      <param-value>/Sha/Shasys/LOGIN.JSP</param-value>
    </init-param>
    <init-param>
      <param-name>Encode</param-name>
      <param-value>none</param-value>
    </init-param>
    <init-param>
      <param-name>CharSet</param-name>
      <param-value>GB2312</param-value>
    </init-param>
    <init-param>
      <param-name>EJBCertificateHomeName</param-name>
      <param-value>sha.shasys.lg.lg010.lg010g01</param-value>
    </init-param>
    <init-param>
      <param-name>LogFilePath</param-name>
      <param-value>C:/JBOSS/server/default/log/sha.log</param-value>
     </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>ShaServlet</servlet-name>
    <url-pattern>/SHA/SHAController/*</url-pattern>
  </servlet-mapping>

</web-app>
<p class="indent">

big1980
2004-06-04 13:27
上面是我的web.xml文件内容

banq
2004-06-05 09:45
> The content of element type "web-app" must >match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".

这个错误表示你的web.xml格式不对,不符和web.xml的规定,建议你使用图形开发工具来校正,否则一个个对比web.xml字符串,眼睛会累,程序没进入主攻阶段,脑子已经给这种小事情搞大。

JBuilder之类工具对你有帮助。

big1980
2004-06-07 10:15
谢谢banq,除了jbuilder还有些什么图形开发工具?

huzhigang
2004-06-07 14:18
eclipse,intellj都不错了.

huzhigang
2004-06-07 14:18
eclipse,intellj都不错了.

big1980
2004-06-07 20:57
感谢非常

猜你喜欢