I am trying to deploy the Cocoon 2 XML publishing framework with JBoss
2.2.2/Tomcat 3.2.2. This works quite well, except for one issue that I like
to have explained.
When trying to lookup an EJB from a Cocoon XML page ala
home = new InitialContext().lookup("java:comp/env/ejb/ContactHome");
I get an '"env" not bound' exception. I found out that some "classloader
hack" in the Cocoon Servlet causes this problem.
In order to support a large variety of servlet containers, Cocoon deploys a
Classloader of its own. Essentially, it does something like
cl = Thread.currentThread().getContextClassLoader();
try{
Thread.currentThread().setContextClassLoader(new URLClassLoader({}, cl
...)
...
(Actually, it is a subclass of URLClassLoader, but it does not change the
main behaviour of Sun's implementation).
When removing this hack from the Cocoon servlet, everything works again.
So, why is the env context not visible when using a different class loader?
Please note that this new loader has Tomcat's original AdaptiveClassLoader
as its parent.
As I said, I can painlessly remove this "hack" as I don't use features like
XSLT extensions. But what would you suggest to someone how needs this class
loader hack and still wants to do JNDI lookups?
Thanks, Sven....
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user