-
1. Re: MainDeployer getting absolute path of deployed package
dimitris Mar 26, 2005 2:32 PM (in response to eltorio)The starting point is the MainDeployer (jboss.system:service=MainDeployer). From this MBean you can find out everything about your deployments. Check out the http://www.jboss.org/wiki/Wiki.jsp?page=FAQJBossJMX to find out how to call an MBean.
In general, though, it looks strange what you are doing with those files. Usually, we access files inside .wars, .jars, etc. as resources (Thread.currentThread.getContextClassLoader.getResource("whateverdir/whateverfile"))... -
2. Re: MainDeployer getting absolute path of deployed package
eltorio Mar 26, 2005 3:38 PM (in response to eltorio)Thanks for your answer,
Why didn't access the source package? Because I didn't know to access resources in a war within an ear. I'm looking around you're right it is better.
I'm now connected to MainDeployer service it is easy, but i don't find the temp place.
is it something as jboss.server.temp.... ?
Thanks -
3. Re: MainDeployer getting absolute path of deployed package
dimitris Mar 26, 2005 3:45 PM (in response to eltorio)The .war should be able to access its own resources. It seems to me you need to redesign your application.
In any case, MainDeployer maintains DeploymentInfo objects, that point to a local url in ./tmp. You really need to see the jboss sources to understand what's going on there. Be warned, though, those are mostly internal implementation details, that often change... -
4. Re: MainDeployer getting absolute path of deployed package
eltorio Mar 29, 2005 8:25 AM (in response to eltorio)Thanks a lot it works well, for me it is magic!
when i callURL currentFile = Thread.currentThread().getContextClassLoader().getResource("file.data"); currentFile.toString();
from my ejb the url answer is
file:/xxxxx/jboss/server/default/tmp/deploy/tmp32294xxxApp.ear-contents/xxxApp.war/file.data
Thanks again -
5. Re: MainDeployer getting absolute path of deployed package
phantom Apr 13, 2005 9:41 AM (in response to eltorio)You try in such way:
URL url = ((UnifiedClassLoader)this.getClass().getClassLoader()).getURL();