Solved

How to add a class to the classpath

Posted on 2004-08-16
13
224 Views
Last Modified: 2010-03-31
I have a webapplication that uses jasper repots to generate a report.  The i have my report is as follows:  There is a report file called address.jasper with a scriplet( which is just a java file) called adressscriplet.class

I dont want to add the addressscriplet.class to the WEB-INF/classes directory b/c  i may modify the report and the scriplet and dont want to stop the webapp.  I want to take my new report modifications along with the scriplet and put it in a directory called reports and update it at anytime with out having to stop the application.  
I have tried putting the path in the classpath: ex. CLASSPATH=%CLASSPATH%;c:/reports
with no luck.

Is there a way to do it?

0
Comment
Question by:netizen1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
13 Comments
 
LVL 92

Expert Comment

by:objects
ID: 11816558
> I dont want to add the addressscriplet.class to the WEB-INF/classes directory b/c  i may modify the report and the scriplet and dont want to stop the webapp.

where your class is doesn't really make any difference
0
 
LVL 92

Expert Comment

by:objects
ID: 11816560
is your webapp configured to do dynamic class reloading?
0
 

Author Comment

by:netizen1
ID: 11817384
That is what i was looking at which was dynamic class reloading.  But I dont think it can be used for what i need it to do.  The thing is i dont use the class directly.  The report address.jasper uses the class but i dont want it tied to the WEB-INF/classes.  Here is what i would like to do:

I created a directory called:
c:\reports
And then i put the address.jasper and the class that the reports use.

I then run the application and it runs fine.  But days later the report needs to be changed so i modify the address.jasper file and adressscriplet.class so i then need to update the files in c:\reports.  But i would like to do it without stopping and re-starting the application.  

I have tried adding c:\reports to the classpath  on startup but it doesnt seem to work.  But again if i put the class in WEB-INF/classes it finds it fine.  But i dont want it there.

Hope this clear it up.
If dynamic loading would work how would you do it.

Thanks
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 92

Expert Comment

by:objects
ID: 11817405
> but i dont want it tied to the WEB-INF/classes

why not?
0
 

Author Comment

by:netizen1
ID: 11817413
b/c this is a war file and i dont want to create a new build everytime.  I'm trying to do this withoug stopping the application.
0
 
LVL 92

Expert Comment

by:objects
ID: 11817428
0
 

Author Comment

by:netizen1
ID: 11817445
But that isnt what i'm looking for.  I dont want to deploy a new war file just the report and its scriplet file.
0
 
LVL 92

Expert Comment

by:objects
ID: 11817459
that link doesn't even mention a war does it?
0
 

Author Comment

by:netizen1
ID: 11817471
But  i'm not using tomcat.  I'm using weblogic that is why i'm looking for the this particular solution.  I guess the question then is can this  be done?
0
 
LVL 92

Accepted Solution

by:
objects earned 70 total points
ID: 11817497
0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question