user393964
user393964

Reputation:

Eclipse and JBoss not refreshing or rebuilding

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!

Upvotes: 6

Views: 7591

Answers (3)

richj
richj

Reputation: 7529

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.

Upvotes: 1

Nayan Wadekar
Nayan Wadekar

Reputation: 11602

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.

Upvotes: 0

Vineet Reynolds
Vineet Reynolds

Reputation: 76709

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.

Upvotes: 4

Related Questions