XAMPP Control Panel & Tomcat - 2 Startup Problems

Problems with the Windows version of XAMPP, questions, comments, and anything related.

XAMPP Control Panel & Tomcat - 2 Startup Problems

Postby Pryath » 15. December 2012 16:40

Hello,

I'm experiencing two problems when attempting to start the Tomcat service with XAMPP:
1. The directory which "\XAMPP\catalina_start.bat" attempts to load tomcat from is "\XAMPP\tmp\tomcat" instead of "\XAMPP\tomcat"
2. After moving the tomcat directory to "XAMPP\tmp\", the file "\XAMPP\tmp\tomcat\catalina_start.bat" hangs.

System Background Information:
-Windows 7 64-bit
-All Visual C++ versions (from 2005 to 2012), both 32-bit & 64-bit (if applicable), are installed.
-FULL UAC enabled
-XAMPP Control Panel is set to run as administrator
-XAMPP CLEAN installation to folder C:\Programming\XAMPP
-Using XAMPP Control Panel v3.1.0 (latest)
-JRE/JDK 32-bit installed in "C:\Programming\Java\x86" in jre7/jdk1.7 respectively
-JRE/JDK 64-bit installed in "C:\Programming\Java\x64" in jre7/jdk1.7 respectively
-It appears XAMPP is defaulting to the 64-bit version.

These posts are relevant:
1. http://community.apachefriends.org/f/viewtopic.php?f=16&t=51780#p199317
2. http://community.apachefriends.org/f/viewtopic.php?f=16&t=49483&start=15#p190855

I tried changing the code in "\XAMPP\catalina_start.bat" to what was described in thread #1, but it didn't work. I had to move tomcat into XAMPP\tmp\
I attempted the steps in post #2, but it didn't help either.

Problem #1

CMD output:
Code: Select all
[XAMPP]: Searching for JDK or JRE HOME with reg query ...

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit
    CurrentVersion    REG_SZ    1.7

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.7
    JavaHome    REG_SZ    C:\Programming\Java\x64\jdk1.7
    MicroVersion    REG_SZ    0

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.7.0_10
    JavaHome    REG_SZ    C:\Programming\Java\x64\jdk1.7
    MicroVersion    REG_SZ    0


[XAMPP]: Using JDK

[XAMPP]: Seems fine!
[XAMPP]: Set JAVA_HOME : C:\Programming\Java\x64\jdk1.7
[XAMPP]: Set CATALINA_HOME : C:\Programming\XAMPP\tmp\tomcat

The system cannot find the path specified.
The system cannot find the path specified.
done.
Press any key to continue . . .


Problem #2
It appears as though the service switches to "running", but the CMD window stays open as the bat file hangs. If I close the window, the service stops running.

Conrol Panel output:
Code: Select all
10:27:37 AM  [Tomcat]    Executing "c:\Windows\sysnative\cmd.exe" "/c "c:\programming\xampp\catalina_start.bat""
10:27:39 AM  [Tomcat]    Status change detected: running


CMD output (Part 1):
Code: Select all
[XAMPP]: Searching for JDK or JRE HOME with reg query ...

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit
    CurrentVersion    REG_SZ    1.7

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.7
    JavaHome    REG_SZ    C:\Programming\Java\x64\jdk1.7
    MicroVersion    REG_SZ    0

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.7.0_10
    JavaHome    REG_SZ    C:\Programming\Java\x64\jdk1.7
    MicroVersion    REG_SZ    0


[XAMPP]: Using JDK

[XAMPP]: Seems fine!
[XAMPP]: Set JAVA_HOME : C:\Programming\Java\x64\jdk1.7
[XAMPP]: Set CATALINA_HOME : C:\Programming\XAMPP\tmp\tomcat

Using CATALINA_BASE:   "C:\Programming\XAMPP\tmp\tomcat"
Using CATALINA_HOME:   "C:\Programming\XAMPP\tmp\tomcat"
Using CATALINA_TMPDIR: "C:\Programming\XAMPP\tmp\tomcat\temp"
Using JRE_HOME:        "C:\Programming\Java\x64\jdk1.7"
Using CLASSPATH:       "C:\Programming\XAMPP\tmp\tomcat\bin\bootstrap.jar;C:\Pro
gramming\XAMPP\tmp\tomcat\bin\tomcat-juli.jar"
Dec 15, 2012 10:27:38 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performanc
e in production environments was not found on the java.library.path:

It then lists all of my directories in my C:\Programming folder (not sure why). I removed it because it's irrelevant.
CMD output (Part 2):
Code: Select all
Dec 15, 2012 10:27:39 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Dec 15, 2012 10:27:39 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Dec 15, 2012 10:27:39 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 506 ms
Dec 15, 2012 10:27:39 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Dec 15, 2012 10:27:39 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.30
Dec 15, 2012 10:27:39 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Programming\XAMPP\tmp\tomcat\webapp
s\docs
Dec 15, 2012 10:27:39 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Programming\XAMPP\tmp\tomcat\webapp
s\examples
Dec 15, 2012 10:27:39 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Programming\XAMPP\tmp\tomcat\webapp
s\host-manager
Dec 15, 2012 10:27:39 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Programming\XAMPP\tmp\tomcat\webapp
s\manager
Dec 15, 2012 10:27:39 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Programming\XAMPP\tmp\tomcat\webapp
s\ROOT
Dec 15, 2012 10:27:39 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Dec 15, 2012 10:27:39 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Dec 15, 2012 10:27:39 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 594 ms


Once again, this is a CLEAN installation of XAMPP.
Would appreciate any advice on these issues.

Another interesting thing to note:
The bat files appear to be executed without administrator privledges (my CMD screen text color is different for admin & non-admin CMD). I know that bat files can be run as administrator by setting a shortcut to them, then forcing that shortcut to execute as an administrator. Just throwing that out there; don't know if it really has anything to do with these problems.
Pryath
 
Posts: 5
Joined: 15. December 2012 16:06
Operating System: Windows 7 64-bit

Re: XAMPP Control Panel & Tomcat - 2 Startup Problems

Postby JonB » 16. December 2012 15:04

In general I can explain a few things -

Tomcat is a Java instance (I know 'doh', right?) - that makes it different that almost everything else on your machine.

Java's 'big deal'(s) are (roughly)

A. its a 'sandbox' - it is effectively walled off from the OS (you could say its a Virtual Machine).

B. As a result/along with A., this makes Java cross platform. Because Java is 'walled off' OS issues are a little different. OS tools can't peer in very well, so monitoring Java instances via usual methods is difficult. About the only OS issues that need to be addressed are the firewall and if the user has the proper NTFS permissions.

C. The CMD Window needs to 'remain open' (AFAIK) because that is the Java executable's 'instance' (Java is not a service, its an executable). Tomcat is a Java-based Application Server that runs 'over' the Java engine (much like IIS [also an application server] runs over Windows). The 'java programs' you would create are actually applets that run totally on Java. There were versions of XAMPP that used a command line instance to run the XAMPP Control Panel (also an executable).

D. I have not given it a go in production mode, only tested it, but the 'catalina_service.bat' is fairly new and intended to install Tomcat as a Service. I don't think its working right. If you want to debug it, find this:

:ENDERROR
exit 1

Delete the exit 1 statement - it causes the Command Processor to close, and sets the error code to 1 (true=failed)
Move :ENDERROR to literally the end of the file. Save

Code: Select all
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>cd \xampp

C:\xampp>catalina_service.bat

[XAMPP]: Searching for JDK or JRE HOME with reg query ...
ERROR: The system was unable to find the specified registry key or value.
. [XAMPP]: Could not find 32 bit or 64 bit JDK
. [XAMPP]: Looking for 32 bit JDK on 64 bit machine
ERROR: The system was unable to find the specified registry key or value.
. [XAMPP]: Could not find 32 bit JDK
. [XAMPP]: Looking for 32 bit or 64 bit JRE

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment
    Java7FamilyVersion    REG_SZ    1.7.0_05
    CurrentVersion    REG_SZ    1.7
    BrowserJavaVersion    REG_SZ    10.5.0

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.7
    JavaHome    REG_SZ    C:\Program Files\Java\jre7
    RuntimeLib    REG_SZ    C:\Program Files\Java\jre7\bin\client\jvm.dll
    MicroVersion    REG_SZ    0

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.7.0_05
    JavaHome    REG_SZ    C:\Program Files\Java\jre7
    MicroVersion    REG_SZ    0
    RuntimeLib    REG_SZ    C:\Program Files\Java\jre7\bin\client\jvm.dll

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.7.0_05\MSI
    JU    REG_SZ    1
    OEMUPDATE    REG_SZ
    MODE    REG_SZ    C
    JQS    REG_SZ
    FROMVERSION    REG_SZ    NA
    FROMVERSIONFULL    REG_SZ
    PRODUCTVERSION    REG_SZ    7.0.50
    INSTALLDIR    REG_SZ    C:\Program Files\Java\jre7\
    PATCHDIR    REG_SZ
    EULA    REG_SZ    0
    IEXPLORER    REG_SZ    1
    MOZILLA    REG_SZ    0
    JAVAUPDATE    REG_SZ    1
    AUTOUPDATECHECK    REG_SZ    1
    AUTOUPDATEDELAY    REG_SZ
    ImageCkSum    REG_SZ    1092648189
    FullVersion    REG_SZ    1.7.0_05-b05


[XAMPP]: Using JRE

[XAMPP]: Seems fine!
[XAMPP]: Set JRE_HOME : C:\Program Files\Java\jre7
[XAMPP]: Set CATALINA_HOME : C:\xampp\tomcat

[XAMPP]: Finding Java Version
[XAMPP]: Java Version: 1.7
[XAMPP]: Starting Tomcat Service Install...
.
Usage: service.bat install/remove [service_name] [/user username]
C:\xampp>


I also tried using the Control Panel

Code: Select all
9:12:20 AM  [tomcat]    Installing service...
9:12:27 AM  [tomcat]    Tomcat Service Install stopped with errors, return code: 3
9:12:27 AM  [tomcat]    Make sure you have Java JDK or JRE installed and the required ports are free
9:12:27 AM  [tomcat]    Service was NOT (un)installed!


I found the error with that, but hackattack may have already fixed in an update.

Edited:

That debug run showed me the problem (for me)
Start the Command Processor (must be as administrator)
catalina_service install


Code: Select all
C:\xampp>catalina_service.bat install

[XAMPP]: Searching for JDK or JRE HOME with reg query ...
ERROR: The system was unable to find the specified registry key or value.
. [XAMPP]: Could not find 32 bit or 64 bit JDK
. [XAMPP]: Looking for 32 bit JDK on 64 bit machine
ERROR: The system was unable to find the specified registry key or value.
. [XAMPP]: Could not find 32 bit JDK
. [XAMPP]: Looking for 32 bit or 64 bit JRE

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment
    Java7FamilyVersion    REG_SZ    1.7.0_05
    CurrentVersion    REG_SZ    1.7
    BrowserJavaVersion    REG_SZ    10.5.0

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.7
    JavaHome    REG_SZ    C:\Program Files\Java\jre7
    RuntimeLib    REG_SZ    C:\Program Files\Java\jre7\bin\client\jvm.dll
    MicroVersion    REG_SZ    0

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.7.0_05
    JavaHome    REG_SZ    C:\Program Files\Java\jre7
    MicroVersion    REG_SZ    0
    RuntimeLib    REG_SZ    C:\Program Files\Java\jre7\bin\client\jvm.dll

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.7.0_05\MSI
    JU    REG_SZ    1
    OEMUPDATE    REG_SZ
    MODE    REG_SZ    C
    JQS    REG_SZ
    FROMVERSION    REG_SZ    NA
    FROMVERSIONFULL    REG_SZ
    PRODUCTVERSION    REG_SZ    7.0.50
    INSTALLDIR    REG_SZ    C:\Program Files\Java\jre7\
    PATCHDIR    REG_SZ
    EULA    REG_SZ    0
    IEXPLORER    REG_SZ    1
    MOZILLA    REG_SZ    0
    JAVAUPDATE    REG_SZ    1
    AUTOUPDATECHECK    REG_SZ    1
    AUTOUPDATEDELAY    REG_SZ
    ImageCkSum    REG_SZ    1092648189
    FullVersion    REG_SZ    1.7.0_05-b05


[XAMPP]: Using JRE

[XAMPP]: Seems fine!
[XAMPP]: Set JRE_HOME : C:\Program Files\Java\jre7
[XAMPP]: Set CATALINA_HOME : C:\xampp\tomcat

[XAMPP]: Finding Java Version
[XAMPP]: Java Version: 1.7
[XAMPP]: Starting Tomcat Service Install...
.
Installing the service 'Tomcat7' ...
Using CATALINA_HOME:    "C:\xampp\tomcat"
Using CATALINA_BASE:    "C:\xampp\tomcat"
Using JAVA_HOME:        ""
Using JRE_HOME:         "C:\Program Files\Java\jre7"
Using JVM:              "C:\Program Files\Java\jre7\bin\server\jvm.dll"
The service 'Tomcat7' has been installed.
C:\xampp>



one more edit - catalina_service uninstall also appears to work.

AFAIK, XAMPP is dependent on the Java 'engine' installed on your machine. That is why the registry linking is necessary.

E. Finally (in the explanation category), XAMPP is set up so the Apache server serves as a proxy. Then the Tomcat Java server can be used to service requests from Apache processes. (Tomcat can be run 'on its own' also, it is actually a web server in its own right and an application server - again just like IIS)

http://httpd.apache.org/docs/2.4/mod/mod_proxy_ajp.html

I don't use Tomcat in my development, but I do use a lot of Java-built applications (including a collaboration server). They all need launchers, and if you want them to auto-start on Windows, in one fashion or another they find their way into 'run' instances or the Start Up folders. On Linux, same deal - you have to start them, and when you close them they are gone. I used this Google Search string: 'windows 7 java as a service' and it provided a lot of good links.

It looks like manually running (as administrator) the \xampp\catalina_service.bat script does the trick...

I sincerely hope this is helpful. Grokking Java is a big byte.

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: XAMPP Control Panel & Tomcat - 2 Startup Problems

Postby hackattack142 » 20. December 2012 03:00

When you start Tomcat, the CMD window will stay open by default. You can turn that off by opening the Control Panel, clicking Config in the upper right, and unchecking the 'Enable tomcat output window' box.

I am not sure what causes the /xampp/tmp problem. I have not been able to reproduce it myself and see no reason for it to do that.

It uses the registry just to easily locate which versions of Java are installed. It should work with Java 6/7 JRE/JDK. By default, XAMPP comes with 32-bit Tomcat so there can be an issue if you have a 64-bit Java and want to use Tomcat as a service. In that case, you need to either force it to use a 32-bit java or upgrade Tomcat to the 64-bit version.
XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 701
Joined: 20. May 2011 23:29
Operating System: Windows 7 Ultimate SP1 64-Bit

Re: XAMPP Control Panel & Tomcat - 2 Startup Problems

Postby DaveWalley » 26. December 2012 18:24

Re: The directory which "\XAMPP\catalina_start.bat" attempts to load tomcat from is "\XAMPP\tmp\tomcat" instead of "\XAMPP\tomcat"

I tried on three different machines running various versions of Windoze and Java, using the installer and installing manually - all had the same problem. The solution was to install an old version of XAMPP.
DaveWalley
 
Posts: 1
Joined: 26. December 2012 18:19
Operating System: VARIOUS

Re: XAMPP Control Panel & Tomcat - 2 Startup Problems

Postby hackattack142 » 26. December 2012 23:35

Perhaps this will fix it:

Open 'catalina_start.bat' and change the two instances of
Code: Select all
set "CURRENT_DIR=%cd%"
set "CATALINA_HOME=%CURRENT_DIR%\tomcat"

to
Code: Select all
set "CURRENT_DIR=%~dp0"
set "CATALINA_HOME=%CURRENT_DIR%tomcat"
XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 701
Joined: 20. May 2011 23:29
Operating System: Windows 7 Ultimate SP1 64-Bit


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 104 guests

cron