RE: Problems starting Tomcat 9.0.24 32-bit as a service
On Tuesday, August 27, 2019 7:41 PM Juan Ramirez wrote: > >I'm currently having an issue with starting Tomcat 9.0.24 32-bit version as a >service. After installing Tomcat9 using the windows service installer, I try >to run Tomcat9 and get the windows service error: >"Windows could not start Tomcat9 service on Local Computer. Error 1067: The >process terminated unexpectedly." I tried looking in the logs to see what >could have caused the error, but no errors are logged. The only thing I could >find in the logs is in the commons daemon log file: > >[10860] Apache Commons Daemon procrun (1.2.0.0 32-bit) started. >[10860] Debugging 'tomcat9' service... >[10860] Starting service... > >I also tried running Tomcat9 through the executable (tomcat9.exe) and get the >error: "Apache Commons Daemon Service Runner has stopped working." I have also >tried manually installing Tomcat9 through the 32-bit Windows zip and keep >having the same errors as installing it through the installer. When I tried >using the 64-bit version of Tomcat 9.0.24, it seems to work fine and I'm able >to launch it as a service, which leads me to belive that something maybe wrong >with the 32-bit version only. I'm using AdoptJDK 12.0.2+10 Here's your problem. See my post to this list from July 26, 11:32 and earlier to which nobody has replied so far http://mail-archives.apache.org/mod_mbox/tomcat-users/201907.mbox/%3CAM6PR03MB60075E5A12F40DAB9281E073BEC00%40AM6PR03MB6007.eurprd03.prod.outlook.com%3E The OpenJdk installers don't configure the registry the same way as as Java 8 did. procrun doesn't cope with it. Workaround is to mess with JAVA_HOME or to install Java 8. procrun needs to be fixed. Michael - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: tomcat and openjdk as windows service
On July 19, 2019 6:26 PM Michael Lemke wrote: >On July 19, 2019 5:51 PM André Warnier wrote: >>For some maybe useful background information, it may be useful to read this : >>https://cwiki.apache.org/confluence/display/TOMCAT/Windows#Windows-Q11 > >Thanks. Actually, I knew this as I am using procrun for an additional service, >which also doesn't find the OpenJdk. > >So doesn't this boil down to why procrun doesn't pick up the OpenJdk >installation? Answering to myself: indeed it does. I created an issue https://issues.apache.org/jira/browse/DAEMON-404 and added a pull request. This fixes the problem for me. Maybe someone can have a look? Michael > >I verified that the ojdkbuild installer sets the appropriate Registry keys. Is >this a bug in procrun or does Oracle play some additional tricks? > >Michael > >> >>On 19.07.2019 14:01, Michael Lemke wrote: >>> I have tomcat (9.0.22) running as a service on Windows with Oracle's Java >>> 8. I now want to move this to OpenJdk 12 to keep current and I have quite >>> some problems to have tomcat find the OpenJdk installation. With Oracle it >>> just worked with the Jvm=auto option for the tomcat service. With OpenJdk I >>> only got it to work by messing around with JAVA_HOME, which is no fun >>> especially for services. Without it tomcat doesn't find Java or uses >>> Oracle's if I don't remove it first. >>> >>> Now is this a tomcat problem or a OpenJdk installation problem? >>> >>> For OpenJdk I used >>> >>> https://github.com/ojdkbuild/ojdkbuild/releases/download/12.0.1-1/java-12-openjdk-12.0.1.12-1.windows.ojdkbuild.x86_64.msi >>> >>> and have the installer set the Windows Registry entries under JavaSoft >>> >>> HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK\12.0.1 >>> >>> From what I found on the net these Registry settings changed with Java 9. >>> >>> So what am I doing wrong? >>> >>> Thanks, >>> Michael - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: tomcat and openjdk as windows service
On July 19, 2019 5:51 PM André Warnier wrote: >For some maybe useful background information, it may be useful to read this : >https://cwiki.apache.org/confluence/display/TOMCAT/Windows#Windows-Q11 Thanks. Actually, I knew this as I am using procrun for an additional service, which also doesn't find the OpenJdk. So doesn't this boil down to why procrun doesn't pick up the OpenJdk installation? I verified that the ojdkbuild installer sets the appropriate Registry keys. Is this a bug in procrun or does Oracle play some additional tricks? Michael > >On 19.07.2019 14:01, Michael Lemke wrote: >> I have tomcat (9.0.22) running as a service on Windows with Oracle's Java 8. >> I now want to move this to OpenJdk 12 to keep current and I have quite some >> problems to have tomcat find the OpenJdk installation. With Oracle it just >> worked with the Jvm=auto option for the tomcat service. With OpenJdk I only >> got it to work by messing around with JAVA_HOME, which is no fun especially >> for services. Without it tomcat doesn't find Java or uses Oracle's if I >> don't remove it first. >> >> Now is this a tomcat problem or a OpenJdk installation problem? >> >> For OpenJdk I used >> >> https://github.com/ojdkbuild/ojdkbuild/releases/download/12.0.1-1/java-12-openjdk-12.0.1.12-1.windows.ojdkbuild.x86_64.msi >> >> and have the installer set the Windows Registry entries under JavaSoft >> >> HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK\12.0.1 >> >> From what I found on the net these Registry settings changed with Java 9. >> >> So what am I doing wrong? >> >> Thanks, >> Michael - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
tomcat and openjdk as windows service
I have tomcat (9.0.22) running as a service on Windows with Oracle's Java 8. I now want to move this to OpenJdk 12 to keep current and I have quite some problems to have tomcat find the OpenJdk installation. With Oracle it just worked with the Jvm=auto option for the tomcat service. With OpenJdk I only got it to work by messing around with JAVA_HOME, which is no fun especially for services. Without it tomcat doesn't find Java or uses Oracle's if I don't remove it first. Now is this a tomcat problem or a OpenJdk installation problem? For OpenJdk I used https://github.com/ojdkbuild/ojdkbuild/releases/download/12.0.1-1/java-12-openjdk-12.0.1.12-1.windows.ojdkbuild.x86_64.msi and have the installer set the Windows Registry entries under JavaSoft HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK\12.0.1 >From what I found on the net these Registry settings changed with Java 9. So what am I doing wrong? Thanks, Michael - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: log4j app logging
On Thursday, December 27, 2018 5:35 PM, Mark H. Wood wrote: >On Wed, Dec 19, 2018 at 06:52:20PM +0000, Lemke, Michael ST/HZA-ZIC2 wrote: >> On December 19, 2018 6:54 PM Lemke, Michael wrote: >> >On December 18, 2018 8:52 PM Christopher Schultz wrote: >> >>On 12/18/18 12:42, Lemke, Michael ST/HZA-ZIC2 wrote: >> >>> I have an old webapp that uses log4j 1.2 and which I am trying to >> >>> deploy on tomcat. For the heck of it I can't get tomcat to use the >> >>> log4.properties file. What am I doing wrong? >> >> >> >> ... >> >I guess I have a terrible mess of all sorts of loggers in my libraries. I am >> >not good at all the different Java loggers. The log4j.properties I want >> >to use is for log4j-1.2.27 so not quite bleeding edge ??. Then there are >> >other libs that pull in slf4j-api-1.7.25.jar, there is a >> >jcl-over-slf4j-1.7.25.jar, >> >logback-classic-1.2.3.jar, logback-core-1.2.3.jar. >> > > >If this happens to be a project built with Maven then 'mvn >dependency:tree' should tell you which artifacts are pulling in >SLF4J. You may need to run this more than once as you comb out >transitive dependencies one by one. > >But it's possible to use multiple logging frameworks in one webapp. if >you include/exclude the right artifacts. See >https://www.slf4j.org/legacy.html if you need to do this with SLF4J >and Log4J v1. Thank you very much, Mark, this was very helpful. With it I could clean up the mess. Most important part was to get rid of logback-* and switch everything to slf4j with the help of slf4j-log4j12. Now everything seems to be working. Thanks again, Michael - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: log4j app logging
On December 19, 2018 6:54 PM Lemke, Michael wrote: >On December 18, 2018 8:52 PM Christopher Schultz wrote: >>On 12/18/18 12:42, Lemke, Michael ST/HZA-ZIC2 wrote: >>> I have an old webapp that uses log4j 1.2 and which I am trying to >>> deploy on tomcat. For the heck of it I can't get tomcat to use the >>> log4.properties file. What am I doing wrong? >> >> >>How are you initializing log4j? > >Good question. I just dug a little and have to say I don't know. It >is a myfaces 1.1 application and I just realized jsf has logging built >in somehow. I can't find any explicit call to Logger.getLogger in the >code. > >I guess I have a terrible mess of all sorts of loggers in my libraries. I am >not good at all the different Java loggers. The log4j.properties I want >to use is for log4j-1.2.27 so not quite bleeding edge ??. Then there are >other libs that pull in slf4j-api-1.7.25.jar, there is a >jcl-over-slf4j-1.7.25.jar, >logback-classic-1.2.3.jar, logback-core-1.2.3.jar. > >Well, I do get quite lot of logging from the app in the tomcat logfiles, so >something is working. But I don't know how to configure it. > >This used to work when I ran it on resin but I also changed quite a bit on >the code when I switched to tomcat. I'll try without all the new stuff. And this was it. The old version without the stuff that pulls in all the other log libraries it works. So tomcat is out of the loop. Sorry for the noise. (But if someone has a hint on my mess I wouldn't mind.) Thanks, Michael - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: log4j app logging
Christopher, On December 18, 2018 8:52 PM Christopher Schultz wrote: >On 12/18/18 12:42, Lemke, Michael ST/HZA-ZIC2 wrote: >> I have an old webapp that uses log4j 1.2 and which I am trying to >> deploy on tomcat. For the heck of it I can't get tomcat to use the >> log4.properties file. What am I doing wrong? > >Are you trying to get Tomcat to use the log4j.properties file from >your application? No, this is not what I want to do. >If so, that's not going to work, because Tomcagt >starts up long before your application is loaded, and so the log4j.jar >file and log4j.properties file are not used at all. > >Your *application* should be able to use log4j without any problems as >long as the log4j.jar file is in WEB-INB/lib and your log4j.properties >file is in (usually) WEB-INF/classes/log4j.properties. Right, I want my application to use its log4j.properties. > >> tomcat 9.0.6 is installed as a Windows service and does serve my >> webapp, so the app is working fine. The project is mavenized, I >> put log4.properties to src/main/resources and it ends up in the jar >> file of my application. Is there anything special that needs to be >> done? > >How are you initializing log4j? Good question. I just dug a little and have to say I don't know. It is a myfaces 1.1 application and I just realized jsf has logging built in somehow. I can't find any explicit call to Logger.getLogger in the code. I guess I have a terrible mess of all sorts of loggers in my libraries. I am not good at all the different Java loggers. The log4j.properties I want to use is for log4j-1.2.27 so not quite bleeding edge . Then there are other libs that pull in slf4j-api-1.7.25.jar, there is a jcl-over-slf4j-1.7.25.jar, logback-classic-1.2.3.jar, logback-core-1.2.3.jar. Well, I do get quite lot of logging from the app in the tomcat logfiles, so something is working. But I don't know how to configure it. This used to work when I ran it on resin but I also changed quite a bit on the code when I switched to tomcat. I'll try without all the new stuff. Thanks, Michael - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: log4j app logging
Thanks, Ryan, this JULI thing actually is what worries me. I don't care about tomcat's logging at the moment. It is my webapp's logging I can't figure out. It worked on other containers. -Original Message- From: Ryan Palmer Sent: Tuesday, December 18, 2018 7:49 PM Michael, Tomcat uses JULI internally. Have you taken necessary steps to redirect JULI to log4j? Thanks, Ryan From: Lemke, Michael ST/HZA-ZIC2 Sent: Tuesday, December 18, 2018 10:20 AM To: Tomcat Users List Subject: RE: log4j app logging On December 18, 2018 6:59 PM Ryan Palmer wrote: > >The file needs to be named log4j.properties<http://log4j.properties> (or .xml, >.json, etc.) and needs to be in the classpath. You ommitted the 'j'. Thanks for spotting this. Unfortunately, this typo was only in the email: pc# ls src/main/resources/ com log4j.properties So for being in the classpath it is sufficient to have it packaged in the jar, isn't it? Archive: myapp-1.1.0-SNAPSHOT.jar Length MethodSize CmprDateTime CRC-32 Name -- --- -- - 0 Stored0 0% 12-18-2018 16:56 META-INF/ 98 Defl:N 91 7% 12-18-2018 16:56 48730e36 META-INF/MANIFEST.MF 0 Stored0 0% 12-18-2018 16:56 META-INF/maven/ ... 0 Stored0 0% 12-18-2018 16:56 com/ ... 1123 Defl:N 451 60% 12-18-2018 16:56 eea5d81a log4j.properties It ought to be something simple but before further digging into my setup details I want to make sure there isn't something special for tomcat. Something in ${catalina.base}/conf or conflicts with tomcat's logging system. >On Dec 18, 2018, at 9:42 AM, "Lemke, Michael ST/HZA-ZIC2" wrote: > >I have an old webapp that uses log4j 1.2 and which I am trying to deploy on >tomcat. For the heck of it I can't get tomcat to use the >log4.properties<http://log4.properties> file. What am I doing wrong? > >tomcat 9.0.6 is installed as a Windows service and does serve my webapp, so >the app is working fine. The project is mavenized, I put >log4.properties<http://log4.properties> to src/main/resources and it ends up >in the jar file of my application. Is there anything special that needs to be >done? > > > >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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: log4j app logging
On December 18, 2018 6:59 PM Ryan Palmer wrote: > >The file needs to be named log4j.properties<http://log4j.properties> (or .xml, >.json, etc.) and needs to be in the classpath. You ommitted the 'j'. Thanks for spotting this. Unfortunately, this typo was only in the email: pc# ls src/main/resources/ com log4j.properties So for being in the classpath it is sufficient to have it packaged in the jar, isn't it? Archive: myapp-1.1.0-SNAPSHOT.jar Length MethodSize CmprDateTime CRC-32 Name -- --- -- - 0 Stored0 0% 12-18-2018 16:56 META-INF/ 98 Defl:N 91 7% 12-18-2018 16:56 48730e36 META-INF/MANIFEST.MF 0 Stored0 0% 12-18-2018 16:56 META-INF/maven/ ... 0 Stored0 0% 12-18-2018 16:56 com/ ... 1123 Defl:N 451 60% 12-18-2018 16:56 eea5d81a log4j.properties It ought to be something simple but before further digging into my setup details I want to make sure there isn't something special for tomcat. Something in ${catalina.base}/conf or conflicts with tomcat's logging system. >On Dec 18, 2018, at 9:42 AM, "Lemke, Michael ST/HZA-ZIC2" wrote: > >I have an old webapp that uses log4j 1.2 and which I am trying to deploy on >tomcat. For the heck of it I can't get tomcat to use the >log4.properties<http://log4.properties> file. What am I doing wrong? > >tomcat 9.0.6 is installed as a Windows service and does serve my webapp, so >the app is working fine. The project is mavenized, I put >log4.properties<http://log4.properties> to src/main/resources and it ends up >in the jar file of my application. Is there anything special that needs to be >done? > > > >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
log4j app logging
I have an old webapp that uses log4j 1.2 and which I am trying to deploy on tomcat. For the heck of it I can't get tomcat to use the log4.properties file. What am I doing wrong? tomcat 9.0.6 is installed as a Windows service and does serve my webapp, so the app is working fine. The project is mavenized, I put log4.properties to src/main/resources and it ends up in the jar file of my application. Is there anything special that needs to be done? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Documentation for Catalina Base
On Thursday, August 09, 2018 4:23 PM, Marek Czernek wrote: >Hi, > >any thoughts about the PR anyone? [1] Feel free to suggest any >improvements, or help me better the docs with your comments of course. > >[1] https://github.com/apache/tomcat/pull/117 Hi Marek, thanks for writing this. Wish you'd done it earlier as I had the very same problem about two months ago (search for "Tomcat Installation on Windows" in this mailing list). My suggestion would be to have CATALINA_HOME reference something like C:\Program Files\apache-tomcat-9.0.10 on Windows. That would make it very clear that this is code you are not supposed to touch. But I have the feeling that tomcat isn't too strict about such a concept and might require you to do so anyway. Michael > >Cheers, > >On 07/30/2018 09:22 AM, Marek Czernek wrote: >> Hi there, >> >> recently, we noticed the lack of documentation for Catalina Base, and >> I wanted to find out more about it. Other than a strangely obscure txt >> file [1], I did not find the concept and usage of Catalina Base >> documented in the Tomcat docs. >> >> My questions are: >> >> 1) Did I overlook it being documented somewhere? >> >> 2) If not, is there any reason for it not being documented? While I >> don't want to duplicate text, I do not consider a txt file somewhere a >> sufficient docs. >> >> If the answer to both of my questions is no, we'll create a patch >> against the Tomcat docs. >> >> >> [1] https://tomcat.apache.org/tomcat-9.0-doc/RUNNING.txt >> >> >> Cheers, >> > >-- > >Marek Czernek > >JWS/JBCS Associate Quality Engineer, RHCA > >Find me at www.halfastack.com >
RE: Tomcat Installation on Windows
On Wednesday, June 13, 2018 10:20 PM Christopher Schultz wrote: >On 6/13/18 12:14 PM, Lemke, Michael ST/HZA-ZIC2 wrote: > >> What is a recommended setup on Windows? So far I am still at a loss >> and can't find anything anywhere. > >Regardless of platform, I always recommend a split-install where you >have separate CATALINA_HOME (this is where you unpack the Tomcat >distribution files) and CATALINA_BASE (this is where you have your own >conf/* files private to the particular service you are running). > Chris, thanks a lot for this hint. I managed to get it set up the way I like. > >Most non-trivial deployments of Tomcat are simply too complicated to >give a cookie-cutter template for people to use. The cookie-cutter >template we have is: > >C:> unzip apache-tomcat-x.y.z.zip >C:> cd apache-tomcat-x.y.z >C:> set CATALINA_HOME=[here] >C:> set CATALINA_BASE=[path to custom config] >C:> service.bat install > >If you want to step outside of that cookie-cutter path, then you have >to start understanding how all the pieces fit together so you can >build-up a deployment that meets your own needs. This is what I did: mkdir c:\Program Files\tomcat unzip apache-tomcat-x.y.z.zip -d c:\Program Files\tomcat mkdir d:\tomcat-server-1\{bin,conf,logs,temp,webapps,work} cp -r c:\program files\tomcat\apache-x.y.z\conf d:\tomcat-server-1\ create d:\tomcat-server-1\bin\setenv.bat with this content: set "CATALINA_BASE=%~dp0%.." d:\tomcat-server-1\bin\setenv.bat cd c:\program files\tomcat\apache-x.y.z\bin .\service.bat install That was it. Unfortunately, I couldn't call service.bat with a full path as then it wouldn't find itself. In the script CATALINA_HOME defaults to %cd%. If it would default to %~dp0% I could have called the script directly. Anyway. I modified my d:\tomcat-server-1\conf\server.xml the way I need it and the tomcat service started right away. So the most important part for me was that you have to create CATALINA_BASE yourself and put some files from the distribution there. I wish tomcat came with a script which does this. But once you know what is required it isn’t hard to do. Thanks again, Michael - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat Installation on Windows
On Wednesday, June 13, 2018 3:11 PM Igal Sapir wrote: >On 6/13/2018 3:58 AM, Lemke, Michael ST/HZA-ZIC2 wrote: >> I've been struggling to come to grips with Tomcat installation on Windows >> Server but I couldn't really find a clear answer. This is what I want to >> achieve: >> >>* Have one directory tree with all my webapps >>* Have a tomcat installation somewhere different, like C:\Program Files >>* run tomcat as a service >>* be able to easily replace/update the tomcat installation >> >> I could run the supplied installer and it created a working service. Editing >> server.xml I could make it use my intended webapps directory. So far so good >> (if I got that server.xml right) but now all lives in something like >> D:\apache-tomcat-9.0.6. Not good. The Windows service configuration has this >> path hard coded in its definition, the directory has files with installation >> specific configuration and some other live working directories also end up >> there. >> Any suggestion how to do this right? So that I can easily upgrade this to >> say, tomcat 9.0.8? > >You can use bin/service.bat [1] to install the service with the settings >that you want. > >Set your configuration settings in environment variables, e.g. > > set CATALINA_HOME= > set JRE_HOME= > Can you elaborate on this? Which variables and do they have to be environment variables? I'd rather much prefer parameters to install scripts. Further down you refer to CATALINA_BASE. Would I not have to start with it to achieve the goals stated above? >Then install the Windows service with > > service.bat install > >If you want to update a previous installation then first uninstall the >service with > > service.bat uninstall > >Be sure to check the changelog for breaking changes first. But then I have to manually copy my whole server.xml configuration and hope it is still compatible? Move all logfiles over? It is that I need to separate the Tomcat installation from my specific configuration and from the runtime requirements. Is this not possible? What is a recommended setup on Windows? So far I am still at a loss and can't find anything anywhere. > >> For now, I'd be happy with a single Tomcat service but to be able to have >> several (on different ports of course) would be a welcome bonus. > >Use a different SERVICE_NAME and a different CATALINA_BASE for each >installation. e.g. > > set CATALINA_BASE= > >[1] https://github.com/apache/tomcat/blob/trunk/bin/service.bat#L17 > - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat Installation on Windows
I've been struggling to come to grips with Tomcat installation on Windows Server but I couldn't really find a clear answer. This is what I want to achieve: * Have one directory tree with all my webapps * Have a tomcat installation somewhere different, like C:\Program Files * run tomcat as a service * be able to easily replace/update the tomcat installation I could run the supplied installer and it created a working service. Editing server.xml I could make it use my intended webapps directory. So far so good (if I got that server.xml right) but now all lives in something like D:\apache-tomcat-9.0.6. Not good. The Windows service configuration has this path hard coded in its definition, the directory has files with installation specific configuration and some other live working directories also end up there. Any suggestion how to do this right? So that I can easily upgrade this to say, tomcat 9.0.8? For now, I'd be happy with a single Tomcat service but to be able to have several (on different ports of course) would be a welcome bonus.