|Serve modules without publishing causing classpath issue [message #214794]
||Tue, 03 June 2008 20:16
Originally posted by: jon.barnard.s1.com|
I'm trying to run a dynamic web project in Server modules without
publishing mode. The web project has several jar libraries and several
utility projects. One of the utility projects is overwriting a class
definition in one of the jar files. The overwrite works just fine when I
publish the utility projects as a jar.
I did some deep debugging and I see that utility projects are at the end
of the classpath. Is there any way to configure this?
|Re: Serve modules without publishing causing classpath issue [message #214830 is a reply to message #214822]
||Wed, 04 June 2008 13:17
| Larry Isaacs
Registered: July 2009
Mauro Molinari wrote:|
> Jon Barnard ha scritto:
>> I did some deep debugging and I see that utility projects are at the
>> end of the classpath. Is there any way to configure this?
> Try to have a look at the Order and Export tab in the Java Build Path
> property page of your project... Maybe it can help.
I could be wrong, but I'm not sure this will help. I haven't done any
experiments to verify this, and the code isn't easy to understand
completely, so it may be worth a try.
Resources local to the web project are processed first to ensure its
Java classes, which are destined for WEB-INF/classes, appear first,
ahead of anything destined for WEB-INF/lib. This behavior is something
required by the Servlet spec. This does result in jars declared in the
web project appearing ahead of the classes appearing in utility projects.
I'm not aware of any requirement in the Servlet spec relating to the
order of jars in WEB-INF/lib. If you were to export the web project as
a war, I don't think there would be any guarantees about which classes
would override which contained in multiple jars.
However, with "Serve modules without publishing" enabled, if you made
sure the jar needs to be overridden is declared and exported in the
build path of the utility project that contains the overriding classes,
it looks like the classes in that utility project would appear ahead of
that jar. Again, this is based on inspection of the code, which I could
be misunderstanding. Give it a try, if you haven't already. If this
overriding is supposed to happen in the final webapp, you may have
additional deployment issues to resolve.
Powered by FUDForum
. Page generated in 0.21145 seconds