Question

I've set up a web service I'm trying to debug in Eclipse.

It has a directory structure like this:

Root /
  + src
  + META-INF
  + WEB-INF

Inside the META-INF directory, there is a folder \xfire\services.xml.

When I start the server, I have the following error:

java.io.FileNotFoundException: class path resource [META-INF/xfire/services.xml] cannot be opened because it does not exist

When I run procmon.exe from sysinternals, I see that I have a "PATH NOT FOUND" error on those following paths:

  • C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\META-INF\xfire\services.xml
  • C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\MyWebService\WEB-INF\META-INF\xfire\services.xml
  • C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\MyWebService\WEB-INF\classes\META-INF\xfire\services.xml

While the file is stored in:

  • C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\MyWebService\META-INF\xfire\services.xml

What am I doing wrong?

Was it helpful?

Solution 2

It's look like getRessources() is used to read your xml, so the file need to be in the classpath.

Just move or copy the META-INF in one of your project source directory (i guess src or src/main...).

OTHER TIPS

I had an issue where the META-INF folder had to stay within the WEB-INF ... this way up, you can keep your normal folders. try this...

<servlet>
   <servlet-name>XFire</servlet-name>
   <servlet-class>org.codehaus.xfire.transport.http.XFireConfigurableServlet</servlet-class>
   <init-param>
      <param-name>config</param-name>
      <param-value>../META-INF/xfire/services.xml</param-value>
   </init-param>
</servlet>

Force the location of the file you need. In this case, I used ".. \" to go up one level. This is done in web.xml

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top