Changes to the jivelive.jsp are not being reflected on Fastpath webchat service.


I am attempting to modify my jivelive.jsp file in my OpenFire webchat directory so I can use a text link instead of an image for my webchat service on our website. However, no matter what changes I make to the file, it is not reflected on the server when I go to load the JSP file in a web browser. If I restart OpenFire, the file is replaced with an original copy. I had read a few things stating that the webchat.war file needs to be recompiled with these changes to the .jsp but I'm not sure if that's even possible. I have already attempted to extract the .war file, change the .jsp, and recreate the .war file which seems to load just fine in OpenFire, but the jivelive.jsp still shows as the original when I browse to it in a browser. Any help is appreciated.

Thank you
OAC TechnologyProfessional NerdsAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

mrcoffee365Connect With a Mentor Commented:
The way servlet engines work is that the .jsp files are converted to .java files and compiled.  The produced .class file is loaded by the classloader into memory.  This can be done without writing anything to disk, which is possibly what jetty is doing.  You might find it educational to check tomcat's \work\Catalina\yourdomainhere\_\org\apache\jsp directory to see the .java and .class files.  That is what has to be produced, and then loaded by the classloader, for changes in the .jsp file to have any effect.

Unfortunately, amit_n_panchal was completely wrong that your solution was to rebuild and redeploy the .war file.  The solution can be incorporated into rebuilding and redeploying the war file, but until you solve the problem, rebuilding and redeploying will not change anything.

You need to look for the jetty configuration (I've mentioned this above) to see what this configuration is doing.  Set the flag that saves .java and .class files to disk -- that will help you debug the problem.

You will probably need to read the jetty documentation for all of this.  But you can start by looking for the webdefault.xml for your app.  Plus the webdefault.xml for your war, which you'll need to overwrite or make sure that it is not used.  Since the war is not your code, that might be difficult.

I need to warn you again that you are choosing to edit a 3rd party war file, which means that every time you deploy it or get an update to it, you'll have to modify it, make sure that the changes are recompiled, and deploy it.  Most people don't do this because of the maintenance headaches.  And of course the configuration headaches you're seeing here.

Jetty's jsp compiler changed in version 2.2 to use the jvm's compiler, which does not write out the classes unless you explicitly set the init-param "saveBytecode" for the jsp servlet.

Make sure when you're adding that init-param to the jsp servlet that if you edit $JETTY_HOME/etc/webdefault.xml you need to ensure that file is applied to your webapp (by default it is not - the webdefault.xml inside the jetty-webapp jar is used instead) by calling setDefaultsDescriptor() on your context.

By the way -- are you fully stopping and starting the jetty instance?  The classloader might hold your changed jsp's class in memory even if you have changed the jsp file and regenerated the class file.  Redeploy can be done such that only a single webapp is reloaded, which might not be enough to get the old compiled jsp out of your web server's stack.  It should be, but jetty is its own little world, so they might have decided to handle the behavior differently.
mccarlIT Business Systems Analyst / Software DeveloperCommented:
I don't have experience with OpenFire (only with Tomcat) but I am guessing that it too would have some sort of "temp" or "work" directory like Tomcat. You may need to clear out any files in there too, as OpenFire might be caching the compiled version of your JSP and not updating that cache when you change the JSP. It is a bit of a guess going on the llimited info.
OAC TechnologyProfessional NerdsAuthor Commented:
Apparently the new version of OpenFire uses Jetty. This was working perfectly fine under Tomcat before the update
Never miss a deadline with

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

It is likely that your tomcat instance automatically recompiled jsp files on any change to the file, and your jetty instance does not.

The most likely reason you're not seeing the changes is that the .java/.class files generated from the .jsp file are not being regenerated and reloaded by jetty.  You also could be editing the wrong .jsp file, but let's assume that you have found the right .jsp file to edit.

So -- you can go into the working directory of the jetty instance and remove the .class and .java files for your changed .jsp, and that should force jetty to recompile and reload.

If jetty does not automatically reload changed class files (we don't know what your settings are), then you might have to stop and start jetty after you force the regenerate and recompile of the .java and .class files.

There is probably a flag in the jetty configuration which you can set so that it will do this automatically on file change, just the way tomcat does.  You could look for that.

Warning:  since the .jsp file is in a war, the next time you update the war (or re-expand it from the original .war file) your jsp changes will go away.

In order for the war to have your changes, you have to replace the .jsp/.java/.class files in the war itself.

If you are getting a 3rd party war, then you'll need to make this change every time you get a new version of the 3rd party war.
Amitkumar PSr. ConsultantCommented:
agree with mrcoffee365.

Rebuild entire war file again and redeploy it.
OAC TechnologyProfessional NerdsAuthor Commented:

I've tried to rebuild the entire war file and redeploy it with the changed files and I'm not finding any .class or .java files in the WAR file or in the directory. When I browse to the open fire plugins /webchat directory, the jivelive.jsp file has the modifications I have made to the jivelive.jsp in the .war file, but even when I reboot the server I am not seeing the changes reflected when I browse to that file in a web browser. I've done a system-wide search and that is the only jivelive.jsp file on the system and there are no .class or .java files. Any other ideas on this? Not sure what's going on.
Amitkumar PConnect With a Mentor Sr. ConsultantCommented:
I found a good link to that will help you to figure the temp directory out.
All Courses

From novice to tech pro — start learning today.