You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Alan Chandler <al...@chandlerfamily.org.uk> on 2005/08/26 07:48:23 UTC

Puzzled about finding a resource

I am starting to debug my very first attempt at using iBATIS.  Unfortunately, 
I have fallen over at the very first hurdle.

Using Eclipse, running tomcat4.1 within it...

I am getting 

java.io.IOException: Could not find resource 
uk/org/chandlerfamily/tapestry/sqlmap/famtree/SqlMapConfig.xml
	at 
com.ibatis.common.resources.Resources.getResourceAsStream(Resources.java:101)

trying to access my config file

The offending piece in my code is  (baring my mail wordwrapping)

	      String resource = 
"uk/org/chandlerfamily/tapestry/sqlmap/famtree/SqlMapConfig.xml";


The file SqlMapConfig.xml is stored in

<webapp-context>/WEB-INF/classes/uk/org/chandlerfamily/tapestry/sqlmap/famtree/SqlMapConfig.xml

I can't see what's wrong here.
-- 
Alan Chandler
http://www.chandlerfamily.org.uk

Re: Puzzled about finding a resource

Posted by Alan Chandler <al...@chandlerfamily.org.uk>.
On Friday 26 Aug 2005 20:03, Alan Chandler wrote:

> Sadly it doesn't seem to help.

That was because the was another problem with the string.  Small typo that it 
took a bit of looking to find.
-- 
Alan Chandler
http://www.chandlerfamily.org.uk

Re: Puzzled about finding a resource

Posted by Alan Chandler <al...@chandlerfamily.org.uk>.
On Friday 26 Aug 2005 13:27, Larry Meadors wrote:
> I have had similar issues in a slightly different context. One thing
> I'd try is to add a leading "/" to the resource name. We found that in
> tomcat 4, different configurations required that the "/" be there
> sometimes, and NOT be there other times.
>
> Give it a shot, you won't make it work less. ;-)

Sadly it doesn't seem to help.


-- 
Alan Chandler
http://www.chandlerfamily.org.uk

Re: Puzzled about finding a resource

Posted by Larry Meadors <la...@gmail.com>.
I have had similar issues in a slightly different context. One thing
I'd try is to add a leading "/" to the resource name. We found that in
tomcat 4, different configurations required that the "/" be there
sometimes, and NOT be there other times.

Give it a shot, you won't make it work less. ;-)

Larry


On 8/25/05, Alan Chandler <al...@chandlerfamily.org.uk> wrote:
> I am starting to debug my very first attempt at using iBATIS.  Unfortunately,
> I have fallen over at the very first hurdle.
> 
> Using Eclipse, running tomcat4.1 within it...
> 
> I am getting
> 
> java.io.IOException: Could not find resource
> uk/org/chandlerfamily/tapestry/sqlmap/famtree/SqlMapConfig.xml
>         at
> com.ibatis.common.resources.Resources.getResourceAsStream(Resources.java:101)
> 
> trying to access my config file
> 
> The offending piece in my code is  (baring my mail wordwrapping)
> 
>               String resource =
> "uk/org/chandlerfamily/tapestry/sqlmap/famtree/SqlMapConfig.xml";
> 
> 
> The file SqlMapConfig.xml is stored in
> 
> <webapp-context>/WEB-INF/classes/uk/org/chandlerfamily/tapestry/sqlmap/famtree/SqlMapConfig.xml
> 
> I can't see what's wrong here.
> --
> Alan Chandler
> http://www.chandlerfamily.org.uk
>