I am new to JSP and struggling with this issue. I created a Hello World page and worked fine. After I made some changes, I uploaded the new version of my index file several times. I have even deleted my index.jsp file from the server, along with the WEB-INF and META-INF folders. I've done this several times, even at shell level, yet when I visit the .JSP file in my browser, it's the same file. It will not update. In NetBeans IDE, I have built and ran my project and it works correctly, displaying the correct file. I've even opened the file in a simple editor first before uploading to make sure the build file was the new updated file and it is. So why after I upload it, does the same page exist? How is that possible?

I've cleared my browser cache, deleted history, everything I know to do. This is not behaving like any other programming language I've used before.

Recommended Answers

All 17 Replies

You need to restart the webserver i think (i had a similar problem but using IIS and ASP.NET and this solved it)

Correct me if I'm wrong, but doesn't that seem like a pretty serious action to do when uploading a new version of a file. I can stop and restart services for the server, but that does not fix the issue. Restarting the server is pretty much out of the question. Although I'm still developing, the main server is the same as the development. It would cause too many problems having to restart everytime I upload an updated file. Is there anything else that can be done?

Why when I delete the file I get a 404? Should it require a restart before that as well?

In work folder of your application/web server installation search for the Java and Class files generated earlier for your old JSP, try removing them. Put the modified JSP file in place, clean up your browser cache once again and try accessing the page.
Let me know if it helped.

Just For your reference, generated classes are generally kept at following places in two of the servers I have used:

  1. Tomcat - C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\shop\org\apache\jsp\JSP
  2. JBoss - D:\jboss-4.0.4.GA\server\default\work\jboss.web\localhost\shop\org\apache\jsp

Tomcat - C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\shop\org\apache\jsp\JSP

You should never mess up with Catalina directory on life server or you may pay dearly. Same apply to your local pc instalation...

Well I thought its not going to effect server settings. Would removing JSP generated classes, which again will get generated upon page access be so dangerous?

The only files I've uploaded to the server are the WEB-INF folder, META-INF folder, and index.jsp.
Inside the WEB-INF folder is:
/classes/ (empty)
/lib/
/lib/jstl.jar
/lib/standard.jar
web.xml

Inside the META-INF folder is:
context.xml
MANIFEST.MF

I have tried deleting all of these from the server and uploading them back. This doesn't seem to affect it, it still loads the old page.

Can you just rename old class and java files, for security sake, and try what I suggested in previous post. Am still pretty sure that even deleting those won't hurt your setup, but since Peter has raised a concern lets keep it in mind, and instead of deleting lets rename them, so that we can revert it back if something goes wrong.

I never run online Tomcat server just local installed plus the project on university server, but my teacher told me always to stop server throught Tomcat manager, do any changes you need, then Start server and do Reload. However this was only school project, I have no idea what you running and don't know what will happens if you try to do so...

The changes I suggested are not at all related to any server configuration changes. Since the java/class files get generated upon page access, if not found in work fold I don't think deleting them would be such a big deal.

Now, for restarting servers, I have 'n' number of experiences with some major companies in this world, that they generally don't allow server restarts without a planned maintenance. And for things like minor changes in JSP, I don't think restart is a good idea, though it will surely solve the issue, but I think the work around I suggested will probably resolve the matter.

So, now am just asking to follow the thumb rule of maintaining any live project on client's server - Don't delete anything, keep a backup, if something weird is witnessed, revert back your changes.

What say??

Ok, I don't know what happened, but somehow, this issue resolved itself. What I did was instead of upload the file as index.jsp, i uploaded it as index2.jsp. i've made modifications to that file and re-uploaded and it all seems to work fine. I don't know what was going on, but I'm glad it's working now. Thanks for all the help.

Its good that issue got resolved, if u want please try one thing, which might help u in learning JSP.

Get the generated java files for index.jsp and index2.jsp, and have a look at them, am pretty sure file index.java will not be containing the changes you did, for the reason, that new jsp file was never used, and the changes never got reflected in generated classes. Hence, you never saw modifications in effect. Now that you have created a new JSP file, a new class file with your changes was generated and modifications were on.

This might have solved the problem (which is awesome), but definitely doesn't help in learning process.

Well, actually no, I don't think the problem is solved. The problem lies somewhere on the server or something. Here's what I'm doing now.

Upload index.jsp
View index.jsp in browser
Modify index.jsp in Dreamweaver
Attempt to upload index.jsp via FireFTP.
SOMETIMES { Upload fails: Text file busy.
Rename local index.jsp to index2.jsp
Upload index2.jsp }
View page in browser
Repeat process.

Sometimes I do not get the Text file busy, which is why I thought my problem was fixed. Also, I no longer have the WEB-INF and META-INF folders. I just have a plain old hello-world .jsp file. What can I do to fix this behavior?

By the way, if I get the "Text file busy" message, then that filename is no-longer usable to me. Even if I telnet to the server and do a "rm index.php". If i ever tried to upload a new index.php, it would upload fine, but it would just display the old file without my changes. So I guess I'll just end up at index100.jsp until I can restart the server or find some other solution.

Seems like some permission issue on the folder at the server, which is not letting u overwrite some files, but it lets you add up new files (which is not at all a solution), please check with some IT guys or try logging through superuser and setting permissions to 777 (if your client permits), and repeat the steps.

Well, i don't think that is the case here. What I did was strip out any of the JSP code and am using a standard HTML file (.html). I have uploaded about 20 different versions since yesterday (all the same filename - index2.html) and hadn't had any problems. It's only when I use .jsp.

Tomcat 5.0 onwards support hot deployment that means any changes to your JSP pages will be reflected back once the request is made for that page again. Here, I mean changees made only to JSP pages will be reflected not to your servlets or Java beans. All you need to do is make some changes to the web.xml file of your webapp in the WEB-INF directory and get started. For more information refer to Tomcat documentation.

Tomcat 5.0 onwards support hot deployment that means any changes to your JSP pages will be reflected back once the request is made for that page again. Here, I mean changees made only to JSP pages will be reflected not to your servlets or Java beans. All you need to do is make some changes to the web.xml file of your webapp in the WEB-INF directory and get started. For more information refer to Tomcat documentation.

Hot deployment definitely works, but only when your development and deployment server are same. If you are developing locally and deploying on a remote server (which I think is the case here), I am sure hot deployment has nothing to do with this.

I shall recommend discussing this issues with some server administrator and let know that uploading files with .jsp extension are throwing "Text file busy" message in your ftp tool.

Googled the message and it returned quite an informative link:

http://lists.freebsd.org/pipermail/freebsd-current/2003-September/009972.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.