This content has been marked as final.
Show 3 replies
-
1. Re: Adding deployer to DeploymentUnit classpath
alesj Oct 18, 2008 4:24 PM (in response to ssilvert)"stan.silvert@jboss.com" wrote:
Is there a better way to do this?
You can do it as I do it for Seam:
- http://anonsvn.jboss.org/repos/jbossas/projects/jboss-seam-int/trunk/microcontainer/src/main/java/org/jboss/seam/integration/microcontainer/deployers/SeamUrlIntegrationDeployer.java
Or, you're probably bundling your jfsunit-xyz-jboss-beans.xml in the same jar which you want to add to unit's classpath.
Why don't you just pull that url out with getClass().getClassLoader().getResource("jfsunit-xyz-jboss-beans.xml") and strip it to jar? -
2. Re: Adding deployer to DeploymentUnit classpath
ssilvert Oct 18, 2008 4:55 PM (in response to ssilvert)I'm building the deployer as a Maven uberjar using the shade plugin. So yes, it's the second case.
Stripping it out to the jar is still a hack, but I guess it's a better hack if it works.
For my own edification, why doesn't getClass().getClassLoader().getResource("/") work? Perhaps there should be some way for the vfsmemory url to get mapped back to a vfsfile url?
Stan -
3. Re: Adding deployer to DeploymentUnit classpath
alesj Oct 18, 2008 5:13 PM (in response to ssilvert)"stan.silvert@jboss.com" wrote:
For my own edification, why doesn't getClass().getClassLoader().getResource("/") work?
Work in what way?
Is there something by the spec that says you must return the jar from where this class is loaded if you put in '/'?
If not, how else do you know which of the classpath entries to return?"stan.silvert@jboss.com" wrote:
Perhaps there should be some way for the vfsmemory url to get mapped back to a vfsfile url?
vfsmemory is different protocol then vfsfile.
vfsmemory is used to handle in-memory VirtualFiles.
We use it for in-memory AOP handling, hence every deployment has it by default in its classpath.