package sampleJSN;
import java.io.IOException;
import java.util.Set;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration.Dynamic;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class Init implements ServletContainerInitializer {
#SuppressWarnings("serial")
#Override
public void onStartup(Set<Class<?>> arg0, ServletContext arg1) throws ServletException {
System.out.println("ssd");
HttpServlet serv = new HttpServlet() {
#Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
resp.getWriter().write("<b>JSN</b>");
}
#Override
public void init(ServletConfig config) throws ServletException {
System.out.println("sirappu");
super.init(config);
}
};
Dynamic dyc = arg1.addServlet("Name", serv);
dyc.addMapping("/jsn");
}
}
I was writing a programme to test ServletContainerInitializer.the problem is ServletContainerInitializer itself works properly and ServletContainerInitializer.onStartup is called "ssd" is printed however the ServletContext.addServlet does not register my servlet and hence init method is not called. please check the log bellow
Apr 11, 2018 12:18:45 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:CheckWeb' did not find a matching property.
Apr 11, 2018 12:18:45 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/8.0.36
Apr 11, 2018 12:18:45 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Jun 9 2016 13:55:50 UTC
Apr 11, 2018 12:18:45 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 8.0.36.0
Apr 11, 2018 12:18:45 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 8.1
Apr 11, 2018 12:18:45 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 6.3
Apr 11, 2018 12:18:45 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Apr 11, 2018 12:18:45 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jdk1.8.0_161\jre
Apr 11, 2018 12:18:45 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_161-b12
Apr 11, 2018 12:18:45 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Apr 11, 2018 12:18:45 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: C:\Users\BalajiGold\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Apr 11, 2018 12:18:45 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: C:\tomcat-8
Apr 11, 2018 12:18:45 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:63748
Apr 11, 2018 12:18:45 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\Users\BalajiGold\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Apr 11, 2018 12:18:45 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\tomcat-8
Apr 11, 2018 12:18:45 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\Users\BalajiGold\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
Apr 11, 2018 12:18:45 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\tomcat-8\endorsed
Apr 11, 2018 12:18:45 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Apr 11, 2018 12:18:45 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\jdk1.8.0_161\jre\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Java\jdk1.8.0_161\jre\bin;C:/Program Files/Java/jdk1.8.0_121/jre/bin/server;C:/Program Files/Java/jdk1.8.0_121/jre/bin;C:/Program Files/Java/jdk1.8.0_121/jre/lib/amd64;C:\Program Files\Microsoft MPI\Bin\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\system32;C:\Windows;C:\Program Files\QuickTime\QTSystem;C:\cygwin64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\MinGW\bin;C:\MinGW\MSYS\1.0\bin;C:\Program Files\Git\bin;C:\Users\BalajiGold\AppData\Local\Programs\Eclipse Che\eclipse-che-5.0.0\tools\jre\bin;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files\Java\jdk1.8.0_161\bin;C:\Program Files\Docker Toolbox;C:\apache-maven-3.5.2\bin;C:\Users\BalajiGold\Desktop;;.
Apr 11, 2018 12:18:45 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
Apr 11, 2018 12:18:45 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Apr 11, 2018 12:18:45 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Apr 11, 2018 12:18:45 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Apr 11, 2018 12:18:45 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 941 ms
Apr 11, 2018 12:18:45 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 11, 2018 12:18:45 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.36
Apr 11, 2018 12:18:48 AM 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.
Apr 11, 2018 12:18:50 AM 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.
ssd
Apr 11, 2018 12:18:54 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
Apr 11, 2018 12:18:54 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Apr 11, 2018 12:18:54 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 9179 ms
dyc.setLoadOnStartup(0);
this code solved the above problem for me
PS: Don't forget to add META-INF/services/javax.servlet.ServletContainerInitializer
Related
package com.luv3code.testdb;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet implementation class TestDBServlet
*/
#WebServlet("/TestDbServlet")
public class TestDBServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* #see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
String user="springstudent";
String pass="springstudent";
String jdbcUrl= "jdbc:mysql://localhost:3306/web_customer_tracker?useSSL&serverTimezome=UTC";
String driver= "com.mysql.cj.jdbc.Driver";
try {
PrintWriter out=response.getWriter();
out.println("Connect to Database: " +jdbcUrl);
Class.forName(driver);
Connection myConn= DriverManager.getConnection(jdbcUrl, user, pass);
out.println("suceess");
}catch(Exception exc) {
exc.printStackTrace();
throw new ServletException(exc);
}
response.getWriter().append("Served at: ").append(request.getContextPath());
}
}
I create a connection springstudent: with user spring student. Besides create a database with table on my workbench.
I would like to connect my eclipse project on my database. So I write the code and add a library.
My steps:
Download apache tomcat
Create web-dynamic project. Create a servlet Add library
my-sql-8.0.12
Java compiler, Java built path, Project Facest have the same version
I try to run doing both of the above settings: Server Right Click
priorities : workspace metadata Server Right Click priorities :
local
Delete and add the server(Window->Show Servers...) Check project
facets->runtime apache clicked Clean project Clean server
Delete and import project again.
console:
Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.startup.VersionLoggerListener log INFO: Server
version name: Apache Tomcat/9.0.35 Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.startup.VersionLoggerListener log INFO: Server
built: May 5 2020 20:36:20 UTC Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.startup.VersionLoggerListener log INFO: Server
version number: 9.0.35.0 Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.startup.VersionLoggerListener log INFO: OS Name:
Windows 10 Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.startup.VersionLoggerListener log INFO: OS
Version: 10.0 Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.startup.VersionLoggerListener log INFO:
Architecture: amd64 Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.startup.VersionLoggerListener log INFO: Java Home:
C:\Program Files\Java\jdk1.8.0_251\jre Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.startup.VersionLoggerListener log INFO: JVM
Version: 1.8.0_251-b08 Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.startup.VersionLoggerListener log INFO: JVM
Vendor: Oracle Corporation Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.startup.VersionLoggerListener log INFO:
CATALINA_BASE:
C:\Users\User\eclipse-workspace.metadata.plugins\org.eclipse.wst.server.core\tmp1
Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.startup.VersionLoggerListener log INFO:
CATALINA_HOME: C:\Program Files\Apache Software
Foundation\Tomcat 9.0 Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.startup.VersionLoggerListener log INFO: Command
line argument:
-Dcatalina.base=C:\Users\User\eclipse-workspace.metadata.plugins\org.eclipse.wst.server.core\tmp1
Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.startup.VersionLoggerListener log INFO: Command
line argument: -Dcatalina.home=C:\Program Files\Apache Software
Foundation\Tomcat 9.0 Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.startup.VersionLoggerListener log INFO: Command
line argument:
-Dwtp.deploy=C:\Users\User\eclipse-workspace.metadata.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps
Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.startup.VersionLoggerListener log INFO: Command
line argument: -Djava.endorsed.dirs=C:\Program Files\Apache Software
Foundation\Tomcat 9.0\endorsed Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.startup.VersionLoggerListener log INFO: Command
line argument: -Dfile.encoding=Cp1253 Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO:
Loaded Apache Tomcat Native library [1.2.24] using APR version
[1.7.0]. Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: APR
capabilities: IPv6 [true], sendfile [true], accept filters [false],
random [true]. Ιουν 14, 2020 1:57:58 ΠΜ
org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO:
APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
Ιουν 14, 2020 1:57:58 ΠΜ org.apache.catalina.core.AprLifecycleListener
initializeSSL INFO: OpenSSL successfully initialized [OpenSSL 1.1.1g
21 Apr 2020] Ιουν 14, 2020 1:57:59 ΠΜ
org.apache.coyote.AbstractProtocol init INFO: Initializing
ProtocolHandler ["http-nio-8081"] Ιουν 14, 2020 1:58:00 ΠΜ
org.apache.catalina.startup.Catalina load INFO: Server initialization
in [2,379] milliseconds Ιουν 14, 2020 1:58:00 ΠΜ
org.apache.catalina.core.StandardService startInternal INFO: Starting
service [Catalina] Ιουν 14, 2020 1:58:00 ΠΜ
org.apache.catalina.core.StandardEngine startInternal INFO: Starting
Servlet engine: [Apache Tomcat/9.0.35] Ιουν 14, 2020 1:58:02 ΠΜ
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. Ιουν 14, 2020 1:58:03 ΠΜ
org.apache.coyote.AbstractProtocol start INFO: Starting
ProtocolHandler ["http-nio-8081"] Ιουν 14, 2020 1:58:03 ΠΜ
org.apache.catalina.startup.Catalina start INFO: Server startup in
[2,449] milliseconds
HTTP Status 404 – Not Found
Type Status Report
Message The requested resource [/web-customer-tracker/] is not
available
Description The origin server did not find a current representation
for the target resource or is not willing to disclose that one exists.
I have two PC, in the first one run the program if change
#WebServlet("/") I cannot undresand why.
In this it doesn't run.
I also reinstall eclipse and tomcat.
Eclipse 2019
Apache 9
java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)
Could someone help me?
Simply right-click on your servlet and choose Run As > Run on Server.
I have created a simple spring mvc web app and after successfully running it on the server I pushed it on github. Later I cloned this project and have imported it as a maven project as shown below (now it is already imported)
Now I am trying to run it but unfortunately I get HTTP Status 404 error:
Nov 27, 2018 9:58:50 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/9.0.13
Nov 27, 2018 9:58:50 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Nov 2 2018 14:27:55 UTC
Nov 27, 2018 9:58:50 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 9.0.13.0
Nov 27, 2018 9:58:50 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 10
Nov 27, 2018 9:58:50 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 10.0
Nov 27, 2018 9:58:50 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Nov 27, 2018 9:58:50 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jre1.8.0_191
Nov 27, 2018 9:58:50 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_191-b12
Nov 27, 2018 9:58:50 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Nov 27, 2018 9:58:50 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: C:\Users\Alexander\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Nov 27, 2018 9:58:50 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: C:\Program Files\Apache Software Foundation\Tomcat 9.0
Nov 27, 2018 9:58:50 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\Users\Alexander\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Nov 27, 2018 9:58:50 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 9.0
Nov 27, 2018 9:58:50 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\Users\Alexander\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
Nov 27, 2018 9:58:50 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 9.0\endorsed
Nov 27, 2018 9:58:50 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Nov 27, 2018 9:58:50 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_191\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_191/bin/server;C:/Program Files/Java/jre1.8.0_191/bin;C:/Program Files/Java/jre1.8.0_191/lib/amd64;C:\Program Files\Microsoft MPI\Bin\;C:\OracleHome\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files (x86)\dotnet\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files\nodejs\;C:\Users\Alexander\AppData\Local\Microsoft\WindowsApps;C:\Users\Alexander\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Alexander\.dotnet\tools;C:\Users\Alexander\AppData\Local\GitHubDesktop\bin;C:\Users\Alexander\AppData\Roaming\npm;C:\Windows\system32;;.]
Nov 27, 2018 9:58:50 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8089"]
Nov 27, 2018 9:58:50 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Nov 27, 2018 9:58:50 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8010"]
Nov 27, 2018 9:58:50 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Nov 27, 2018 9:58:50 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 795 ms
Nov 27, 2018 9:58:51 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service [Catalina]
Nov 27, 2018 9:58:51 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/9.0.13
Nov 27, 2018 9:58:51 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.
Nov 27, 2018 9:58:51 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8089"]
Nov 27, 2018 9:58:52 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8010"]
Nov 27, 2018 9:58:52 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1088 ms
I have seen several similar topics and it seems that everything is correct:
What I am missing?
Update 1:
https://github.com/AlexDev5/javaTesting
Update 2:
https://www.youtube.com/watch?v=CiTrERL4Htw&t=12s
I changed from Windows to Ubuntu 17.04 and now I get an Error when I start the webapp on a Tomcat 8.0.36 via Eclipse Neon.3 Release (4.6.3).
java.lang.ClassCircularityError: ch/qos/logback/core/spi/FilterReply
The project is build via M2E has AspectJ in it.
Uses following SLF4J Dependencies:
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.7</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>1.7.21</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.21</version>
</dependency>
It work's under Windows Eclipse with almost same settings and installation.
Also it works when I mvn clean package (default ubuntu maven installation not eclipse one) and deployed it manually to the default Tomcat installation of Ubuntu.
I already changed my eclipse version to Oxygen and got the same problem.
I tried to change the versions of the dependencies too - same result.
I have debuged the code to a "ServletContextListener" that tries to get a JDNI object:
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import org.slf4j.LoggerFactory;
import org.slf4j.bridge.SLF4JBridgeHandler;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.joran.JoranConfigurator;
import ch.qos.logback.classic.jul.LevelChangePropagator;
import ch.qos.logback.core.util.StatusPrinter;
// ....
#Override
public void contextInitialized(final ServletContextEvent sce) {
new LogRecord(Level.FINEST, "Ensure class is loaded!");
// Prepare logging context
final LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
context.reset();
// setup JUL to SLF4J log bridging
SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();
final LevelChangePropagator levelChangePropagator = new LevelChangePropagator();
levelChangePropagator.setResetJUL(true);
levelChangePropagator.setContext(context);
levelChangePropagator.start();
context.addListener(levelChangePropagator);
// Load context values
String contextPath = sce.getServletContext().getContextPath().replaceAll("[^0-9a-zA-Z-_]", "");
if(contextPath.length() == 0){
contextPath = "ROOT";
}
context.putProperty("appName", contextPath);
final Boolean isProductiveVal = (Boolean) getJNDI(IS_PRODUCTIVE_JNDI);
// .....
private static Object getJNDI(final String jndiPath) {
try {
final Context initialContext = new InitialContext(); // << This line crashes
return initialContext.lookup(jndiPath);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
I have no clue what I could try to fix it. And also im not fully understand the problem. Tomcat tries to load a Class that reference it self?!
Does some one have a clue what I could check?
Full stack of Tomcat start.
Sep 06, 2017 5:05:36 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNUNG: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:MyProject' did not find a matching property.
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Server version: Apache Tomcat/8.0.36
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Server built: Jun 9 2016 13:55:50 UTC
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Server number: 8.0.36.0
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: OS Name: Linux
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: OS Version: 4.10.0-33-generic
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Architecture: amd64
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Java Home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: JVM Version: 1.8.0_131-8u131-b11-2ubuntu1.17.04.3-b11
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: JVM Vendor: Oracle Corporation
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: CATALINA_BASE: /home/kani/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: CATALINA_HOME: /opt/tomcat8
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Command line argument: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:37177
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Command line argument: -Drebel.base=/home/kani/.jrebel
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Command line argument: -Drebel.env.ide.plugin.version=7.0.14
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Command line argument: -Drebel.env.ide.version=4.6.3
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Command line argument: -Drebel.env.ide.product=Eclipse
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Command line argument: -Drebel.env.ide=eclipse
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Command line argument: -Drebel.notification.url=http://localhost:17434
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Command line argument: -Drebel.workspace.path=/home/kani/eclipse-workspace
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Command line argument: -Drebel.properties=/home/kani/.jrebel/jrebel.properties
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Command line argument: -agentpath:/opt/eclipse/plugins/org.zeroturnaround.eclipse.embedder_7.0.14.RELEASE/jrebel/lib/libjrebel64.so
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Command line argument: -Dcatalina.base=/home/kani/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Command line argument: -Dcatalina.home=/opt/tomcat8
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Command line argument: -Dwtp.deploy=/home/kani/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Command line argument: -Djava.endorsed.dirs=/opt/tomcat8/endorsed
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMATION: Command line argument: -Dfile.encoding=UTF-8
Sep 06, 2017 5:05:36 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFORMATION: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
Sep 06, 2017 5:05:36 PM org.apache.coyote.AbstractProtocol init
INFORMATION: Initializing ProtocolHandler ["http-nio-8080"]
Sep 06, 2017 5:05:36 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFORMATION: Using a shared selector for servlet write/read
Sep 06, 2017 5:05:36 PM org.apache.coyote.AbstractProtocol init
INFORMATION: Initializing ProtocolHandler ["ajp-nio-8009"]
Sep 06, 2017 5:05:36 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFORMATION: Using a shared selector for servlet write/read
Sep 06, 2017 5:05:36 PM org.apache.catalina.startup.Catalina load
INFORMATION: Initialization processed in 802 ms
Sep 06, 2017 5:05:36 PM org.apache.catalina.core.StandardService startInternal
INFORMATION: Starting service Catalina
Sep 06, 2017 5:05:36 PM org.apache.catalina.core.StandardEngine startInternal
INFORMATION: Starting Servlet Engine: Apache Tomcat/8.0.36
2017-09-06 17:05:37 JRebel: Directory '/home/kani/eclipse-workspace/MyProject/target/classes' will be monitored for changes.
2017-09-06 17:05:37 JRebel: Directory '/home/kani/eclipse-workspace/MyProject/target/m2e-wtp/web-resources' will be monitored for changes.
2017-09-06 17:05:37 JRebel: Directory '/home/kani/eclipse-workspace/MyProject/src/main/webapp' will be monitored for changes.
Sep 06, 2017 5:05:41 PM org.apache.jasper.servlet.TldScanner scanJars
INFORMATION: 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.
Sep 06, 2017 5:05:41 PM org.apache.catalina.core.ApplicationContext log
INFORMATION: No Spring WebApplicationInitializer types detected on classpath
java.lang.ClassCircularityError: ch/qos/logback/core/spi/FilterReply
at ch.qos.logback.classic.LoggerContext.getTurboFilterChainDecision_0_3OrMore(LoggerContext.java:267)
at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:373)
at ch.qos.logback.classic.Logger.log(Logger.java:765)
at org.slf4j.bridge.SLF4JBridgeHandler.callLocationAwareLogger(SLF4JBridgeHandler.java:221)
at org.slf4j.bridge.SLF4JBridgeHandler.publish(SLF4JBridgeHandler.java:303)
at java.util.logging.Logger.log(Logger.java:738)
at java.util.logging.Logger.doLog(Logger.java:765)
at java.util.logging.Logger.logp(Logger.java:931)
at org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:180)
at org.apache.juli.logging.DirectJDKLog.debug(DirectJDKLog.java:103)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:361)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
at org.apache.catalina.startup.Catalina.start(Catalina.java:629)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:43)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
I changed to the Tomcat8 installation that I used in windows.
And it finally worked (I didn't know what the previous Head of did there).
The only difference I can see instantly is that it used Log4j also on Tomcat side. Maybe thats the difference. Sorry if someone else also have this problem and no solution.
I am using Eclipse Mars IDE, JRE 1.8.0_51, and Tomcat 8.0.39. Is there any compatibility issue? Please suggest.
Server Tomcat v8.0 Server at localhost was unable to start within 45
seconds. If the server requires more time, try increasing the timeout
in the server editor.
I have also tried increasing the timeouts, but it didn't work.
Dec 12, 2016 8:27:23 PM
org.apache.catalina.startup.VersionLoggerListener log INFO: Server
version: Apache Tomcat/8.0.39 Dec 12, 2016 8:27:23 PM
org.apache.catalina.startup.VersionLoggerListener log INFO: Server
built: Nov 9 2016 08:48:39 UTC Dec 12, 2016 8:27:23 PM
org.apache.catalina.startup.VersionLoggerListener log INFO: Server
number: 8.0.39.0 Dec 12, 2016 8:27:23 PM
org.apache.catalina.startup.VersionLoggerListener log INFO: OS Name:
Windows 7 Dec 12, 2016 8:27:23 PM
org.apache.catalina.startup.VersionLoggerListener log INFO: OS
Version: 6.1 Dec 12, 2016 8:27:23 PM
org.apache.catalina.startup.VersionLoggerListener log INFO:
Architecture: amd64 Dec 12, 2016 8:27:23 PM
org.apache.catalina.startup.VersionLoggerListener log INFO: Java Home:
C:\Program Files\Java\jre1.8.0_51 Dec 12, 2016 8:27:23 PM
org.apache.catalina.startup.VersionLoggerListener log INFO: JVM
Version: 1.8.0_51-b16 Dec 12, 2016 8:27:23 PM
org.apache.catalina.startup.VersionLoggerListener log INFO: JVM
Vendor: Oracle Corporation Dec 12, 2016 8:27:23 PM
org.apache.catalina.startup.VersionLoggerListener log INFO:
CATALINA_BASE:
C:\Users\esboddu.metadata.plugins\org.eclipse.wst.server.core\tmp0
Dec 12, 2016 8:27:23 PM
org.apache.catalina.startup.VersionLoggerListener log INFO:
CATALINA_HOME:
D:\softwares\apache-tomcat-8.0.39-windows-x64\apache-tomcat-8.0.39 Dec
12, 2016 8:27:23 PM org.apache.catalina.startup.VersionLoggerListener
log INFO: Command line argument:
-Dcatalina.base=C:\Users\esboddu.metadata.plugins\org.eclipse.wst.server.core\tmp0
Dec 12, 2016 8:27:23 PM
org.apache.catalina.startup.VersionLoggerListener log INFO: Command
line argument:
-Dcatalina.home=D:\softwares\apache-tomcat-8.0.39-windows-x64\apache-tomcat-8.0.39
Dec 12, 2016 8:27:23 PM
org.apache.catalina.startup.VersionLoggerListener log INFO: Command
line argument:
-Dwtp.deploy=C:\Users\esboddu.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
Dec 12, 2016 8:27:23 PM
org.apache.catalina.startup.VersionLoggerListener log INFO: Command
line argument:
-Djava.endorsed.dirs=D:\softwares\apache-tomcat-8.0.39-windows-x64\apache-tomcat-8.0.39\endorsed
Dec 12, 2016 8:27:23 PM
org.apache.catalina.startup.VersionLoggerListener log INFO: Command
line argument: -Dfile.encoding=Cp1252 Dec 12, 2016 8:27:23 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_51\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:/Program
Files/Java/jre1.8.0_51/bin/server;C:/Program
Files/Java/jre1.8.0_51/bin;C:/Program
Files/Java/jre1.8.0_51/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Informatica\9.6.1\clients\tools\datadirect;C:\app\esboddu\product\11.2.0\client_2\bin;C:\app\esboddu\product\11.2.0\client_1;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\TortoiseSVN\bin;C:\Program Files (x86)\Skype\Phone\;C:\Program
Files\Java\jdk1.8.0_51\bin;D:\hadoop-home\hadoop-common-2.2.0-bin-master\bin\;C:\Program
Files\Java\jdk1.8.0_51\jre;C:\Users\esboddu\AppData\Local\Programs\EmEditor;C:\Program Files\Java\jdk1.8.0_51\bin;D:\softwares\eclipse-jee-mars-2-win32-x86_64\eclipse;;.
Dec 12, 2016 8:27:23 PM org.apache.coyote.AbstractProtocol init INFO:
Initializing ProtocolHandler ["http-nio-8080"] Dec 12, 2016 8:27:23 PM
org.apache.tomcat.util.net.NioSelectorPool getSharedSelector INFO:
Using a shared selector for servlet write/read Dec 12, 2016 8:27:23 PM
org.apache.coyote.AbstractProtocol init INFO: Initializing
ProtocolHandler ["ajp-nio-8009"] Dec 12, 2016 8:27:23 PM
org.apache.tomcat.util.net.NioSelectorPool getSharedSelector INFO:
Using a shared selector for servlet write/read Dec 12, 2016 8:27:23 PM
org.apache.catalina.startup.Catalina load INFO: Initialization
processed in 464 ms Dec 12, 2016 8:27:23 PM
org.apache.catalina.core.StandardService startInternal INFO: Starting
service Catalina Dec 12, 2016 8:27:23 PM
org.apache.catalina.core.StandardEngine startInternal INFO: Starting
Servlet Engine: Apache Tomcat/8.0.39 Dec 12, 2016 8:27:24 PM
org.apache.catalina.startup.HostConfig deployDescriptor INFO:
Deploying configuration descriptor
C:\Users\esboddu.metadata.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost\will.xml
Dec 12, 2016 8:27:24 PM
org.apache.catalina.startup.SetContextPropertiesRule begin WARNING:
[SetContextPropertiesRule]{Context} Setting property 'source' to
'org.eclipse.jst.jee.server:will' did not find a matching property.
Dec 12, 2016 8:27:24 PM org.apache.catalina.startup.HostConfig
deployDescriptor INFO: Deployment of configuration descriptor
C:\Users\esboddu.metadata.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost\will.xml
has finished in 49 ms Dec 12, 2016 8:27:24 PM
org.apache.coyote.AbstractProtocol start INFO: Starting
ProtocolHandler ["http-nio-8080"] Dec 12, 2016 8:27:24 PM
org.apache.coyote.AbstractProtocol start INFO: Starting
ProtocolHandler ["ajp-nio-8009"] Dec 12, 2016 8:27:24 PM
org.apache.catalina.startup.Catalina start INFO: Server startup in 375
ms
I'm new to Spring MVC. My project structure is as follows:
I'm getting the following error while running the web project:
HTTP Status 404 -
type Status report
message
description The requested resource is not available.
Apache Tomcat/7.0.65
AppConfig.java:
package config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView;
#Configuration
#EnableWebMvc
public class AppConfig {
#Bean
public ViewResolver viewResolver() {
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
viewResolver.setViewClass(JstlView.class);
viewResolver.setPrefix("/WEB-INF/views/");
viewResolver.setSuffix(".jsp");
return viewResolver;
}
}
AppInitializer.java:
package config;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
public class AppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
#Override
protected Class<?>[] getRootConfigClasses() {
return new Class[] { AppConfig.class };
}
#Override
protected Class<?>[] getServletConfigClasses() {
return null;
}
#Override
protected String[] getServletMappings() {
return new String[] { "/" };
}
}
UserController.java:
package controller;
import model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import service.UserService;
#Controller
public class UserController {
#Autowired
private UserService userService;
#RequestMapping(value="/users",method= RequestMethod.GET)
public String listUsers(Model model) {
model.addAttribute("user",new User());
model.addAttribute("listUser" , userService.listUser());
return "user";
}
}
Startup logs:
Jul 13, 2016 12:14:24 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:demo' did not find a matching property.
Jul 13, 2016 12:14:24 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:test' did not find a matching property.
Jul 13, 2016 12:14:24 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.65
Jul 13, 2016 12:14:24 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Oct 9 2015 08:36:58 UTC
Jul 13, 2016 12:14:24 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.65.0
Jul 13, 2016 12:14:24 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 7
Jul 13, 2016 12:14:24 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 6.1
Jul 13, 2016 12:14:24 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Jul 13, 2016 12:14:24 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jre1.8.0_72
Jul 13, 2016 12:14:24 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_72-b15
Jul 13, 2016 12:14:24 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Jul 13, 2016 12:14:24 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: D:\bruno\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Jul 13, 2016 12:14:24 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: D:\apache-tomcat-7.0.65\apache-tomcat-7.0.65
Jul 13, 2016 12:14:24 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=D:\bruno\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Jul 13, 2016 12:14:24 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=D:\apache-tomcat-7.0.65\apache-tomcat-7.0.65
Jul 13, 2016 12:14:24 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=D:\bruno\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
Jul 13, 2016 12:14:24 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=D:\apache-tomcat-7.0.65\apache-tomcat-7.0.65\endorsed
Jul 13, 2016 12:14:24 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Jul 13, 2016 12:14:24 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_72\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:/Program Files/Java/jre1.8.0_72/bin/server;C:/Program Files/Java/jre1.8.0_72/bin;C:/Program Files/Java/jre1.8.0_72/lib/amd64;C:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\ProgramData\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\Program Files (x86)\Microsoft Application Virtualization Client;C:\Program Files\TortoiseSVN\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\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\ProgramData\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\Program Files (x86)\Microsoft Application Virtualization Client;C:\Program Files\TortoiseSVN\bin;C:\windows\System32\WindowsPowerShell\v1.0\;;D:\apache-ant-1.9.7-bin\apache-ant-1.9.7\bin;C:\Program Files\Java\jdk1.8.0_77\bin;C:\Users\kushagra_maurya\Desktop\ABC\eclipse-jee-juno-SR2-win32-x86_64\eclipse;;.
Jul 13, 2016 12:14:24 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8084"]
Jul 13, 2016 12:14:24 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8085"]
Jul 13, 2016 12:14:24 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1261 ms
Jul 13, 2016 12:14:24 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jul 13, 2016 12:14:24 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.65
Jul 13, 2016 12:14:25 PM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [134] milliseconds.
Jul 13, 2016 12:14:26 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8084"]
Jul 13, 2016 12:14:26 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8085"]
Jul 13, 2016 12:14:26 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1664 ms
What am I missing here? Any help will be appreciated.
I am pretty sure you are calling the root path of the server (e.g. localhost:8080/), right?
Eclipse deploys WebApplication in a context path with your projects name. The working path should be localhost:8080/<yourProjectName>/
You can change this behavior by opening the project settings -> Web Project Settings -> Context root.
Edit: since your only endpoint is /users you have to call localhost:8080/<yourProjectName>/users