• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomcat10 Issues running web app

 
Greenhorn
Posts: 3
  • Number of slices to send:
    Optional 'thank-you' note:
Hi guys i'm newbie in Tomcat, i have deployed on web apps war file but it gives me errors. i have checked the logs but i don't have any idea whats going wrong.
Please can anyone help me with this issue? the logs are as follows
Thanks

catalina: ---------------------------------------------------------------------------------------------------------------
11-Aug-2022 12:52:35.577 INFO [http-nio-8080-exec-16] 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.

localhost_access_log :---------------------------------------------------------------------------------------------
127.0.0.1 - - [11/Aug/2022:12:52:12 +0200] "GET / HTTP/1.1" 200 11437
127.0.0.1 - - [11/Aug/2022:12:52:18 +0200] "GET /manager/html HTTP/1.1" 401 2562
127.0.0.1 - admin [11/Aug/2022:12:52:25 +0200] "GET /manager/html HTTP/1.1" 200 17074
127.0.0.1 - - [11/Aug/2022:12:52:25 +0200] "GET /manager/css/manager.css HTTP/1.1" 200 2946
127.0.0.1 - - [11/Aug/2022:12:52:29 +0200] "GET /BilancWebApp/ HTTP/1.1" 404 769
127.0.0.1 - admin [11/Aug/2022:12:52:35 +0200] "POST /manager/html/start;jsessionid=C0964E088F326C87A81DDE96F341210A?path=/BilancWebApp&org.apache.catalina.filters.CSRF_NONCE=F9757E121A0AF1B7A5724E9408349CE1 HTTP/1.1" 200 16050

manager log -----------------------------------------------------------------------------------------------------------------------
11-Aug-2022 12:52:25.723 INFO [http-nio-8080-exec-13] org.apache.catalina.core.ApplicationContext.log HTMLManager: list: Listing contexts for virtual host 'localhost'
11-Aug-2022 12:52:32.102 INFO [http-nio-8080-exec-16] org.apache.catalina.core.ApplicationContext.log HTMLManager: start: Starting web application '/BilancWebApp'
11-Aug-2022 12:52:35.579 SEVERE [http-nio-8080-exec-16] org.apache.catalina.core.ApplicationContext.log HTMLManager: Error starting [/BilancWebApp]
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/BilancWebApp]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1415)
at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:703)
at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:221)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:694)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:777)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:223)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:203)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
at org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:126)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:661)
at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:378)
at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:56)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:119)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:356)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:867)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1760)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: javax/servlet/ServletRequestListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2510)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:877)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1413)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1257)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:535)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:516)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150)
at org.apache.catalina.core.ApplicationContext.addListener(ApplicationContext.java:1091)
at org.apache.catalina.core.ApplicationContextFacade.addListener(ApplicationContextFacade.java:662)
at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5168)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 35 more
Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletRequestListener
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1449)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1257)
... 50 more
11-Aug-2022 12:52:35.579 INFO [http-nio-8080-exec-16] org.apache.catalina.core.ApplicationContext.log HTMLManager: list: Listing contexts for virtual host 'localhost'

 
Saloon Keeper
Posts: 15625
366
  • 2
  • Number of slices to send:
    Optional 'thank-you' note:
Welcome to CodeRanch!

Tomcat 10 is based on the Jakarta EE 9 specification, not the old Java EE specifications. That means your application needs a dependency on the Jakarta EE 9 API libraries, and you need to refactor your code to use only types from the jakarta namespaces.

For instance, you code appears to be using javax.servlet.ServletRequestListener, but instead it should be using jakarta.servlet.ServletRequestListener.
 
Saloon Keeper
Posts: 27871
196
  • 1
  • Number of slices to send:
    Optional 'thank-you' note:

Stephan van Hulst wrote:Welcome to CodeRanch!

Tomcat 10 is based on the Jakarta EE 9 specification, not the old Java EE specifications. That means your application needs a dependency on the Jakarta EE 9 API libraries, and you need to refactor your code to use only types from the jakarta namespaces.

For instance, you code appears to be using javax.servlet.ServletRequestListener, but instead it should be using jakarta.servlet.ServletRequestListener.



If that's not an option for the moment, switch to Tomcat 9, which uses the old package space. Then budget for migration.
 
Saloon Keeper
Posts: 7597
177
  • 1
  • Number of slices to send:
    Optional 'thank-you' note:
Another option is the Tomcat migration tool, which allows you to use old-style webapps on Tomcat 10 and newer.
 
Medar Shtylla
Greenhorn
Posts: 3
  • Number of slices to send:
    Optional 'thank-you' note:
thanks buddies, i downgraded Tomcat to version 9 and works.
But i cannot connect to mssql server
 
Tim Moores
Saloon Keeper
Posts: 7597
177
  • Number of slices to send:
    Optional 'thank-you' note:

But i cannot connect to mssql server


Describe in detail what "cannot connect" means. If there are error messages, either on web pages or in the Tomcat log files, post those in full.
 
Medar Shtylla
Greenhorn
Posts: 3
  • Number of slices to send:
    Optional 'thank-you' note:
the login form appears, but throws error that username and password are not correct, which makes me think that tomcat is not connected with database.
i have added this config to context.xml :

<Resource name="jdbc/sqlserver"
     auth="Container"
     type="javax.sql.DataSource"
     driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
     url="jdbc:sqlserver://localhost:1433;databaseName=test;user=WebUser;password=web;"
     username="WebUser"
     password="web"
     maxActive="20"
     initialSize="0"
     minIdle="0"
     maxIdle="8"
     maxWait="10000"
     timeBetweenEvictionRunsMillis="30000"
     minEvictableIdleTimeMillis="60000"
     testWhileIdle="true"
     poolPreparedStatements="true"
     maxOpenPreparedStatements="100"
     validationQuery="SELECT 1"
     maxAge="600000"
     rollbackOnReturn="true"
     />
 
Tim Moores
Saloon Keeper
Posts: 7597
177
  • Number of slices to send:
    Optional 'thank-you' note:
Is there anything in any of the Tomcat log files?
 
Tim Holloway
Saloon Keeper
Posts: 27871
196
  • Number of slices to send:
    Optional 'thank-you' note:
If you are using JEE-standard security, the database connection you need is in the Realm definition. The application's database connection pool doesn't get used for that.

If you have written your own security system, well, as I often say, the technical term for user-designed security is "hacked" or "pwned", but regardless, we'd need to see the Tomcat logs.
 
Greenhorn
Posts: 1
  • Number of slices to send:
    Optional 'thank-you' note:
I've been having trouble for the past several days deploying an example Java application in AppService on a Linux environment using Tomcat.
The application is built and deployed correctly in the Azure app service when I use the usual Maven build and deploy workflow using pipeline.
Meanwhile, when I try to access the url, all I can see is my application's index page; however, the url /SpringWeb/hello returns a 404 error. The application functions flawlessly on my personal Tomcat server https://distinguished.io/companies/software-development
 
Tim Holloway
Saloon Keeper
Posts: 27871
196
  • Number of slices to send:
    Optional 'thank-you' note:
Welcome to the Ranch, Rematraza!

Your URL points to something that looks like Blatant Advertising. I hope you are not attempting to abuse this forum bt pretending to ask a question when you're actually just doing self-promotion.

I'm afraid I cannot help much with Windows-related issues, since I haven't worked with Windows for years now, but Tomcat should operate exactly the same in both real and virtual machines — and containers — regardless of OS. At least as long as you don't hard-code OS-dependent file paths into the app.

I also don't use Maven to deploy so I'm not much help there either. I use Maven to build, and sometimes I build OS-installable packages, but I don't have Maven directly install them into the target machine.

My best suggestion is to take the WAR that works on your own machine and manually install it into the target VM and see if you still have problems. If you do, then there's likely some sort of proxy confugration problems, not Tomcat problems. If you do not have problems, then the Maven installer is apparently not capable of handling the special connectivity needs of that machine (although that might just be a POM config issue).
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic
vceplus-200-125    | boson-200-125    | training-cissp    | actualtests-cissp    | techexams-cissp    | gratisexams-300-075    | pearsonitcertification-210-260    | examsboost-210-260    | examsforall-210-260    | dumps4free-210-260    | reddit-210-260    | cisexams-352-001    | itexamfox-352-001    | passguaranteed-352-001    | passeasily-352-001    | freeccnastudyguide-200-120    | gocertify-200-120    | passcerty-200-120    | certifyguide-70-980    | dumpscollection-70-980    | examcollection-70-534    | cbtnuggets-210-065    | examfiles-400-051    | passitdump-400-051    | pearsonitcertification-70-462    | anderseide-70-347    | thomas-70-533    | research-1V0-605    | topix-102-400    | certdepot-EX200    | pearsonit-640-916    | itproguru-70-533    | reddit-100-105    | channel9-70-346    | anderseide-70-346    | theiia-IIA-CIA-PART3    | certificationHP-hp0-s41    | pearsonitcertification-640-916    | anderMicrosoft-70-534    | cathMicrosoft-70-462    | examcollection-cca-500    | techexams-gcih    | mslearn-70-346    | measureup-70-486    | pass4sure-hp0-s41    | iiba-640-916    | itsecurity-sscp    | cbtnuggets-300-320    | blogged-70-486    | pass4sure-IIA-CIA-PART1    | cbtnuggets-100-101    | developerhandbook-70-486    | lpicisco-101    | mylearn-1V0-605    | tomsitpro-cism    | gnosis-101    | channel9Mic-70-534    | ipass-IIA-CIA-PART1    | forcerts-70-417    | tests-sy0-401    | ipasstheciaexam-IIA-CIA-PART3    | mostcisco-300-135    | buildazure-70-533    | cloudera-cca-500    | pdf4cert-2v0-621    | f5cisco-101    | gocertify-1z0-062    | quora-640-916    | micrcosoft-70-480    | brain2pass-70-417    | examcompass-sy0-401    | global-EX200    | iassc-ICGB    | vceplus-300-115    | quizlet-810-403    | cbtnuggets-70-697    | educationOracle-1Z0-434    | channel9-70-534    | officialcerts-400-051    | examsboost-IIA-CIA-PART1    | networktut-300-135    | teststarter-300-206    | pluralsight-70-486    | coding-70-486    | freeccna-100-101    | digitaltut-300-101    | iiba-CBAP    | virtuallymikebrown-640-916    | isaca-cism    | whizlabs-pmp    | techexams-70-980    | ciscopress-300-115    | techtarget-cism    | pearsonitcertification-300-070    | testking-2v0-621    | isacaNew-cism    | simplilearn-pmi-rmp    | simplilearn-pmp    | educationOracle-1z0-809    | education-1z0-809    | teachertube-1Z0-434    | villanovau-CBAP    | quora-300-206    | certifyguide-300-208    | cbtnuggets-100-105    | flydumps-70-417    | gratisexams-1V0-605    | ituonline-1z0-062    | techexams-cas-002    | simplilearn-70-534    | pluralsight-70-697    | theiia-IIA-CIA-PART1    | itexamtips-400-051    | pearsonitcertification-EX200    | pluralsight-70-480    | learn-hp0-s42    | giac-gpen    | mindhub-102-400    | coursesmsu-CBAP    | examsforall-2v0-621    | developerhandbook-70-487    | root-EX200    | coderanch-1z0-809    | getfreedumps-1z0-062    | comptia-cas-002    | quora-1z0-809    | boson-300-135    | killtest-2v0-621    | learncia-IIA-CIA-PART3    | computer-gcih    | universitycloudera-cca-500    | itexamrun-70-410    | certificationHPv2-hp0-s41    | certskills-100-105    | skipitnow-70-417    | gocertify-sy0-401    | prep4sure-70-417    | simplilearn-cisa    |
http://www.pmsas.pr.gov.br/wp-content/    | http://www.pmsas.pr.gov.br/wp-content/    |