[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-user
Subject:    [commons-digester] still can't get xmlrules to work in tomcat
From:       "Allen,Eva" <allene () oclc ! org>
Date:       2006-10-25 23:33:47
Message-ID: 4643B3D2B28BE14FAA467B9FF400445F0168E8C5 () OAEXCH2SERVER ! oa ! oclc ! org
[Download RAW message or body]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic