Tomcat 9 no responde en puerto 80

Estoy haciendo una aplicación web con Spring y quiero probarla en un servidor tomcat 9. La cuestión es que al configurarlo va todo OK desde localhost y la IP publica. Compré un dominio en DonDominio y todo bien hasta el momento que instalé y configuré el DonDns para la IP dinámica. En ese momento tomcat dejo de responder al puerto 80 desde la IP pública. Puerto abierto y todo correcto. Miré los servicios y conexiones y el puerto no está siendo usado. Si cambio el pierto del tomcat al 81 vuelve a funcionar todo. Alguna idea de que puede ser?? Un saludo

docker-compose tomcat – mapear diretório externo

Tenho uma aplicação rodando no tomcat aonde quando eu faço upload de uma imagem, ela salva em “portal/WEB-INF/classes/static/img” que é um diretório dentro da minha aplicação. O problema é que quando eu atualizo a aplicação, o tomcat destrói o diretório e recria e eu perco as imagens salvas. Gostaria de mapear um diretório fora da minha aplicação (ex.: /opt/img) para salvar essas imagens, isso é possível via docker-compose?

Services: tomcat: image: tomcat:8.5-jre8 volumes: – ./Tomcat/Webapps:/usr/local/tomcat/webapps – ./Tomcat/Logs:/usr/local/tomcat/logs – ./Tomcat/Webapps/portal/WEB-INF/classes/static/img:/opt/img – ./tomcat-users.xml:/usr/local/tomcat/conf/tomcat-users.xml – ./server.xml:/usr/local/tomcat/conf/server.xml ports: – “8090:8080”

Configuring APR, OpenSSL, Tomcat Native Library, Java 1.8.0_171-b11 on Tomcat 8.5.32

I am trying to configure our dedicated server to use two SSL certificates with the same IP address. The only way to do so is to use SNI. But before I can use SNI, I have to configure Tomcat with APR, OpenSSL and Tomcat Native Library.

I tried to configure Tomcat to use APR 1.6.5, OpenSSL 1.0.2o, Tomcat Native Library 1.2.17 with Java 1.8.0_171-b11.

I added in a file setenv.sh to contain the lines LD_LIBRARY_PATH=’$ LD_LIBRARY_PATH:$ CATALINA_HOME/lib:/usr/local/apr/lib’ export LD_LIBRARY_PATH

But when I restarted Tomcat, it encountered the following error: 10-Apr-2019 17:56:25.395 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Lo aded APR based Apache Tomcat Native library [1.2.17] using APR version [1.6.5].

10-Apr-2019 17:56:25.395 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent AP R capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].

10-Apr-2019 17:56:25.395 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent AP R/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]

10-Apr-2019 17:56:25.396 SEVERE [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Failed to initialize the SSLEngine. org.apache.tomcat.jni.Error: 70023: This function has not been implemented on this platform at org.apache.tomcat.jni.SSL.initialize(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.core.AprLifecycleListener.initializeSSL(AprLifecycleListener.java:289 ) at org.apache.catalina.core.AprLifecycleListener.lifecycleEvent(AprLifecycleListener.java:13 6) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94) at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:395) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106) at org.apache.catalina.startup.Catalina.load(Catalina.java:632) at org.apache.catalina.startup.Catalina.load(Catalina.java:655) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:309) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)

10-Apr-2019 17:56:25.458 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler [“http-nio-8080”]

What have I done wrong? Am I using incompatible versions of the APR, OpenSSL, Tomcat Native, Tomcat server or Java? What minimum version of each of the above software should I use?

using kubectl how to merge/link a tomcat container with another container having mysql installed in it?

I have built a tomcat image using the following dockerfile

FROM tomcat COPY data-core.war /usr/local/tomcat/webapps/ 

then I built it using

docker build --no-cache -t tomcat:warfile . 

Now how do I link a container based off this image with another container having mysql installed in it. Iam not really sure how the tomcat container can interact with the mysql database container.

Then finally i want to deploy/overlay this using kubernetes using the following yaml files for deployment and service.

1) deployment.yaml

apiVersion: apps/v1 kind: Deployment metadata:   name: tomcat-pod spec:   selector:     matchLabels:       run: tomcat-pod   replicas: 1   template:     metadata:       labels:         run: tomcat-pod     spec:       containers:       - name: tomcat         image: tomcat:warfile         ports:         - containerPort: 8080 

2) service.yaml

apiVersion: v1 kind: Service metadata:   name: tomcat-pod   labels:     run: tomcat-pod spec:   type: NodePort   ports:   - port: 8080     targetPort: 8080   selector:     run: tomcat-pod 

Tomcat 7 war application SQL driver missing

When I deploy my WAR application on Tomcat 7 on my Synology NAS, everything goes fine the first time. But when I want to update the war file to a newer version, I have to stop the current session to upload the new war file. When I then try to start the new application, I get the following error message in the manager:

FAIL - Application at context path /Franke2-0.1 could not be started FAIL - Encountered exception org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Franke2-0.1]] 

When I reinstall Tomcat 7 and use the exact same war file as before, it works again. But I don’t want to reinstall Tomcat every time I want to upload a newer version of my application.

My application a Grails Application and I am using an external database, not Grails integrated one. In the catalina.out log file I am getting the following error:

java.sql.SQLException: No suitable driver found for jdbc:sqlite:./database/dataUser.db at java.sql.DriverManager.getConnection(DriverManager.java:689) at java.sql.DriverManager.getConnection(DriverManager.java:270) at home.DatabaseUser.check(DatabaseUser.java:242) at home.DatabaseUser$  check.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:136) at franke2.LoginController.login(LoginController.groovy:12) at org.grails.core.DefaultGrailsControllerClass$  MethodHandleInvoker.invoke(DefaultGrailsControllerClass.java:223) at org.grails.core.DefaultGrailsControllerClass.invoke(DefaultGrailsControllerClass.java:188) at org.grails.web.mapping.mvc.UrlMappingsInfoHandlerAdapter.handle(UrlMappingsInfoHandlerAdapter.groovy:90) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) at javax.servlet.http.HttpServlet.service(HttpServlet.java:650) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:111) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:77) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:103) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:130) at org.springframework.boot.web.support.ErrorPageFilter.access$  000(ErrorPageFilter.java:66) at org.springframework.boot.web.support.ErrorPageFilter$  1.doFilterInternal(ErrorPageFilter.java:105) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:123) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:1025) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1137) at org.apache.coyote.AbstractProtocol$  AbstractConnectionHandler.process(AbstractProtocol.java:637) at org.apache.tomcat.util.net.JIoEndpoint$  SocketProcessor.run(JIoEndpoint.java:318) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$  Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$  WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) 

I have already tried to paste the sqlite-jdbc-3.27.2.1.jar in both the Tomcat lib folder and the WEB-INF/lib folder of my application, but it didn’t change anything.

The weird thing is, that even though the application starts after reinstalling Tomcat, the database does not work and I am getting the same SQLException as above.

Thanks in advance!

Tomcat 8.5 on Ubuntu 16.04 using Letsencrypt certificate not working

I have repeated the process a number of times, both in local, using a VM and in the final server and for some reason I can’t figure out, connection via HTTPS doesn’t work. It stays on “Performing a TLS handshake…” until it ends with a “Time out”.

From a fresh installation of Ubuntu 16.04, I installed:

Java (8)

Tomcat (8.5) and authbind, so Tomcat can use ports 80 and 443 With a tomcat.service similar to this one: http://azurvii.blogspot.com/2016/06/tomcat-8-authbind-on-port-80443-systemd.html

[Unit] Description=Tomcat Container After=network.target  [Service] Type=forking  Environment=JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre Environment=CATALINA_PID=/home/tomcat/tmp/tomcat.pid Environment=CATALINA_HOME=/home/tomcat/apache-tomcat-8.0.35 Environment=CATALINA_BASE=/home/tomcat/apache-tomcat-8.0.35  ExecStart=/home/tomcat/apache-tomcat-8.0.35/bin/startup.sh ExecStop=/home/tomcat/apache-tomcat-8.0.35/bin/shutdown.sh  User=tomcat Group=tomcat RestartSec=10 Restart=always  [Install] WantedBy=multi-user.target 

Besides switching /opt/tomcat/bin/startup.sh last line for this one:

exec authbind --deep "$  PRGDIR"/"$  EXECUTABLE" start "$  @" 

certbot – Via repositories:

 $   sudo apt-get update  $   sudo apt-get install software-properties-common  $   sudo add-apt-repository universe  $   sudo add-apt-repository ppa:certbot/certbot  $   sudo apt-get update  $   sudo apt-get install certbot 

Got the certificate using webroot option:

$   sudo certbot certonly --webroot --webroot-path /opt/tomcat/webapps/ROOT/ -d domainInQuestion.com //Obviously using the real domain. 

Checked the renew command from certbot:

$   sudo certbot renew --dry-run // It works perfectly. 

And configured the HTTPS Tomcat’s connector as mentioned here: https://stackoverflow.com/questions/49431642/letsencrypt-ssl-tomcat8-ubuntu-16-04#51362347

<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true">     <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol"/>     <SSLHostConfig>        <Certificate            certificateKeyFile="/etc/letsencrypt/live/YOUR_WEBSITE_HERE/privkey.pem"            certificateFile="/etc/letsencrypt/live/YOUR_WEBSITE_HERE/cert.pem"           certificateChainFile="/etc/letsencrypt/live/YOUR_WEBSITE_HERE/chain.pem"            type="RSA" />     </SSLHostConfig> </Connector> 

While accessing the server via port 80 works well (I can do it both in local installation and in the server one without problems), accessing via HTTPS stays on “Performing a TLS handshake…” in both (Just mentioning this because when doing the tests on local I thought it could be related to the LAN configuration/firewall, but no, the exactly same problem occurs on the server).

The main/BIG problem to me is I can’t figure out where is the very problem, since I have checked the process with many other sites/manuals/documentation I do not find what I do wrong, besides I can’t find any error in any log file or after execution any command. Apparently there are no errors, however it is obvious that I am doing something wrong or forgetting to do something else.

What could possibly be the problem?

Appending new lines in Tomcat Catalina log rotate

Application running on Tomcat is using log4j for some unknown reason is appending (randomly) new log lines somewhere in the middle of the log file

log4j.properites looks like:

log4j.rootLogger=INFO, CATALINA log4j.appender.CATALINA=org.apache.log4j.rolling.RollingFileAppender log4j.appender.CATALINA.RollingPolicy=org.apache.log4j.rolling.TimeBasedRollingPolicy log4j.appender.CATALINA.RollingPolicy.FileNamePattern=$  {catalina.base}/logs/catalina.%d{yyyy-MM-dd}.log log4j.appender.CATALINA.layout=com.medallies.log.ThreadIdSupportedPatternLayout log4j.appender.CATALINA.layout.ConversionPattern=[TID=%i] %-5p %d{HH:mm:ss,SSS} | %c | %m%n 

Tomcat restart will help in that case but after some time issue will come back.

Any thought on that?

Documentacion de Tomcat

estoy haciendo un montaje de un entorno para la empresa y necesito ayuda con el tomcat(server), Me han dado una documentación con los requisitos que necesita ese entorno( con eso no hay problema) y los pasos para montar el tomcat con catalina, pero cada vez que uso debug para iniciarlo y ver si hay errores no se me inicia dicho entorno. No quiero que me lo den hecho, solo si alguien tiene otra documentación de tomcat para este caso o si le ha sucedido algo similar le agradeceria la ayuda.

Como iniciar dois serviços iguais no TomCat, porém com Final names diferentes

Basicamente tenho um serviço rodando no Tomcat, eu gostaria de subir uma cópia dele com outro final name no TomCat.

O problema é que existe algum limitador que não é o finalName que me impede de subir dois serviços iguais.

Ao tentar dar ‘Start’ no serviço o seguinte erro aparece:

FAIL - Application at context path [/xtr-conteudos-2] could not be started FAIL - Encountered exception [org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/xtr-conteudos-2]]] 

A estrutura do projeto compõe Thymeleaf e Spring, porém mesmo buscando este erro não consegui visualizar o que está limitando ele de rodar.

RESTful webservice with Java on Tomcat

i am having trouble creating a simple webservice in java with Tomcat (v. 9).
Essentialy i followed this guide from IntelliJ and it works perfectly if i use glassfish, but if i repeat the same steps with Tomcat 9 (just change the application server at the beginning of the guide) i get a 404.
So far i tried editing web.xml file but all the times i get the 404 (also i think it is not necessary since i didn’t have to change it for glassfish).
What do i have to do differently in order to make this guide work for Tomcat 9?