Link to home
Start Free TrialLog in
Avatar of netizen1
netizen1

asked on

How to add a class to the classpath

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?

Avatar of Mick Barry
Mick Barry
Flag of Australia image

> 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
is your webapp configured to do dynamic class reloading?
Avatar of netizen1
netizen1

ASKER

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
> but i dont want it tied to the WEB-INF/classes

why not?
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.
But that isnt what i'm looking for.  I dont want to deploy a new war file just the report and its scriplet file.
that link doesn't even mention a war does it?
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?
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial