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
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
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.
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
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
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
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
-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
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 =
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
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
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
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:
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
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
15 matches
Mail list logo