update: Log Files from deployment with 1.2.5.RELEASE are below.
I want to deploy my Spring Boot Application to a Tomcat 7 on OpenShift.
This works fine with the spring-boot-starter-parent Version 1.1.12.RELEASE. (Demo Ping service is responding). But when I change the Version to 1.2.5.RELEASE (current realease) I get a HTTP 404 Error on my ping Service (build and deployment does not show any error message).
I want to use 1.2.5.RELEASE because I want to extend my Application to Send Emails with
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
this requires 1.2.5.RELEASE. On 1.1.12.RELEASE I get the Error:
Project build error: 'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-mail:jar is missing.
Could someone please help me to fix this.
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">
<modelVersion>4.0.0</modelVersion>
<groupId>appdemo</groupId>
<artifactId>appdemo</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>appdemo</name>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<!-- here I want to use 1.2.5.RELEASE -->
<version>1.1.12.RELEASE</version>
<relativePath />
</parent>
<repositories>
<repository>
<id>eap</id>
<url>http://maven.repository.redhat.com/techpreview/all</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>eap</id>
<url>http://maven.repository.redhat.com/techpreview/all</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<start-class>Application</start-class>
</properties>
<dependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.2-1003-jdbc4</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.25</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<!-- When built in OpenShift the 'openshift' profile will be used when
invoking mvn. -->
<!-- Use this profile for any OpenShift specific customization your app
will need. -->
<!-- By default that is to put the resulting archive into the 'webapps'
folder. -->
<!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html -->
<id>openshift</id>
<build>
<finalName>appdemo</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<outputDirectory>webapps</outputDirectory>
<warName>ROOT</warName>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<classifier>boot</classifier>
</configuration>
</plugin>
</plugins>
</build>
</project>
Application.java
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
#Configuration
#ComponentScan
#EnableAutoConfiguration
public class Application extends SpringBootServletInitializer {
#Override
protected SpringApplicationBuilder configure(
SpringApplicationBuilder application) {
return application.sources(Application.class);
}
public static void main(String[] args) throws Exception {
SpringApplication.run(Application.class, args);
}
}
Ping.java (responding with 1.1.12.RLEASE but not with 1.2.5.RELEASE)
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
#Controller
#RequestMapping("/ping")
public class Ping {
#RequestMapping(method = RequestMethod.GET)
#ResponseStatus(HttpStatus.OK)
public #ResponseBody String getPing() {
return "{ \"ping\": pong}";
}
}
jbossews.log Delpoyment with 1.2.5.RELEASE
:: Spring Boot :: (v1.2.5.RELEASE)
2015-08-13 17:30:00.551 INFO 217490 --- [ost-startStop-1] Application : Starting Application on ex-std-node625.prod.rhcloud.com with PID 217490 (/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/classes/Application.class started by 55cbae307628e1fae70000c3 in /var/lib/openshift/55cbae307628e1fae70000c3/jbossews)
2015-08-13 17:30:00.871 INFO 217490 --- [ost-startStop-1] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#1d09808: startup date [Thu Aug 13 17:30:00 EDT 2015]; root of context hierarchy
2015-08-13 17:30:00.967 WARN 217490 --- [ost-startStop-1] ionWarningsApplicationContextInitializer :
** WARNING ** : Your ApplicationContext is unlikely to start due to a #ComponentScan of the default package.
2015-08-13 17:30:43.449 INFO 217490 --- [ost-startStop-1] .b.l.ClasspathLoggingApplicationListener : Application failed to start with classpath: [file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/classes/, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/aopalliance-1.0.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/classmate-1.0.0.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/hibernate-validator-5.1.3.Final.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/jackson-annotations-2.4.6.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/jackson-core-2.4.6.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/jackson-databind-2.4.6.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/jboss-logging-3.1.3.GA.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/jcl-over-slf4j-1.7.12.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/jul-to-slf4j-1.7.12.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/log4j-over-slf4j-1.7.12.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/logback-classic-1.1.3.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/logback-core-1.1.3.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/mysql-connector-java-5.1.25.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/postgresql-9.2-1003-jdbc4.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/slf4j-api-1.7.12.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/snakeyaml-1.14.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/spring-aop-4.1.7.RELEASE.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/spring-beans-4.1.7.RELEASE.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/spring-boot-1.2.5.RELEASE.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/spring-boot-actuator-1.2.5.RELEASE.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/spring-boot-autoconfigure-1.2.5.RELEASE.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/spring-boot-starter-1.2.5.RELEASE.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/spring-boot-starter-actuator-1.2.5.RELEASE.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/spring-boot-starter-logging-1.2.5.RELEASE.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/spring-boot-starter-web-1.2.5.RELEASE.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/spring-context-4.1.7.RELEASE.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/spring-core-4.1.7.RELEASE.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/spring-expression-4.1.7.RELEASE.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/spring-web-4.1.7.RELEASE.jar, file:/var/lib/openshift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/spring-webmvc-4.1.7.RELEASE.jar, file:/var/lib/opens
hift/55cbae307628e1fae70000c3/jbossews/work/Catalina/localhost/_/WEB-INF/lib/validation-api-1.1.0.Final.jar]
2015-08-13 17:30:43.462 ERROR 217490 --- [ost-startStop-1] o.s.boot.SpringApplication : Application startup failed
java.lang.NoClassDefFoundError: org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2957)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1210)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1690)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
at org.springframework.core.type.classreading.AnnotationReadingVisitorUtils.convertClassValues(AnnotationReadingVisitorUtils.java:72)
at org.springframework.core.type.classreading.AnnotationMetadataReadingVisitor.getAnnotationAttributes(AnnotationMetadataReadingVisitor.java:129)
at org.springframework.core.type.classreading.AnnotationMetadataReadingVisitor.getAnnotationAttributes(AnnotationMetadataReadingVisitor.java:48)
at org.springframework.context.annotation.AnnotationConfigUtils.attributesFor(AnnotationConfigUtils.java:255)
at org.springframework.context.annotation.AnnotationBeanNameGenerator.determineBeanNameFromAnnotation(AnnotationBeanNameGenerator.java:90)
at org.springframework.context.annotation.AnnotationBeanNameGenerator.generateBeanName(AnnotationBeanNameGenerator.java:70)
at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:252)
at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:140)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:266)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:230)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:197)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:166)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:306)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:239)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:606)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:462)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.context.web.SpringBootServletInitializer.run(SpringBootServletInitializer.java:119)
at org.springframework.boot.context.web.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:110)
at org.springframework.boot.context.web.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:69)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5456)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
... 44 common frames omitted
2015-08-13 17:30:43.549 INFO 217490 --- [ost-startStop-1] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#1d09808: startup date [Thu Aug 13 17:30:00 EDT 2015]; root of context hierarchy
2015-08-13 17:30:43.557 WARN 217490 --- [ost-startStop-1] ationConfigEmbeddedWebApplicationContext : Exception thrown from ApplicationListener handling ContextClosedEvent
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#1d09808: startup date [Thu Aug 13 17:30:00 EDT 2015]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:344)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:869)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.doClose(EmbeddedWebApplicationContext.java:150)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:836)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:342)
at org.springframework.boot.context.web.SpringBootServletInitializer.run(SpringBootServletInitializer.java:119)
at org.springframework.boot.context.web.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:110)
at org.springframework.boot.context.web.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:69)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5456)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
2015-08-13 17:30:43.558 WARN 217490 --- [ost-startStop-1] ationConfigEmbeddedWebApplicationContext : Exception thrown from LifecycleProcessor on context close
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#1d09808: startup date [Thu Aug 13 17:30:00 EDT 2015]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:357)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:877)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.doClose(EmbeddedWebApplicationContext.java:150)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:836)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:342)
at org.springframework.boot.context.web.SpringBootServletInitializer.run(SpringBootServletInitializer.java:119)
at org.springframework.boot.context.web.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:110)
at org.springframework.boot.context.web.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:69)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5456)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Aug 13, 2015 5:30:43 PM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2957)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1210)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1690)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
at org.springframework.core.type.classreading.AnnotationReadingVisitorUtils.convertClassValues(AnnotationReadingVisitorUtils.java:72)
at org.springframework.core.type.classreading.AnnotationMetadataReadingVisitor.getAnnotationAttributes(AnnotationMetadataReadingVisitor.java:129)
at org.springframework.core.type.classreading.AnnotationMetadataReadingVisitor.getAnnotationAttributes(AnnotationMetadataReadingVisitor.java:48)
at org.springframework.context.annotation.AnnotationConfigUtils.attributesFor(AnnotationConfigUtils.java:255)
at org.springframework.context.annotation.AnnotationBeanNameGenerator.determineBeanNameFromAnnotation(AnnotationBeanNameGenerator.java:90)
at org.springframework.context.annotation.AnnotationBeanNameGenerator.generateBeanName(AnnotationBeanNameGenerator.java:70)
at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:252)
at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:140)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:266)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:230)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:197)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:166)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:306)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:239)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:606)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:462)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.context.web.SpringBootServletInitializer.run(SpringBootServletInitializer.java:119)
at org.springframework.boot.context.web.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:110)
at org.springframework.boot.context.web.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:69)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5456)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
Caused by: java.lang.ClassNotFoundException: org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
... 44 more
Aug 13, 2015 5:30:43 PM org.apache.catalina.startup.HostConfig deployWAR
SEVERE: Error deploying web application archive /var/lib/openshift/55cbae307628e1fae70000c3/app-root/runtime/dependencies/jbossews/webapps/ROOT.war
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Alright I fixed it: All I had to do was moving my Main Class in a declared package.
The way I came to this:
I added the dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
And in the application.properties:
security.basic.enabled=false
management.security.enabled=false
As reported by this Bug: https://github.com/spring-projects/spring-boot/issues/2124
But this is fixed in 1.2.5 so this was not the reason.
Afterwards I got a new Error:
2015-08-14 04:31:51.000 WARN 368699 --- [ost-startStop-1] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [Application]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class] cannot be opened because it does not exist
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:180)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:306)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:239)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:606)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:462)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.context.web.SpringBootServletInitializer.run(SpringBootServletInitializer.java:119)
at org.springframework.boot.context.web.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:110)
at org.springframework.boot.context.web.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:69)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5456)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.FileNotFoundException: class path resource [org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:172)
at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:50)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:98)
at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:93)
at org.springframework.context.annotation.ConfigurationClassParser.asSourceClass(ConfigurationClassParser.java:597)
at org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getSuperClass(ConfigurationClassParser.java:777)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:301)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:230)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:189)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:270)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:230)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:197)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:166)
... 25 common frames omitted
This was fixed by moving my Main Class Application.java from the default package into any other declared package.
This Bug report helped my: https://github.com/spring-projects/spring-boot/issues/2050
also it is not the reason because the Bug is about WebConfigurationAdapter and my Stacktrace is about RepositoryRestMvcConfiguration.
Now my Ping is working with spring boot 1.2.5.RELEASE.
I could even remove the spring-boot-starter-security dependency and it is still working, so the only reason it did not work was that my Main Class was in the default package.
I hope it still works with the other packages I want to add.
Related
This error message shows that the Tomcat is 8.0.30, and I am using JDK 8. I am creating a Spring-boot project. Some suggested that JDK 8 should be used but I indeed am using JDK 8. What's the problem here?
信息: Starting Servlet Engine: Apache Tomcat/8.0.30
十月 18, 2018 12:26:19 下午 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor /home/export/Domains/nluqe.jd.com/server1/conf/Catalina/localhost/ROOT.xml
十月 18, 2018 12:26:19 下午 org.apache.catalina.core.StandardContext setPath
警告: A context path must either be an empty string or start with a '/' and do not end with a '/'. The path [/] does not meet these criteria and has been changed to []
十月 18, 2018 12:26:32 下午 org.apache.catalina.startup.ContextConfig processAnnotationsJar
严重: Unable to process Jar entry [module-info.class] from Jar [jar:file:/home/export/App/nluqe.jd.com/WEB-INF/lib/lombok-1.16.22.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:97)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.<init>(ConstantPool.java:55)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:176)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:85)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2011)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1961)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1936)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1897)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1149)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:586)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1777)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)
十月 18, 2018 12:26:34 下午 org.apache.catalina.startup.ContextConfig processAnnotationsJar
严重: Unable to process Jar entry [module-info.class] from Jar [jar:file:/home/export/App/nluqe.jd.com/WEB-INF/lib/log4j-api-2.10.0.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:97)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.<init>(ConstantPool.java:55)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:176)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:85)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2011)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1961)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1936)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1897)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1149)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:586)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1777)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)
Updated (I want to configure not scanning annotation per suggestions):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<bean id="executorService" class="java.util.concurrent.Executors" factory-method="newFixedThreadPool">
<constructor-arg value="20"></constructor-arg>
</bean>
<!-- jsf -->
<import resource="jsf-context.xml"/>
<aop:aspectj-autoproxy proxy-target-class="true"/>
<bean class="com.jd.ump.annotation.JAnnotation">
<property name="systemKey" value="com.nlu-qe-service.systemKey"></property>
<property name="jvmKey" value="com.nlu-qe-service.jvmKey"></property>
</bean>
</beans>
Tomcat 8.0 has reached End of Life and should not be used!
The replacement is Tomcat 8.5 (implementing the same specifications as Tomcat 8.0) or Tomcat 9.0 (newer versions of specifications). See "Migration Guide" at tomcat.apache.org.
org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:97)
The BCEL library here is used to parse class files when Tomcat scans for annotations. The version that you are using does not support some features in class file format of Java 8, and thus fails when trying to parse the file.
Your options:
Ignore.
Upgrade Tomcat.
Exclude those jars from annotation scanning. (See the official Tomcat FAQ → Performance → How do I make Tomcat start up faster?).
In order to upgrade the tomcat version for the tomcat7-maven-plugin.
<properties>
<tomcat7-version>7.0.93</tomcat7-version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<dependencies>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>${tomcat7-version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
You can try to downgrade the version of glassfish packages in your dependencies.
Had the problem with 2.30.1 version (and Tomcat 8.5 Server), no more issue after changing to 2.22.2.
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>2.22.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.22.2</version>
</dependency>
I also got same issue. I just changed aspectjrt and aspectjweaver jar version to
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.8.5</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.5</version>
</dependency>
Try this one might work for you also.
I just started a new ActiveWeb/ActiveJDBC project based on the activeweb-simple example. When I build and run it with Jetty as described in the ReadMe everything works fine but I can't get it to work with TomEE plus (7.0.2/1.7.5) and I would like to ask for help.
I tried several things out so I will split this in three parts.
1) Not running on Jetty, JSR-356 support unavailable
When building and deploying the war an error occurs no matter if I copy the war-file to the webapps-folder or if I use the tomee-maven-plugin:
FATAL: Error during ServletContainerInitializer processing
javax.servlet.ServletException: Not running on Jetty, JSR-356 support unavailable
at org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer.onStartup(WebSocketServerContainerInitializer.java:183)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5622)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1009)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:985)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1127)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:2020)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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:748)
The tomee-maven-plugin is defined as follows:
<plugin>
<groupId>org.apache.openejb.maven</groupId>
<artifactId>tomee-maven-plugin</artifactId>
<version>1.7.5</version>
<configuration>
<tomeeClassifier>plus</tomeeClassifier>
<systemVariables>
<activejdbc.log />
<active_reload>true</active_reload>
<activeweb.log.request>true</activeweb.log.request>
</systemVariables>
</configuration>
</plugin>
Searching for the error itself haven't lead me to a solution.
2) "Fixed" above error, still no server
I commented out all of the Jetty-related code and dependencies and redeployed afterwards. This time no error occurs but unfortunately there was no server available under localhost either.
3) Fatal error unexpected element
After this I added the 'tomcat-websocket' dependency as replacement for the 'javax-websocket-server-impl' dependency
<!-- <dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>javax-websocket-server-impl</artifactId>
<version>9.4.1.v20170120</version>
</dependency>-->
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-websocket</artifactId>
<version>9.0.10</version>
</dependency>
which lead to the error below:
INFORMATION: Configuring enterprise application:
C:\Users\...\activeweb-simple-master\target\apache-tomee\webapps\activeweb-simple-1.1-SNAPSHOT
[severity=FATAL_ERROR, message=unexpected element (URI:"http://xmlns.jcp.org/xml/ns/javaee", lokal:"web-fragment"). Expected elements are <{http://java.sun.com/xml/ns/javaee}handler-chains>,<{http://java.sun.com/xml/ns/javaee}web-fragment>, locator=[node=null, object=null, url=null, line=23,col=28,offset=-1]]
Jun 27, 2018 7:57:26 AM org.apache.openejb.config.ReadDescriptors mergeWebFragments
WARNING: can't read org.apache.openejb.config.ReadDescriptors$UrlSource#3d1db871
javax.xml.bind.UnmarshalException: unexpected element (URI:"http://xmlns.jcp.org/xml/ns/javaee", lokal:"web-fragment"). Expected elements are <{http://java.sun.com/xml/ns/javaee}handler-chains>,<{http://java.sun.com/xml/ns/javaee}web-fragment>
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:662)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:258)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:253)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:120)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:1063)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:498)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:480)
at com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:150)
at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:551)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:852)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:258)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:229)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:214)
at org.apache.openejb.jee.JaxbJavaee.unmarshal(JaxbJavaee.java:174)
at org.apache.openejb.config.ReadDescriptors.mergeWebFragments(ReadDescriptors.java:578)
at org.apache.openejb.config.ReadDescriptors.readWebApp(ReadDescriptors.java:551)
at org.apache.openejb.config.ReadDescriptors.deploy(ReadDescriptors.java:129)
at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:403)
at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:971)
at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1227)
at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1100)
at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:130)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5519)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1009)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:985)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1127)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:2020)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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:748)
All above errors happen for version 2.0 and 2.1-SNAPSHOT of ActiveWeb/ActiveJDBC.
So, is there a solution to get ActiveWeb to work with TomEE plus?
I am trying to upgrade my struts version from 2.3.3 to 2.3.33.post running the apache tomcat 7 I am getting the below error.
SEVERE: Exception starting filter struts2
java.lang.NoSuchMethodError: ognl.SimpleNode.isSequence(Lognl/OgnlContext;)Z
at com.opensymphony.xwork2.ognl.OgnlUtil.isEvalExpression(OgnlUtil.java:320)
at com.opensymphony.xwork2.ognl.OgnlUtil.checkEnableEvalExpression(OgnlUtil.java:431)
at com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecute(OgnlUtil.java:386)
at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:298)
at com.opensymphony.xwork2.ognl.OgnlUtil.internalSetProperty(OgnlUtil.java:627)
at com.opensymphony.xwork2.ognl.OgnlUtil.setProperties(OgnlUtil.java:190)
at com.opensymphony.xwork2.ognl.OgnlUtil.setProperties(OgnlUtil.java:217)
at com.opensymphony.xwork2.ognl.OgnlUtil.setProperties(OgnlUtil.java:204)
at com.opensymphony.xwork2.ognl.OgnlReflectionProvider.setProperties(OgnlReflectionProvider.java:58)
at com.opensymphony.xwork2.factory.DefaultInterceptorFactory.buildInterceptor(DefaultInterceptorFactory.java:43)
at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:209)
at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:70)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:1114)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStack(XmlConfigurationProvider.java:932)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStacks(XmlConfigurationProvider.java:945)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptors(XmlConfigurationProvider.java:968)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:537)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:295)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:264)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:978)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5633)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)
I am using ognl-3.0.4 jar
For googlers, the problem in my case (when I got a similar exception) was a mismatch between thymeleaf and ognl versions.
The versions I used later that worked fine together:
<dependency>
<groupId>ognl</groupId>
<artifactId>ognl</artifactId>
<version>3.0.12</version>
</dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring5</artifactId>
<version>3.0.12.RELEASE</version>
</dependency>
The problem has been resolved now,it is the jar issue after upgrading the struts version step by step 2.3.3 to 2.3.15 then 2.3.28 and then 2.3.33, i have not faced this problem.
I am trying to understand the basic steps of how to deploy a spring boot application. However, despite the fact that I do everything correctly, I can't deploy it on a tomcat server. The tomcat successfuly extracts my war archive but it gives the folloving below error:
11-Dec-2016 16:49:31.975 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/springrest]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot#5a0050e9]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4842)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4974)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet#57a81b37]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:708)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 13 more
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid END header (bad central directory offset)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:113)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
... 16 more
Caused by: java.util.zip.ZipException: invalid END header (bad central directory offset)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.jar.JarFile.<init>(JarFile.java:166)
at java.util.jar.JarFile.<init>(JarFile.java:103)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:110)
... 17 more
11-Dec-2016 16:49:31.976 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive /home/bora/Desktop/apache-tomcat-8.5.9/webapps/springrest.war
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/springrest]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:756)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)
I think the error is caused by a ZipException. But I don't understand why. I have followed this and this guides as exactly as it written, but ...
Here is more files, maybe it will be useful:
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>com.bora.test</groupId>
<artifactId>springrest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.2.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<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-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<java.version>1.8</java.version>
</properties>
<!-- <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> -->
<repositories>
<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>
</project>
And my Application class:
package com.bora.rest;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.RequestMapping;
#Configuration
#ComponentScan
#EnableAutoConfiguration
public class Application extends SpringBootServletInitializer {
private static Class<Application> applicationClass = Application.class;
#Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
// TODO Auto-generated method stub
return builder.sources(Application.class);
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
class GreetingController {
#RequestMapping("/")
String hello() {
return "Hello World";
}
}
I compile and package my maven project by givin mvn clean package and coppy the .war file into my tomcat's webapps folder. Restart the tomcat, it extracts but the above error occurs. I have been searching for solution for about 2 hours, but ...
My tomcat version is 8.5.9. I am using Ubuntu 16.04. Environment variables:
$CATALINA_BASE: /home/bora/Desktop/apache-tomcat-8.5.9
$CATALINA_HOME: /home/bora/Desktop/apache-tomcat-8.5.9
$CATALINA_TMPDIR: /home/bora/Desktop/apache-tomcat-8.5.9/temp
$JRE_HOME: /home/bora/Applications/jdk1.8.0_111
$CLASSPATH: /home/bora/Desktop/apache-tomcat-8.5.9/bin/bootstrap.jar:/home/bora/Desktop/apache-tomcat-8.5.9/bin/tomcat-juli.jar
I have strong knowledge about java language, I develop android applications. However, I am totally stranger to Java EE technologies. If someone finds an answer, could you please tell me the answer like you telling a child?
Thank you very much.
Spring-Boot ist using Tomcat 7 as default. This should be the reason why you get an exception. If u want to use Tomcat 8.5.9 u have to set the Version in your pom.xml:
<properties>
<tomcat.version>8.5.9</tomcat.version>
</properties>
EDIT
Use the spring-boot-maven-plugin for building the app. So you cant be sure your app is builded correctly.
EDIT 2
Just annotate your class with #SpringBootApplication this is enough. your Dont need the other ones.
EDIT 3
After compiling your code with my mentioned changes it worket fine. So the issue must be your config. Clear your local maven-repository and redownload the libaries. That should work.
It seems the version conflict, please check compiled version and JVM of Tomcat version are same.
Pls check JAVA_HOME
Check the Tomcat version to build. Follow the link: https://docs.spring.io/spring-boot/docs/current/reference/html/howto-embedded-servlet-containers.html
Check the Java version to build: http://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-build-systems.html
Hope this help.
I am migrating my application from jboss-eap-5.1 to jboss-eap-6.4.0. My application is using spring 3.1.1 related jar and apache-cxf-2.7.7 jars.
Ear file structure is as below
EAR/lib - contains all the jar which is common for wars.
app1.war/lib - contains jars required for it
app2.war/lib - contains jars required for it
I have also excluded modules for webservice, org.jboss.as.jaxrs & ejb3 from standalong.xml config file.
Spring jars :
spring-orm-3.1.1.RELEASE.jar
spring-aop-3.1.1.RELEASE.jar spring-oxm-3.2.4.RELEASE.jar
spring-asm-3.1.1.RELEASE.jar spring-test-3.2.4.RELEASE.jar
spring-beans-3.1.1.RELEASE.jar spring-tx-3.1.1.RELEASE.jar
spring-context-3.1.1.RELEASE.jar spring-web-3.2.4.RELEASE.jar
spring-core-3.1.1.RELEASE.jar spring-webmvc-3.2.4.RELEASE.jar
spring-data-commons-core-1.1.0.RELEASE.jar spring-ws-core-2.1.4.RELEASE.jar
spring-data-jpa-1.0.3.RELEASE.jar spring-ws-test-2.1.4.RELEASE.jar
spring-expression-3.1.1.RELEASE.jar spring-xml-2.1.4.RELEASE.jar
javaw.ws.rs jar containes below jar
javax.ws.rs-api-2.0-m10.jar
apache-cfx-jars packaged in ear/lib are
cxf-api-2.7.7.jar cxf-rt-frontend-jaxrs-2.7.7.jar
cxf-rt-bindings-soap-2.7.7.jar cxf-rt-frontend-jaxws-2.7.7.jar
cxf-rt-bindings-xml-2.7.7.jar cxf-rt-frontend-simple-2.7.7.jar
cxf-rt-core-2.7.7.jar cxf-rt-transports-http-2.7.7.jar
cxf-rt-databinding-jaxb-2.7.7.jar cxf-rt-transports-local-2.7.7.jar
cxf-rt-features-clustering-2.7.7.jar
now when i deploy , i am getting below error. I am not sure how to resolve this error as below
7:33:07,784 INFO [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor] (pool-6-thread-2) JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
07:33:07,785 INFO [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor] (pool-5-thread-1) JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
07:33:07,790 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] (pool-6-thread-2) Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#75b6f75e: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,servletContextReaderComponent,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,signatureAlgorithm,serviceAuthManager,authServiceProvider,soaErrorBundle,soaErrorMapper,soaExceptionHandler,soaClientPolicyEvaluator,com.walmart.platform.soa.client.listener.SOAClientLifeCycleListener#0,clientHeaderOutInterceptor,clientLoggingOutInterceptor,clientHeaderInInterceptor,clientLoggingInInterceptor,serviceAuthOutInterceptor,clientPolicyOutInterceptor,clientPolicyInInterceptor,cxf.config2,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy
#
07:33:08,015 ERROR [stderr] (Thread-147) 2016-06-20 07:33:08.014 WARN net.spy.memcached.auth.AuthThread: Authentication failed to /172.16.113.154:11210, Status: {OperationStatus success=false: Invalid arguments}
07:33:08,026 WARN [org.jboss.modules] (pool-6-thread-2) Failed to define class org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder in Module "deployment.smcfs.ear:main" from Service Module Loader: java.lang.LinkageError: Failed to link org/apache/cxf/transport/http/policy/HTTPServerAssertionBuilder (Module "deployment.smcfs.ear:main" from Service Module Loader)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:487) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:277) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:92) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.Module.loadModuleClass(Module.java:568) [jboss-modules.jar:1.3.6.Final-redhat-1
When i check errors closely it is failing due to below class not found exception .
]
at com.walmartlabs.services.util.base.LabsCallable.call(LabsCallable.java:31) [labs-ims-1.0.jar:]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_51]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_51]
Caused by: java.lang.NoClassDefFoundError: org/apache/cxf/ws/policy/builder/jaxb/JaxbAssertionBuilder
at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.8.0_51]
at java.lang.ClassLoader.defineClass(ClassLoader.java:760) [rt.jar:1.8.0_51]
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:361) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:482) [jboss-modules.jar:1.3.6.Final-redhat-1]
... 148 more
Caused by: java.lang.ClassNotFoundException: org.apache.cxf.ws.policy.builder.jaxb.JaxbAssertionBuilder from [Module "deployment.smcfs.ear:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.6.
*********************************************8
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_51]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_51]
Caused by: java.lang.NoClassDefFoundError: org/apache/cxf/ws/policy/AbstractPolicyInterceptorProvider
at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.8.0_51]
at java.lang.ClassLoader.defineClass(ClassLoader.java:760) [rt.jar:1.8.0_51]
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:361) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:482) [jboss-modules.jar:1.3.6.Final-redhat-1]
... 148 more
Caused by: java.lang.ClassNotFoundException: org.apache.cxf.ws.policy.AbstractPolicyInterceptorProvider from [Module "deployment.smcfs.ear:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.6.Final-redhat-1]
a
************************************
Any suggestion how to overcome this problem
Thanks
I had to add this following dependencies to my pom to avoid that error:
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-ws-policy</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-wsdl</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>3.2.0</version>
</dependency>