You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Wendy Smoak <ja...@wendysmoak.com> on 2004/11/01 21:44:45 UTC

Desperate Plea - FileNotFoundException from ValidatorPlugIn

Okay, now I'm desperate, and you know I wouldn't come bother you if I had
any other choice. ;)

But I have a webapp that works perfectly well on Windows where I develop,
and then when I make a .war file and deploy it to HP-UX, it will not start.
This began with Struts 1.2.4 and continues to happen with 1.2.5.  (It worked
on HP-UX with Struts 1.2.0 but dropping back will cause some pain at this
point.)

The (Tomcat) localhost log file says:
2004-11-01 12:31:53 StandardContext[/benauth-dev]: Servlet /benauth-dev
threw load() exception
javax.servlet.UnavailableException: Cannot load a validator resource from
'/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'

And in the log for the application, I see:
12:31:53,712 - INFO org.apache.struts.validator.ValidatorPlugIn - Loading
validation rules file from '/WEB-INF/validator-rules.xml'
12:31:53,713 - INFO org.apache.struts.validator.ValidatorPlugIn - Loading
validation rules file from '/WEB-INF/validation.xml'
12:31:53,833 - ERROR org.apache.struts.validator.ValidatorPlugIn - JAR entry
org/apache/commons/validator/resources/validator_1_1_3.dtd not found in
/opt/hpws/tomcat/webapps/benauth-dev/WEB-INF/lib/commons-validator.jar
java.io.FileNotFoundException: JAR entry
org/apache/commons/validator/resources/validator_1_1_3.dtd not found in
/opt/hpws/tomcat/webapps/benauth-dev/WEB-INF/lib/commons-validator.jar

Does anyone have any idea why this is happening?  The dtd is present in the
.jar file, so the "real" problem must be something else, I just have no idea
what.

Thanks in advance,
-- 
Wendy Smoak


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Desperate Plea - FileNotFoundException from ValidatorPlugIn

Posted by db...@qis.net.
Just a wild-eyed guess, and one with little probability of correctness, but if
getResource is being called from a class, that is derived from in another
package, and the derived class is the one that is instantiated, you will
probably have path problems due to relative path rules.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Desperate Plea - FileNotFoundException from ValidatorPlugIn

Posted by Wendy Smoak <ja...@wendysmoak.com>.
From: "Joe Germuska" <Jo...@Germuska.com>
> Have you tried putting a copy of the DTD in WEB-INF/classes?  Might
> be a workaround.   It seems peculiar that it is telling you exactly
> where in the classpath it isn't finding something -- so it's not (as
> you noted) that it isn't there.

Thank you!  That works.  Earlier I was vaguely remembering that we used to
have to configure something in web.xml... but that turned out to be tld's,
and I never got as far as figuring out where to put a "loose" dtd file.

> Maybe there's something quirky about the JAR
> you have that your app server doesn't like.

I'd like to blame the .jar file, except that I can deploy
struts-examples.war on the offending server, and the module that has
validation works fine.  I copied commons-validator.jar from the working
struts-examples webapp over to my own and stopped/started-- same error.
This is just plain weird.  But HP-UX is like that sometimes. ;)

> Is it trying to read the DTD from a WAR?  Or an "exploded" directory?

Exploded directory.

Thanks again!  Now I'm off to convince Ant to extract the dtd or copy it
from somewhere to 'classes' so I don't lose it every time I clean and
compile.

-- 
Wendy Smoak


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Desperate Plea - FileNotFoundException from ValidatorPlugIn

Posted by Joe Germuska <Jo...@Germuska.com>.
At 1:44 PM -0700 11/1/04, Wendy Smoak wrote:
>Okay, now I'm desperate, and you know I wouldn't come bother you if I had
>any other choice. ;)
>
>But I have a webapp that works perfectly well on Windows where I develop,
>and then when I make a .war file and deploy it to HP-UX, it will not start.
>This began with Struts 1.2.4 and continues to happen with 1.2.5.  (It worked
>on HP-UX with Struts 1.2.0 but dropping back will cause some pain at this
>point.)
>
>The (Tomcat) localhost log file says:
>2004-11-01 12:31:53 StandardContext[/benauth-dev]: Servlet /benauth-dev
>threw load() exception
>javax.servlet.UnavailableException: Cannot load a validator resource from
>'/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'
>
>And in the log for the application, I see:
>12:31:53,712 - INFO org.apache.struts.validator.ValidatorPlugIn - Loading
>validation rules file from '/WEB-INF/validator-rules.xml'
>12:31:53,713 - INFO org.apache.struts.validator.ValidatorPlugIn - Loading
>validation rules file from '/WEB-INF/validation.xml'
>12:31:53,833 - ERROR org.apache.struts.validator.ValidatorPlugIn - JAR entry
>org/apache/commons/validator/resources/validator_1_1_3.dtd not found in
>/opt/hpws/tomcat/webapps/benauth-dev/WEB-INF/lib/commons-validator.jar
>java.io.FileNotFoundException: JAR entry
>org/apache/commons/validator/resources/validator_1_1_3.dtd not found in
>/opt/hpws/tomcat/webapps/benauth-dev/WEB-INF/lib/commons-validator.jar
>
>Does anyone have any idea why this is happening?  The dtd is present in the
>.jar file, so the "real" problem must be something else, I just have no idea
>what.

Have you tried putting a copy of the DTD in WEB-INF/classes?  Might 
be a workaround.   It seems peculiar that it is telling you exactly 
where in the classpath it isn't finding something -- so it's not (as 
you noted) that it isn't there.  Maybe if you made a fresh 
commons-validator.jar?  Maybe there's something quirky about the JAR 
you have that your app server doesn't like.

Is it trying to read the DTD from a WAR?  Or an "exploded" directory? 
I had some problems once trying to deploy a simple webapp as a WAR to 
Weblogic 6 under Solaris where it couldn't read resources with the 
ClassPath loader even though it could read them just fine when I 
instaleed the same app in "exploded" form.

Joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn 
back; I'll know I'm in the wrong place."
    - Carlos Santana

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org