Reputation: 85
I am trying to create Jsp's in localhost:8080 using Spring-Boot, Spring-mvc and tomcat-jasper. However when i open localhost:8080/, every time i get an exception which seems related with tomcat-jasper:
ERROR 5488 --- [nio-8080-exec-1] o.apache.coyote.http11.Http11Processor : Error processing request java.lang.NoSuchMethodError: 'void org.apache.tomcat.util.buf.UDecoder.convert(org.apache.tomcat.util.buf.ByteChunk, org.apache.tomcat.util.buf.EncodedSolidusHandling)'
and continues...
I am using 3 files currently and added them here.
package com.avalon.springmvcboot;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HomeController {
@RequestMapping("/")
public String home() {
return "index.jsp";
}
}
package com.avalon.springmvcboot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringmvcbootApplication {
public static void main(String[] args) {
SpringApplication.run(SpringmvcbootApplication.class, args);
}
}
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
Hello World!
</body>
</html>
plugins {
id 'org.springframework.boot' version '2.4.3'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = 'com.avalon'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '14'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.apache.tomcat:tomcat-jasper:9.0.21'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
test {
useJUnitPlatform()
}
System Information: OpenJDK Java 15, Windows 10 IDE: Visual Studio Code
Any helps will be appreciated! Best regards...
Upvotes: 1
Views: 2492
Reputation: 151
It seems wrong tomcat version used at runtime.
void org.apache.tomcat.util.buf.UDecoder.convert(org.apache.tomcat.util.buf.ByteChunk, org.apache.tomcat.util.buf.EncodedSolidusHandling)
is only available at tomcat 9
Upvotes: 1