views:

39

answers:

3

Hey guys,

I'm having this problem in eclipse (EE) when I change things in my code (even something as simple as the text I'm printing using println) it doesn't get applied. I'm using JBoss and when I rerun the servlet, nothing happens.

Any idea how I can force JBoss/Eclipse to do this? I can't preview anything so it's really annoying if I want to test some new code.

Thanks!

+2  A: 

Eclipse publishes the newer versions of your application periodically (its called the automatic publish feature). Either the interval is too large, or you're not waiting sufficiently long enough for re-deployment, or automatic publishing of the application has been disabled.

Sometimes, despite ensuring the above, Eclipse might still not publish the newer classes, in which case you might want to perform a clean build, which causes the newly built classes to be loaded into JBoss.

Vineet Reynolds
How do I perform a new build? My automatic publishing feature is set at 15 seconds, so that can't be the problem. I also deleted my project from the server panel so it would be removed from JBoss but stil no difference when I run the servlet. When I refresh the servlet in a browser a second time however, I get "The requested resource (/BiblioWeb/BiblioServlet) is not available."
Sled
You can clean the project by inokving the following sequence: Project -> Clean, from the menu bar. However, if this turns out to be cumbersome, you're better off using a script (using Maven perhaps), that performs deployment of the app on JBoss. I must admit that the JBoss tools are probably not as squeaky clean as they appear to be. Quite a few people have reported the same issue in SO.
Vineet Reynolds
Oops, I forgot that you might find the "fingertouch" button useful: http://docs.jboss.org/tools/3.1.0.CR1/en/as/html/modules.html#d0e2634
Vineet Reynolds
Can't get the fingertouch to appear, but project->clean does the trick. thank you!
Sled
+1  A: 

Working on EJB deployed in JBoss with Eclipse IDE. We have ANT build file, in which first old project is deleted from JBoss, then compiling classes, & building proper directory structure & deploy as .ear - .sar again in JBoss directory.

Stop JBoss, run build file, start JBoss.

Its a good practice to have a build file to deploy project.

Nayan Wadekar
+1  A: 

Sorry to ask such a basic question: Do you save your changes before testing?

Eclipse uses its own compiler to check for syntax errors while you are editing, but you have to save the file before the edits take effect in the application.

I only ask because this could be confusing if you are new to Eclipse, having changed from a different IDE. File permission settings can also prevent your files from being saved or built.

richj