This content has been marked as final.
Show 9 replies
-
1. Re: Exploded WAR archive with no web.xml is no longer suppor
starksm64 Oct 10, 2008 5:56 AM (in response to alesj)Yes, something like that. It would have to run after the parsing deployers for web.xml/jboss-web.xml and only if there was no JBossWebMetaData.
-
2. Re: Exploded WAR archive with no web.xml is no longer suppor
adrian.brock Oct 10, 2008 10:51 AM (in response to alesj)It should be done in the WarStructureDeployer.
Otherwise a war that looks like this:
my.war/
my.war/WEB-INF/class/MyServlet.class
wouldn't have the correct classpath, etc.
i.e. we treat anything that ends with a .war as a war regardless
even if it doesn't contain a WEB-INF/web.xml -
3. Re: Exploded WAR archive with no web.xml is no longer suppor
adrian.brock Oct 10, 2008 10:52 AM (in response to alesj)"adrian@jboss.org" wrote:
my.war/
my.war/WEB-INF/class/MyServlet.class
I assume the servlet is annotated. ;-) -
4. Re: Exploded WAR archive with no web.xml is no longer suppor
alesj Oct 10, 2008 10:58 AM (in response to alesj)"adrian@jboss.org" wrote:
wouldn't have the correct classpath, etc.
Why wouldn't it have correct classpath?
As you said, every .war file is recognized as a war,
hence getting war-kind of classpath.
This does the trick for mepublic void deploy(DeploymentUnit unit) throws DeploymentException { if (unit.isAttachmentPresent(JBossWebMetaData.class)) return; // only care about true deployments if (unit instanceof VFSDeploymentUnit == false) return; if (unit.getSimpleName().endsWith(".war")) { log.debug("Web archive doesn't contain web.xml: " + unit.getName()); unit.getTransientManagedObjects().addAttachment(JBossWebMetaData.class, new JBossWebMetaData()); } }
-
5. Re: Exploded WAR archive with no web.xml is no longer suppor
adrian.brock Oct 10, 2008 11:33 AM (in response to alesj)"alesj" wrote:
"adrian@jboss.org" wrote:
wouldn't have the correct classpath, etc.
Why wouldn't it have correct classpath?
Because it the war has no WEB-INF/web.xml it is currently treated as a jar.
i.e. the root for the war will be the classpath which is clearly wrong. -
6. Re: Exploded WAR archive with no web.xml is no longer suppor
alesj Oct 10, 2008 11:40 AM (in response to alesj)"adrian@jboss.org" wrote:
"alesj" wrote:
"adrian@jboss.org" wrote:
wouldn't have the correct classpath, etc.
Why wouldn't it have correct classpath?
Because it the war has no WEB-INF/web.xml it is currently treated as a jar.
i.e. the root for the war will be the classpath which is clearly wrong.
Hmmm ...
WarStructure.relativeOrder == 1k
JarStructure.relativeOrder == 10k
Doesn't that mean .war file would be first recognized by WarS and not JarS? -
7. Re: Exploded WAR archive with no web.xml is no longer suppor
adrian.brock Oct 10, 2008 11:43 AM (in response to alesj)"adrian@jboss.org" wrote:
"alesj" wrote:
"adrian@jboss.org" wrote:
wouldn't have the correct classpath, etc.
Why wouldn't it have correct classpath?
Because it the war has no WEB-INF/web.xml it is currently treated as a jar.
i.e. the root for the war will be the classpath which is clearly wrong.
Actually, I see the WARStructure already recognises .war files as webapps.if (isLeaf(file) == false) { // We require either a WEB-INF or the name ends in .war if (file.getName().endsWith(".war") == false)
-
8. Re: Exploded WAR archive with no web.xml is no longer suppor
alesj Oct 10, 2008 11:46 AM (in response to alesj)"adrian@jboss.org" wrote:
Actually, I see the WARStructure already recognises .war files as webapps.
Exactly. ;-)"adrian@jboss.org" wrote:
i.e. we treat anything that ends with a .war as a war regardless
even if it doesn't contain a WEB-INF/web.xml
Now I get this. It was actually really meant as an i.e.
Although in reality it already was doing this.
Hence the confusion, mostly yours. :-) -
9. Re: Exploded WAR archive with no web.xml is no longer suppor
adrian.brock Oct 10, 2008 11:51 AM (in response to alesj)"alesj" wrote:
Now I get this. It was actually really meant as an i.e.
Although in reality it already was doing this.
Hence the confusion, mostly yours. :-)
I wasn't confused, I was just inaccurate because I didn't check the facts
before opening my big mouth. ;-)