To fix the current problems with class loading in wars I
have dropped the parsing of war subcomponents by the
MainDeployer. The problem was that the jars found in
wars were being broken out and loaded as deployment units
and added to the JBoss ServiceLibraries. The WEB-INF/classes
directory was not added correctly. When a class in the some.jar
(WEB-INF/lib/some.jar) tried to load a class from
WEB-INF/classes using Marc's favorite Class.forName(String),
this foreced used of the JBoss classloader for the some.jar
subdeployment and this knew nothing about WEB-INF/classes
and so failed.

Instead of heading further into the abyss and also adding the
WEB-INF/classes to the ServiceLibraries, I don't want to
deploy any subcomponents of wars. Let the servlet container
handle this. In addition to their own WEB-INF/classes
reload semantics, they also have to deal with the recommended
non-standard classloader behavior defined in the 2.3 servlet
spec:

<servlet-2.3 spec>
SRV.9.7.2 Web Application Classloader
The classloader that a container uses to load a servlet in a WAR must allow
the
developer to load any resources contained in library JARs within the WAR
following normal J2SE semantics using getResource. It must not allow theWAR
to
override J2SE or Java servlet API classes. It is further recommended that
the loader
not allow servlets in theWAR access to the web container's implementation
classes.
It is recommended also that the application class loader be implemented so
that classes and resources packaged within the WAR are loaded in preference
to
classes and resources residing in container-wide library JARs.
</servlet-2.3 spec>

The only downside to throwing out the parsing of the war subcomponents
is the potential loss of jar manifest classpaths. The servlet container is
supposed to handle this as well so this needs to be tested.

xxxxxxxxxxxxxxxxxxxxxxxx
Scott Stark
Chief Technology Officer
JBoss Group, LLC
xxxxxxxxxxxxxxxxxxxxxxxx



_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to