The DTD's are shipped in the Commons Validator jar - when the xml config
file(s) are parsed (using Digester) local copies of the DTD (i.e. the ones
in the jar) are registered and should be picked up and therefore it
shouldn't need to go over the net to get them. This problem usually occurs
when the DTD declaration in your validatior xml config files is incorrect.

You should have something like the following at the top of your validator
xml files...

<!DOCTYPE form-validation PUBLIC
    "-//Apache Software Foundation//DTD Commons Validator Rules
Configuration 1.1.3//EN"
    "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd";>

The above is for Version 1.1.3 of Commons Validator DTD - but the jar also
contains DTDs for 1.0, 1.0.1, and 1.1 - so declarations for them should also
work locally.

If your DTD declaration is correct, the other thing you might check is that
you have deployed the correct Commons Validator jar.

Niall

----- Original Message ----- 
From: "Bart Busschots" <[EMAIL PROTECTED]>
To: <user@struts.apache.org>
Sent: Friday, January 20, 2006 12:06 AM
Subject: Problem with Struts Validator on machines without internet access


> Hi,
>
> I'm trying to develop a Struts application on my laptop which spends
> quite a lot of it's time without net access. This should not cause any
> problems because the app it self has  no need to access the net at all
> but it is. The problem occours when I try to start Tomcat while not
> connected to the network. When I do that the Struts Validator throws an
> exception while Tomcat is starting. If I connect to the net the app
> start fine. The stack trace is as follows:
>
> INFO: Processing Context configuration file URL
>
file:/usr/local/jakarta-tomcat-5.0.28/conf/Catalina/localhost/vtie_live.xml
> Jan 19, 2006 11:41:21 PM org.apache.struts.validator.ValidatorPlugIn
> initResources
> INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
> Jan 19, 2006 11:41:21 PM org.apache.struts.validator.ValidatorPlugIn
> initResources
> INFO: Loading validation rules file from '/WEB-INF/validation.xml'
> Jan 19, 2006 11:41:22 PM org.apache.struts.validator.ValidatorPlugIn init
> SEVERE: jakarta.apache.org
> java.net.UnknownHostException: jakarta.apache.org
>         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
>         at java.net.Socket.connect(Socket.java:452)
>         at java.net.Socket.connect(Socket.java:402)
>         at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
>         at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
>         at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
>         at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
>         at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
>         at sun.net.www.http.HttpClient.New(HttpClient.java:339)
>         at sun.net.www.http.HttpClient.New(HttpClient.java:320)
>         at sun.net.www.http.HttpClient.New(HttpClient.java:315)
>         at
>
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.j
ava:521)
>         at
>
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:4
98)
>         at
>
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
.java:626)
>         at
> org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
>         at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown
> Source)
>         at
> org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
>         at
> org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
>         at
>
org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown
> Source)
>         at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
>         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
>         at org.apache.commons.digester.Digester.parse(Digester.java:1591)
>         at
>
org.apache.commons.validator.ValidatorResources.<init>(ValidatorResources.ja
va:159)
>         at
>
org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.ja
va:237)
>         at
> org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:162)
>         at
>
org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.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:10
29)
>         at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
>         at
>
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
4013)
>         at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)
>         at
>
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:8
23)
>         at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
>         at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
>         at
>
org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.
java:903)
>         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.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
>         at
org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
>         at org.apache.commons.digester.Rule.end(Rule.java:276)
>         at
> org.apache.commons.digester.Digester.endElement(Digester.java:1058)
>         at
>
org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:7
6)
>         at
> org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
>         at
>
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown
> Source)
>         at
>
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
her.dispatch(Unknown
> Source)
>         at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
>         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
>         at org.apache.commons.digester.Digester.parse(Digester.java:1567)
>         at
>
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.j
ava:488)
>         at
> org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
>         at
>
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483
)
>         at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
>         at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
>         at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
>         at
>
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:119)
>         at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
>         at
> org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
>         at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
>         at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
>         at
> org.apache.catalina.core.StandardService.start(StandardService.java:480)
>         at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
>         at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
>         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.start(Bootstrap.java:287)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
>
>
> The only relevant thing I could find with Google is this:
> http://issues.apache.org/bugzilla/show_bug.cgi?id=17470 which implies
> that the problem is with a DTD not being part of the binary package and
> that the problem has been fixed. I'm on the latest version of struts
> (1.2.8) and the problem is obviously still here. Basically, where do I
> get a copy of this DTD and how do I install it in such a way that Tomcat
> will find it without trying to access the web?
>
> Thanks,
>
> Bart Busschots,
> Department of Computer Science,
> NUI Maynooth.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to