Tomcat Uninstall Using Control Panel-Tomcat Service not deleted
I installed tomcat 9.0.12 using Windows Installer .exe on windows server 2016. It was running fine on port 8080. I had also logged into tomcat service using server admin credentials, not local system.
I wanted to run on port 80 so made the required changes in server.xml but no effect. I reverted the changes(had backed up server.xml).
So I stopped the tomcat service, tried uninstalling using uninstall exe present in tomcat directory but it it prompted me:
No service name specified to uninstall. This will be provided automatically if you uninstall via Add/Remove Programs or the shortcut on start menu. Alternatively, call the installer from the command line with -ServiceName=""
- Therefore, I uninstalled tomcat from Add/Remove Programs but tomcat9w.exe in tomcat/bin was not deleted nor was the service Apache Tomcat 9.0 Tomcat9 from services. The service is showing up as disabled in services.msc. Due to this, I cannot reinstall tomcat as the tomcat installer says service by same name already exists.
What would be the best way to install tomcat now?
See also questions close to this topic
Logger file rotation not working when python code started from windows service
I am starting a python application (exe version created using pyInstaller) from a windows service (created in python, converted to exe using pyinstaller and installed using sc) but the log files generated by my application are not getting rotated.
So I have actually used a logger.conf file which has logger configuration with rotatingFileHandler to rotate file after every 10KBs (for testing purpose). The configuration in conf file looks like this:
... [handler_fileRotationHandler] class=logging.handlers.RotatingFileHandler level=NOTSET formatter=simpleFormatter args=('<absolute path of log file>','a',10240,5) ...
Inside python code I am using this config to create and rotate log files.
Here is a list of cases when proper log file rotation works:
1- The python version started using python command
2- The exe version (created using PyInstaller) works fine when launched by double clicking directly
3- The exe version when started from a windows service also created in python, if service is installed using python commands like below:
Now here is when it does not work:
I am converting the windows service code to exe (using pyInstaller again) and install the service with sc using below command:
sc create MyService binPath= "<absolute path of service exe file>"
When started using this service, the application works fine, and log file is generated too, but after reaching the max size defined in fileHandler for log, it does not create another log file and thus gets stuck in terms of log there only. The application keeps on working perfectly fine, just logs doesn't get recorded.
Here is what I have tried and observed:
1- In both cases, I have launched my app exe version using subprocess.Popen() command and my application does not have any UI element, so it runs perfectly in windows session 0 in background. Just for the information, in case it is relevant.
2- If I remove existing log statements and empty log file, logs start to get logged in the file and again stop when max size reach.
3- I have used os.getcwd() command to get directory where my app runs when launched in both cases for which I found below directories:
in python service installed using python case, app runs in "C:\Users\\AppData\Local\Programs\Python\Python36\lib\site-packages\win32"
while in exe version launched from service installed using sc case, app runs in "C:\Windows\system32"
Although in both cases, the logging.conf file provides the log file creation path, so I am assuming this should not be any issue (in fact, log file does gets created at expected location, just file rotation does not work, so this I guess is not relevant)
I need to use the exe version installed by sc only and not python service version. How to solve this issue, any help or guidance or direction is appreciated.
PS script unauthorized access exception when overcopy assemblies
I have a Visual Studio application that builds following assemblies :
ADODB.dll Autofac.dll Autofac.xml MoreLinq.dll MoreLinq.xml NodaTime.dll NodaTime.xml MyApp.dll MyApp.pdb System.Interactive.dll System.Interactive.xml
My app runs as a plug-in to a larger commercial app, which requires my app's binaries to be installed to the commercial app's plugins subfolder.
My PowerShell deploy scripts (1) stops the third-party app's services ( all five of them ), (2) over-copies binaries, (3) starts services.
I'm finding that
MyApp.pdbovercopy with no problem, but the dependencies libs (
ADODB.dlletc. ) encounter
How can I further diagnose this failure ? How can I analyze what services/processes potentially have locks on these assemblies ?
VB.Net Service on Windows 10 pins incorrect files to Start Menu (original post garbled)
Windows 10 Pro (64 bit), NET 3.5+, Visual Studio 2008
I have written and successfully installed a service but have a problem with the installed files. The correct Help file is on the desktop and both the CompanyName folder and the ServiceName folder are in Program Files.
The problem is that there is an Uninstall file pinned to the Start Menu (this is from the ServiceName folder in Program Files) but there is no CompanyName on the Start Menu.
When installed on Windows 7 the Uninstall file appears correctly in the CompayName folder on the Start Menu.
My question is simply how to fix this.
IIS Blue / Green deployment wrong sites started after reboot
We setup our IIS sites to accommodate blue / green deployments. We noticed that after reboot the wrong sites get started.
app.entrysite we have a rewrite rule that forwards traffic to either the
app.greendepending on which is the active site. This all works as expected and has for quite some time.
Recently, because of Windows Updates the server has rebooted during non-production hours. After the reboot we noticed the wrong IIS sites are getting started. So, for example app.blue was the active site and the rewrite rule is pointing to
app.entryrule. After the reboot,
app.greenis started, but obviously the entry rule is pointing to blue.
We are using the IIS Admin API to manage the site swaps and updating the rewrite rule. What seems to be strange is the sites that get started were set as the previous Blue / Green site. In the example above,
app.greenwas the previous site so after reboot it gets restarted and the
The only option I can think of to correct this is to has a task run after reboot to check the rewrite rules and start / stop the correct sites.
Windows Server 2016 Active Directory Joining Issue
I'm having an issue Joining my Amazon Web Services Windows Server 2016 Base Active Directory Server. I have assigned it an Elastic IP Address.
What I'm trying to do is: Join my AWS Windows Active Directory Server to another server at my home network. It was working before I shut down my AWS and my Server at home. I was connected to the DOMAIN and everything was working before it shut down. I ended up resetting my AWS server and then re-trying it again but nothing is working now. All of the ports are opened.
I have configured the IPV4 Preferred DNS Server on the server at home to the Elastic IP Address from AWS. I'm able to ping it but the ping is return the Private IP Address of the AWS Server.
The firewalls are also all turned of on both servers, the aws server and my local server at home.
I'm guessing its a DNS Issue since its returning the Local Private IP Address from AWS but Don't know how to fix this?
This is a learning experience just me tinkering with Windows Server 2016
Here are the DNS Settings on my AWS Server. DNS Settings on my AWS Server Image
Connect MS-Server2016 to Internet
Looking for any help and support and help , because I'm absolutly noob in this situation.
I have installed and run well MS Server 2016.
DNS Name : "MS-SERVER"
Server run on local ip: 10.111.10.12
myip.com show me Your IP address is:" : 188.8.131.52
ipconfig show me IP V4 : 184.108.40.206
Domain name: GoldSite.COM
I need provide web accesss to local shared folder. Folder with files, very simple web site. Someone can tell me what are steps for connect my web site to Internet?
JDBC Digest Authentication Tomcat 9
I'm attempting to use basic DIGEST authentication for my website (we're just learning).
- I'm currently using Tomcat v9.0.14
- I'm using JavaEE with Eclipse
- The database functions properly (we coded that first and used it as a basis for this part)
<Realm className="org.apache.catalina.realm.JDBCRealm" digest="MD5" driverName="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/MTP" connectionName="zzz" connectionPassword="zzz" userTable="users" userNameCol="user_name" userCredCol="user_pass" userRoleTable="user_roles" roleNameCol="role_name" /> <CredentialHandler className="org.apache.catalina.realm.MessageDigestCredentialHandler" algorithm="MD5" iterations="1" saltlength="0" />
<role rolename="admin"/> <user username="Manager" password="202cb962ac59075b964b07152d234b70" roles="admin"/>
<login-config> <auth-method>DIGEST</auth-method> <realm-name>jdbcRealm</realm-name> <form-login-config> <form-login-page>/admin/Admin.jsp</form-login-page> <form-error-page>/LoginError.jsp</form-error-page> </form-login-config> </login-config>
My question is: What about my code is wrong? It all looks right, but it doesn't accept my plaintext version of the password, it ONLY accepts the hash of it (because its saved in the database).
How to change routes for Tomcat ROOT, manager, host-manager directories (menus)
I have changed ROOT app of Tomcat to /panel directory, because I user "/" directory for my deployed app. How can I configure Tomcat to access home menu (ROOT app) and managers (manager, host-manager) in other routes, because currently I get error, when trying to navigate /manager
I am accesing home panel on http://localhost:8080/panel/
<Context path="/panel" docBase="ROOT"></Context>
Clicking "Manage app" routes me to http://localhost:8080/manager/html and gives error
HTTP Status 404 – Not Found
Type Status Report
Message Not found
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exist
I tried to add
<Context path="/manager" docBase="manager"></Context>
But that gives me error
HTTP Status 500 – Internal Server Error
Type Exception Report
Message Error instantiating servlet class [org.apache.catalina.manager.HTMLManagerServlet]
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
javax.servlet.ServletException: Error instantiating servlet class [org.apache.catalina.manager.HTMLManagerServlet] org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:607) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:748)
java.lang.SecurityException: Access to class [class org.apache.catalina.manager.HTMLManagerServlet] is forbidden. It is a restricted class (implements ContainerServlet interface). A web application must be configured as privileged to be able to load it org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:607) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:748)
Note The full stack trace of the root cause is available in the server logs
MS WINDOWS: Declaring setenv.bat for Tomcat9 for use with THREDDS server - What is wrong with my syntax?
UPDATE: I've tried starting TomCat from commandline. During the startup messages I get this:
15-Mar-2019 09:05:08.603 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [C:\Program Files\ASF\Tomcat9\webapps\thredds.war] 15-Mar-2019 09:05:15.900 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 15-Mar-2019 09:05:18.286 INFO [main] org.hibernate.validator.internal.util.Version.<clinit> HV000001: Hibernate Validator 4.3.2.Final 15-Mar-2019 09:05:19.382 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file 15-Mar-2019 09:05:19.383 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal Context [/thredds] startup failed due to previous errors 15-Mar-2019 09:05:19.460 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [thredds] appears to have started a thread named [Log4j2-TF-12-Scheduled-2] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078) java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093) java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809) java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) java.lang.Thread.run(Thread.java:748) 15-Mar-2019 09:05:19.469 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [C:\Program Files\ASF\Tomcat9\webapps\thredds.war] has finished in [10,866] ms
I'm starting to believe that Gerhard is right that it is not a batch issue?
I'm trying to deploy the THREDDS server (version 4.6.13) for Windows using Tomcat 9. However, when I try to start the server I get:
FAIL - Application at context path [/thredds] could not be started
I've tried creating setenv.bat from a working setenv.sh on a Linux-machine, but my batch-scripting is more than rusty, but I certainly believe it's down to wrong syntax.
My script file is as follows:
@ECHO OFF set "CATALINA_HOME=%ProgramFiles%/ASF/Tomcat9" set "CATALINA_BASE=%ProgramFiles%/ASF/Tomcat9" set "JAVA_HOME=%ProgramFiles%/AdoptOpenJDK/jdk8u202-b08-jre" :: TDS specific ENVARS :: :: Define where the TDS content directory will live :: set "CONTENT_ROOT=-Dtds.content.root.path=%ProgramFiles%/ASF/Tomcat9/content" :: set java prefs related variables (used by the wms service, for example) set "JAVA_PREFS_ROOTS=-Djava.util.prefs.systemRoot=%CATALINA_HOME%/content/thredds/javaUtilPrefs -Djava.util.prefs.userRoot=%CATALINA_HOME%/content/thredds/javaUtilPrefs" :: Some commonl used JAVA_OPTS settings: set NORMAL="-d64 -Xmx4096m -Xms512m -server -ea" set HEAP_DUMP="-XX:+HeapDumpOnOutOfMemoryError" set HEADLESS="-Djava.awt.headless=true"
Where did I mess up?