How to clear old class files cached in JVM

JVM stores old class files in its cache even after the corresponding files have been deleted from the database. This causes a conflict if a new file is saved with the same name as one that was deleted earlier causing old data to be fetched and not the new one.
am using the following line of code to load the class file :
Class.forName(className, false, this.getClass().getClassLoader())
please help
Thanks - N

Why are you trying to do that?
Dynamic Classloading(reloading) has a meaing only on "application container" like WAS.
Not appropriate for normal applcation.
Focus on enhancing your application logic and algorithm rather than wasting your brain on difficult and meaningless things. Applying some flexible design patterns wouldn't suffice?
Anyway, Sun provides wonderful and simple custom classloader sample.
http://java.sun.com/developer/onlineTraining/Security/Fundamentals/magercises/ClassLoader/help.html
Anayzing tomcat source(which is downloadable) is another approach.
Edited by: Dion_Cho on Nov 26, 2007 5:18 PM
Typo...

Similar Messages

  • Tomcat Web-server uses old .class files

    Hi Friends,
    My Tomcat webserver uses old .class files. The problem persists even if I delete old class files. The new ones are formed but then if i again recompile, the new-old ones are used :)
    Am I doing something wrong????
    Please suggest!!

    I have experienced this problem before as well. Tomcat seems to cache compiled class files for better speed. To get Tomcat to reload class files that I've recently recompiled here is what I do:
    1. Go into the Tomcat server administration area (http://localhost/admin)
    2. Choose the context that is using the classes that you want to reload (from Service / Host)
    3. Make sure reloadable is set to true
    3. Click save, and then commit changes
    Hope this helps, but if there is a better way to get Tomcat to use the most recent class files I would love to hear it!

  • How to convert java class file version without decompiling

    Hi,
    Oracle R12.1.3 i am having illegal access error while try to access the class file version Java 1.3 uses major version 47,So how to convert the class file version without using decompiling.
    Current java version is 1.6.0_07
    Is there any tool or API for converting class file version?
    Thanks,
    Selvapandian T

    Beside this I wonder where you get your error from since AFAIK 12c comes with java 1.6.
    Well wonder no more!
    OP isn't using Oracle 12c database.
    They are using Oracle R12.1.3 - which is the E- Business Suite.

  • How to convert a class file to exe file and how to cteate a class file to d

    how to convert a class file to exe file

    Hi Bhaskarq,
    Hi,
    It is not at all possible.
    But it is a really worst method.
    Please go through it.
    This is a very common question asked in the comp.lang.java newsgroup. Its often useful to have an
    executable application when deploying your
    applications to a specific platform, but remember to
    make your .class files available for users running
    Unix/Macintosh/other platforms.
    Microsoft provide a free system development kit (SDK),
    for Java, which includes the jexegen tool. This
    will convert class files into a .EXE form. The only
    disadvantage is that users need a Microsoft Java
    Virtual Machine (JVM) installed. If your target
    platform is Win32, you can either redistribute the
    virtual
    machine, or raise the level of your system
    requirements, to include Windows 98, or Windows 95
    with
    Internet Explorer 4. Systems matching these
    requirements will already have a copy of the Microsoft
    Java Virtual Machine installed.
    Note : You must specify all of the class files your
    application needs (except for standard java packges)
    as a parameter, so if you have third party libraries,
    you'll need to include them as well. You can use wildcards * though, and you don't need the original source code.
    Also please see this Forum which will give a good idea
    http://forum.java.sun.com/thread.jsp?forum=31&thread=149733
    I hope this will help you.
    Thanks
    Bakrudeen
    Technical Support Engineer
    Sun MicroSystems Inc, India

  • How to get the .class file for the extended Controller .java file

    Hi,
    I did the below steps.
    1. Created New OAWorkspace
    2. Created New project
    3. Imported the page .xml file
    4. Added new .java file by extending the controller class
    5. Added code in the .java file.
    6. Ran the .xml file
    As I copied all the folders from Unix box, the page was opened.
    But My question was where can I see the .class file the extended controller. It's a .java file. How to compile and get the .class file for this .java file. If I get this .class file, I can go to the page and click the personlize page. and change the Controller name to the new path by ftp ing the new class to the cust.oracle.apps.pos.changeorder.webiui.
    Please let me know how to create the .class file.
    Thanks,
    HP

    All are Java files are stored in JDEV_INSTALL_DIR:\jdevhome\jdev\myprojects\
    In your case the path java would be
    JDEV_INSTALL_DIR:\jdevhome\jdev\ myprojects \cust\oracle\apps\pos\changeorder\webui\
    AND
    Once you compile the java file in Jdeveloper, Class files get generated @ below path
    In your case the path of class would be
    JDEV_INSTALL_DIR:\jdevhome\jdev\ myclasses \cust\oracle\apps\pos\changeorder\webui\
    Duplicate Thread-
    Thanks
    --Anil
    http://oracleanil.blogspot.com/

  • How to decode  java class file to java file

    hi
    how to decode java class file into java file
    regards
    kedar

    Its really.......... really BAD.
    Write ur own code... or use open source code..
    Its a bad practice...
    however i am telling u ..there is DJ java decompiler.
    but mind it there are Obfuscator also....like codeshield and others
    take care...
    Alok

  • Is it possible clear the class loader cache programatically?

    Hi,
    Is it possible clear the class loader cache programatically?
    Thanks

    By the cache do you mean the loaded classes? If so, you can do that by discarding any pointer you have to the class loader and creating a new class loader. ...though I wonder why you would need to do that...

  • How to clear the directory server cache?

    How to clear the directory server cache?
    we are using the directory server 5.2
    Thanks,
    Subbu

    try asking it here - http://forum.java.sun.com/forum.jspa?forumID=761

  • Caching of old class files

    Ok, I have a problem with oracle which appears to be that it is caching an old version of a class file. I get a class not found exception but the thing is the package that the error message is refering to doesn't even exist anymore and isn't refrenced in my code. I've verified that the class's being deployed aren't old versions as well and tried restarting the server as well as redployments of my application. Does anyone know where this caching maybe occuring? I know this happens sometimes in weblogic and you have to go in and manually delete the compiled class files from a weblogic directory.

    Hi,
    The caching of classes happens in the application-deployments/<you_application_name> folder. Just delete this folder and start OC4J.
    Regards.

  • How to clear old data?

    Greetings,
    My first question: how do I locate and clear out old, unnecessary files and folders? I'm thinking about browser cookies, temp files, etc.
    Second question: is this even necessary on a Mac? I just switched from PC recently, and I am still trying to learn the Mac way. I know that with a Windows PC it is CRUCIAL to clear out cookies, the "temp" folder, and various other folders from time to time, because Windows constantly saves things you don't need. I just freed up 5GB on my work PC by cleaning it up in this fashion.
    So: is this kind of "maintenance" necessary on a Mac, and if so how do I do it?
    Thank you!

    Hello DePombal, and a warm welcome to the forums & Macdom!
    Different Maintenance is required on a Mac, if it were me, I'd give a try with Applejack...
    http://www.versiontracker.com/dyn/moreinfo/macosx/19596
    After installing, reboot holding down CMD+s, (+s), then when the DOS like prompt shows, type in...
    applejack AUTO
    Then let it do all 5 of it's things.
    At least it'll eliminate some questions if it doesn't fix it.
    The 5 things it does are...
    Correct any Disk problems.
    Repair Permissions.
    Clear out Cache Files.
    Repair/check several plist files.
    Dump the VM files for a fresh start.
    As long as you don't have a USB connection in tandem with a UPS, which can cause problems. If so, disconnect it first.
    The other thing is to have a Cloned backup, Get carbon copy cloner to make an exact copy of your old HD to the New one...
    http://www.bombich.com/software/ccc.html
    SuperDuper...
    http://www.shirt-pocket.com/SuperDuper/
    Have a look at Synchronize! Pro X 6.0.5
    http://www.macupdate.com/info.php/id/6897/synchronize!-pro-x
    Or the most expensive one & my favorite, Tri-Backup...
    http://www.tri-edre.com/english/tribackup.html
    One other thing... OSX's Disk Utility is a poor cousin to dskfix on a PC, Your best bet on a Mac is DiskWarrior, but you'll need the CD/DVD...
    http://www.alsoft.com/DiskWarrior/
    Every Mac should come with it imho.

  • Again,HOW to conver a .class file into .java one?

    sorry , but Can't u send me a specific link for downloading this "Java decomplier"??
    coz I found my self in something called (jad decompiler) with lots of versions and this is confusing
    and Is that mean, that there's a decompiler which can convert the .class file into .java one?
    and thanks alot man.....u help me always!
    (I'm still begginner in java)

    Just to emphasise what yawmark said...
    Decompiled java code is NEVER going to be as clear as well-written original java source code. The decompiler can see what the compiled code does but not why or what it means, so the source code that the decompiler produces is going to be ugly and hard to read. Decompilers are really only useful for experienced programmers who know what to infer, how to read between the lines...
    If you need help writing something, then you're better off looking at tutorials. In tutorials the code will be well-commented.

  • My server still taking old class file

    Hi,
    I have got a J2EE application.
    In that I have to modify a Java file.
    I made the required changes and check it in the local test environment and find that it is working fine and the changes are reflecting in my application.
    Then I copied the class file in the main server and deploy the server(i m using oracle9i server) .
    After successful depletion ''THE CHANGES WERE NOT REFLECTED IN THE APPLICATION ".
    I found the latest class file is copied in the application(checked the class file using D-Complier).
    MY PROBLEM IS : WHY THE SERVER IS NOT TAKING THE LATEST CLASS FILE ??
    IS THERE ANY PROBLEM OF WEB-CACHING ??
    kindly advise how can i rectify it.
    keep smiling.....
    Debasis

    The last response is correct. You have to stop the server and start it again to reflect the changes in the class file. Only the JSP files can be changed dynamically while server is running as the container compiles it if there is any change in the file. All other files need a server restart.
    Thanks

  • How to edit a ".class" file?  Anyone?

    I hope someone can help me with this...
    Someone gave me a class file to put into my applet. However, I'm wanting to go into the class file and change a few things around. However, I've done just about everything to try to find a way to go into the code of this file to do some changing, and I can't find anything to do it with! I've tried Netbeans and Visual Studio .NET, but it doesn't work. Maybe I'm doing something wrong. Does anyone know how to go into the class file and change it?
    thanks soo much..

    Someone gave me a class file to put into my applet.
    ... Does anyone know how to go
    into the class file and change it? And why can't you ask "someone" for the source? Or ask them to modify it for you?

  • How to call a class file in a jsp without deploying anything in j2ee

    Hi,
    I am new in J2EE. I have some jsps, which I configured using web.properties(documentroot=c:/jsp/). I am able to get
    those pages by the web browser. I have some import statements in some jsps, now I
    am trying to access those page but it is failing, it says
    org.apache.jasper.JasperException: Unable to compile class for
    JSPD:\j2sdkee1.3\repository\pradip\web\_0002fLogin_0002ejspLogin_jsp_0.java:1:
    Class com.gui.UPMGuiGlobalConstants not found in import.
    import com.gui.UPMGuiGlobalConstants;
    Actually I have not deployed any class file or jsps.. Now my question is can I access
    these jsps without deploying anything, like can I put my .jar file in any j2ee
    directory(like lib or anywhere else, I already tried after putting in /lib) and restart the
    j2ee and use it. So how can I call a class file from a jsp without any kind of
    deployment?
    Please send me the reply as soon as possible.
    Regds,
    Pradip

    After you put the jar containing the class to import into the WEB-INF/lib directory, you still need to include it in the jsp.
    Putting the jar into the lib dir, will make it available to the vm, but as in any other java class, you still need to import it into the class, that the jsp will be compiled into.
    And you do that by putting
    <%@page import="com.gui.UPMGuiGlobalConstants" %>somewhere near the top of your jsp. (well you don't need to put it there, but it good style ;)
    That should do it.

  • Thiz iz Urgent..........How to convert a .class file to a .java file

    Hi Everybody,
    I want to convert back a .class file (a compiled servlet) into .java (source code) file. How do I do it???
    Note using javap has not been of any help.
    Thanks in Advance
    Rajib

    Why don't you look at this thread:
    http://forums.java.sun.com/thread.jsp?forum=31&thread=143500
    If thats not enough, try searching all the forums for:
    "convert .java .class" That'll give yu a bunch of other threads...
    Sjur

Maybe you are looking for

  • Two business rules runtime errors

    Hi, The business rules looks very nice but I got two runtime errors, The first I have to deploy twice else I got a wdsl error 08/02/17 13:05:16 -------> CompositeDeployerTimer: deploying composites ... 08/02/17 13:05:16 --------->deploying composite

  • Can I restore an iPhone 5 backup on iTunes to an iPhone 4S?

    I had (still have) a 4S; I upgrade to the 5 on 10/25/12. I backed up my 4S and loaded that backup on to my 5 on 10/25/12, then I erased the 4S. Well, I just lost my iPhone 5 and I was able to restore my old 4S with the 10/25/12 back that I made (I mu

  • Mutual referenced for relationships and Java GC

    Hi, I apologize for so many questions in such a short period of time, but I am new to the TopLink product and just starting to accumulate experience. Hopefully in not so distant future I will start giving some of the knowledge back to the community :

  • SAP PRINT to WORD

    We have a requirement from Tanzania Government, Printing of document must be in readable format PDF/DOC which is to be processed via electronic signature device, so that all the values can be read then some digitial signature printing will be done. W

  • Control panel not showing up

    the control panel on my hp photosmart C8180 all in 1 printer will not come on and the printer is on. This question was solved. View Solution.