Scott M Stark wrote:
> <j2ee 1.3 spec>
> J2EE.8.1.1.2 Dependencies
Wrong spec. See Servlet 2.3 (PFD 2), SRV.9.7.1 (Dependencies on Extensions).
It goes for a few paragraphs, but the relevant one is:
It is recommended that Application developers provide a META-INF/MANIFEST.MF
entry in the WAR file listing extensions, if any, needed by the WAR. The
format of the manifest entry should follow standard JAR manifest format. In
expressing dependencies on extensions installed on the web container, the
manifest entry should follow the specification for standard extensions
defined at
http://java.sun.com/j2se/1.3/docs/guide/extensions/versioning.html.
Basically the J2EE spec says that the valid targets for the Class-Path are
JAR files. So, a WAR file could refer to an EJB (or a library jar) this way,
but the EJB (or library jar) can not refer back to the WAR in this fashion.
> Are you using this archive format successfully with another
> app server?
Umm... not right now. :) Of the three servers I've played with recently,
JBoss is the first to use the Extension mechanism correctly (read: at all)
> That is your interpretation.
I'll stand by the interpretation... in any case, I don't believe that JBoss
is not spec compliant. There's nothing in the Extension mechanism to talk
about how you get _back_ to the calling classloader, and it is
fine-and-dandy for the Extension to be loaded on a separate classloader.
> > Sorry if that wasn't clear before. :) Anyway, to get back
> to the core of the
> > problem:
> >
> > Is there an object that the servlet has access to (such as
> the ServletConfig
> > or the ServletContext) that is certain to be instantiated
> by the classloader
> > for the Web App? If I can get such an object, I can use its
> classloader to
> > instantiate the other classes.
> >
> Any class loaded from the standard WEB-INF/classes or
> WEB-INF/lib/*.jar
> is certain to be loaded by the servlet war class loader. At
> what point are
> you trying to do the reflection, and how are you loading the
> class? I would
> expect that using the thread context class loader should work:
>
> public void init() throws ServletException
> {
> ClassLoader loader =
> Thread.currentThread().getContextClassLoader();
> Class clazz = loader.loadClass("myClass");
> ...
> }
I'm trying to do it in the init() of the servlet.
I'll try the Thread idea tomorrow. I'll let you know how I go.
Robert.
--
"Duct tape is like the Force: it has a light side, a dark side,
and it holds the universe together"
Robert Watkins [EMAIL PROTECTED] [EMAIL PROTECTED]
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user