I have a simple maven spring project, when I run the project on the tomcat server, I don't see tomcat load the configuration on the start up.
MySpringMvcDispatcherServletInitializer.java
package com.abc.xyz.config;
import
org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
public class MySpringMvcDispatcherServletInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
#Override
protected Class<?>[] getRootConfigClasses() {
// TODO Auto-generated method stub
return null;
}
#Override
protected Class<?>[] getServletConfigClasses() {
return new Class[] { DemoAppConfig.class };
}
#Override
protected String[] getServletMappings() {
return new String[] { "/" };
}
}
DemoAppConfig.java
package com.abc.xyz.config;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
#Configuration
#EnableWebMvc
#ComponentScan("com.abc.xyz")
public class DemoAppConfig implements WebMvcConfigurer {
}
DemoRestController.java
package com.abc.xyz.rest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
#RestController
#RequestMapping("/test")
public class DemoRestController {
// add code for the "/hello" endpoint
#GetMapping("/hello")
public String sayHello() {
return "Hello World!";
}
}
tomcat7 startup log
Oct 24, 2018 4:15:45 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:spring-rest-demo' did not find a matching property.
Oct 24, 2018 4:15:45 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SIT_Dashboard' did not find a matching property.
Oct 24, 2018 4:15:45 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.82
Oct 24, 2018 4:15:45 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Sep 29 2017 12:23:15 UTC
Oct 24, 2018 4:15:45 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.82.0
Oct 24, 2018 4:15:45 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 7
Oct 24, 2018 4:15:45 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 6.1
Oct 24, 2018 4:15:45 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Oct 24, 2018 4:15:45 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\FAST\JDK64\LINKS\JDK8\jre
Oct 24, 2018 4:15:45 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_144-b01
Oct 24, 2018 4:15:45 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Oct 24, 2018 4:15:45 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: C:\FAST\ApacheTomcat\7.0.82\apache-tomcat-7.0.82
Oct 24, 2018 4:15:45 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: C:\FAST\ApacheTomcat\7.0.82\apache-tomcat-7.0.82
Oct 24, 2018 4:15:45 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\FAST\ApacheTomcat\7.0.82\apache-tomcat-7.0.82
Oct 24, 2018 4:15:45 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\FAST\ApacheTomcat\7.0.82\apache-tomcat-7.0.82
Oct 24, 2018 4:15:45 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\FAST\ApacheTomcat\7.0.82\apache-tomcat-7.0.82\wtpwebapps
Oct 24, 2018 4:15:45 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\FAST\ApacheTomcat\7.0.82\apache-tomcat-7.0.82\endorsed
Oct 24, 2018 4:15:45 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Oct 24, 2018 4:15:45 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\FAST\JDK64\LINKS\JDK8\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\FAST\JDK64\1.8.0.144\bin;C:\ProgramData\Oracle\Java\javapath;C:\oracle\product\11.2.0\client_64\BIN\;C:\Program Files\Micro Focus\Reflection\;C:\Program Files (x86)\Micro Focus\Reflection\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\1E\SMSNomad\;C:\Program Files\aim\aim-install\bin\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Git\cmd;C:\FAST\nodejs\6.11.4\;C:\Program Files\TortoiseSVN\bin;C:\opt\gate\base91\..\perl\bin;C:\Users\R633368\AppData\Roaming\npm;C:\FAST\maven\3.5.0\apache-maven-3.5.0\bin;.
Oct 24, 2018 4:15:45 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Oct 24, 2018 4:15:45 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Oct 24, 2018 4:15:45 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 768 ms
Oct 24, 2018 4:15:45 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Oct 24, 2018 4:15:45 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.82
Oct 24, 2018 4:15:46 PM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
WARNING: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [472] milliseconds.
Oct 24, 2018 4:15:47 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\FAST\ApacheTomcat\7.0.82\apache-tomcat-7.0.82\webapps\docs
Oct 24, 2018 4:15:47 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\FAST\ApacheTomcat\7.0.82\apache-tomcat-7.0.82\webapps\docs has finished in 101 ms
Oct 24, 2018 4:15:47 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\FAST\ApacheTomcat\7.0.82\apache-tomcat-7.0.82\webapps\examples
Oct 24, 2018 4:15:47 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Oct 24, 2018 4:15:47 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Oct 24, 2018 4:15:47 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache#6d4352bf')
Oct 24, 2018 4:15:47 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\FAST\ApacheTomcat\7.0.82\apache-tomcat-7.0.82\webapps\examples has finished in 499 ms
Oct 24, 2018 4:15:47 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\FAST\ApacheTomcat\7.0.82\apache-tomcat-7.0.82\webapps\host-manager
Oct 24, 2018 4:15:47 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\FAST\ApacheTomcat\7.0.82\apache-tomcat-7.0.82\webapps\host-manager has finished in 157 ms
Oct 24, 2018 4:15:47 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\FAST\ApacheTomcat\7.0.82\apache-tomcat-7.0.82\webapps\manager
Oct 24, 2018 4:15:47 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\FAST\ApacheTomcat\7.0.82\apache-tomcat-7.0.82\webapps\manager has finished in 82 ms
Oct 24, 2018 4:15:47 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\FAST\ApacheTomcat\7.0.82\apache-tomcat-7.0.82\webapps\ROOT
Oct 24, 2018 4:15:48 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\FAST\ApacheTomcat\7.0.82\apache-tomcat-7.0.82\webapps\ROOT has finished in 77 ms
Oct 24, 2018 4:15:48 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Oct 24, 2018 4:15:48 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Oct 24, 2018 4:15:48 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2191 ms
As you can see, the start up doesn't show it read my spring configuration, please help, thanks in advance
tomcat web application manager
Updated: I have a temp fix, (wow,it takes me 2 days to make some progress since there is no ERRORs at all in the project).
Here is the trick: Right click project => properties=> Deployment
Assembly=> add=> choose Java Build Path Entries=>choose Maven
Dependencies=> apply=> OK
You can see server log refresh and it finally loads spring
configuration, and if you check
tomcat home directory/wtpwebapps/{project name}/WEB-INF/lib, you can
see all the maven dependencies are copied to here
Up to this point, It looks like everything is fine now, but I find the
other issue, every time I right click=>maven=> update project...=> it
will try to remove the dependencies(jars) in tomcat home
directory/wtpwebapps/{project name}/WEB-INF/lib,
If your project is running at the tomcat , you will get a error
because these jars are being used.
But if you stop server, and update project and then run as server
again, everything is back to normal, no error, no spring configuration
in the server startup log, then you have to do the same trick again.
I tried so many online solutions about "maven project update will
remove jars in tomcat server", none of them are working. So if anyone
has the the fix, please shared
Related
Dec 11, 2019 1:21:24 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Add3' did not find a matching property.
Dec 11, 2019 1:21:24 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Add33' did not find a matching property.
Dec 11, 2019 1:21:24 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/8.0.32
Dec 11, 2019 1:21:24 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Feb 2 2016 19:34:53 UTC
Dec 11, 2019 1:21:24 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 8.0.32.0
Dec 11, 2019 1:21:24 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 7
Dec 11, 2019 1:21:24 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 6.1
Dec 11, 2019 1:21:24 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Dec 11, 2019 1:21:24 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jre1.8.0_221
Dec 11, 2019 1:21:24 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_221-b11
Dec 11, 2019 1:21:24 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Dec 11, 2019 1:21:24 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: C:\Users\HP\Downloads\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32
Dec 11, 2019 1:21:24 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: C:\Users\HP\Downloads\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32
Dec 11, 2019 1:21:24 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\Users\HP\Downloads\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32
Dec 11, 2019 1:21:24 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\Users\HP\Downloads\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32
Dec 11, 2019 1:21:24 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\Users\HP\Downloads\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\wtpwebapps
Dec 11, 2019 1:21:24 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\Users\HP\Downloads\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\endorsed
Dec 11, 2019 1:21:24 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Dec 11, 2019 1:21:24 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_221\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.3\bin;;.
Dec 11, 2019 1:21:24 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8082"]
Dec 11, 2019 1:21:27 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Dec 11, 2019 1:21:27 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Dec 11, 2019 1:21:27 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Dec 11, 2019 1:21:27 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 4612 ms
Dec 11, 2019 1:21:27 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Dec 11, 2019 1:21:27 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.32
Dec 11, 2019 1:21:28 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Users\HP\Downloads\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\webapps\docs
Dec 11, 2019 1:21:28 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\Users\HP\Downloads\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\webapps\docs has finished in 71 ms
Dec 11, 2019 1:21:28 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Users\HP\Downloads\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\webapps\examples
Dec 11, 2019 1:21:29 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Dec 11, 2019 1:21:29 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Dec 11, 2019 1:21:29 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\Users\HP\Downloads\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\webapps\examples has finished in 1,244 ms
Dec 11, 2019 1:21:29 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Users\HP\Downloads\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\webapps\host-manager
Dec 11, 2019 1:21:29 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\Users\HP\Downloads\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\webapps\host-manager has finished in 68 ms
Dec 11, 2019 1:21:29 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Users\HP\Downloads\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\webapps\manager
Dec 11, 2019 1:21:29 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\Users\HP\Downloads\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\webapps\manager has finished in 65 ms
Dec 11, 2019 1:21:29 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Users\HP\Downloads\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\webapps\ROOT
Dec 11, 2019 1:21:30 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\Users\HP\Downloads\apache-tomcat-8.0.32-windows-x64\apache-tomcat-8.0.32\webapps\ROOT has finished in 113 ms
Dec 11, 2019 1:21:30 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8082"]
Dec 11, 2019 1:21:30 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Dec 11, 2019 1:21:30 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2296 ms
my localhost:8080 cannot connect on chrome..it runs successfully but i wont show me the page for successful connection.
my system is windows 64 bit.
The only thing you have to do is change the port to 8082, if it still shows you nothing, the problem would be that it is not a localhost.
Dec 11, 2019 1:21:30 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8082"]
Also if you upload the code it would be easier to help you.
I hope I helped you with the information provided
I was trying to learn how to use servlet by following the tutorial in this page:
https://www.ntu.edu.sg/home/ehchua/programming/howto/Tomcat_HowTo.html
When I reached 2.6 STEP 5: Develop and Deploy a WebApp, I was told to restart tomcat so that it'll load the directory I just made. However, the changes I made was not loaded, the assigned port is still 8080 even though I assigned it to 9999 and the hello directory was not found. Here are the messages when I issued startup.bat:
Apr 26, 2019 5:32:04 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.2.21 using APR version 1.6.5.
Apr 26, 2019 5:32:04 PM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Apr 26, 2019 5:32:04 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.1.1a 20 Nov 2018)
Apr 26, 2019 5:32:04 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8080"]
Apr 26, 2019 5:32:04 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
Apr 26, 2019 5:32:04 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 494 ms
Apr 26, 2019 5:32:04 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 26, 2019 5:32:04 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.47
Apr 26, 2019 5:32:04 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory G:\Tomcat 2\webapps\docs
Apr 26, 2019 5:32:05 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [146] milliseconds.
Apr 26, 2019 5:32:05 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory G:\Tomcat 2\webapps\examples
Apr 26, 2019 5:32:05 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory G:\Tomcat 2\webapps\host-manager
Apr 26, 2019 5:32:05 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory G:\Tomcat 2\webapps\manager
Apr 26, 2019 5:32:05 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory G:\Tomcat 2\webapps\ROOT
Apr 26, 2019 5:32:05 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
Apr 26, 2019 5:32:05 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Apr 26, 2019 5:32:05 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1092 ms
As you can see, the hello directory was not deployed. So, what is exactly happening here?
I just realized that when I issued the startup & shutdown command that there was an information in the console which looked like this:
Using CLASSPATH: "G:\Learning\tomcat9\bin\bootstrap.jar;G:\Learning\tomcat9\bin\tomcat-juli.jar"
It seemed that my classpath was pointing to the wrong path. I deleted CATALINA_HOME in the environment variable settings, and now it is working fine.
I got source code from my client.
Spring with tomcat. I use Eclipse STS IDE for spring.
and got error in weblogic :
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app
xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
<wls:weblogic-version>12.1.3</wls:weblogic-version>
<wls:context-root>api.elastic</wls:context-root>
<wls:container-descriptor>
<wls:prefer-application-packages>
<wls:package-name>com.fasterxml.jackson</wls:package-name>
</wls:prefer-application-packages>
</wls:container-descriptor>
</wls:weblogic-web-app>
invalid content was found with element : wls:prefer-application-packages
and when I tried to force run it with tomcat server :
Jul 23, 2018 3:53:11 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:api.elastic' did not find a matching property.
Jul 23, 2018 3:53:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/8.0.53
Jul 23, 2018 3:53:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Jun 29 2018 14:42:45 UTC
Jul 23, 2018 3:53:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 8.0.53.0
Jul 23, 2018 3:53:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Mac OS X
Jul 23, 2018 3:53:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 10.13.6
Jul 23, 2018 3:53:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: x86_64
Jul 23, 2018 3:53:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
Jul 23, 2018 3:53:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_144-b01
Jul 23, 2018 3:53:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Jul 23, 2018 3:53:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: /Users/emerio-ridho/Documents/workspace-sts/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
Jul 23, 2018 3:53:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: /Users/emerio-ridho/Downloads/apache-tomcat-8.0.53
Jul 23, 2018 3:53:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/Users/emerio-ridho/Documents/workspace-sts/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
Jul 23, 2018 3:53:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/Users/emerio-ridho/Downloads/apache-tomcat-8.0.53
Jul 23, 2018 3:53:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=/Users/emerio-ridho/Documents/workspace-sts/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps
Jul 23, 2018 3:53:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/Users/emerio-ridho/Downloads/apache-tomcat-8.0.53/endorsed
Jul 23, 2018 3:53:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=UTF-8
Jul 23, 2018 3:53:11 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /Users/emerio-ridho/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
Jul 23, 2018 3:53:11 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
Jul 23, 2018 3:53:11 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Jul 23, 2018 3:53:11 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Jul 23, 2018 3:53:11 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Jul 23, 2018 3:53:11 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 563 ms
Jul 23, 2018 3:53:11 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jul 23, 2018 3:53:11 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.53
Jul 23, 2018 3:53:14 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: 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.
Jul 23, 2018 3:53:18 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: 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.
Jul 23, 2018 3:53:18 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
Jul 23, 2018 3:53:18 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Jul 23, 2018 3:53:18 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6577 ms
I've tried google any clue, but I dont solve it untill now.
Can the following namespace be used as suggested here?
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app
xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd
http://xmlns.oracle.com/weblogic/weblogic-web-app
http://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd">
<wls:weblogic-version>12.1.3</wls:weblogic-version>
<wls:context-root>api.elastic</wls:context-root>
<wls:container-descriptor>
<wls:prefer-application-packages>
<wls:package-name>com.fasterxml.jackson</wls:package-name>
</wls:prefer-application-packages>
</wls:container-descriptor>
</wls:weblogic-web-app>
I'm running Tomcat 7 server in eclipse. This is working fine but http://localhost:8080 is not popping up! Please help me I'm new to eclipse and server programming.
my console status:
Jul 30, 2016 7:42:27 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.70
Jul 30, 2016 7:42:27 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Jun 15 2016 16:27:45 UTC
Jul 30, 2016 7:42:27 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.70.0
Jul 30, 2016 7:42:27 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 8
Jul 30, 2016 7:42:27 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 6.2
Jul 30, 2016 7:42:27 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: x86
Jul 30, 2016 7:42:27 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jre1.8.0_102
Jul 30, 2016 7:42:27 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_102-b14
Jul 30, 2016 7:42:27 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Jul 30, 2016 7:42:27 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: D:\testingp\.metadata\.plugins\org.eclipse.wst.server.core\tmp2
Jul 30, 2016 7:42:27 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: D:\testingp\apache-tomcat-7.0.70-windows-x86\apache-tomcat-7.0.70
Jul 30, 2016 7:42:27 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=D:\testingp\.metadata\.plugins\org.eclipse.wst.server.core\tmp2
Jul 30, 2016 7:42:27 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=D:\testingp\apache-tomcat-7.0.70-windows-x86\apache-tomcat-7.0.70
Jul 30, 2016 7:42:27 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=D:\testingp\.metadata\.plugins\org.eclipse.wst.server.core\tmp2\wtpwebapps
Jul 30, 2016 7:42:27 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=D:\testingp\apache-tomcat-7.0.70-windows-x86\apache-tomcat-7.0.70\endorsed
Jul 30, 2016 7:42:27 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Jul 30, 2016 7:42:27 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_102\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_102/bin/client;C:/Program Files/Java/jre1.8.0_102/bin;C:/Program Files/Java/jre1.8.0_102/lib/i386;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Java\jdk1.8.0_92\bin;<path-to-sdk>/platform-tools;C:\Users\MISSION ANDROID\Desktop\;C:\Users\MISSION ANDROID\Downloads\Compressed\eclipse-jee-indigo-SR2-win32\eclipse;;.
Jul 30, 2016 7:42:27 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jul 30, 2016 7:42:27 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jul 30, 2016 7:42:27 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 767 ms
Jul 30, 2016 7:42:27 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jul 30, 2016 7:42:27 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.70
Jul 30, 2016 7:42:28 PM org.apache.catalina.startup.TldConfig execute
INFO: 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.
Jul 30, 2016 7:42:28 PM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [220] milliseconds.
Jul 30, 2016 7:42:28 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jul 30, 2016 7:42:28 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jul 30, 2016 7:42:28 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 687 ms
and deploy path is by default:
"wtpwebapps"
I am trying retrieve data from SQLLite DB in a Java Class.
This is the part of the web app that uses the Beans and Form processing" as per the tutorial here:
http://www.jsptut.com/forms.jsp
I am getting a persistent error of java.lang.ClassNotFoundException: org.sqlite.JDBC
I have added sqlite-jdbc-3.8.7.jar to the java classpath
This is my code:
public int startConnection() {
Connection c = null;
try {
Class.forName("org.sqlite.JDBC");
c = DriverManager.getConnection("jdbc:sqlite:test.db");
} catch ( Exception e ) {
System.err.println( e.getClass().getName() + ": " + e.getMessage() );
System.exit(0);
return CONNECTION_FAILURE;
}
System.out.println("Opened database successfully");
return CONNECTION_SUCCESSFUL;
}
This is the console output:
Jan 03, 2015 2:42:15 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:webapp01' did not find a matching property.
Jan 03, 2015 2:42:15 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.57
Jan 03, 2015 2:42:15 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Nov 3 2014 08:39:16 UTC
Jan 03, 2015 2:42:15 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.57.0
Jan 03, 2015 2:42:15 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Mac OS X
Jan 03, 2015 2:42:15 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 10.10
Jan 03, 2015 2:42:15 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: x86_64
Jan 03, 2015 2:42:15 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JAVA_HOME: /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre
Jan 03, 2015 2:42:15 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_25-b17
Jan 03, 2015 2:42:15 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Jan 03, 2015 2:42:15 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: /Users/hadi/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
Jan 03, 2015 2:42:15 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: /Users/hadi/Documents/apache-tomcat-7.0.57
Jan 03, 2015 2:42:15 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/Users/hadi/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
Jan 03, 2015 2:42:15 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/Users/hadi/Documents/apache-tomcat-7.0.57
Jan 03, 2015 2:42:15 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=/Users/hadi/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps
Jan 03, 2015 2:42:15 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/Users/hadi/Documents/apache-tomcat-7.0.57/endorsed
Jan 03, 2015 2:42:15 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=UTF-8
Jan 03, 2015 2:42:15 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /Users/hadi/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
Jan 03, 2015 2:42:15 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jan 03, 2015 2:42:15 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jan 03, 2015 2:42:15 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1296 ms
Jan 03, 2015 2:42:15 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jan 03, 2015 2:42:15 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.57
Jan 03, 2015 2:42:16 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jan 03, 2015 2:42:16 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jan 03, 2015 2:42:16 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 913 ms
java.lang.ClassNotFoundException: org.sqlite.JDBC
Jan 03, 2015 2:42:32 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Please anyone solve this problem......Thanks....
Add the sqlite-jdbc-3.8.7.jar to the tomcat class-path by moving it to $CATALINA_HOME/lib.
See the Apache Tomcat 7 - Class Loader Howto for an in-depth look at how the Tomcat class loader works. It reads, in part,
System — This class loader is normally initialized from the contents of the CLASSPATH environment variable. All such classes are visible to both Tomcat internal classes, and to web applications. However, the standard Tomcat startup scripts ($CATALINA_HOME/bin/catalina.sh or %CATALINA_HOME%\bin\catalina.bat) totally ignore the contents of the CLASSPATH environment variable itself, and instead build the System class loader from ...