472,341 Members | 2,228 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,341 software developers and data experts.

Loading Two Different Versions of the Same Class/JAR???

I'm trying to write an application that runs on an app server. The app
server uses an older version of a particular API. In my application I
need to use a newer version of the same API. If I put the JAR
containing the newer version of the API in my app server's classpath,
the app server fails. How do I load my own copy of this JAR?

-- John
Jul 17 '05 #1
3 11950
John Davison wrote:
I'm trying to write an application that runs on an app server. The app
server uses an older version of a particular API. In my application I
need to use a newer version of the same API. If I put the JAR
containing the newer version of the API in my app server's classpath,
the app server fails. How do I load my own copy of this JAR?


Use an URLClassLoader.
Jul 17 '05 #2
> I'm trying to write an application that runs on an app server. The app
server uses an older version of a particular API. In my application I
need to use a newer version of the same API. If I put the JAR
containing the newer version of the API in my app server's classpath,
the app server fails. How do I load my own copy of this JAR?

-- John


Hi John,

You should'nt add your application specific jar in the apps server
classpath. Most app server provide a method to include the jar file
only for the context of your application. Usually (at least in tomcat)
you put the jar file in WEB-INF/lib directory of your context. In
tomcat if you want to use a jar across multiple contexts, the place to
put the jar is $CATALINA_TOP/shared/lib.

If this does not help, then the only way out would be to write your
own ClassLoader and load the target classes and all other classes that
use them through this ClassLoader. But this method has its own
disadvantages. You will loose the benifits, like dynamic reloading
etc, that the apps server ClassLoader would provide you.

Regards

Amitabh
Jul 17 '05 #3
> I'm trying to write an application that runs on an app server. The app
server uses an older version of a particular API. In my application I
need to use a newer version of the same API. If I put the JAR
containing the newer version of the API in my app server's classpath,
the app server fails. How do I load my own copy of this JAR?

-- John


Hi John,

You should'nt add your application specific jar in the apps server
classpath. Most app server provide a method to include the jar file
only for the context of your application. Usually (at least in tomcat)
you put the jar file in WEB-INF/lib directory of your context. In
tomcat if you want to use a jar across multiple contexts, the place to
put the jar is $CATALINA_TOP/shared/lib.

If this does not help, then the only way out would be to write your
own ClassLoader and load the target classes and all other classes that
use them through this ClassLoader. But this method has its own
disadvantages. You will loose the benifits, like dynamic reloading
etc, that the apps server ClassLoader would provide you.

Regards

Amitabh
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Roger | last post by:
Hi All, If a user runs a Framework 1.0 app, and then opens a 1.1 app, and then opens a 1.2 app (when version 1.2 comes) , does this mean that all...
17
by: Aguilar, James | last post by:
My previous example used the concept of a Shape class heirarchy, so I will continue with that. Suppose I have something like fifty different...
3
by: Alexander | last post by:
When i store rule on PC with .NET.SP1 i cant restore them from PC without SP1. An i get this Error: ...
6
by: Pete Davis | last post by:
I'm confused about what precisely the limitations are on loading plugins in separate app domains. In all my previous apps that supported plugins,...
3
by: Scott Langham | last post by:
Hi, can anybody help please! I've got an app with a few dlls. When I run the app I get the following message in a message box: The procedure...
3
by: Peter Oliphant | last post by:
Trying to save/load a class instance to a file is tough. The reason is because there is no way to preserve its type other than by conventon. For...
28
by: larpup | last post by:
I have computers setup with A97 runtime with mde's. Work perfectly. I've written an app in 2003 and purchased the Developer extensions. When I...
6
by: kaens | last post by:
Hey everyone, this may be a stupid question, but I noticed the following and as I'm pretty new to using xml and python, I was wondering if I could...
3
by: downloads4birdman | last post by:
Trick Or Treat! I have a web server setup to host both .NET 1.1 and .NET 2.0 web applications. The applications are isolated by virutal...
8
by: =?Utf-8?B?TWFyaw==?= | last post by:
We've got a wierd failure happening on just one machine. One part of our product uses a 3rd party search implementation (dtSearch). DtSearch has a...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.