Re: [classloading] How to use URLClassLoader within a servlet

2002-12-13 Thread Ola Berg
Okay, I moved the JAR to $CATALINA_HOME/webapps/ROOT and changed the code to: Great, and thanks. In about two hours I will stop the daunting task of creating a web application in VBScript/ASP (yuck) and picking up the registry-system again. I will immediately try out your way. I suspect the

RE: [classloading] How to use URLClassLoader within a servlet

2002-12-12 Thread Ralph Einfeldt
I would recommend to use a different approach: Define an interface for the API. Implement the different protocols in different classes with unique names. Load the classes dynamically and store instances of the classes in variables. Use the interface to access the api. public class

Re: [classloading] How to use URLClassLoader within a servlet

2002-12-12 Thread Ola Berg
I would recommend to use a different approach: [snip] Doesn't help since the underlying API (outside of my control) belongs in different jars (same class names, different implementations). Sure, by tweaking I can do as you suggested, but the dynamic class loading will be the most flexible.

RE: [classloading] How to use URLClassLoader within a servlet

2002-12-12 Thread Ralph Einfeldt
a debugger to find ourt what hapens Or you could try to isolate the problem with an example and post that to the list. -Original Message- From: Ola Berg [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 10:30 AM To: Tomcat Users List Subject: Re: [classloading] How to use

Re: [classloading] How to use URLClassLoader within a servlet

2002-12-12 Thread Martin Jacobson
Ola Berg wrote: I have this problem with using my own (URLClassLoader) class loader in a servlet of mine. The thing is that I am writing a web front end to domain name services (automatic registration of .org, .com. .biz, .info etc domains). Depending on the top level domain, I need to use

Re: [classloading] How to use URLClassLoader within a servlet

2002-12-12 Thread Ola Berg
I have an analogous case, in which I have a single API for database access, with choice of database (Oracle, MySQL,...) made at run-time. The problem was simply solved using the 'Abstract Factory' pattern. This means that I have two packages (db.MySql, db.Oracle), which both

Re: [classloading] How to use URLClassLoader within a servlet

2002-12-12 Thread Ola Berg
Or you could try to isolate the problem with an example and post that to the list. The problem can be stated as ---8--- URL[] urls = new URL[]{ new URL(http://www.myserver.com/jars/myapi-1.2.jar;) }; URLClassLoader cl = new URLClassLoader( urls); //have tried different parents //here it hangs

RE: [classloading] How to use URLClassLoader within a servlet

2002-12-12 Thread Cox, Charlie
-Original Message- From: Ola Berg [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 3:52 AM To: Tomcat Users List Subject: [classloading] How to use URLClassLoader within a servlet I have this problem with using my own (URLClassLoader) class loader in a servlet of

Re: [classloading] How to use URLClassLoader within a servlet

2002-12-12 Thread Kris Schneider
As an experiment, I created a directory under WEB-INF called ext and dumped a JAR file in it (commons-cli-1.0.jar). Then I created a servlet that did: URL jarURL = getServletContext().getResource(/WEB-INF/ext/commons-cli-1.0.jar); URL[] urls = { jarURL }; ClassLoader ctxClassLoader =

RE: [classloading] How to use URLClassLoader within a servlet

2002-12-12 Thread Cox, Charlie
PROTECTED]] Sent: Thursday, December 12, 2002 6:20 AM To: Tomcat Users List Subject: Re: [classloading] How to use URLClassLoader within a servlet Or you could try to isolate the problem with an example and post that to the list. The problem can be stated as ---8--- URL[] urls = new

Re: [classloading] How to use URLClassLoader within a servlet

2002-12-12 Thread Ola Berg
couldn't you use this the 'top level domain' to determine which context to send the request to?. Yes of course. That is one of the B plans, should this classloading thing fail. A plan is still dynamic class loading. /O -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional

Re: [classloading] How to use URLClassLoader within a servlet

2002-12-12 Thread Ola Berg
As an experiment, I created a directory under WEB-INF called ext and dumped a' JAR file in it (commons-cli-1.0.jar). Then I created a servlet that did: [snip] Which is just the kind of thing you want, yes? No, you cheated ;-) You put the jar file in the WEB-INF. Strictly, we want it

Re: [classloading] How to use URLClassLoader within a servlet

2002-12-12 Thread Kris Schneider
Okay, I moved the JAR to $CATALINA_HOME/webapps/ROOT and changed the code to: URL jarURL = new URL(http://gizzard.dotech.com:8080/commons-cli-1.0.jar;); And got as output: URL of org.apache.commons.cli.ParseException:

RE: [classloading] How to use URLClassLoader within a servlet

2002-12-12 Thread Noel J. Bergman
See java/net/URL.java, specifically getURLStreamHandler(String), for an illustration of how Java has handled pluggable handlers since version 1.0. --- Noel -Original Message- From: Ola Berg [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 9:52 AM To: Tomcat Users

Re: [classloading] How to use URLClassLoader within a servlet

2002-12-12 Thread Craig R. McClanahan
On Thu, 12 Dec 2002, Ola Berg wrote: Date: Thu, 12 Dec 2002 12:19:35 +0100 From: Ola Berg [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: [classloading] How to use URLClassLoader within a servlet Or you could try