I am having an Exception with SpringBoot, when loading the ApplicationContext an Exception is thrown.
It claims, that it can not find, org.apache.tomcat.util.buf.UDecoder.URLDecode.
See Error: Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.NoSuchMethodError: org.apache.tomcat.util.buf.UDecoder.URLDecode(Ljava/lang/String;)Ljava/lang/String;
I investigated the error, and added these dependencies:
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>8.0.28</version>
</dependency>
However, adding these dependencies, did not resolve the missing org.apache.tomcat.util.buf.UDecoder.URLDecode NoSuch method error.
Please advise on which dependency in Maven repository can help resolve this error.
See pom.xml, Application.java, and console.log below.
------ begin Application.java package server;
import org.springframework.boot.SpringApplication; import org.springframework.boot.actuate.autoconfigure.TraceWebFilterAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.core.env.Environment;
import org.springframework.beans.factory.annotation.Autowired; / import org.springframework.beans.factory.annotation.Qualifier; / import org.springframework.context.support.ClassPathXmlApplicationContext;
/ import org.springframework.boot.context.; */
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
import org.apache.tomcat.util.buf.UDecoder; import org.springframework.boot.context.embedded.FilterRegistrationBean; // import javax.servlet.ServletContext.*;
/ import org.springframework.beans.factory.config.AutowireCapableBeanFactory; import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.xml.XmlBeanFactory; /
import com.persistence.pojo.Properties; // import java.util.Properties; import java.util.Arrays;
import org.slf4j.Logger; import org.slf4j.LoggerFactory;
@SpringBootApplication @Configuration @EnableAutoConfiguration @ComponentScan @ImportResource("classpath:bean.xml") // http://stackoverflow.com/questions/25495629/how-can-i-use-spring-boot-auto-configured-beans-in-xml-configuration-files @PropertySources({ @PropertySource(value="file:config/application.properties",ignoreResourceNotFound=true), @PropertySource(value="file:src/main/resources/application.properties",ignoreResourceNotFound=true) }) public class Application { private static final Logger logger = LoggerFactory.getLogger(ServletController.class);
// @Bean // Properties appProperties() { // return new Properties(); // }
// http://www.mkyong.com/spring/spring-propertysources-example/
// @Autowired // private Environment env;
@Bean
public static PropertySourcesPlaceholderConfigurer propertyConfigInDev() {
return new PropertySourcesPlaceholderConfigurer();
}
@Bean
public TomcatEmbeddedServletContainerFactory servletContainer() {
TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();
return factory;
}
public static void main (String[] args) {
String cassandraIpaddress = new String("");
String cassandraPort = new String("");
logger.debug("Application Main Startup...DEBUG");
logger.info("Application Main Startup...INFO");
logger.warn("Application Main Startup...WARN");
logger.error("Application Main Startup...ERROR");
Singleton cassandraProperties = Singleton.getInstance();
if (args.length > 0)
{
for (String s: args) {
if (s.contains("-Dcassandra.ip")) {
System.out.println("found cassandra ip");
cassandraIpaddress = s.substring(s.indexOf("=") + 1, s.length());
cassandraProperties.setCassandraIpAddress(cassandraIpaddress);
logger.info(cassandraIpaddress);
}
if (s.contains("-Dcassandra.port")) {
System.out.println("found cassandra port");
cassandraPort = s.substring(s.indexOf("=") + 1, s.length());
cassandraProperties.setCassandraPort(cassandraPort);
logger.info(cassandraPort);
}
}
}
// ApplicationContext contextBean = new ClassPathXmlApplicationContext("file:src/main/resources/bean.xml"); ConfigurableApplicationContext context = SpringApplication.run(Application.class, args);
logger.info("Beans that are registered by Spring Boot:");
String[] beanNamesApplicationContext = context.getBeanDefinitionNames();
Arrays.sort(beanNamesApplicationContext);
for (String beanName : beanNamesApplicationContext) {
logger.info(beanName);
}
// String[] beanNames = context.getBeanDefinitionNames(); // Arrays.sort(beanNames); // for (String beanName : beanNames) { // logger.info(beanName); // }
// ApplicationContext ctx = SpringApplication.run(Application.class, args);
// SpringApplication.run(Application.class, args);
// logger.info("Beans that are registered by Spring Boot:"); // String[] beanNames = ctx.getBeanDefinitionNames(); // Arrays.sort(beanNames); // for (String beanName : beanNames) { // System.out.println(beanName); // } } } ----- end application.java
------ begin pom.xml
<groupId>org.springframework</groupId>
<artifactId>gs-rest-service</artifactId>
<version>0.1.0</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.5.RELEASE</version>
</parent>
<properties>
<java.version>1.7</java.version>
<jackson.version>2.5.3</jackson.version>
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
<org.springframework.version>3.0.5.RELEASE</org.springframework.version>
<netty.version>3.2.10.Final</netty.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.directory>/Users/hottelet/Desktop/rest-server-demo/rest-server/server/</project.build.directory>
<base.path>/Users/hottelet/Desktop/rest-server-demo/rest-server/server/</base.path>
<start.class>server.Application</start.class>
<docker.image.prefix>rest-server</docker.image.prefix>
</properties>
<packaging>jar</packaging>
<!--<packaging>pom</packaging>-->
<dependencies>
<!-- Spring Boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- tag::actuator[] -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- end::actuator[] -->
<!-- tag::tests[] -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- end::tests[] -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>1.2.4.RELEASE</version>
</dependency>
<!-- Maven Shade to Build Nested JAR file -->
<!--<plugin>-->
<!--<groupId>org.apache.maven.plugins</groupId>-->
<!--<artifactId>maven-shade-plugin</artifactId>-->
<!--<version>2.3</version>-->
<!--<executions>-->
<!--<execution>-->
<!--<phase>package</phase>-->
<!--<goals>-->
<!--<goal>shade</goal>-->
<!--</goals>-->
<!--<configuration>-->
<!--<artifactSet>-->
<!--<excludes>-->
<!--<exclude>junit:junit</exclude>-->
<!--</excludes>-->
<!--</artifactSet>-->
<!--</configuration>-->
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->
<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-XX:MaxPermSize=128m -Xmx256m</argLine>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<runOrder>alphabetical</runOrder>
<classpathDependencyExcludes>
<classpathDependencyExclude>org.springsource.loaded:springloaded</classpathDependencyExclude>
</classpathDependencyExcludes>
</configuration>
</plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<!-- Maven shade plugin -->
<!--
</execution>
</executions>
<configuration>
<transformers>
<!- must be SURE to do this with both spring.handlers and spring.schemas.
otherwise you won't be able to use them in the spring config files. -->
<!-- <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
</transformers>
</configuration>
</plugin> -->
<!-- Build an executable JAR -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<index>true</index>
<compress>false</compress>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>server.Application</mainClass>
</manifest>
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- Needs executable JAR generated, Intellij Build artifacts workaround -->
<!-- <plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.3.2</version>
<configuration>
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
<dockerDirectory>src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin> -->
</plugins>
</build>
<repositories>
<repository>
<id>central</id>
<name>Maven Repository Switchboard</name>
<layout>default</layout>
<url>http://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
<repository>
<id>netty-all</id>
<url>http://clinker.netty.io/nexus/content/repositories/snapshots/io/netty/</url>
</repository>
<repository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/libs-snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<url>http://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Maven Plugin Repository</name>
<url>http://repo1.maven.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
</pluginRepository>
<pluginRepository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
<pluginRepository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/libs-snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<url>http://repo.spring.io/milestone</url>
</pluginRepository>
<pluginRepository>
<id>netty-all</id>
<url>http://clinker.netty.io/nexus/content/repositories/snapshots/io/netty</url>
</pluginRepository>
</pluginRepositories>
<!--<modules>-->
<!--<module>Persistence</module>-->
<!--</modules>-->
--------- end pom.xml
----------begin console.log 16:14:32.635 default [main] DEBUG server.ServletController - Application Main Startup...DEBUG 16:14:32.708 default [main] DEBUG o.s.w.c.s.StandardServletEnvironment - Adding [servletConfigInitParams] PropertySource with lowest search precedence 16:14:32.708 default [main] DEBUG o.s.w.c.s.StandardServletEnvironment - Adding [servletContextInitParams] PropertySource with lowest search precedence 16:14:32.710 default [main] DEBUG o.s.w.c.s.StandardServletEnvironment - Adding [systemProperties] PropertySource with lowest search precedence 16:14:32.712 default [main] DEBUG o.s.w.c.s.StandardServletEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence 16:14:32.712 default [main] DEBUG o.s.w.c.s.StandardServletEnvironment - Initialized StandardServletEnvironment with PropertySources [servletConfigInitParams,servletContextInitParams,systemProperties,systemEnvironment] 16:14:32.713 default [main] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Searching for key 'spring.profiles.active' in [servletConfigInitParams] 16:14:32.713 default [main] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Searching for key 'spring.profiles.active' in [servletContextInitParams] 16:14:32.713 default [main] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Searching for key 'spring.profiles.active' in [systemProperties] 16:14:32.713 default [main] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Searching for key 'spring.profiles.active' in [systemEnvironment] 16:14:32.713 default [main] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Could not find key 'spring.profiles.active' in any property source. Returning [null] 16:14:32.714 default [main] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Searching for key 'spring.profiles.active' in [servletConfigInitParams] 16:14:32.714 default [main] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Searching for key 'spring.profiles.active' in [servletContextInitParams] 16:14:32.714 default [main] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Searching for key 'spring.profiles.active' in [systemProperties] 16:14:32.714 default [main] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Searching for key 'spring.profiles.active' in [systemEnvironment] 16:14:32.714 default [main] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Could not find key 'spring.profiles.active' in any property source. Returning [null] 16:14:32.715 default [main] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Searching for key 'banner.location' in [servletConfigInitParams] 16:14:32.715 default [main] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Searching for key 'banner.location' in [servletContextInitParams] 16:14:32.715 default [main] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Searching for key 'banner.location' in [systemProperties] 16:14:32.715 default [main] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Searching for key 'banner.location' in [systemEnvironment] 16:14:32.715 default [main] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Could not find key 'banner.location' in any property source. Returning [null]
. _ _ __ _ _ /\ / ' __ _ () __ __ _ \ \ \ \ ( ( ) | ' | '| | ' \/ _` | \ \ \ \ \/ )| |)| | | | | || (| | ) ) ) ) ' |____| .*|| ||| |*, | / / / / =========||==============|___/=///_/ :: Spring Boot ::
16:14:32.761 default [main] DEBUG o.s.w.c.s.StandardServletEnvironment - Adding [servletConfigInitParams] PropertySource with lowest search precedence 16:14:32.762 default [main] DEBUG o.s.w.c.s.StandardServletEnvironment - Adding [servletContextInitParams] PropertySource with lowest search precedence 16:14:32.762 default [main] DEBUG o.s.w.c.s.StandardServletEnvironment - Adding [systemProperties] PropertySource with lowest search precedence 16:14:32.762 default [main] DEBUG o.s.w.c.s.StandardServletEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence 16:14:32.762 default [main] DEBUG o.s.w.c.s.StandardServletEnvironment - Initialized StandardServletEnvironment with PropertySources [servletConfigInitParams,servletContextInitParams,systemProperties,systemEnvironment] 16:14:32.783 default [main] DEBUG o.s.c.a.ClassPathBeanDefinitionScanner - JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning 16:14:32.787 default [main] DEBUG server.Application - Running with Spring Boot, Spring 16:14:32.788 default [main] DEBUG o.s.boot.SpringApplication - Loading source class server.Application 16:14:32.795 default [main] DEBUG o.s.c.a.ClassPathBeanDefinitionScanner - JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning 16:14:32.832 default [main] DEBUG o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Bean factory for org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@47e72466: org.springframework.beans.factory.support.DefaultListableBeanFactory@76a5f472: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,application]; root of factory hierarchy 16:14:32.840 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' 16:14:32.841 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' 16:14:32.851 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' to allow for resolving potential circular references 16:14:32.852 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' 16:14:32.866 default [main] DEBUG o.s.w.c.s.StandardServletEnvironment - Adding [URL [file:config/application.properties]] PropertySource with lowest search precedence 16:14:32.866 default [main] DEBUG o.s.w.c.s.StandardServletEnvironment - Adding [URL [file:src/main/resources/application.properties]] PropertySource with search precedence immediately higher than [URL [file:config/application.properties]] 16:14:32.868 default [main] DEBUG o.s.core.env.StandardEnvironment - Adding [systemProperties] PropertySource with lowest search precedence 16:14:32.868 default [main] DEBUG o.s.core.env.StandardEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence 16:14:32.868 default [main] DEBUG o.s.core.env.StandardEnvironment - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment] 16:14:32.869 default [main] DEBUG o.s.c.a.ClassPathBeanDefinitionScanner - JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning 16:14:32.871 default [main] DEBUG o.s.c.i.s.PathMatchingResourcePatternResolver - Looking for matching resources in jar file [file:/Users/hottelet/Desktop/rest-server-demo/rest-server/server/out/artifacts/gs_rest_service_jar/gs-rest-service.jar] 16:14:32.930 default [main] DEBUG o.s.c.i.s.PathMatchingResourcePatternResolver - Resolved location pattern [classpath_:server/__/_.class] to resources [URL [jar:file:/Users/hottelet/Desktop/rest-server-demo/rest-server/server/out/artifacts/gs_rest_service_jar/gs-rest-service.jar!/server/Application.class], URL [jar:file:/Users/hottelet/Desktop/rest-server-demo/rest-server/server/out/artifacts/gs_rest_service_jar/gs-rest-service.jar!/server/Greeting.class], URL [jar:file:/Users/hottelet/Desktop/rest-server-demo/rest-server/server/out/artifacts/gs_rest_service_jar/gs-rest-service.jar!/server/MessagePost.class], URL [jar:file:/Users/hottelet/Desktop/rest-server-demo/rest-server/server/out/artifacts/gs_rest_service_jar/gs-rest-service.jar!/server/ServletController.class], URL [jar:file:/Users/hottelet/Desktop/rest-server-demo/rest-server/server/out/artifacts/gs_rest_service_jar/gs-rest-service.jar!/server/Singleton.class]] 16:14:32.962 default [main] DEBUG o.s.c.a.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/Users/hottelet/Desktop/rest-server-demo/rest-server/server/out/artifacts/gs_rest_service_jar/gs-rest-service.jar!/server/ServletController.class] 16:14:32.982 default [main] DEBUG o.s.c.a.ConfigurationClassBeanDefinitionReader - Registering bean definition for @Bean method server.Application.propertyConfigInDev() 16:14:32.983 default [main] DEBUG o.s.c.a.ConfigurationClassBeanDefinitionReader - Registering bean definition for @Bean method server.Application.servletContainer() 16:14:32.984 default [main] DEBUG o.s.core.env.StandardEnvironment - Adding [systemProperties] PropertySource with lowest search precedence 16:14:32.984 default [main] DEBUG o.s.core.env.StandardEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence 16:14:32.984 default [main] DEBUG o.s.core.env.StandardEnvironment - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment] 16:14:32.988 default [main] DEBUG o.s.b.f.xml.DefaultDocumentLoader - Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl] 16:14:33.006 default [main] DEBUG o.s.b.f.xml.PluggableSchemaResolver - Loading schema mappings from [META-INF/spring.schemas] 16:14:33.007 default [main] DEBUG o.s.b.f.xml.PluggableSchemaResolver - Loaded schema mappings: {http://www.springframework.org/schema/beans/spring-beans-3.2.xsd=org/springframework/beans/factory/xml/spring-beans-3.2.xsd, http://www.springframework.org/schema/util/spring-util-3.0.xsd=org/springframework/beans/factory/xml/spring-util-3.0.xsd, http://www.springframework.org/schema/util/spring-util-4.1.xsd=org/springframework/beans/factory/xml/spring-util-4.1.xsd, http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd, http://www.springframework.org/schema/util/spring-util-2.5.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd, http://www.springframework.org/schema/tool/spring-tool-3.0.xsd=org/springframework/beans/factory/xml/spring-tool-3.0.xsd, http://www.springframework.org/schema/tool/spring-tool-4.1.xsd=org/springframework/beans/factory/xml/spring-tool-4.1.xsd, http://www.springframework.org/schema/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd, http://www.springframework.org/schema/util/spring-util-3.2.xsd=org/springframework/beans/factory/xml/spring-util-3.2.xsd, http://www.springframework.org/schema/beans/spring-beans-4.1.xsd=org/springframework/beans/factory/xml/spring-beans-4.1.xsd, http://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd, http://www.springframework.org/schema/tool/spring-tool-2.5.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd, http://www.springframework.org/schema/beans/spring-beans-3.1.xsd=org/springframework/beans/factory/xml/spring-beans-3.1.xsd, http://www.springframework.org/schema/beans/spring-beans-2.5.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd, http://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-4.1.xsd, http://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-4.1.xsd, http://www.springframework.org/schema/tool/spring-tool-3.2.xsd=org/springframework/beans/factory/xml/spring-tool-3.2.xsd, http://www.springframework.org/schema/util/spring-util-4.0.xsd=org/springframework/beans/factory/xml/spring-util-4.0.xsd, http://www.springframework.org/schema/tool/spring-tool-4.0.xsd=org/springframework/beans/factory/xml/spring-tool-4.0.xsd, http://www.springframework.org/schema/util/spring-util-3.1.xsd=org/springframework/beans/factory/xml/spring-util-3.1.xsd, http://www.springframework.org/schema/beans/spring-beans-4.0.xsd=org/springframework/beans/factory/xml/spring-beans-4.0.xsd, http://www.springframework.org/schema/beans/spring-beans-3.0.xsd=org/springframework/beans/factory/xml/spring-beans-3.0.xsd, http://www.springframework.org/schema/tool/spring-tool-3.1.xsd=org/springframework/beans/factory/xml/spring-tool-3.1.xsd, http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-4.1.xsd} 16:14:33.008 default [main] DEBUG o.s.b.f.xml.PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schema/beans/spring-beans-2.5.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-2.5.xsd 16:14:33.044 default [main] DEBUG o.s.b.f.x.DefaultBeanDefinitionDocumentReader - Loading bean definitions 16:14:33.052 default [main] DEBUG o.s.b.f.xml.XmlBeanDefinitionReader - Loaded 1 bean definitions from location pattern [classpath:bean.xml] 16:14:33.104 default [main] DEBUG o.s.c.a.ConfigurationClassEnhancer - Successfully enhanced server.Application; enhanced class name is: server.Application$$EnhancerBySpringCGLIB$$276b6dee 16:14:33.104 default [main] DEBUG o.s.c.a.ConfigurationClassPostProcessor - Replacing bean definition 'propertyConfigInDev' existing class name 'server.Application' with enhanced class name 'server.Application$$EnhancerBySpringCGLIB$$276b6dee' 16:14:33.106 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'propertyConfigInDev' 16:14:33.106 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'propertyConfigInDev' 16:14:33.111 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'propertyConfigInDev' to allow for resolving potential circular references 16:14:33.111 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'propertyConfigInDev' 16:14:33.111 default [main] DEBUG o.s.core.env.MutablePropertySources - Adding [environmentProperties] PropertySource with lowest search precedence 16:14:33.111 default [main] DEBUG o.s.core.env.MutablePropertySources - Adding [localProperties] PropertySource with lowest search precedence 16:14:33.116 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor' 16:14:33.116 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor' 16:14:33.116 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor' to allow for resolving potential circular references 16:14:33.116 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor' 16:14:33.117 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor' 16:14:33.117 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor' 16:14:33.117 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor' to allow for resolving potential circular references 16:14:33.117 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor' 16:14:33.117 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor' 16:14:33.117 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor' 16:14:33.119 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor' to allow for resolving potential circular references 16:14:33.119 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor' 16:14:33.119 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor' 16:14:33.119 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor' 16:14:33.119 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor' to allow for resolving potential circular references 16:14:33.120 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor' 16:14:33.120 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor' 16:14:33.120 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor' 16:14:33.120 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor' to allow for resolving potential circular references 16:14:33.120 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor' 16:14:33.122 default [main] DEBUG o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@3cbbad22] 16:14:33.123 default [main] DEBUG o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@4efca5f6] 16:14:33.124 default [main] DEBUG o.s.u.c.s.UiApplicationContextUtils - Unable to locate ThemeSource with name 'themeSource': using default [org.springframework.ui.context.support.ResourceBundleThemeSource@16adc7c8] 16:14:33.125 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'servletContainer' 16:14:33.125 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'servletContainer' 16:14:33.126 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'application' 16:14:33.126 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'application' 16:14:33.130 default [main] DEBUG o.s.b.f.annotation.InjectionMetadata - Registered injected element on class [server.Application]: AutowiredFieldElement for private org.springframework.core.env.Environment server.Application.env 16:14:33.130 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'application' to allow for resolving potential circular references 16:14:33.136 default [main] DEBUG o.s.b.f.annotation.InjectionMetadata - Processing injected element of bean 'application': AutowiredFieldElement for private org.springframework.core.env.Environment server.Application.env 16:14:33.137 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'environment' 16:14:33.138 default [main] DEBUG o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - Autowiring by type from bean name 'application' to bean named 'environment' 16:14:33.138 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'application' 16:14:33.152 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'servletContainer' to allow for resolving potential circular references 16:14:33.160 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'servletContainer' 16:14:33.220 default [main] DEBUG o.s.b.c.e.t.TomcatEmbeddedServletContainerFactory - Code archive: /Users/hottelet/Desktop/rest-server-demo/rest-server/server/out/artifacts/gs_rest_service_jar/gs-rest-service.jar 16:14:33.220 default [main] DEBUG o.s.b.c.e.t.TomcatEmbeddedServletContainerFactory - Code archive: /Users/hottelet/Desktop/rest-server-demo/rest-server/server/out/artifacts/gs_rest_service_jar/gs-rest-service.jar 16:14:33.220 default [main] DEBUG o.s.b.c.e.t.TomcatEmbeddedServletContainerFactory - None of the document roots [src/main/webapp, public, static] point to a directory and will be ignored. 16:14:33.246 default [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@76a5f472: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,application,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor,servletController,propertyConfigInDev,servletContainer,properties,org.springframework.boot.autoconfigure.AutoConfigurationPackages]; root of factory hierarchy Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.NoSuchMethodError: org.apache.tomcat.util.buf.UDecoder.URLDecode(Ljava/lang/String;)Ljava/lang/String; at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474) 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.SpringApplication.run(SpringApplication.java:957) at org.springframework.boot.SpringApplication.run(SpringApplication.java:946) at server.Application.main(Application.java:119) Caused by: java.lang.NoSuchMethodError: org.apache.tomcat.util.buf.UDecoder.URLDecode(Ljava/lang/String;)Ljava/lang/String; at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3082) at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3059) at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.addDefaultServlet(TomcatEmbeddedServletContainerFactory.java:199) at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.prepareContext(TomcatEmbeddedServletContainerFactory.java:174) at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:154) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:157) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130) ... 7 more ----- end console.log
Comment From: philwebb
Your bug reports are very difficult to read, please could you: - Use a short descriptive title that explains the problem. - Use backticks (```) around code and log blocks so that they are formatted correctly (read https://help.github.com/articles/markdown-basics/ for details). - Consider creating a issue GitHub project rather than pasting lots of individual file snippets.
The org.apache.tomcat.util.buf.UDecoder.URLDecode
class is provided by tomcat-embedded-core
. The easiest way to get the dependency is to use spring-boot-starter-web
. Looking at your POM you seem to be declaring versions for various dependencies that could be managed by Spring Boot.
These sections of the reference docs should help: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-maven http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-starter-poms