Severe exception on servlet with java.lang.NoClassDefFoundError - java-8

I get this exception on my tomcat8 running on this java version OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-0ubuntu1.16.04.2-b13)
SEVERE [http-nio-80-exec-9]
org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [restSdkService] in context with path [/RestService] threw exception [java.lang.NoClassDefFoundError: Could not initialize class com.example.bean.SomeBean] with root cause
java.lang.NoClassDefFoundError: Could not initialize class com.example.bean.SomeBean at com.example.service.SomeService.getStuff(SomeService.java:118)
at sun.reflect.GeneratedMethodAccessor451.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.wink.server.internal.handlers.InvokeMethodHandler.handleRequest(InvokeMethodHandler.java:63)
at org.apache.wink.server.handlers.AbstractHandler.handleRequest(AbstractHandler.java:33)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
at org.apache.wink.server.internal.handlers.CreateInvocationParametersHandler.handleRequest(CreateInvocationParametersHandler.java:54)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleSubResourceMethod(FindResourceMethodHandler.java:183)
at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleRequest(FindResourceMethodHandler.java:110)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
at org.apache.wink.server.internal.handlers.FindRootResourceHandler.handleRequest(FindRootResourceHandler.java:95)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
at org.apache.wink.server.internal.handlers.HeadMethodHandler.handleRequest(HeadMethodHandler.java:53)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
at org.apache.wink.server.internal.handlers.OptionsMethodHandler.handleRequest(OptionsMethodHandler.java:46)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
at org.apache.wink.server.internal.handlers.SearchResultHandler.handleRequest(SearchResultHandler.java:33)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
at org.apache.wink.server.internal.log.ResourceInvocation.handleRequest(ResourceInvocation.java:92)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
at org.apache.wink.server.internal.log.Requests.handleRequest(Requests.java:76)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:63)
at org.apache.wink.server.handlers.AbstractHandlersChain.run(AbstractHandlersChain.java:48)
at org.apache.wink.server.internal.RequestProcessor.handleRequestWithoutFaultBarrier(RequestProcessor.java:207)
at org.apache.wink.server.internal.RequestProcessor.handleRequest(RequestProcessor.java:154)
at org.apache.wink.server.internal.servlet.RestServlet.service(RestServlet.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.wink.server.internal.servlet.contentencode.ContentEncodingResponseFilter.doFilter(ContentEncodingResponseFilter.java:122)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at psiprobe.Tomcat80AgentValve.invoke(Tomcat80AgentValve.java:40)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1504)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1460)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
and this is how my web.xml looks like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Wink SDK demo</display-name>
<description>Demonstration of SDK features</description>
<filter>
<filter-name>ContentEncodingResponseFilter</filter-name>
<filter-class>org.apache.wink.server.internal.servlet.contentencode.ContentEncodingResponseFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ContentEncodingResponseFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>com.example.listener.ApplicationLifeCycleListener</listener-class>
</listener>
<servlet>
<servlet-name>restSdkService</servlet-name>
<servlet-class>org.apache.wink.server.internal.servlet.RestServlet</servlet-class>
<init-param>
<param-name>applicationConfigLocation</param-name>
<param-value>/WEB-INF/application</param-value>
</init-param>
<init-param>
<param-name>propertiesLocation</param-name>
<param-value>/WEB-INF/bookmarks.properties</param-value>
</init-param>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>com.example.WinkApplication</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>restSdkService</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
</web-app>
and here is my pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.some.service</groupId>
<artifactId>RestService</artifactId>
<packaging>war</packaging>
<version>current-SNAPSHOT</version>
<parent>
<groupId>de.some.parent</groupId>
<artifactId>parent</artifactId>
<version>current-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.wink</groupId>
<artifactId>wink-server</artifactId>
<version>1.1.3-incubating</version>
</dependency>
<dependency>
<groupId>org.apache.wink</groupId>
<artifactId>wink-client</artifactId>
<version>1.1.3-incubating</version>
</dependency>
<dependency>
<artifactId>mongo-java-driver</artifactId>
<groupId>org.mongodb</groupId>
<version>${mongo-java-driver.version}</version>
</dependency>
<dependency>
<groupId>de.some.entities</groupId>
<artifactId>someinternalentities</artifactId>
<version>current-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>de.some.utils</groupId>
<artifactId>someinternalutils</artifactId>
<version>current-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.some.lib</groupId>
<artifactId>someinternallib</artifactId>
<version>current-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jaxb-annotations</artifactId>
<version>2.7.4</version>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5-20081211</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>apache-log4j-extras</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>net.sf.cron4j</groupId>
<artifactId>cron4j</artifactId>
<version>2.2.5</version>
</dependency>
<!-- JETTY DEPENDENCIES FOR TESTING -->
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.25</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>6.1.25</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-management</artifactId>
<version>6.1.25</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>de.some.internal.library</groupId>
<artifactId>someinternal-svc</artifactId>
<version>current-SNAPSHOT</version>
</dependency>
<!-- JUNIT DEPENDENCY FOR TESTING -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/asm/asm-attrs -->
<dependency>
<groupId>asm</groupId>
<artifactId>asm-attrs</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<filtering>false</filtering>
<directory>src/main/resources</directory>
</resource>
<resource>
<filtering>false</filtering>
<directory>src/main/java</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/main/config</directory>
<filtering>true</filtering>
</testResource>
<testResource>
<filtering>false</filtering>
<directory>src/test/java</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</testResource>
</testResources>
<plugins>
<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<optimize>true</optimize>
<debug>true</debug>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1</version>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
<archiveClasses>true</archiveClasses>
</configuration>
</plugin>
</plugins>
</build>
</project>
Does anybody have any clue why this is happening?

We solved the problem by removing the folders that tomcat creates in the path /tomcat8/work/Catalina/localhost.
Reading #Jared answer here Why am I getting a NoClassDefFoundError in Java?
Usually this indicates that we previously attempted to load a class from the classpath, but it failed for some reason - now we're trying to use the class again (and thus need to load it, since it failed last time), but we're not even going to try to load it, because we failed loading it earlier
and regarding the fact that the work directory of tomcat is where tomcat writes any file that it needs during run time (for more info read here tomcat8 configuration reference)
This directory will be made visible to servlets in the web application by a servlet context attribute (of type java.io.File) named javax.servlet.context.tempdir as described in the Servlet Specification
, I believe that these two things correlate with each other

Related

OSGi: org.apache.felix.http.base.internal.context.ServletContextImpl cannot be cast to weblogic.servlet.internal.WebAppServletContext

I'm new to the field and I'm migrating an OSGi type web application from a java7 environment on weblogic 12c server to a java8 environment on 14c server. I'm having a problem deploying the application. Previously, I don't know if it's relevant or not, the jersey libraries were provided directly in the application, while now the 'provided' scope has been added to the dependencies of these libraries. I specify that the application uses the felix one as a servlet, specifically org.apache.felix.http.proxy.ProxyServlet. When I deploy to the server I get the following exception:
<Jan 13, 2023 2:57:32,881 PM CET> <Warning> <com.hazelcast.config.AbstractXmlConfigHelper> <BEA-000000> <Name of the hazelcast schema location incorrect using default>
[ERROR] : [eu.sia.mdp.be.rest.activator.MdpRestActivator-0] The callback method start has thrown an exception : org.apache.felix.http.base.internal.context.ServletContextImpl cannot be cast to weblogic.servlet.internal.WebAppServletContext
java.lang.ClassCastException: org.apache.felix.http.base.internal.context.ServletContextImpl cannot be cast to weblogic.servlet.internal.WebAppServletContext
at weblogic.jaxrs.onwls.ejb.EjbComponentProvider.getEjbBeanInfo(EjbComponentProvider.java:177)
at weblogic.jaxrs.onwls.ejb.EjbComponentProvider.initialize(EjbComponentProvider.java:144)
at org.glassfish.jersey.server.ComponentProviderConfigurator.lambda$null$0(ComponentProviderConfigurator.java:55)
at java.util.stream.ReferencePipeline$11$1.accept(ReferencePipeline.java:372)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at org.glassfish.jersey.server.ComponentProviderConfigurator.lambda$init$1(ComponentProviderConfigurator.java:56)
at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:317)
at org.glassfish.jersey.server.ExternalRequestScopeConfigurator.init(ExternalRequestScopeConfigurator.java:50)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:336)
at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$1(ApplicationHandler.java:293)
at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:232)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:292)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:259)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:311)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:154)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:346)
at javax.servlet.GenericServlet.init(GenericServlet.java:203)
at org.apache.felix.http.base.internal.handler.ServletHandler.init(ServletHandler.java:308)
at org.apache.felix.http.base.internal.handler.HandlerRegistry.addServlet(HandlerRegistry.java:56)
at org.apache.felix.http.base.internal.service.HttpServiceImpl.registerServlet(HttpServiceImpl.java:102)
at org.apache.felix.http.api.ExtHttpService$$Proxy.registerServlet(Unknown Source)
at eu.sia.mdp.be.rest.activator.MdpRestActivator.__M_start(MdpRestActivator.java:56)
at eu.sia.mdp.be.rest.activator.MdpRestActivator.start(MdpRestActivator.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.felix.ipojo.util.Callback.call(Callback.java:237)
at org.apache.felix.ipojo.util.Callback.call(Callback.java:193)
at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallback.call(LifecycleCallback.java:86)
at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__M_stateChanged(LifecycleCallbackHandler.java:162)
at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)
at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:560)
at org.apache.felix.ipojo.InstanceManager.stateChanged(InstanceManager.java:1533)
at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:585)
at org.apache.felix.ipojo.HandlerManager.stateChanged(HandlerManager.java:239)
at org.apache.felix.ipojo.Handler.setValidity(Handler.java:174)
at org.apache.felix.ipojo.handlers.dependency.DependencyHandler.__M_checkContext(DependencyHandler.java:170)
at org.apache.felix.ipojo.handlers.dependency.DependencyHandler.checkContext(DependencyHandler.java)
at org.apache.felix.ipojo.handlers.dependency.DependencyHandler.__M_validate(DependencyHandler.java:133)
at org.apache.felix.ipojo.handlers.dependency.DependencyHandler.validate(DependencyHandler.java)
at org.apache.felix.ipojo.util.DependencyModel.validate(DependencyModel.java:522)
at org.apache.felix.ipojo.util.DependencyModel.computeAndSetDependencyState(DependencyModel.java:362)
at org.apache.felix.ipojo.util.DependencyModel.onChange(DependencyModel.java:1123)
at org.apache.felix.ipojo.dependency.impl.ServiceReferenceManager.fireUpdate(ServiceReferenceManager.java:561)
at org.apache.felix.ipojo.dependency.impl.ServiceReferenceManager.onNewMatchingService(ServiceReferenceManager.java:525)
at org.apache.felix.ipojo.dependency.impl.ServiceReferenceManager.addedService(ServiceReferenceManager.java:504)
at org.apache.felix.ipojo.util.Tracker$Tracked.trackAdding(Tracker.java:711)
at org.apache.felix.ipojo.util.Tracker$Tracked.track(Tracker.java:672)
at org.apache.felix.ipojo.util.Tracker$Tracked.serviceChanged(Tracker.java:633)
at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:987)
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:838)
at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:545)
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4536)
at org.apache.felix.framework.Felix.registerService(Felix.java:3518)
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:348)
at org.apache.felix.ipojo.IPojoContext.registerService(IPojoContext.java:395)
at org.apache.felix.ipojo.handlers.providedservice.ProvidedService.registerService(ProvidedService.java:351)
at org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler.__M_stateChanged(ProvidedServiceHandler.java:503)
at org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler.stateChanged(ProvidedServiceHandler.java)
at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:560)
at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:440)
at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:179)
at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:319)
at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:240)
at org.apache.felix.ipojo.extender.internal.linker.ManagedType$InstanceSupport$1.call(ManagedType.java:312)
at org.apache.felix.ipojo.extender.internal.linker.ManagedType$InstanceSupport$1.call(ManagedType.java:306)
at org.apache.felix.ipojo.extender.internal.queue.JobInfoCallable.call(JobInfoCallable.java:114)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
[ERROR] : java.lang.ClassCastException: org.apache.felix.http.base.internal.context.ServletContextImpl cannot be cast to weblogic.servlet.internal.WebAppServletContext
java.lang.IllegalStateException: java.lang.ClassCastException: org.apache.felix.http.base.internal.context.ServletContextImpl cannot be cast to weblogic.servlet.internal.WebAppServletContext
at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__M_stateChanged(LifecycleCallbackHandler.java:171)
at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)
at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:560)
at org.apache.felix.ipojo.InstanceManager.stateChanged(InstanceManager.java:1533)
at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:585)
at org.apache.felix.ipojo.HandlerManager.stateChanged(HandlerManager.java:239)
at org.apache.felix.ipojo.Handler.setValidity(Handler.java:174)
at org.apache.felix.ipojo.handlers.dependency.DependencyHandler.__M_checkContext(DependencyHandler.java:170)
at org.apache.felix.ipojo.handlers.dependency.DependencyHandler.checkContext(DependencyHandler.java)
at org.apache.felix.ipojo.handlers.dependency.DependencyHandler.__M_validate(DependencyHandler.java:133)
at org.apache.felix.ipojo.handlers.dependency.DependencyHandler.validate(DependencyHandler.java)
at org.apache.felix.ipojo.util.DependencyModel.validate(DependencyModel.java:522)
at org.apache.felix.ipojo.util.DependencyModel.computeAndSetDependencyState(DependencyModel.java:362)
at org.apache.felix.ipojo.util.DependencyModel.onChange(DependencyModel.java:1123)
at org.apache.felix.ipojo.dependency.impl.ServiceReferenceManager.fireUpdate(ServiceReferenceManager.java:561)
at org.apache.felix.ipojo.dependency.impl.ServiceReferenceManager.onNewMatchingService(ServiceReferenceManager.java:525)
at org.apache.felix.ipojo.dependency.impl.ServiceReferenceManager.addedService(ServiceReferenceManager.java:504)
at org.apache.felix.ipojo.util.Tracker$Tracked.trackAdding(Tracker.java:711)
at org.apache.felix.ipojo.util.Tracker$Tracked.track(Tracker.java:672)
at org.apache.felix.ipojo.util.Tracker$Tracked.serviceChanged(Tracker.java:633)
at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:987)
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:838)
at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:545)
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4536)
at org.apache.felix.framework.Felix.registerService(Felix.java:3518)
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:348)
at org.apache.felix.ipojo.IPojoContext.registerService(IPojoContext.java:395)
at org.apache.felix.ipojo.handlers.providedservice.ProvidedService.registerService(ProvidedService.java:351)
at org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler.__M_stateChanged(ProvidedServiceHandler.java:503)
at org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler.stateChanged(ProvidedServiceHandler.java)
at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:560)
at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:440)
at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:179)
at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:319)
at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:240)
at org.apache.felix.ipojo.extender.internal.linker.ManagedType$InstanceSupport$1.call(ManagedType.java:312)
at org.apache.felix.ipojo.extender.internal.linker.ManagedType$InstanceSupport$1.call(ManagedType.java:306)
at org.apache.felix.ipojo.extender.internal.queue.JobInfoCallable.call(JobInfoCallable.java:114)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
Caused by: java.lang.ClassCastException: org.apache.felix.http.base.internal.context.ServletContextImpl cannot be cast to weblogic.servlet.internal.WebAppServletContext
at weblogic.jaxrs.onwls.ejb.EjbComponentProvider.getEjbBeanInfo(EjbComponentProvider.java:177)
at weblogic.jaxrs.onwls.ejb.EjbComponentProvider.initialize(EjbComponentProvider.java:144)
at org.glassfish.jersey.server.ComponentProviderConfigurator.lambda$null$0(ComponentProviderConfigurator.java:55)
at java.util.stream.ReferencePipeline$11$1.accept(ReferencePipeline.java:372)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at org.glassfish.jersey.server.ComponentProviderConfigurator.lambda$init$1(ComponentProviderConfigurator.java:56)
at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:317)
at org.glassfish.jersey.server.ExternalRequestScopeConfigurator.init(ExternalRequestScopeConfigurator.java:50)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:336)
at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$1(ApplicationHandler.java:293)
at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:232)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:292)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:259)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:311)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:154)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:346)
at javax.servlet.GenericServlet.init(GenericServlet.java:203)
at org.apache.felix.http.base.internal.handler.ServletHandler.init(ServletHandler.java:308)
at org.apache.felix.http.base.internal.handler.HandlerRegistry.addServlet(HandlerRegistry.java:56)
at org.apache.felix.http.base.internal.service.HttpServiceImpl.registerServlet(HttpServiceImpl.java:102)
at org.apache.felix.http.api.ExtHttpService$$Proxy.registerServlet(Unknown Source)
at eu.sia.mdp.be.rest.activator.MdpRestActivator.__M_start(MdpRestActivator.java:56)
at eu.sia.mdp.be.rest.activator.MdpRestActivator.start(MdpRestActivator.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.felix.ipojo.util.Callback.call(Callback.java:237)
at org.apache.felix.ipojo.util.Callback.call(Callback.java:193)
at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallback.call(LifecycleCallback.java:86)
at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__M_stateChanged(LifecycleCallbackHandler.java:162)
... 41 more
di seguito i pom, e i file web.xml, weblogic.xml e felix.properties:
parent pom
<dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.ipojo</artifactId>
<version>1.12.1</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.ipojo.manipulator.online</artifactId>
<version>1.12.1</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.http.bridge</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.http.api</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.http.proxy</artifactId>
<version>2.3.2</version>
</dependency>
<!-- JAX-RS -->
<!-- prova dipendenza sostituitiva -->
<!-- dipendenza utilizzate al posto di jax-rs per il deploy su server veblogic 14c-->
<!-- nelle build con java 7 questa dipendenza non è presente. aggiunta per prove -->
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<version>2.1.5</version>
<scope>provided</scope>
</dependency>
<!-- JAX-RS -->
<!-- JERSEY -->
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-jaxb</artifactId>
<version>${jersey.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>${jersey.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>${jersey.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>${jersey.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>jersey-bean-validation</artifactId>
<version>${jersey.version}</version>
<scope>provided</scope>
</dependency>
<!-- Librerie di test server side https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest/test-framework.html -->
<!-- ptrebbero non servire -->
<!-- <dependency>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
<artifactId>jersey-test-framework-provider-inmemory</artifactId>
<version>${jersey.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
<artifactId>jersey-test-framework-provider-jetty</artifactId>
<version>${jersey.version}</version>
<scope>provided</scope>
</dependency> -->
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>${jersey.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<version>${jersey.version}</version>
<scope>provided</scope>
</dependency>
<!-- questa dipendenza serve per fare il deploy della webapp -->
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>${jersey.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.hk2</groupId>
<artifactId>hk2-api</artifactId>
<version>2.6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.hk2</groupId>
<artifactId>hk2-utils</artifactId>
<version>2.6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.hk2</groupId>
<artifactId>hk2-locator</artifactId>
<version>2.6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
<version>3.0.2</version>
<!-- <scope>provided</scope> -->
</dependency>
<!-- JERSEY -->
...
webapp.pom
...
<build>
<finalName>mdp-be</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy-dependencies</id>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<verbose>true</verbose>
<outputDirectory>${project.build.directory}/osgi-lib</outputDirectory>
<includeScope>compile</includeScope>
<excludeScope>provided</excludeScope>
<excludeArtifactIds>
org.apache.felix.framework,
javax.servlet-api,
org.apache.felix.ipojo.annotations,
hazelcast-code-generator,
annotations,
minimal-json,
freemarker,
slf4j-simple,
ccf2,
eci,
eci-tools,
frame,
server,
client,
security,
transaction-api,
connector-api,
hamcrest-core,
slf4j-api,
logback-classic,
logback-core,
janino,
derby,
flyway-core,
jooq-codegen,
derbynet,
derbyclient,
hsqldb,
jersey-container-servlet,
jersey-hk2,
jersey-common,
jersey-media-jaxb,
jersey-client,
jersey-media-json-jackson,
jersey-bean-validation,
jersey-server,
jersey-container-servlet-core,
jakarta.ws.rs-api
</excludeArtifactIds>
</configuration>
</execution>
</executions>
</plugin>
<dependencies>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.http.proxy</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.http.bridge</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
web.xml
<listener>
<listener-class>org.apache.felix.http.proxy.ProxyListener</listener-class>
</listener>
<servlet>
<servlet-name>felix-http-proxy</servlet-name>
<servlet-class>org.apache.felix.http.proxy.ProxyServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<servlet-mapping>
<servlet-name>felix-http-proxy</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<resource-ref>
<description>Database Motore dei Pagamenti</description>
<res-ref-name>jdbc/MDPDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<security-constraint>
<web-resource-collection>
<web-resource-name>SecuredPages</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
</web-app>
weblogic.xml
<container-descriptor>
<!-- MUST USE THIS OR WEBLOGIC WILL USE SYSTEM CLASSPATH FIRST -->
<prefer-application-packages>
<package-name>org.slf4j.*</package-name>
<package-name>org.apache.commons.logging.*</package-name>
<!--<package-name>com.sun.jersey.*</package-name>
<package-name>com.sun.mail.*</package-name>-->
<!-- <package-name>org.glassfish.jersey.*</package-name>
<package-name>org.glassfish.hk2.*</package-name>
<package-name>org.jvnet.hk2.*</package-name>
<package-name>jersey.repackaged.org.objectweb.asm.*</package-name> -->
<package-name>org.objectweb.asm.*</package-name>
<!--<package-name>com.sun.ws.rs.ext.*</package-name>-->
<!--<package-name>javax.ws.rs.*</package-name>-->
<package-name>javax.persistence.*</package-name>
<package-name>javax.mail.*</package-name>
</prefer-application-packages>
<prefer-application-resources>
<resource-name>org/slf4j/impl/StaticLoggerBinder.class</resource-name>
<resource-name>org/slf4j/impl/StaticMDCBinder.class</resource-name>
<resource-name>META-INF/services/javax.xml.ws.spi.Provider</resource-name>
</prefer-application-resources>
</container-descriptor>
<resource-description>
<res-ref-name>jdbc/MDPDB</res-ref-name>
<jndi-name>jdbc/MDPDB</jndi-name>
</resource-description>
<context-root>mdp-be</context-root>
</weblogic-web-app>
felix.properties
org.osgi.framework.storage.clean = onFirstInit
org.osgi.framework.bootdelegation=sun.*,com.sun.*
org.osgi.framework.system.packages.extra=\
sun.net.www.protocol.https,\
javax.servlet;javax.servlet.http;javax.servlet.descriptor;javax.servlet.annotation;version=3.0,\
oracle.jdbc,oracle.jdbc.pool,\
com.ibm.connector2.cics,com.ibm.connector2.spi,\
javax.naming,javax.resource,javax.resource.spi,javax.resource.cci,\
com.jcabi.aspects,com.jcabi.aspects.aj,com.jcabi.aspects.apt,com.jcabi.log,\
org.aspectj,org.aspectj.runtime.internal,org.aspectj.runtime.reflect,org.aspectj.lang,org.aspectj.lang.reflect,\
it.zerounotribe.poste.context.posteID.cryptography,it.zerounotribe.poste.context.posteID.exception,\
org.osgi.service.log,\
javax.ws.rs;javax.ws.rs.client;javax.ws.rs.container;javax.ws.rs.core;javax.ws.rs.ext;javax.ws.rs.sse;version=2.1.5,\
org.glassfish.jersey;org.glassfish.jersey.inject.spi;org.glassfish.jersey.internal;org.glassfish.jersey.internal.config;org.glassfish.jersey.internal.guava;org.glassfish.jersey.internal.inject;org.glassfish.jersey.internal.jsr166;org.glassfish.jersey.internal.l10n;org.glassfish.jersey.internal.routing;org.glassfish.jersey.internal.sonar;org.glassfish.jersey.internal.spi;org.glassfish.jersey.internal.util;org.glassfish.jersey.internal.util.collection;org.glassfish.jersey.logging;org.glassfish.jersey.message;org.glassfish.jersey.message.internal;org.glassfish.jersey.model;org.glassfish.jersey.model.internal;org.glassfish.jersey.model.internal.spi;org.glassfish.jersey.process;org.glassfish.jersey.process.internal;org.glassfish.jersey.spi;org.glassfish.jersey.uri;org.glassfish.jersey.uri.internal;org.glassfish.jersey.server;org.glassfish.jersey.server.filter;org.glassfish.jersey.server.filter.internal;org.glassfish.jersey.server.internal;org.glassfish.jersey.server.internal.inject;org.glassfish.jersey.server.internal.monitoring;org.glassfish.jersey.server.internal.monitoring.core;org.glassfish.jersey.server.internal.monitoring.jmx;org.glassfish.jersey.server.internal.process;org.glassfish.jersey.server.internal.routing;org.glassfish.jersey.server.internal.scanning;org.glassfish.jersey.server.internal.sonar;org.glassfish.jersey.server.model;org.glassfish.jersey.server.model.internal;org.glassfish.jersey.server.monitoring;org.glassfish.jersey.server.spi;org.glassfish.jersey.server.spi.internal;org.glassfish.jersey.server.wadl;org.glassfish.jersey.server.wadl.config;org.glassfish.jersey.server.wadl.internal;org.glassfish.jersey.server.wadl.internal.generators;org.glassfish.jersey.server.wadl.internal.generators.resourcedoc;org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.model;org.glassfish.jersey.server.wadl.internal.generators.resourcedoc.xhtml;org.glassfish.jersey.server.wadl.processor;com.sun.research.ws.wadl;jersey.repackaged.org.objectweb.asm;org.glassfish.jersey.servlet;org.glassfish.jersey.servlet.internal;org.glassfish.jersey.servlet.internal.spi;org.glassfish.jersey.servlet.spi;version=2.29.0
Could someone help me figure out what's missing or where I'm going wrong?

Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext - Tomcat 9

I've a application with spring boot + cassandra + spark. I builded the file .war, but it's not loading. I prepared the packed based on the spring boot's documentation. The pom, inicialization class, ...
I cheked all the stackoverflow about this topic, but I did not find any this like this.
However, I have this stacktrace:
12-Feb-2021 17:47:19.321 SEVERE [main] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/opt/tomcat/webapps/SSP-0.0.1.war]
java.lang.IllegalStateException: Error starting child
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:720)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:706)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:978)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1848)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:773)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1576)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:309)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:936)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SSP-0.0.1]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)
... 37 more
Caused by: java.lang.NullPointerException
at org.springframework.boot.cli.app.SpringApplicationWebApplicationInitializer.getSources(SpringApplicationWebApplicationInitializer.java:61)
at org.springframework.boot.cli.app.SpringApplicationWebApplicationInitializer.onStartup(SpringApplicationWebApplicationInitializer.java:47)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:174)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5166)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 38 more
The POM.XML
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>SSP</groupId>
<artifactId>SSP</artifactId>
<packaging>war</packaging>
<version>0.0.1</version>
<name>SSP</name>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.2</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-cassandra -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-cassandra</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.python</groupId>
<artifactId>jython</artifactId>
<version>2.7.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/com.datastax.spark/spark-cassandra-connector -->
<dependency>
<groupId>com.datastax.spark</groupId>
<artifactId>spark-cassandra-connector_2.12</artifactId>
<version>3.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.spark/spark-core -->
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.12</artifactId>
<version>3.1.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.spark/spark-sql -->
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.12</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-exec</artifactId>
<version>1.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.27.0-GA</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.webjars.npm/chart.js -->
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>chart.js</artifactId>
<version>2.9.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.webjars.bower/jquery -->
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>jquery</artifactId>
<version>3.2.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-math3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.6.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.yaml/snakeyaml -->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.webjars/jquery -->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>3.5.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.webjars/jquery-ui -->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery-ui</artifactId>
<version>1.12.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-rng-parent</artifactId>
<version>1.3</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20200518</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.6.1</version>
</dependency>
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>4.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.datastax.cassandra/cassandra-driver-core -->
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
<version>4.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/joda-time/joda-time -->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.10.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-cli -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-cli</artifactId>
<version>2.4.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet/servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven
defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.2.6.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
My SpringBootServletInitializer
#SpringBootApplication
#EntityScan(basePackages = { "br.com.genesis.*" })
#EnableCassandraRepositories(basePackages = { "br.com.genesis." })
#ComponentScan(basePackages = {"br.com.genesis.*"})
public class AppSSP extends SpringBootServletInitializer
{
public static void main( String[] args )
{
SpringApplication.run(AppSSP.class, args);
}
}
Thanks for the help,
I can see org.springframework.boot.cli.app.SpringApplicationWebApplicationInitializer in the stack trace. That class is part of Spring Boot's CLI and shouldn't be involved when you're building an application with Maven or Gradle. Looking at your pom, I can see the following dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-cli</artifactId>
<version>2.4.2</version>
</dependency>
The CLI isn't intended to be used as a dependency and it's unlikely that your application needs it. Removing the dependency from your pom should fix the NullPointerException that's causing your application to fail to start.
You may also want to review some of the other versions in your pom.xml. For example, I can see that you're using 2.4.2 of spring-boot-starter-parent but have overridden the version of spring-boot-maven-plugin to 2.2.6.RELEASE. You should remove <version>2.2.6.RELEASE</version> and allow spring-boot-starter-parent to control the version.

Tomcat 7 Gets Errors During Startup of Java Project

I have a Java project which was working perfectly before. Now I'm getting the errors below. The server startup is successful but the services do not work.
Java version of the project is 8 and I use Tomcat 7 server.
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>ProjectName</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>ServiceNameRest</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ServiceNameRest</servlet-name>
<url-pattern>/projectName/*</url-pattern>
</servlet-mapping>
<listener>
<listener-class>...contextlistener.OCServletContextListener</listener-class>
</listener>
</web-app>
pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ProjectName</groupId>
<artifactId>ProjectName</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<finalName>ProjectName2</finalName>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<inherited>true</inherited>
<configuration>
<source>1.8</source>
<target>1.8</target>
<webXml>src\main\webapp\WEB-INF\web.xml</webXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<failOnMissingWebXml>true</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>5.0.3</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-bundle</artifactId>
<version>1.19</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.19</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20140107</version>
</dependency>
<dependency>
<groupId>nz.ac.waikato.cms.weka</groupId>
<artifactId>weka-stable</artifactId>
<version>3.8.0</version>
</dependency>
<dependency>
<groupId>nz.ac.waikato.cms.weka</groupId>
<artifactId>LibSVM</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.9</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
<version>5.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client</artifactId>
<version>2.2.0</version>
</dependency>
</dependencies>
</project>
Error Log:
Haz 27, 2020 2:16:29 PM org.apache.catalina.core.ApplicationContext
log SEVERE: StandardWrapper.Throwable
java.lang.IllegalArgumentException at
jersey.repackaged.org.objectweb.asm.ClassReader.(ClassReader.java:170)
at
jersey.repackaged.org.objectweb.asm.ClassReader.(ClassReader.java:153)
at
jersey.repackaged.org.objectweb.asm.ClassReader.(ClassReader.java:424)
at
com.sun.jersey.spi.scanning.AnnotationScannerListener.onProcess(AnnotationScannerListener.java:138)
at
com.sun.jersey.core.spi.scanning.JarFileScanner.scan(JarFileScanner.java:97)
at
com.sun.jersey.spi.scanning.servlet.WebAppResourcesScanner$1.f(WebAppResourcesScanner.java:94)
at com.sun.jersey.core.util.Closing.f(Closing.java:71) at
com.sun.jersey.spi.scanning.servlet.WebAppResourcesScanner.scan(WebAppResourcesScanner.java:92)
at
com.sun.jersey.spi.scanning.servlet.WebAppResourcesScanner.scan(WebAppResourcesScanner.java:79)
at
com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:80)
at
com.sun.jersey.api.core.servlet.WebAppResourceConfig.init(WebAppResourceConfig.java:102)
at
com.sun.jersey.api.core.servlet.WebAppResourceConfig.(WebAppResourceConfig.java:89)
at
com.sun.jersey.api.core.servlet.WebAppResourceConfig.(WebAppResourceConfig.java:74)
at
com.sun.jersey.spi.container.servlet.WebComponent.getWebAppResourceConfig(WebComponent.java:668)
at
com.sun.jersey.spi.container.servlet.ServletContainer.getDefaultResourceConfig(ServletContainer.java:435)
at
com.sun.jersey.spi.container.servlet.ServletContainer.getDefaultResourceConfig(ServletContainer.java:602)
at
com.sun.jersey.spi.container.servlet.WebServletConfig.getDefaultResourceConfig(WebServletConfig.java:87)
at
com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:699)
at
com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:674)
at
com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:205)
at
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:394)
at
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:577)
at javax.servlet.GenericServlet.init(GenericServlet.java:158) at
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1269)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1182)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1072)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5368)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5660)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
at java.util.concurrent.FutureTask.run(FutureTask.java:266) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Haz 27, 2020 2:16:29 PM org.apache.catalina.core.StandardContext
loadOnStartup SEVERE: Servlet [Jersey Web Application] in web
application [/DocumentClassifier] threw load() exception
java.lang.IllegalArgumentException at
jersey.repackaged.org.objectweb.asm.ClassReader.(ClassReader.java:170)
at
jersey.repackaged.org.objectweb.asm.ClassReader.(ClassReader.java:153)
at
jersey.repackaged.org.objectweb.asm.ClassReader.(ClassReader.java:424)
at
com.sun.jersey.spi.scanning.AnnotationScannerListener.onProcess(AnnotationScannerListener.java:138)
at
com.sun.jersey.core.spi.scanning.JarFileScanner.scan(JarFileScanner.java:97)
at
com.sun.jersey.spi.scanning.servlet.WebAppResourcesScanner$1.f(WebAppResourcesScanner.java:94)
at com.sun.jersey.core.util.Closing.f(Closing.java:71) at
com.sun.jersey.spi.scanning.servlet.WebAppResourcesScanner.scan(WebAppResourcesScanner.java:92)
at
com.sun.jersey.spi.scanning.servlet.WebAppResourcesScanner.scan(WebAppResourcesScanner.java:79)
at
com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:80)
at
com.sun.jersey.api.core.servlet.WebAppResourceConfig.init(WebAppResourceConfig.java:102)
at
com.sun.jersey.api.core.servlet.WebAppResourceConfig.(WebAppResourceConfig.java:89)
at
com.sun.jersey.api.core.servlet.WebAppResourceConfig.(WebAppResourceConfig.java:74)
at
com.sun.jersey.spi.container.servlet.WebComponent.getWebAppResourceConfig(WebComponent.java:668)
at
com.sun.jersey.spi.container.servlet.ServletContainer.getDefaultResourceConfig(ServletContainer.java:435)
at
com.sun.jersey.spi.container.servlet.ServletContainer.getDefaultResourceConfig(ServletContainer.java:602)
at
com.sun.jersey.spi.container.servlet.WebServletConfig.getDefaultResourceConfig(WebServletConfig.java:87)
at
com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:699)
at
com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:674)
at
com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:205)
at
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:394)
at
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:577)
at javax.servlet.GenericServlet.init(GenericServlet.java:158) at
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1269)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1182)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1072)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5368)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5660)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
at java.util.concurrent.FutureTask.run(FutureTask.java:266) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

GWT Requestfactory issue with Maven + IntelliJ

I am working on a webapp project using GWT 2.5.1 and the requestfactory with a maven config. Actually, I began the project out of maven as a standalone project in eclipse and it still works fine.
But for integration purpose I had to integrate the project as a maven module and to use IntelliJ IDE. And now, when I launch the project on dev mode it works, but as soon as I use the requestfactory I get an Error500. I have found many topic on this subject but I still can not fix it.
I guess this error is either related to annotating processing or to pom.xml config.
About annotationg processing with gwt requestfactory-apt.jar configuration, I can not get the rep .apt_generated with my new configuration with maven in IntelliJ like I did in eclipse and I don't understand why.
Here is my maven config pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>toolkit2</artifactId>
<groupId>somepackage</groupId>
<version>v2-maven-alpha</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>docentryeditor</artifactId>
<packaging>war</packaging>
<name>doc-entry-editor</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>gwt-maven</id>
<url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/</url>
</repository>
</repositories>
<!-- include pluginRepository and repository for GWT-Maven -->
<pluginrepositories>
<pluginrepository>
<id>gwt-maven-plugins</id>
<url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/</url>
</pluginrepository>
</pluginrepositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<classifier>deps</classifier>
<version>2.5.1</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.5.1</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.web.bindery</groupId>
<artifactId>requestfactory-server</artifactId>
<version>2.5.1</version>
</dependency>
<dependency>
<groupId>com.google.web.bindery</groupId>
<artifactId>requestfactory-apt</artifactId>
<version>2.5.1</version>
</dependency>
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.google.gwt.inject</groupId>
<artifactId>gin</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-servlet</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-assistedinject</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.1.1.Final</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0-20050927.133100</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<classifier>sources</classifier>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.7</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.7</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
</dependencies>
<build>
<finalName>docentryeditor</finalName>
<!-- Generate compiled stuff in the folder used for developing mode -->
<!--<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>-->
<plugins>
<!-- GWT Maven Plugin -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test</goal>
<goal>i18n</goal>
<goal>generateAsync</goal>
</goals>
</execution>
</executions>
<!-- Plugin configuration. There are many available options, see gwt-maven-plugin
documentation at codehaus.org -->
<configuration>
<runTarget>XDS-MetadataEditor.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
</configuration>
</plugin>
<!-- Copy static web files before executing gwt:run -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
</executions>
<configuration>
<webappDirectory>${webappDirectory}</webappDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<!-- RequestFactory Validation jar -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.web.bindery</groupId>
<artifactId>requestfactory-apt</artifactId>
<version>2.5.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/client/**</include>
<include>**/*.gwt.xml</include>
</includes>
</resource>
</resources>
</build>
Here is my annotation processing config:
And, eventually, this is the error I get:
SEVERE: Server Error 500 <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 500 javax/validation/ParameterNameProvider</title>
</head>
<body><h2>HTTP ERROR: 500</h2><pre>javax/validation/ParameterNameProvider</pre>
<p>RequestURI=/gwtRequest</p><h3>Caused by:</h3><pre>java.lang.NoClassDefFoundError: javax/validation/ParameterNameProvider
at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:41)
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:269)
at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:111)
at com.google.web.bindery.requestfactory.server.ReflectiveServiceLayer.<clinit>(ReflectiveServiceLayer.java:60)
at com.google.web.bindery.requestfactory.server.ServiceLayer.create(ServiceLayer.java:75)
at com.google.web.bindery.requestfactory.server.RequestFactoryServlet.<init>(RequestFactoryServlet.java:103)
at com.google.web.bindery.requestfactory.server.RequestFactoryServlet.<init>(RequestFactoryServlet.java:89)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:153)
at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:463)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Caused by: java.lang.ClassNotFoundException: javax.validation.ParameterNameProvider
at java.lang.ClassLoader.findClass(ClassLoader.java:531)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:352)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337)
... 31 more
</pre>
<h3>Caused by:</h3><pre>java.lang.ClassNotFoundException: javax.validation.ParameterNameProvider
at java.lang.ClassLoader.findClass(ClassLoader.java:531)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:352)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337)
at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:41)
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:269)
at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:111)
at com.google.web.bindery.requestfactory.server.ReflectiveServiceLayer.<clinit>(ReflectiveServiceLayer.java:60)
at com.google.web.bindery.requestfactory.server.ServiceLayer.create(ServiceLayer.java:75)
at com.google.web.bindery.requestfactory.server.RequestFactoryServlet.<init>(RequestFactoryServlet.java:103)
at com.google.web.bindery.requestfactory.server.RequestFactoryServlet.<init>(RequestFactoryServlet.java:89)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:153)
at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:463)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
</pre>
<p><i><small>Powered by Jetty://</small></i></p><br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
</body>
</html>
ERROR: Uncaught exception escaped
com.google.web.bindery.event.shared.UmbrellaException: Exception caught: Server Error 500 <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 500 javax/validation/ParameterNameProvider</title>
</head>
<body><h2>HTTP ERROR: 500</h2><pre>javax/validation/ParameterNameProvider</pre>
<p>RequestURI=/gwtRequest</p><h3>Caused by:</h3><pre>java.lang.NoClassDefFoundError: javax/validation/ParameterNameProvider
at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:41)
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:269)
at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:111)
at com.google.web.bindery.requestfactory.server.ReflectiveServiceLayer.<clinit>(ReflectiveServiceLayer.java:60)
at com.google.web.bindery.requestfactory.server.ServiceLayer.create(ServiceLayer.java:75)
at com.google.web.bindery.requestfactory.server.RequestFactoryServlet.<init>(RequestFactoryServlet.java:103)
at com.google.web.bindery.requestfactory.server.RequestFactoryServlet.<init>(RequestFactoryServlet.java:89)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:153)
at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:463)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Caused by: java.lang.ClassNotFoundException: javax.validation.ParameterNameProvider
at java.lang.ClassLoader.findClass(ClassLoader.java:531)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:352)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337)
... 31 more
</pre>
<h3>Caused by:</h3><pre>java.lang.ClassNotFoundException: javax.validation.ParameterNameProvider
I would be really thankful if someone could help me get through this.
I finally solved it.
It seems I was all wrong about the problem. Indeed, my problem was related to maven config in pom.xml for bean validation. I was using a version of hibernate which is too recent, just had to downgrade to hibernate 4.3.1.
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.3.1.Final</version>
</dependency>

what's contain ${Session.resources} in applicationContext?

i'm trying to understand this applicationContex:
<tx:annotation-driven/>
<!-- Definició dels beans de sessió i usuari -->
**<import resource="${session.resources}" />**
<!-- Definició dels beans del subjecte anònim -->
${session.subjecteanonim}
<!-- Integració amb BASE OnLine -->
<import resource="classpath:bf-modul-baseonline-appConfiguration.xml" />
<import resource="classpath:gim.logica-context.xml" />
<!-- Serveis de lògica de negoci proporcionats per base
<jee:remote-slsb id="serveiMestreMunicipiEns"
business-interface="cat.base.mestres.servei.IServeiMestreMunicipiEns"
jndi-name="${cat.base.mestre.municipi.ens.service.name}">
<jee:environment>
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=${cat.base.mestre.municipi.ens.jndi.url}
java.naming.provider.port=${cat.base.mestre.municipi.ens.jndi.port}
</jee:environment>
</jee:remote-slsb>
-->
so, my problem is that I don't know where is defined ${session.resources}, and what can i have inside? is from jsf?I hope you apologize for my strnge english, ty.
ztb.
this is the parent's pom:
http://maven.apache.org/maven-v4_0_0.xsd">
4.0.0
<groupId>cat.base</groupId>
<artifactId>gim</artifactId>
<version>0.0.2-SNAPSHOT</version>
<packaging>pom</packaging>
<parent>
<groupId>cat.base.baseframe</groupId>
<artifactId>projecte-pare-baseframe</artifactId>
<version>0.0.11.a</version>
</parent>
<modules>
<module>gim.assistent</module>
</modules>
<properties>
<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>cat.base</groupId>
<artifactId>mme.domini</artifactId>
<version>1.3.3</version>
<scope>provided</scope>
</dependency>
</dependencies>
and this i the pom's application
http://maven.apache.org/maven-v4_0_0.xsd">
4.0.0
<parent>
<groupId>cat.base</groupId>
<artifactId>gim</artifactId>
<version>0.0.2-SNAPSHOT</version>
</parent>
<artifactId>gim.assistent</artifactId>
<packaging>war</packaging>
<name>Assistent d'Expedients GIM</name>
<build>
<finalName>gim.assistent.${profile.entorn}</finalName>
<resources>
<resource>
<directory>./</directory>
<includes>
<include>change.log</include>
</includes>
</resource>
<resource>
<directory>src/main/resources/</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webXml>src\main\webapp\WEB-INF\web.xml</webXml>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- domini, servei deps. -->
<dependency>
<groupId>jboss</groupId>
<artifactId>jboss-ejb3x</artifactId>
<version>4.2.3.GA</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.2.1.ga</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jboss</groupId>
<artifactId>jboss-annotations-ejb3</artifactId>
<version>4.2.3.GA</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.client</groupId>
<artifactId>jbossall-client</artifactId>
<version>EAP-4.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.5.6</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<!-- test deps. -->
<dependency>
<groupId>com.ibm.informix</groupId>
<artifactId>ifxjdbc</artifactId>
<version>2.21.JC2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
<!-- ui deps. -->
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>org.springframework.js</artifactId>
<version>2.0.5.RELEASE</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>org.springframework.faces</artifactId>
<version>2.0.5.RELEASE</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>org.springframework.binding</artifactId>
<version>2.0.5.RELEASE</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>org.springframework.webflow</artifactId>
<version>2.0.5.RELEASE</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>1.2_10</version>
<scope>provided</scope>
</dependency>
</dependencies>
<!-- PERFILS DE CONSTRUCCIÓ -->
<profiles>
<!-- PERFIL CIUTADA -->
<profile>
<id>ciutada</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>src/main/webapp</directory>
<filtering>true</filtering>
<includes>
<include>**/applicationContext.xml</include>
<include>**/web.xml</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<profile.entorn>ciutada</profile.entorn>
<session.resources>classpath:bf-modul-session-bd-jbosscache-appConfiguration.xml</session.resources>
<session.postproces>classpath*:bf-modul-session-bd.properties</session.postproces>
<session.subjecteanonim>
<![CDATA[
<import resource="classpath:bf-modul-subjecte-anonim-appConfiguration.xml" />
]]>
</session.subjecteanonim>
<webxml.module.filter>cat.base.baseframe.modules.login.session.bd.BaseSessionLoginJBossCacheFilter</webxml.module.filter>
<webxml.module.listener>cat.base.baseframe.modules.login.session.bd.BaseSessionHttpSessionEventListener</webxml.module.listener>
<webxml.login.config>
<![CDATA[
<login-config>
<auth-method>CLIENT-CERT</auth-method>
</login-config>
]]>
</webxml.login.config>
<webxml.subjecte.anonim.filter>
<![CDATA[
<filter>
<filter-name>SubjecteAnonimFilter</filter-name>
<filter-class>cat.base.baseframe.modules.anonim.filtre.SubjecteAnonimFilter</filter-class>
<init-param>
<param-name>acceptaAnonims</param-name>
<param-value>false</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>SubjecteAnonimFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
]]>
</webxml.subjecte.anonim.filter>
</properties>
</profile>
<!-- PERFIL EMPLEAT -->
<profile>
<id>empleat</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>src/main/webapp</directory>
<filtering>true</filtering>
<includes>
<include>**/applicationContext.xml</include>
<include>**/web.xml</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<profile.entorn>empleat</profile.entorn>
<session.resources>classpath*:bf-modul-session-ldap-jbosscache-appConfiguration.xml</session.resources>
<session.postproces>classpath*:bf-modul-session-ldap.properties</session.postproces>
<session.subjecteanonim/>
<webxml.module.filter>cat.base.baseframe.modules.login.session.ldap.BaseSessionLoginJBossCacheFilter</webxml.module.filter>
<webxml.module.listener>cat.base.baseframe.modules.login.session.ldap.BaseSessionHttpSessionEventListener</webxml.module.listener>
<webxml.login.config>
<![CDATA[
<login-config>
<auth-method>FORM</auth-method>
<realm-name>BaseRealm</realm-name>
<form-login-config>
<form-login-page>/security/login-page.jsp</form-login-page>
<form-error-page>/security/login-error.jsp</form-error-page>
</form-login-config>
</login-config>
]]>
</webxml.login.config>
<webxml.subjecte.anonim.filter />
</properties>
</profile>
</profiles>
Ok ! i find a way to understand!
this variables are defined at pom anf do reference to maven profile a way to aunthenticate.
<session.resources>classpath:bf-modul-session-bd-jbosscacheappConfiguration.xml</session.resources>
I felt like a stupid monkey.
ztb

Resources