Error deploying java project eclipse Tomcat

I have this problem when I try to deploy a java web project with Eclipse:

My environment:
-Eclipse version 2022-06 (4.24.0) – the last version from the official site
-java jdk-11.0.15.1
-postgres Server 14
-Apache Tomcat 8.5 configured in Eclipse
-the libraries (in WEB-INF/lib):
[![enter image description here][1]][1]

The problem:

when I deploy in eclipse (right click on the server – Debug) I get these errors:

Exception while processing file, D:worksmicronos.metadata.pluginsorg.eclipse.wst.server.coretmp0wtpwebappsCatiWEB-INFlibpostgresql-42.4.0.jar
java.lang.ArrayIndexOutOfBoundsException: Index 45408 out of bounds for length 17793
    at org.objectweb.asm.ClassReader.<init>(Unknown Source)
    at org.objectweb.asm.ClassReader.<init>(Unknown Source)
    at org.objectweb.asm.ClassReader.<init>(Unknown Source)
    at com.sun.jersey.impl.container.config.AnnotatedClassScanner.getClassReader(AnnotatedClassScanner.java:302)
    at com.sun.jersey.impl.container.config.AnnotatedClassScanner.analyzeClassFile(AnnotatedClassScanner.java:294)
    at com.sun.jersey.impl.container.config.AnnotatedClassScanner.indexJar(AnnotatedClassScanner.java:256)
    at com.sun.jersey.impl.container.config.AnnotatedClassScanner.indexJar(AnnotatedClassScanner.java:245)
    at com.sun.jersey.impl.container.config.AnnotatedClassScanner.indexDir(AnnotatedClassScanner.java:237)
    at com.sun.jersey.impl.container.config.AnnotatedClassScanner.index(AnnotatedClassScanner.java:196)
    at com.sun.jersey.impl.container.config.AnnotatedClassScanner.scan(AnnotatedClassScanner.java:106)
    at com.sun.jersey.api.core.ClasspathResourceConfig.init(ClasspathResourceConfig.java:135)
    at com.sun.jersey.api.core.ClasspathResourceConfig.<init>(ClasspathResourceConfig.java:106)
    at com.sun.jersey.api.core.ClasspathResourceConfig.<init>(ClasspathResourceConfig.java:88)
    at com.sun.jersey.spi.container.servlet.ServletContainer.createResourceConfig(ServletContainer.java:342)
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:144)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1173)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1118)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1011)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4952)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5266)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)

giu 21, 2022 10:56:29 PM com.sun.jersey.impl.application.WebApplicationImpl processRootResources
SEVERE: The ResourceConfig instance does not contain any root resource classes.
giu 21, 2022 10:56:29 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Servlet.init() for servlet [ServletAdaptor] threw exception
com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
    at com.sun.jersey.impl.application.WebApplicationImpl.processRootResources(WebApplicationImpl.java:713)
    at com.sun.jersey.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:609)
    at com.sun.jersey.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:472)
    at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:541)
    at com.sun.jersey.spi.container.servlet.ServletContainer.load(ServletContainer.java:465)
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:147)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1173)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1118)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1011)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4952)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5266)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)

giu 21, 2022 10:56:29 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet [ServletAdaptor] in web application [/Cati] threw load() exception
com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
    at com.sun.jersey.impl.application.WebApplicationImpl.processRootResources(WebApplicationImpl.java:713)
    at com.sun.jersey.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:609)
    at com.sun.jersey.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:472)
    at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:541)
    at com.sun.jersey.spi.container.servlet.ServletContainer.load(ServletContainer.java:465)
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:147)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1173)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1118)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1011)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4952)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5266)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)

I tried different versions of asm and jersey.

UPDATE: with the latest version of ASM I get another known error:

java.lang.IncompatibleClassChangeError: Found class org.objectweb.asm.MethodVisitor, but interface was expected

UPDATE: I have changed the environment…now I have java 1.7 and postgresql-9.4.1212.jre7.jar.
These are the errors:

GRAVE: The ResourceConfig instance does not contain any root resource classes.
giu 22, 2022 1:05:24 AM org.apache.catalina.core.ApplicationContext log
GRAVE: Servlet.init() for servlet [ServletAdaptor] threw exception
com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
    at com.sun.jersey.impl.application.WebApplicationImpl.processRootResources(WebApplicationImpl.java:713)
    at com.sun.jersey.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:609)
    at com.sun.jersey.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:472)
    at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:541)
    at com.sun.jersey.spi.container.servlet.ServletContainer.load(ServletContainer.java:465)
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:147)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1173)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1118)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1011)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4952)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5266)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

I think this is easier to solve. I will try later.

Thank you

Leave a Comment