Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » VTS not finding resource file(VTS not finding resource file)
VTS not finding resource file [message #916663] Wed, 19 September 2012 05:39 Go to next message
Erik Vande Velde is currently offline Erik Vande Velde
Messages: 62
Registered: September 2012
Member
I'm deploying a working tomcat war under VTS, and there it doesn't work any more because VTS can't find a resource file. The log message is:
Unable to obtain inputstream for resource: .war/WEB-INF/classes/db/migration/V1_0_0_B__Initial_version.sql.
Still: that sql file is indeed packaged in the war file, but VTS doesn't find it.
When retrieving the resource this code is used:
Thread.currentThread().getContextClassLoader().getResourceAsStream(location);
, with location being the .war/WEB-INF/classes/db/migration/V1_0_0_B__Initial_version.sql above. What is wrong here?
Re: VTS not finding resource file [message #916784 is a reply to message #916663] Wed, 19 September 2012 09:09 Go to previous messageGo to next message
Erik Vande Velde is currently offline Erik Vande Velde
Messages: 62
Registered: September 2012
Member
I found out, with remote debugging, that
VTS uses the org.eclipse.gemini.web.tomcat.internal.loading.BundleWebappClassLoader,
which in turn tries to find the resource with
1) BundleDelegatingClassLoader [org.eclipse.virgo.apps.repository-3.5.0.RELEASE]
2) KernelBundleClassLoader [bundle=com.springsource.org.apache.catalina_7.0.26]
3) org.eclipse.virgo.web.tomcat.support.FindResourceDelegatingClassLoader
None of these succeeds in retrieving the sql file, while tomcat's org.apache.catalina.loader.WebappClassLoader just finds it under WEB-INF/classes.
What's the proper way to fix this problem?
Re: VTS not finding resource file [message #917566 is a reply to message #916784] Thu, 20 September 2012 03:49 Go to previous message
Erik Vande Velde is currently offline Erik Vande Velde
Messages: 62
Registered: September 2012
Member
In the end it transpired that this wasn't a virgo problem, but rather a flyway (see code.google.com/p/flyway) bug. The virgo classloaders didn't find the file because the resource name it was looking for was wrong: .war/WEB-INF/classes/db/migration/V1_0_0_B__Initial_version.sql is impossible to find, but the correct db/migration/V1_0_0_B__Initial_version.sql is found by the loaders. In the end I fixed this problem by just using flyway 1.7 instead of 1.6.1, the flyway team had already solved this problem before I reported it ...
Previous Topic:hi,a error of SpringAMQP in Virgo
Next Topic:migration to 3.5.0 camel with blueprint issues
Goto Forum:
  


Current Time: Thu Jul 31 03:39:25 EDT 2014

Powered by FUDForum. Page generated in 0.02016 seconds