今天准备试一下Struts中的Validator框架,可是配置完成后,启动tomcat总是报一大串错误,而且Validator无法正常工作,我是用Eclipse+MyEclipse开发工具,应用服务器是tomcat,下面是tomcat报的错误:
2006-5-16 10:46:46 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: The Apache Tomcat Native library which allows optimal performance in produ
ction environments was not found on the java.library.path: D:\Tomcat5\bin;.;C:\W
INDOWS\system32;C:\WINDOWS;d:\sybase\ASE-12_5\bin;d:\sybase\ASE-12_5\dll;d:\syba
se\CFG-1_0\bin;d:\sybase\EFTS-12_5\dll;d:\sybase\EFTS-12_5\bin;d:\sybase\OCS-12_
5\dll;d:\sybase\OCS-12_5\lib3p;d:\sybase\OCS-12_5\bin;d:\sybase\ASE-12_5\dll;d:\
sybase\ASE-12_5\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\P
rogram Files\Microsoft SQL Server\80\Tools\BINN;D:\jdk15\bin;C:\Program Files\Mi
crosoft SQL Server\90\Tools\binn\;d:\sybase\SQLRemote\dll;d:\sybase\DLL;d:\sybas
e\BIN;G:\Program Files\MySQL\MySQL Server 5.0\bin;d:\Program Files\SSH Communica
tions Security\SSH Secure Shell;g:\Program Files\SSH Communications Security\SSH
Secure Shell
2006-5-16 10:46:47 org.apache.coyote.http11.Http11BaseProtocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2006-5-16 10:46:47 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 4917 ms
2006-5-16 10:46:48 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2006-5-16 10:46:48 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/5.5.16
2006-5-16 10:46:48 org.apache.catalina.core.StandardHost start
信息: XML validation disabled
2006-5-16 10:46:55 org.apache.struts.validator.ValidatorPlugIn initResources
信息: Loading validation rules file from '/WEB-INF/validator-rules.xml'
2006-5-16 10:46:55 org.apache.struts.validator.ValidatorPlugIn initResources
信息: Loading validation rules file from '/WEB-INF/validation.xml'
2006-5-16 10:46:56 org.apache.commons.digester.Digester error
严重: Parse Error at line 1 column 17: Document is invalid: no grammar found.
org.xml.sax.SAXParseException: Document is invalid: no grammar found.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAX
ParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unk
nown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scan
StartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSCo
ntentDispatcher.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l$FragmentContentDispatcher.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
nknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
nknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown So
urce)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Un
known Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1591)
at org.apache.commons.validator.ValidatorResources.<init>(ValidatorResou
rces.java:159)
at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPl
ugIn.java:237)
at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java
:162)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServle
t.java:869)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1105)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:93
2)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3917)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
197)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:73
9)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.jav
a:904)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.j
ava:867)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474
)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1112)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442
)
at org.apache.catalina.core.StandardService.start(StandardService.java:4
50)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709
)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2006-5-16 10:46:57 org.apache.commons.digester.Digester error
严重: Parse Error at line 1 column 17: Document root element "form-validation",
must match DOCTYPE root "null".
org.xml.sax.SAXParseException: Document root element "form-validation", must mat
ch DOCTYPE root "null".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAX
ParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unk
nown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scan
StartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSCo
ntentDispatcher.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l$FragmentContentDispatcher.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
nknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
nknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown So
urce)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Un
known Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1591)
at org.apache.commons.validator.ValidatorResources.<init>(ValidatorResou
rces.java:159)
at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPl
ugIn.java:237)
at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java
:162)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServle
t.java:869)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1105)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:93
2)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3917)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
197)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:73
9)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.jav
a:904)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.j
ava:867)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474
)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1112)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442
)
at org.apache.catalina.core.StandardService.start(StandardService.java:4
50)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709
)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2006-5-16 10:46:59 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2006-5-16 10:46:59 org.apache.catalina.core.StandardContext start
严重: Context [/jsp-examples] startup failed due to previous errors
2006-5-16 10:47:00 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2006-5-16 10:47:00 org.apache.catalina.core.StandardContext start
严重: Context [/servlets-examples] startup failed due to previous errors
2006-5-16 10:47:02 org.apache.coyote.http11.Http11BaseProtocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2006-5-16 10:47:03 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2006-5-16 10:47:03 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/691 config=null
2006-5-16 10:47:04 org.apache.catalina.storeconfig.StoreLoader load
信息: Find registry server-registry.xml at classpath resource
2006-5-16 10:47:04 org.apache.catalina.startup.Catalina start
信息: Server startup in 16905 ms
validation.xml的原文件:
<form-validation>
<global>
<constant>
<constant-name>phone</constant-name>
<constant-value>^\d{8}\d*$</constant-value>
</constant>
</global>
<formset>
<form name = "loginForm">
<field property="login" depends="required">
<arg0 key = "lable.login"/>
</field>
<field property="password" depends="required">
<arg0 key = "lable.password"/>
</field>
</form>
</formset>
</form-validation>
请大家帮忙看看,谢谢!