Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Tomcat+Spring to WildFly - Physical files?  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm attempting to move my webapp from Tomcat to WildFly 8, but I'm running into file system problems. I think I need to understand more about configuration and the VFS.

My webapp is built on Spring, so I have some spring beans which receive paths from the 'applicationContext.xml' file. I pass in a path to a folder that will receive files to for processing, so I must have access to a physical file location for the webapp to function properly.

My problem is that at the path [wildfly]/standalone/deployments/myapp.war, the .war is not expanded. Tomcat auto-expands wars, so I end up passing in ServletContext-relative paths into the spring beans like "/MyFilesDir", which I expect to be in the expanded war directory. I'm not sure how to handle the fact that the WAR is not expanded.

Ideally, I would like to be able to modify the applicationContext.xml file and have this work. Can I reference a WildFly path into the applicationContext.xml somehow? I can modify my app to take absolute paths rather than relative ones, but I'd like to make this work by configuration rather then re-coding.

Any help is much appreciated.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I replied to a similar question recently on JBoss forums, see if this helps https://community.jboss.org/thread/240770
 
Sheriff
Posts: 67261
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I 100% agree with Jaikiran's answer; writing files into the web app context is a recipe for heartbreak and sorrow.
 
If you two don't stop this rough-housing somebody is going to end up crying. Sit down and read this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!