Can't setup remote debugging with JBoss Web 2.1.4 windows and eclipse - windows

I'm unable to find an option to setup remote debugging in JBossWeb 2.1.4 on Windows. It is not installed as a service and there are no .bat scripts where I can edit the JAVA_OPTS environment variable to include:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4142
The only thing in the jboss web bin directory are jbossweb.exe files.
I've tried editing the run configuration in eclipse to start the container by running jbossweb.exe and setting the environment variable JAVA_OPTS to the above, but it doesn't listen on port 4142 on startup (ie, there seems to be no effect in adding the environment variable to the run configuration).
Any ideas here?

If you control the server from eclipse with for instance JBoss Tools, you can just click "debug" instead of "start" in the Server pane in order to start up in debug mode.

You can create such bat script by yourself. Just add jboss.bat file to bin subdirectory of JBoss install directory and put there:
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4142 -jar "D:\JBoss.org\JBoss Web 2.1\bin\bootstrap.jar" start
When you run this script, you will get JBoss running in debug mode. Probably, it won't help you in all situations, but it worked for me.

Related

How to pass environment variable to Tomcat running as Windows service

I have an application installed in Tomcat that is invoked by the wrapper which sets an environment variable
set FOO=c:\foo
and invokes the startup.bat, and I have a requirement to run Tomcat as windows service.
So far, I tried to set the system environment variable, which did not help.
I tried following the windows service HOWTO appending ++Environment in the registry, so that
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat7\Parameters\ImagePath
looks like this
C:\Apache\Tomcat-7.0.64\bin\Tomcat7.exe //RS//Tomcat7 ++Environment=FOO=c:\foo
That did not help either.
Any suggestions, please
You were almost there. Replace the equal sign with a space in your tomcat7 command, and that should work.
I've just written this up on another question: Setting User Environment Variables for tomcat on Windows
I had to change --JvmOptions of the service.bat file then remove the service and re-install again.
--JvmOptions "-Dspring.profiles.active=pp;-Dcatalina.home=%CATALINA_HOME%;...."
I have a InstallService.bat file. In the file I am first creating the service without specifying the Environment variable and then I am updating the service with the Environment variable specified.This is how the bat file looks like.
tomcat8 //IS//CompassTomcat8_8080 --DisplayName="Compass Apache Tomcat 8:8080" --Install=%CATALINA_HOME%\bin\tomcat8.exe --Startup=auto
tomcat8 //US//CompassTomcat8_8080 --DisplayName="Compass Apache Tomcat 8:8080" --Install=%CATALINA_HOME%\bin\tomcat8.exe --Startup=auto --Environment=Key1=Value1;Key2=Value2
It has started working now.

How to start tomcat server manually

I installed tomcat 7 in my windows 7.Then ran C:\apache-tomcat-7.0.57\binstartup.bat,one window will open for 1 second and closes.when i hit http //localhost/8080 ,its not dsiplaying anything.I just checked C:\apache-tomcat-7.0.57\conf/server.xml and port is 8080.
Can somebody help on this.
Read RUNNING.txt and create C:\apache-tomcat-7.0.57\bin\setenv.bat file that sets JRE_HOME (or JAVA_HOME) path for Tomcat.
Sample from Tomcat 7 RUNNING.txt file using Java 6 JRE:
set "JRE_HOME=%ProgramFiles%\Java\jre6"
exit /b 0
You need to set Java_Home in Cataline.bat first in order to run TomCat server.
Additional Information for running project using Tomcat Server.
You can cd into the folder where tomcatXX/bin is through command line and run "run startup". So, when you , run startup on command line it tries to run script from startup.bat file, probably it crashed because port to be used by TomCat to run server is already in use. If you try to point your url to localhost:8080, if TomCat's home page appears, that would be because your server is already running. You should ideally also try to point to Windows -> Preference -> Runtime Environment. Check if Tomcat server is added in list under Server Runtime Environment window, if not try to add that server by clicking Add button, and trying to locate where Tomcat/bin is stored. If that still doesn't help, I would suggest you to also try right clicking a project on your IDE then click Run As, then click Run Configuration, it will give you option to run application using TomcatServer. List of servers will be found on left side of Run Configuration window.

Install Liferay as Windows 2012R2 service

I am a newbie on Liferay and furthermore 100% Windows infrastructure knowledge based. I installed Liferay 6.2 on my Windows 2012R2 server together with Java jdk-8u5 version. All is running perfect as long as I am logged in as user on the Server via remotedesktop having open the tomcat startup.bat window.
What have I to do exactly to start Liferay and/or tomcat as service?
Thanks in advance for your efforts.
Configuring liferay or tomcat to run as a service on a windows server doesn't differ that much.So in order to do that you have to add some files to the LIFERAY_HOME\tomcat\bin directory.
To get those files you have to download a full version of 64-bitWindows tomcat from here :
http://tomcat.apache.org/download-70.cgi.
Extract the zip and go to the bin directory, copy service.bat , tomcat7.exe and tomcat7w.exe to this location : LIFERAY_HOME\tomcat\bin
Setting Up the service
Open the commad prompt (Make sure you have admin rights or run the command prompt as administrator),In Command Prompt go to LIFERAY_HOME\tomcat\bin and Execute the following command
service.bat install tomcat7
This will install the tomcat6 service in windows.
Now execute following commond to setup additional configuration for the service
tomcat7w.exe ES tomcat7.exe
2 . Extra configuration :
-XX:MaxPermSize=512m
-Dfile.encoding=UTF8
-Duser.timezone=GMT
-Djava.security.auth.login.config="%CATALINA_HOME%/conf/jaas.config"
-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
and make sure to provide enough memory for your service by setting the initial memory pool and the maximum one.
Either go with Rafik Beldi's answer (quite an effort, wow) or just go to tomcat's documentation in case you're still missing some information
I had to delete what was in Java Options completely or it wouldn't start: and then I entered:
-XX:MaxPermSize=512m
-Dfile.encoding=UTF8
-Duser.timezone=America/New_York
-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
-Djava.net.preferIPv4Stack=true
note that where I am: America/New_York allows for both EST and EDT

tomcat debugging

I am working on a project where the backend code is in Java.
I want to debug this code and am running tomcat in the debug mode correctly .
I have the Java code in Eclipse where I set up a new debug config for Remote Java Application and start the debugging.It shows no error but it is not breaking at the breakpoint.
So the Tomcat Webapps folder has only a copy of the Servlet classes and my Java code is in a folder at some other place.
Is this the reason that I am not being able to link them properly
You have to start tomcat with the JPDA options in order to debug remotely. Under *nix, issue "catalina jpda start" instead of "catalina start".
If you want to do a remote debug to figure out a problem in code, then your code locally must be the same. Also remember to connect to the correct port, 8000, I believe.

How to enable remote debugging in JBOSS 5?

How do you enable remote debugging in JBoss 5? The usual line from JBoss 4:
set JAVA_OPTS= -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n %JAVA_OPTS%
As can be found in other answers like this do not seem to work. The server never suspends. Googling "jboss 5 remote debug" doesn't bring up anything in the JBoss docs. Did something change from JBoss 4? How can I remotely debug my JBoss 5 server from eclipse?
You have suspend=n in your options. Change this to suspend=y.
Or is the line you posted not the one you're using with JBoss?
We have to do 2 changes to debug remote java application that is running in JBoss
Configure in JBoss
Creating remote debugger in in eclipse
Open run.conf.bat(windows) or run.conf(Linux) file in JBoss bin folder.
go to the below lines
`# Sample JPDA settings for remote socket debugging`
#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n
and remove hash in JAVA_OPTS
# Sample JPDA settings for remote socket debugging
JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y
Restart the server if it is started.
2. In Eclipse, Run -> Debug configuration -> Remote Java Application and create a new.
Note that you have to give port that is mentioned in run.conf.bat file

Resources