Hi I need some help.

 

I have a Handler class for my protocol.  Before we embedded tomcat in
our own "App Server" like runtime.  This handler class could be loaded.
But now we were forced to change to install into tomcat.  So now we put
classes into commons/lib/... and we add a global resource to server.xml
that starts our services.  This all works fine except now my protocol
can't be loaded.  We use new URL("myprotocol:\\..."); and this throws an
exception because it now can't find the handler class.  I have debugged
into the URL code and it can't find my class because tomcat must put a
classloader between the jvm classloader and my classes loaded in tomcat.
Because URL is loaded in the parent classloader it can't find classes in
the child classloader.  

 

My question is how can I get this to work?  There is a
DirContextURLStreamHandlerFactory that tomcat installs as the stream
handler factory used in URL class, is there a way to add my handler
there?  We had a similar idea where this static factory class had a
addURLStreamHandler(sProtocol, sClass); method.

 

Any help is appreciated.

 

Thanks Mike

Reply via email to