commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allen,Eva" <all...@oclc.org>
Subject [commons-digester] still can't get xmlrules to work in tomcat
Date Wed, 25 Oct 2006 23:33:47 GMT
I'm still having problems with getting xmlrules to work within a Tomcat
servlet container.  I pretty much snagged the code I use from the
xmlrules example that comes with the digester source.  The problem comes
with the getSystemResource call.  I keep getting a null URL.  I finally
named the rules file x.xml and placed it in every directory under
$TOMCAT_HOME and used the following code:
            
URL rulesURL = ClassLoader.getSystemResource("x.xml");

but still the returned URL is null.  This works fine as long as I'm not
running within the Tomcat servlet container.  It also works fine if I do
this instead

            URL rulesURL = null;
            File f = new File("x.xml");
            try {
                rulesURL = f.toURL();
            } catch (MalformedURLException e1) {
                e1.printStackTrace();
            }

but I'd much prefer to do it the "right" way if I could.  Any hints?

--
Eva Allen
Consulting Software Engineer, OCLC, Inc.
6565 Frantz Rd., Dublin, OH  43017
614.764.6009 | allene@oclc.org
Views contained herein are my own; they do not necessarily reflect those
of my employer


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message