Replacing default servlet using url-mapping

2016-04-13 Thread Rune Stilling
Hi list

I have a question regarding the servlet-mapping property in web.xml. Normally a 
url would look like this:

http://host:port/context/servlet-path

As many others I have tried to setup my servlet so that it matches the 
following:

http://host:port/

I’m trying to obtain this by using the following url-mapping:


ServletAdaptor
/


I have read the answers on these two links:

http://stackoverflow.com/questions/4140448/difference-between-and-in-servlet-mapping-url-pattern
 
<http://stackoverflow.com/questions/4140448/difference-between-and-in-servlet-mapping-url-pattern>
http://stackoverflow.com/questions/10874188/jax-rs-application-on-the-root-context-how-can-it-be-done
 
<http://stackoverflow.com/questions/10874188/jax-rs-application-on-the-root-context-how-can-it-be-done>

It’s still not clear to me why this doesn’t work (using Tomcat 7.0)

I’ve have turned on Jersey tracing and this is what I get (on a url like this 
http://localhost:8080/emner/81.20.00):

X-Jersey-Tracing-004:MATCH   [  /  1,00 ms |   %] Matching path [/]

What’s puzzling to me is that it seems that for some reason my path gets 
stripped away before reaching the servlet. I would have expected something like 
this instead:

X-Jersey-Tracing-004:MATCH   [  / 19,39 ms |   %] Matching path 
[/emner/81.20.00]

Is it so in Tomcat, that when you use the url-pattern “/“ that the rest of path 
is ignored when interpreting the original url? Is it different using other 
containers?

Could be related to this:

http://bluxte.net/musings/2006/03/29/servletpath-and-pathinfo-servlet-api-weirdness
 
<http://bluxte.net/musings/2006/03/29/servletpath-and-pathinfo-servlet-api-weirdness>

With regards,
Rune Stilling

Re: Tomcat 7 doesn't start on Windows

2013-02-27 Thread Rune Stilling
Hi again

Thanks for your answers. I have given up. I have tried some of the suggestions:

* Uninstall all JVM's and Tomcats (and reinstall)
* Checked dependcies, yes there were two, that are also present on another 
machine running Tomcat7 (TCP/IP, ADF)
* Tried to use client/jvm.dll instead of server/jvm.dll

Nothing helps - I can still only run the service from the command prompt. I 
find it strange though, that Tomcat isn't able to log anything at all about 
this, but maybe it's all Windows fault?

Hopefully things will work on a new VPS, and I'll quit the old one.

/Rune

Den 26/02/2013 kl. 13.04 skrev Rune Stilling s...@rdfined.dk:

 Hi list
 
 I have been trying to get this to work by looking a lot on similar situations 
 around the net but nothing works. My setup is as follows:
 
 * Tomcat 7.0.37 installed via the Windows service installer package
 * Windows 2003 server
 * Java/JRE 1.7.0_15
 * Using C:\Program Files\Java\jre7\bin\server\jvm.dll
 
 So the problem is that the Tomcat7 service won't start from the service 
 control panel. I just get a Could not start … and Error 1053: The service 
 did not respond ….
 
 There's nothing in the Tomcat logs (both stdout and stderr are empty). The 
 event logs shows a generic service control manager error.
 
 But - If I start the service from the command line by typing tomcat7 
 //TS/Tomcat7 the thing works fine.
 
 Also if I change the service user account to the Administrator account I 
 get a different error by startup Error 1068: The dependency service or group 
 failed to start.
 
 Any ideas?
 
 /Rune
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 7 doesn't start on Windows

2013-02-27 Thread Rune Stilling
Ok - So I did:

* uninstall Tomcat
* only one jvm present on the system (64 bit)
* setting CATALINA_HOME, JAVA_HOME and JRE_HOME:

CATALINA_HOME=C:\Progra~1\APACHE~1\TOMCAT~1.0
JAVA_HOME=C:\Progra~1\Java
JRE_HOME=C:\Progra~1\Java\jre7

* restarting server
* reinstalling Tomcat7 (using the service installer, not the service.bat file, 
that I can't locate anyway)
* checking Java Virtual Machine in Java tab in Tomcat7w.exe:

C:\Program Files\Java\jre7\bin\server\jvm.dll

* checking PATH:

Path=C:\PARALL~1\Plesk\ADDITI~1\Perl\bin\;C:\Parallels\Plesk\Additional\Python\;C:\Parallels\Plesk\Mail
 Servers\Mail 
Enable\BIN;C:\PARALL~1\Plesk\ADDITI~1\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program
 Files\TortoiseSVN\bin;C:\Program Files (x86)\MySQL\MySQL 
Server5.5\bin;C:\Program Files(x86)\IDM Computer Solutions\UltraEdit\

But - Problem persists.

Is there some registry key I could check related to the installation process?

\Rune

Den 27/02/2013 kl. 12.57 skrev Giles computer.support.cen...@googlemail.com:

 On 27 February 2013 11:52, André Warnier a...@ice-sa.com wrote:
 computer repair centre wrote:
 
 On Wed, Feb 27, 2013 at 10:18 AM, Rune Stilling s...@rdfined.dk wrote:
 
 Hi again
 
 Thanks for your answers. I have given up. I have tried some of the
 suggestions:
 
 * Uninstall all JVM's and Tomcats (and reinstall)
 * Checked dependcies, yes there were two, that are also present on
 another machine running Tomcat7 (TCP/IP, ADF)
 * Tried to use client/jvm.dll instead of server/jvm.dll
 
 Nothing helps - I can still only run the service from the command prompt.
 I find it strange though, that Tomcat isn't able to log anything at all
 about this, but maybe it's all Windows fault?
 
 Hopefully things will work on a new VPS, and I'll quit the old one.
 
 /Rune
 
 Den 26/02/2013 kl. 13.04 skrev Rune Stilling s...@rdfined.dk:
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 Hi Rune,
 
 Please can you provide the value of the JAVA_HOME environment variable?
 
 
 That has nothing to do with the matter. The wrapper (tomcat7.exe) takes the
 path of the JVM to run from the Registry, not from environment variables.
 Run tomcat7w.exe and check the Java tab.
 
 But it is used by service.bat when installing the service. This issue
 could be caused by using the 64-bit installation with the 32-bit JVM.
 This would explain why calling the wrapper directly from the command
 line does execute successfully.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 7 doesn't start on Windows

2013-02-27 Thread Rune Stilling
As I wrote I'm using the service installer 32-bit/64-bit Windows Service 
Installer. This is an exe file and not a zip-archive.

Regarding the paths - I have used windows short paths to avoid eventual 
troubles with spaces in path names.

\Rune

Den 27/02/2013 kl. 13.54 skrev Howard W. Smith, Jr. smithh032...@gmail.com:

 On Wed, Feb 27, 2013 at 7:34 AM, Howard W. Smith, Jr. 
 smithh032...@gmail.com wrote:
 
 On Wed, Feb 27, 2013 at 7:11 AM, Rune Stilling s...@rdfined.dk wrote:
 
 Ok - So I did:
 
 CATALINA_HOME=C:\Progra~1\APACHE~1\TOMCAT~1.0
 
 
 * reinstalling Tomcat7 (using the service installer, not the service.bat
 file, that I can't locate anyway)
 * checking Java Virtual Machine in Java tab in Tomcat7w.exe:
 
 
 TOMCAT~1.0 ? interesting, never seen a tomcat7 install to folder like
 that. See [1] below.
 
 using the service installer = 'sc ...' at command prompt? you cannot
 locate service.bat file (in C:\Progra~1\APACHE~1\TOMCAT~1.0)?
 wow/interesting. I repeat, see [1] below.
 
 
 [1] I download .zip file and extract to D:\ root folder, and it should
 extract files to D:\apache-tomcat-7.0.37 (or whatever version you are
 using). I would 'never' install Tomcat to C:\Program Files or D:\Program
 Files.
 
 
 Add to [1] above... service.bat is located in D:\apache-tomcat-7.0.37\bin,
 after extracting 'all' files from the .zip file, and if 'Use folder names'
 was checked/selected prior to extracting files via WinZip.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 7 doesn't start on Windows

2013-02-27 Thread Rune Stilling
And BTW - I have several running Tomcat7-instances on other servers that run in 
Program Files-folders.

\Rune

Den 27/02/2013 kl. 13.54 skrev Howard W. Smith, Jr. smithh032...@gmail.com:

 On Wed, Feb 27, 2013 at 7:34 AM, Howard W. Smith, Jr. 
 smithh032...@gmail.com wrote:
 
 On Wed, Feb 27, 2013 at 7:11 AM, Rune Stilling s...@rdfined.dk wrote:
 
 Ok - So I did:
 
 CATALINA_HOME=C:\Progra~1\APACHE~1\TOMCAT~1.0
 
 
 * reinstalling Tomcat7 (using the service installer, not the service.bat
 file, that I can't locate anyway)
 * checking Java Virtual Machine in Java tab in Tomcat7w.exe:
 
 
 TOMCAT~1.0 ? interesting, never seen a tomcat7 install to folder like
 that. See [1] below.
 
 using the service installer = 'sc ...' at command prompt? you cannot
 locate service.bat file (in C:\Progra~1\APACHE~1\TOMCAT~1.0)?
 wow/interesting. I repeat, see [1] below.
 
 
 [1] I download .zip file and extract to D:\ root folder, and it should
 extract files to D:\apache-tomcat-7.0.37 (or whatever version you are
 using). I would 'never' install Tomcat to C:\Program Files or D:\Program
 Files.
 
 
 Add to [1] above... service.bat is located in D:\apache-tomcat-7.0.37\bin,
 after extracting 'all' files from the .zip file, and if 'Use folder names'
 was checked/selected prior to extracting files via WinZip.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 7 doesn't start on Windows

2013-02-27 Thread Rune Stilling
Hi André

Thanks for an excellent summary. There's one thing that I haven't been precise 
enough about I can see.

I CANNOT run Tomcat via the RS-parameter:

Tomcat7.exe //RS/Tomcat7

If I try the log produces the following:

[2013-02-27 14:33:55] [info]  [548184] Commons Daemon procrun (1.0.13.0 64-bit) 
started
[2013-02-27 14:33:55] [info]  [548184] Running 'Tomcat7' Service...
[2013-02-27 14:33:55] [error] [548184] StartServiceCtrlDispatcher for 'Tomcat7' 
failed
[2013-02-27 14:33:55] [error] [548184] The service process could not connect to 
the service controller.
[2013-02-27 14:33:55] [error] [548184] Commons Daemon procrun failed with exit 
value: 4 (Failed to run service)
[2013-02-27 14:33:55] [error] [548184] The service process could not connect to 
the service controller.

What I CAN do is to run it via the TS-parameter:

Tomcat7.exe //TS/Tomcat7

But - I'll try what you suggested anyways.

/Rune

Den 27/02/2013 kl. 14.20 skrev André Warnier a...@ice-sa.com:

 Rune Stilling wrote:
 Is there some registry key I could check related to the installation process?
 Call up the Registry Editor, and search for tomcat7.
 
 You should find essentially 2 places :
 
 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat7
 (under this one, you will find the parameters which Windows needs to know 
 about the service (such as, how to start it) (it being tomcat7.exe)
 
 HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\
 (under this one, you will find the parameters which tomcat7.exe (the 
 service wrapper) needs to know (such as, which JVM to start and with which 
 parameters)
 
 (and remember, tomcat7.exe is a renamed prunsrv.exe, which is one of the 2 
 modules that are part of procrun).
 
 --
 
 Let's step back a bit.
 
 1) you install Tomcat on the machine, using the Windows installer package 
 from tomcat.apache.org.
 
 2) this installer creates the Registry value :
 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat7\ImagePath = 
 C:\apache-tomcat-\bin\tomcat7.exe //RS//Tomcat7
 (or similar)
 This Registry value is the one that will be used by the Windows Service 
 Manager, to know which program to launch when you click on Services.. 
 Tomcat7...start.
 
 3) when you login as a user onto the machine, open a command window, and run 
 the above command (C:\apache-tomcat-\bin\tomcat7.exe //RS//Tomcat7), 
 the tomcat7.exe program runs, and starts a JVM which starts Tomcat, as a 
 Service.
 And that works fine, tomcat logs are produced etc.
 
 4) when instead, you open the Windows Service Manager dialog, and ask Windows 
 to start the Tomcat service, nothing happens.
 (Tomcat does not start, tomcat7.exe does not run, no logs are produced etc.)
 
 So the intuitive conclusions would be :
 - there is nothing wrong with Tomcat per se.  Otherwise, it would not run, no 
 matter how it is started.  There is also nothing wrong with the JVM, for the 
 same reasons.
 - there is nothing wrong with the Registry parameters of tomcat7.exe (the 
 ones found under HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation).  
 Otherwise, in case (3) above, tomcat7.exe would not be able to start the JVM 
 etc..
 
 So there must be something wrong with the parameters used by the Windows 
 Service Manager when it tries to start the Tomcat service. (The ones under 
 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat7\)
 
 What that would be, I couldn't say, and certainly not without access to your 
 Registry.
 
 But what I would do at this stage is this :
 
 1) de-install Tomcat again (do not delete the installer.exe file that you 
 downloaded, you'll need it again)
 2) using the Registry Editor (carefully), go to the key 
 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat7\, and delete it 
 (and everything under it).
 3) reboot Windows, and with the Registry Editor, verify that the key is still 
 deleted
 (I am saying that because who knows what MS will have invented yet to 
 re-instate things that you deleted..)
 4) re-install the Tomcat service by re-running the installer
 5) try again to start Tomcat
 
 and tell us what happens.
 
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 7 doesn't start on Windows

2013-02-27 Thread Rune Stilling
Problem solved!!

Ah finally :) I did as you suggested below and it didn't help, but then I 
looked a bit on the registry values. I found that the ImagePath key looked a 
bit strange. It contained the following value:

C:\Program Files\Apache Software Foundation\Tomcat 7.0\bin\Tomcat7.exe 
ogs\commons-daemon.2013-02-27.log//RS//Tomcat7

I tried to replace it with:

C:\Program Files\Apache Software Foundation\Tomcat 7.0\bin\Tomcat7.exe 
//RS//Tomcat7

And voliá the service would start.

I have no idea where the ogs\commons-daemon.2013-02-27.log comes from, but it 
must be something the installer added, and for some reason the service won't 
start using this value?

Thanks for all the help,
Rune

Den 27/02/2013 kl. 14.20 skrev André Warnier a...@ice-sa.com:

 Rune Stilling wrote:
 Is there some registry key I could check related to the installation process?
 Call up the Registry Editor, and search for tomcat7.
 
 You should find essentially 2 places :
 
 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat7
 (under this one, you will find the parameters which Windows needs to know 
 about the service (such as, how to start it) (it being tomcat7.exe)
 
 HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\
 (under this one, you will find the parameters which tomcat7.exe (the 
 service wrapper) needs to know (such as, which JVM to start and with which 
 parameters)
 
 (and remember, tomcat7.exe is a renamed prunsrv.exe, which is one of the 2 
 modules that are part of procrun).
 
 --
 
 Let's step back a bit.
 
 1) you install Tomcat on the machine, using the Windows installer package 
 from tomcat.apache.org.
 
 2) this installer creates the Registry value :
 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat7\ImagePath = 
 C:\apache-tomcat-\bin\tomcat7.exe //RS//Tomcat7
 (or similar)
 This Registry value is the one that will be used by the Windows Service 
 Manager, to know which program to launch when you click on Services.. 
 Tomcat7...start.
 
 3) when you login as a user onto the machine, open a command window, and run 
 the above command (C:\apache-tomcat-\bin\tomcat7.exe //RS//Tomcat7), 
 the tomcat7.exe program runs, and starts a JVM which starts Tomcat, as a 
 Service.
 And that works fine, tomcat logs are produced etc.
 
 4) when instead, you open the Windows Service Manager dialog, and ask Windows 
 to start the Tomcat service, nothing happens.
 (Tomcat does not start, tomcat7.exe does not run, no logs are produced etc.)
 
 So the intuitive conclusions would be :
 - there is nothing wrong with Tomcat per se.  Otherwise, it would not run, no 
 matter how it is started.  There is also nothing wrong with the JVM, for the 
 same reasons.
 - there is nothing wrong with the Registry parameters of tomcat7.exe (the 
 ones found under HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation).  
 Otherwise, in case (3) above, tomcat7.exe would not be able to start the JVM 
 etc..
 
 So there must be something wrong with the parameters used by the Windows 
 Service Manager when it tries to start the Tomcat service. (The ones under 
 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat7\)
 
 What that would be, I couldn't say, and certainly not without access to your 
 Registry.
 
 But what I would do at this stage is this :
 
 1) de-install Tomcat again (do not delete the installer.exe file that you 
 downloaded, you'll need it again)
 2) using the Registry Editor (carefully), go to the key 
 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat7\, and delete it 
 (and everything under it).
 3) reboot Windows, and with the Registry Editor, verify that the key is still 
 deleted
 (I am saying that because who knows what MS will have invented yet to 
 re-instate things that you deleted..)
 4) re-install the Tomcat service by re-running the installer
 5) try again to start Tomcat
 
 and tell us what happens.
 
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 7 doesn't start on Windows

2013-02-27 Thread Rune Stilling
 I've encountered and solved hundreds of Tomcat-as-a-Windows-Service problems 
 before, but I have never seen Tomcat not log anything. If you don't mind, 
 could you run Tomcat7w.exe, screenshot each tab (Alt + Print Screen gets a 
 screenshot for just the window instead of the whole thing), put the 
 screenshots online somewhere public, and then post links to the screenshots 
 here? My money is on finding something amiss there.

http://rdfined.fastmail.fm/diverse/Tomcat7w.zip

 Question: When you run the service installer, it installs Tomcat at 
 C:\Program Files\Apache Software Foundation\Tomcat 7.0, correct? (Unless, of 
 course, you changed it at install time.)

Yes - It creates that exact path and install files into the Tomcat 7.0 folder.

 Question: I know at some point you said this, but I can't find the email 
 anymore. Can you remind me what version of Windows you are running on?

Microsoft Windows 2003 R2 - Datacenter x64 edition - Service Pack 2
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat 7 doesn't start on Windows

2013-02-26 Thread Rune Stilling
Hi list

I have been trying to get this to work by looking a lot on similar situations 
around the net but nothing works. My setup is as follows:

* Tomcat 7.0.37 installed via the Windows service installer package
* Windows 2003 server
* Java/JRE 1.7.0_15
* Using C:\Program Files\Java\jre7\bin\server\jvm.dll

So the problem is that the Tomcat7 service won't start from the service control 
panel. I just get a Could not start … and Error 1053: The service did not 
respond ….

There's nothing in the Tomcat logs (both stdout and stderr are empty). The 
event logs shows a generic service control manager error.

But - If I start the service from the command line by typing tomcat7 
//TS/Tomcat7 the thing works fine.

Also if I change the service user account to the Administrator account I get 
a different error by startup Error 1068: The dependency service or group 
failed to start.

Any ideas?

/Rune
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org