User Tools

Site Tools


java:hotdeploymenteclipse

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
java:hotdeploymenteclipse [2014/05/17 20:08] rlunarojava:hotdeploymenteclipse [2014/05/19 09:41] rlunaro
Line 74: Line 74:
 === Jboss 5 and Windows XP === === Jboss 5 and Windows XP ===
  
-Working on it...+Assumed you have the configuration of your project as described before, the only thing you have to do is create the symbolic link. 
 + 
 +For this example, I've have my Jboss installation under ''c:\jboss'', and I will refer it as JBOSS_JOME.  
 + 
 +To make the symbolic link you need first to install ''junction'' command, where you can get it [[http://technet.microsoft.com/es-es/sysinternals/bb896768.aspx|here]]. 
 + 
 +After installing, you should issue a command like this:  
 + 
 +<code> 
 +junction "JBOSS_HOME\server\default\deploy\myTest.war" "c:\workspace\myTest\WebContent" 
 +</code> 
 + 
 +== Start the business == 
 + 
 +The only thing you have to do to start the application is the following:  
 + 
 +  * Please, before of everything, remove all the "servers" in eclipse: remember that running the application through eclipse will spoil everything because eclipse will try to overwrite the deployment directory, and because it is the same directory as your webContent directory, everything will be mixed up and spoiled. You have been warned.  
 +  * Start the Jboss application server, manually, ''JBOSS_HOME/bin/run.bat''. It is a good measure to have a look to the logs, you can issue a ''tail -f LOGFILE'', but the detailed instructions are for another chapter 
 +  * Start your eclipse application: you can easily verify that every change in the application is reflected instantly in the Jboss directory and Jboss redeploy automagically your application reflecting every change 
 + 
 +== Debugging == 
 + 
 +**You can also debug your application.** To do so, edit the file ''JBOSS_HOME\bin\run.conf.bat'' and add the following line:  
 + 
 +<code> 
 +rem # Sample JPDA settings for remote socket debugging 
 +set "JAVA_OPTS=%JAVA_OPTS% -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" 
 +</code> 
 + 
 +This will make Jboss to hear from the port 8000 for debugging interruptions. Who will interrupt JBoss?? Properly configured, eclipse will do.  
 + 
 +In your eclipse click on run -> debug configurations. Under "Remote Java application" click on "new": 
 + 
 +{{:java:20140519_1.png|}} 
 + 
 +Configure it with the apropiate values (remember, port 8000) and you will have an entry like this: 
 + 
 +{{:java:20140519_2.png|}} 
 + 
 +Whenever you want to debug your application you only have to start the remote debug option you have createdThis will make your application to stop in the step points you have set
  
 === Tomcat 6 and Linux ===  === Tomcat 6 and Linux === 
Line 92: Line 131:
 Every time you want to run your application the only thing you have to do is:  Every time you want to run your application the only thing you have to do is: 
  
-  - Start Tomcat+  - Start Tomcat ($TOMCAT_HOME/bin/start.sh, **Don't use** the "start server" button on eclipse)
   - Start eclipse (Remember!!!! **Don't use** de Run as -> run on server facility of eclipse or you will ruin your project   - Start eclipse (Remember!!!! **Don't use** de Run as -> run on server facility of eclipse or you will ruin your project
  
 And that's it, because everytime you make a change in a class, or in a web page, it will be reflected automatically in tomcat.  And that's it, because everytime you make a change in a class, or in a web page, it will be reflected automatically in tomcat. 
  
 +== Debug: Things you have to do the first time ==
  
 +You can debug your application, also. For debugging your application, you have to run Tomcat with the remote debugging facility enabled. To do so, you have to add the following line to the java start parameters:
  
 +<code>
 +-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
 +</code>
  
 +I've opened the file ''$TOMCAT_HOME/bin/catalina.sh'' and I've located the following line: 
  
 +<code shell>
 +if [ -z "$LOGGING_MANAGER" ]; then
 +  JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
 +else
 +  JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER"
 +fi
 +<code>
  
 +and added the following:
  
-~~DISQUS~~+<code shell> 
 +JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
  
 +if [ -z "$LOGGING_MANAGER" ]; then
 +  JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
 +else
 +  JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER"
 +fi
 +</code>
 +
 +And start Tomcat.
 +
 +**For debug in eclipse,** open the "Debug configurations..." option:
 +
 +{{ :java:20140517_1.png?direct&400 |}}
 +
 +And select "Remote Java Application" and then "New":
 +
 +{{ :java:20140517_2.png?direct&400 |}}
 +
 +And fill it with the following data: 
 +
 +{{ :java:20140517_3.png?direct |}}
 +
 +
 +
 +
 +
 +
 +
 +~~DISQUS~~
  
  
java/hotdeploymenteclipse.txt · Last modified: 2022/12/02 22:02 by 127.0.0.1