10 Replies Latest reply on Mar 13, 2015 5:07 PM by apexlars

    JBoss is caching JSPs and not detecting changes

    scotthendo

      Hi guys, after a lot of snooping around I am 99% certain that JBoss is caching my JSPs but it is not detecting changes that I have made to them, so when I make some changes and deploy, its using old versions. I noticed that JBoss is adding a .java and a .class file for each JSP that I modify in my \jboss-4.0.5.GA\server\all\work\jboss.web\localhost\ directory. Its also creating a tmp folder in my \jboss-4.0.5.GA\server\all directory.

      Can anyone suggest a solution? Is it possible to disable JBoss-Cache??

      I am using JBoss 4.0.5.GA on Windows XP SP2.

      Thanks in advance for any help, Scott

        • 1. Re: JBoss is caching JSPs and not detecting changes
          jaikiran

           

          "scotthendo" wrote:
          Hi guys, after a lot of snooping around I am 99% certain that JBoss is caching my JSPs but it is not detecting changes that I have made to them, so when I make some changes and deploy, its using old versions.


          Scott,

          How is your application deployed? Is it a war file or an ear? And is it deployed as an archive or in exploded format (as an directory)? And how do you change the jsps? I have been using JBoss and i havent seen an issue where JBoss does not detect changes to my jsps.



          • 2. Re: JBoss is caching JSPs and not detecting changes
            scotthendo

            Hi Jaikiran, thanks for your reply.

            MY application is deployed as an ear file in the \jboss-4.0.5.GA\server\all\deploy directory and I am using eclipse to edit all my JSPs and Java files.

            I have been using JBoss alongside eclipse for the past 2 and a half months without any problems what so ever and now this has happened out of the blue.

            Regards, Scott.

            • 3. Re: JBoss is caching JSPs and not detecting changes
              jaikiran

               

              "scotthendo" wrote:
              I am using eclipse to edit all my JSPs and Java files.


              Scott, i don't use Eclipse (or any other IDE) for my applications on JBoss. Sorry, i wont be of much help here. Maybe someone familiar with Eclipse integration with JBoss might be able to help.


              • 4. Re: JBoss is caching JSPs and not detecting changes
                peterj

                Based on your file naming convention, I assume you are using Windows. Windows has some rather strange file locking issues. Here is what I think is happening. The last time you updated the JSP successfully, and JBossAS noticed that and updated it, for some reason Windows kept the file locked. Then when you made the update in Eclipse and deployed it, Windows noticed the file was still locked so it semi-deleted the old JSP, keeping it available for JBossAS, which still sees the old copy and not the new copy. Not until you reboot JBossAS will Windows release the old JSP and fully delete it. Wierdnesses like this can be affected by Windows updates, and possibly even Java updates.

                • 5. Re: JBoss is caching JSPs and not detecting changes
                  scotthendo

                  Thanks for your help Peter.

                  Unfortunately not even restarting JBoss does anything but I have found that if i delete my jboss-4.0.5.GA\server\all\work directory then hit refresh on my browser it will notice the changes but this is still not the best solution as from time to time it wont let me remove the work folder as it is in use so then I need to restart my JBoss. Hmm frustrating, might have to start using Linux after all!

                  • 6. Re: JBoss is caching JSPs and not detecting changes
                    scotthendo

                    Hey guys I figured out the problem.

                    Now the problem is that the Australian Government are a bunch of morons. What they did is they decided to push daylight savings back a week resulting in chaos for our airlines and public transport and apparently also for JBoss.

                    So this meant that JBoss was not picking up the changes to my JSPs as the time was all screwed up(even though for some reason my system clock was fine). So in the end all I had to do was uncheck the 'Automatically adjust for daylight savings' option in windows.

                    Regards, Scott

                    • 7. Re: JBoss is caching JSPs and not detecting changes

                      that's why servers should always be set to use UTC internally rather than local time.

                      • 8. Re: JBoss is caching JSPs and not detecting changes
                        peterj

                        You might also want to check that you have the latest timezone info for your JVM. See http://java.sun.com/javase/timezones/DST_faq.html, items 12, 13 and others related to TZUpdater.

                        • 9. Re: JBoss is caching JSPs and not detecting changes
                          scotthendo

                          Thanks guys

                          • 10. Re: JBoss is caching JSPs and not detecting changes
                            apexlars

                            Thanks - fixed a "bug" we've been trying to find all week.