tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject RE: XML problem with Tomcat 4.1.18 (but was ok in 4.0.4)
Date Sat, 01 Mar 2003 21:45:16 GMT

First, how how exactly are you calling getResource()?  Here are some 
examples...

This will get the resource in the root of the current classloader ( ie... 
WEB-INF/classes or the root of a .jar file)
myClass.getResource("/myprops.properties");

This will get the resource relative to the location of the calling class....
myClass.getResource("myprops.properties");

I've never run into the scheme problem.  You can try the above first and 
see if that works.  If not, please provide a full description about where 
the file is that you are trying to get using getResource() and show exactly 
how you are calling getResource().

Jake

At 01:29 PM 3/1/2003 -0800, you wrote:
>actually the full URL that's coming back does not have the "file://" in
>front.  I guess that's why its complaining about not having a scheme.
>
>But again, why did it work before?  Why does it not work now?  And if the
>scheme is required, why is Class.getResource() not returning that as part of
>the URL?
>
>
>
>-----Original Message-----
>From: Jacob Kjome [mailto:hoju@visi.com]
>Sent: Saturday, March 01, 2003 1:24 PM
>To: Tomcat Users List
>Subject: RE: XML problem with Tomcat 4.1.18 (but was ok in 4.0.4)
>
>
>
>That's normal.  The full URL should look soemthing like this, though...
>
>file:///D:/dev/tomcat/webapps/myapp/WEB-INF/classes/org/mypackage/somefile.p
>roperties
>
>or if it is inside an archive...
>
>jar:file:///D:/dev/tomcat/webapps/myapp/WEB-INF/lib/somejar.jar!/org/mypacka
>ge/somefile.properties
>
>
>Jake
>
>At 01:00 PM 3/1/2003 -0800, you wrote:
> >Actually,
> >
> >It seems that the problem is that Class.getResource() is returning a URL
> >with a leading "/" dispite the fact that I'm on a Windows box.  For
> >instance, its returning a url like:
> >
> >/D:/dev/tomcat/...
> >
> >where it *should* be returning:
> >
> >D:/dev/tomcat/..
> >
> >If I mockup a String of that nature it works fine which seems to confirm
> >this.
> >
> >So, I could always compensate by removing the "/" but I ultimately deploy
>to
> >Linux and I presume this will mess up my paths in my production site if I
>do
> >so.
> >
> >Of course, I could always find a workaround ... but ... should I have to?
>I
> >mean, I'm guessing this is a bug somehow associated with the context of
>this
> >version of Tomcat.
> >
> >Any thoughts?
> >
> >Thanks.
> >
> >Neal
> >
> >-----Original Message-----
> >From: Reynir Hübner [mailto:reynir@hugsmidjan.is]
> >Sent: Saturday, March 01, 2003 12:41 PM
> >To: Tomcat Users List
> >Subject: RE: XML problem with Tomcat 4.1.18 (but was ok in 4.0.4)
> >
> >
> >Hi,
> >
> >This may have something to do with an upgraded version of jaxp or xerces,
> >distributed with some dists of tomcat.
> >According to the error you're getting your url is missing scheme, often
> >'http' or 'https' in the beginning of the url (before '://')
> >
> >   [scheme:]scheme-specific-part[#fragment]
> >
> >Which version of tomcat did you download (the full version or 1.4. LE) ?
> >
> >Hope it helps
> >-reynir
> >
> >
> >
> > > -----Original Message-----
> > > From: neal [mailto:nealcabage@yahoo.com]
> > > Sent: 1. mars 2003 20:36
> > > To: Tomcat Users List
> > > Subject: RE: XML problem with Tomcat 4.1.18 (but was ok in 4.0.4)
> > >
> > >
> > > Hmm ... it appears that for some F***'ed up reason, that the
> > > URL created by using his.getClass().getResource() is no
> > > longer acceptable for TRAX when using Tomcat 4.1.18, as
> > > compared to Tomcat 4.0.4.
> > >
> > > The problem is that the URI begins with a "/". If I remove
> > > that leading "/" suddenly the URLs are acceptable in Tomcat 4.1.18.
> > >
> > > Why would Tomcat be involving itself in such issues?  Only
> > > thing I can think of is that maybe the conditions for this
> > > Apache Exception were redefined in
> > > 4.1.18:
> > >
> > > org.apache.xml.utils.URI$MalformedURIException: No scheme found in URI
> > >
> > > Neal
> > >
> > > -----Original Message-----
> > > From: neal [mailto:nealcabage@yahoo.com]
> > > Sent: Saturday, March 01, 2003 11:02 AM
> > > To: Tomcat Users List
> > > Subject: RE: XML problem with Tomcat 4.1.18 (but was ok in 4.0.4)
> > >
> > >
> > > I ported my app from Tomcat 4.0.4 (Windows) to Tomcat 4.1.18
> > > (Windows) and now it doesn't work!  It appears that I have a
> > > problem now with parsing my conf.xml file in my initServlet.
> > >
> > > I noticed that the new Tomcat has an "endorsed" directory
> > > with a different copy of Xerces in it.  Is this somehow related?
> > >
> > > Here's the error:
> > > javax.xml.transform.TransformerException:
> > > org.apache.xml.utils.URI$MalformedURIException: No scheme found in URI
> > >
> > >
> > > Thanks.
> > > Neal
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > >
> > >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message