简体   繁体   中英

JBoss server does not get changes

Eclipse Indigo Version: Indigo Service Release 1 Build id: 20110916-0149

JBoss 6.1.Final

I have a server which i have configured with some support, but it has broken down. Broken down means, even tough i; - stop the server, - clean and build projects in workspace, - and clean the server and publish from scratch, - and start the server again it responds like it has yesterday's code. I made lots of change but server seems not to be aware of changes.

If you have an advise on this issue, please provide.

Thanks

Try autodeploying your .war or .ear file manually, not using the Eclipse JBoss connector (which sometimes breaks down and acts strangely). Just copy the file to the autodeploy dir (for JBoss 6 i believe this is /server/default/deploy), check the JBoss's logs/console to see that your file is currently deployed, then delete it from there, and again check that the JBoss console confirms succesfully undeploying that application.

Now, that Eclipse JBoss connector is convenient because it lets you quickly deploy, debug, etc (even tho it has it's bugs). You can however to several things to simulate it's behavious without actually using it:

  • simplest one: Use Jetty: http://irc.codehaus.org/display/JETTY/Downloading+Jetty . Comes as Eclipse plugn, maven plugin, stand alone server. Jetty 8 supports servlet 3.0 so it's up to date. Deploying and debugging is fast and easy and it actually works (I use this a lot). Only downer: doesn't have EJB container.

  • Use tomcat 7 (stand alone install) and the Eclipse sysdeo plugin: http://www.eclipsetotale.com/tomcatPlugin.html . Allows for seamless deployment/debugging as you'd do with a Java SE application inside Eclipse. Again, the downer is no EJB container

  • If you really wanna use JBoss, try the following:

    • start in in debug mode all the time by adding this to your run.bat:

    set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n %JAVA_OPTS%

    • make your "target" project folder (the one where either Eclipse or Maven (whichever you use)) to be something like [jboss root]\\server\\default\\deploy\\myAppName

    • Start a "Remote Java application" debug session from Eclipse on the port 8787.

    With all this the project should deploy any changes you make on the fly, and stop at whatever breakpoints you have when execution reaches them. It's not awesome, as sometimes certain changes will not be taken into account (eg: if you modify the body of a method in a Java class it will be hot-deployed. If you add a new method it will not).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM