I am using tomcat5.0.28 windows installer , and it stopped in the middle of progress bar.
with the last message "using jvm: c:\java\j2sdk1.4.2_19\"
i wait for a long time, and it seems freeze, i have to kill the process.
I use process explorer to check the processes. i found a children process created by tomcat installer, i checked the property of this process, and found the command line is:
C:\TEMP\nse305.tmp\ns306.tmp "C:\Program Files\Apache Software Foundation\Tomcat5.0\bin\tomcat5.exe" //IS//Tomcat5 --DisplayName "Apache Tomcat" --Description "Apache Tomcat 5.0 Server -http://jakarta.apache.org/tomcat/" --LogPath "C:\Program Files\Apache Software Foundation\Tomcat 5.0\logs" --Install "C:\Program Files\Apache Software Foundation\Tomcat 5.0\bin\tomcat5.exe" --Jvm "$2"'
i copied this long command line, and try to run it in cmd windows, it show some tomcat install service message, then it freeze, the process does not return at all.
i think that is the problem, this children process does not return , which blocked the tomcat installation.
i downloaded the tomcat5.0.28 sourcecode and go to tomcat5.nsi file.(the install script file), and found it is trying to run this :
nsExec::ExecToLog '"$INSTDIR\bin\tomcat5.exe" //IS//Tomcat5 --DisplayName "Apache Tomcat" --Description "Apache Tomcat #VERSION# Server - http://jakarta.apache.org/tomcat/" --LogPath "$INSTDIR\logs" --Install "$INSTDIR\bin\tomcat5.exe" --Jvm "$2"'
looks like the installer use nsExec, a library to run the command .
i found C:\TEMP\nse305.tmp\ns306.tmp, and in the same folder, there is also a nsExec.dll file.
i compared the ns306.tmp with nsExec.dll. there is a little difference between them, only several byte, and 99% is same, so i think this tmp file is actually a variant of nsExec.dll.
i guess the nsis engine created this temp folder and temp file, and use it to run the command line, i am not clear how NSIS engine and NsExec do their job, but i think they don't work well this time in my pc, maybe it's my pc's problem.
but why this process never return? can anybody give me any clue ?
(i also tried to run tomcat6.0 installer, it works well, no problem)
Not sure if this is related, but I vaguely remember having issues with Tomcat when I installed it on a path which included empty spaces. ie. the space in between "Program" and "Files" in your Tomcat installation path in C:\Program Files... may be the cause for the issues.
I might be completely off the track though. Let us know if this helps though.
I agree with tim_wonil that the issue is probably a bad path somewhere.
As far as nsExec goes, .dll files are normally NSIS plugins and the nsExec plugin makes a copy of itself and patches that copy so it will run as a program and not a dll. You can find the nsExec source # NSIS SCM
Related
I’m a Jenkins newbie but really want to see how Jenkins can help me in our build pipeline. As a part of our requirement, we need to be able to invoke PowerShell scripts via the x64 instance. I've got Jenkins installed on Windows Server 2012 R2 and out of the box, the PowerShell plugin worked fine but via the x86 engine. As I’ve learned, by default, Jenkins uses the x86 version of Java. No problem. I’ve installed the x64 version of Java, modified Jenkins.xml to look like this:
<executable>C:\Program Files\Java\jre1.8.0_131\bin\java.exe</executable>
…and restarted the Jenkins service. The service restarts fine but the web interface is unresponsive. I’ve tried to reboot the entire server, set the JAVA_HOME system environment variable to C:\Program Files\Java\jre1.8.0_131 and uninstalled the x86 version of Java to no avail.
From what I've been reading, this works for most people but not for me. I've also looked at the jenkins.err.log and jenkins.out.log files to see any indication why I'm getting no response from the web interface and they have nothing in them.
Adam, I think your correct except the entry would require quotes. Here is what I have in my very PowerShell oriented Jenkins and all works as expected.
<executable>"C:\Program Files\Java\jre1.8.0_131\bin\java.exe"</executable>
64 bit Java and 64 bit PowerShell, as you require.
UPDATE:
Here is my scrubbed but accurate full jenkins.xml. I've never had to set JAVA_HOME, maybe something is picking that up and getting confused. Aside from altering the executable to an external JVM (64bit) and some --https* parameters added I've not done anything extraordinary to the config and like I said its been happily working for awhile.
<service>
<id>jenkins</id>
<name>Jenkins</name>
<description>This service runs Jenkins continuous integration system.</description>
<env name="JENKINS_HOME" value="%BASE%"/>
<!--
if you'd like to run Jenkins with a specific version of Java, specify a full path to java.exe.
The following value assumes that you have java in your PATH.
-->
<!--<executable>%BASE%\jre\bin\java</executable>-->
<executable>"C:\Program Files\Java\jre1.8.0_131\bin\java.exe"</executable>
<arguments>-Xrs -Xms1G -Xmx1G -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --webroot="%BASE%\war" --ajp13Port=-1 --httpPort=-1 --httpsPort=8443 --httpsListenAddress=192.0.0.192 --httpsKeyStore=C:\MyJavaKeyStore.jks --httpsKeyStorePassword=PasswordToSaidJKS</arguments>
<!--
interactive flag causes the empty black Java window to be displayed.
I'm still debugging this.
<interactive />
-->
<logmode>rotate</logmode>
<onfailure action="restart" />
</service>
You might try un-commenting the <interactive /> node to see what errors might be thrown but possibly not logged.
There is a workaround , you can use the Execute Windows batch command instead of Windows powershell and call the x64 powershell like below
"C:\Windows\SysNative\WindowsPowerShell\v1.0\Powershell.exe" -ExecutionPolicy ByPass -noprofile -file "<Folder Path of file>\Psscript.ps1" -<Parameter> "<Parameter value>"
I ended up just getting frustrated and copying the x64 JRE into the C:\Program Files (x86)\Jenkins\jre folder and everything worked.
I updated the windows firewall "allowed executable" in the programs/services tab from the exe in the Jenkins directory to the new java.exe in the 64 bit directory.
I noticed that if I ran Jenkins in localhost:8080 on the remote machine, everything ran fine. Only remote machines couldn't connect.
I downloaded the Carrot2 Document clustering server build 3.15.0 for Mac. The read me file says:
The DCS requires a Java Runtime Environment (JRE) version 1.7.0 or later. To
run the DCS, execute the 'dcs' script and point your browser at
http://localhost:8080 for further instructions.
Mac OS Sierra doesn't make it easy, but I got 1.8.0_112 installed.
The problem is that I don't know how to execute the 'dcs' script.
There are .cmd, .sh, .war, and .jar files. I wasn't sure which of those to work with. I thought .jar looked promising, so I followed some of this thread and tried this in a terminal window:
java -jar invoker.jar
I cd-ed to the correct directory, but it just says Provide main class, but I'm not sure what or where that is.
Can anybody provide instructions or a link to how to do this?
Use the dcs.sh (on Linux/Mac) and dcs.cmd (on Windows) to start the server. The scripts will set some extra options for the JVM and then start the DCS. In case of any problems, append the -v option to see diagnostic output.
I'm trying to determine the Tomcat install directory when it is started from startup.bat in Windows.
It is easy enough to determine where tomcat7.exe is running when Tomcat is running as a service, but I'm not sure how to do it when it's started with the script. I know java is running when Tomcat is started from the script, but the executable path is for the java jre. Is there something I can do to find where catalina is running based on java?
Assuming you know the location of startup.bat, then just go two folders above and you're done.
Assuming you only have a shortcut to this file, then you would need to retrieve a list of processes explaining the application and the location of the files they're using, similar like ps aux command from Unix based OSes. Fortunately, Windows have such thing as well. From this great Q/A: Is there a command in Windows like ps -aux in UNIX?, more specifically, this answer, the way to find the location of tomcat in Windows is to execute the wmic application (through CMD if you want) and write process command, this will provide a list of the current applications running and their parameters. For example, I initialized Tomcat from startup.bat file and got this result using the commands above (single line):
java.exe "C:\Program Files\Java\jdk1.7.0_40\bin\java" -Djava.util.logging.config.file="<TOMCAT_HOME>\conf\logging.properties" -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs="<TOMCAT_HOME>\endorsed" -classpath "<TOMCAT_HOME>\bin\bootstrap.jar;<TOMCAT_HOME>\bin\tomcat-juli.jar" -Dcatalina.base="<TOMCAT_HOME>" -Dcatalina.home="<TOMCAT_HOME>" -Djava.io.tmpdir="<TOMCAT_HOME>\temp" org.apache.catalina.startup.Bootstrap start
Here's the same result but splitted in several lines to ease readability:
java.exe "C:\Program Files\Java\jdk1.7.0_40\bin\java"
-Djava.util.logging.config.file="<TOMCAT_HOME>\conf\logging.properties"
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.endorsed.dirs="<TOMCAT_HOME>\endorsed"
-classpath "<TOMCAT_HOME>\bin\bootstrap.jar;<TOMCAT_HOME>\bin\tomcat-juli.jar"
-Dcatalina.base="<TOMCAT_HOME>"
-Dcatalina.home="<TOMCAT_HOME>"
-Djava.io.tmpdir="<TOMCAT_HOME>\temp"
org.apache.catalina.startup.Bootstrap start
Note: I've replaced the real path by <TOMCAT_HOME> in the results from above.
TL;DR do this:
Open cmd
Execute wmic
Execute process
Wait few secs and search java.exe and the arguments containing Tomcat jars.
Since you explicitly mentioned *.bat and Windows here is your answer.
1.Most tomcat application comes as a zip instead as msi/exe . The place where you extract is actually its locations . You start the application by clicking startup.bat file
2.Open the bat file with notepad . You will also find the relative path of the application.
3.Look for the path variables .
Hope this information helps
In many materials about tomcat what I've looked I saw that authors uses exeternal batch script for start and stop tomcat.
I didn't see information about wrting this script. I think this script provided by tomcat.
I used exe file for installing my tomcat 7 on my windows 7. In tomcat directory I search startup.bat. This file is missed.
Can you help me?
It should be in the /bin directory. If you're missing this file possibly it means that you have installed Tomcat using Windows Installer. Try to download appropriate .zip archive, I believe that you will find startup script there.
I was puzzled by this - windows people need to script too!
However I think it is because tomcat gets installed as a service with a manager. If you want to start and stop it without using the manager you start and stop the service directly.
You can do this by typing (in an admin command prompt)
net start tomcat7
and
net stop tomcat7
Though it would be everywhere, still if you download the zip from their site, you can follow these instructions - http://www.ntu.edu.sg/home/ehchua/programming/howto/Tomcat_HowTo.html
bin\startup.bat is for windows & .sh is for Unix.
Have you checked bin directory under Tomcat instalation dir? It should containt *.bat for start and stop server etc.
If you want to start Tomcat server by using startup.bat and you are unable to find it(that's because installer does not have it, you can only see it if you download and run .zip this will show startup.bat explicitly https://www.screencast.com/t/RMPCq5eJre3),
So to solve the issue just go to C:\Program Files\Apache Software Foundation\Tomcat 7.0_Tomcat7\bin and double click Tomcat.exe, a command prompt like screen will appear this is the the same as clicking startup.bat script. Hope this helps
Sorry if repost
I’m new to JSP. I’m following a tutorial from a book, but I’m facing a problem in one of the first steps of the example web app.
I’ve installed the Tomcat 6.0, and this is it’s full path:
C:\Program Files\Apache Software Foundation\Tomcat 6.0
The book says that to start Tomcat, I must cd into the Tomcat home directory and run bin/startup.sh, but since there is not any startup.sh file into bin folder, I do bin/tomcat6.exe.
I don’t know If that is right, but Tomcat seems to start correctly that way.
But here is the problem : I created a folder (named Beer-v1) with an HTML form inside (form.html), and I placed everything into the already existing folder webapps.
This is the full path of the html file:
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\Beer-v1\form.html
So I type in my browser: http://localhost:8080/Beer-v1/form.html , but the page “503 Service Temporarily Unavailable” is displayed, and not the form.html.
What am I doing wrong?.
Please help.
Thanks in advance.
The book says that to start Tomcat, I
must cd into the Tomcat home directory
and run bin/startup.sh, but since
there is not any startup.sh file into
bin folder, I do bin/tomcat6.exe.
If you don't have TOMCAT_HOME/bin/startup.bat which should be used for Windows instead of startup.sh for Unix/Linux, but have tomcat6.exe and tomcat6w.exe, then you've probably installed Tomcat through an installer.
What you need to do, is on the system tray, find the tomcat logo, right-click on it and start it.
Alternatively, run Services.msc (from windows Run) and start Apache Tomcat 6 service.