I am getting an exception with Spring Boot latest and Vaadin.
Tried to understand and debug what can be wrong (Jar hells, different versions etc), but nothing.
Here is the stack:
java.lang.ClassNotFoundException: elemental.json.JsonException
at java.net.URLClassLoader.findClass(Unknown Source) ~[na:1.8.0_171]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_171]
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) ~[na:1.8.0_171]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_171]
at com.vaadin.flow.spring.SpringServlet.createServletService(SpringServlet.java:54) ~[vaadin-spring-10.0.3.jar:na]
at com.vaadin.flow.server.VaadinServlet.createServletService(VaadinServlet.java:240) ~[flow-server-1.0.4.jar:na]
at com.vaadin.flow.server.VaadinServlet.init(VaadinServlet.java:77) ~[flow-server-1.0.4.jar:na]
My view class:
package com.example.demo;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.notification.Notification;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;
@Route("vaadin")
public class MainView extends VerticalLayout {
/**
*
*/
private static final long serialVersionUID = 1L;
public MainView() {
add(new Button("Click me", e -> Notification.show("Hello Spring+Vaadin user!")));
}
}
My dependency config is quite simple as you can see:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<vaadin.version>10.0.4</vaadin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-bom</artifactId>
<version>${vaadin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
and my environment info:
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T10:58:13+03:00)
Maven home: C:\Users\Sigmar\Apps\apache-maven-3.5.2\bin\..
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_144\jre
Default locale: en_US, platform encoding: Cp1257
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
I tried with some test code like this:
public static void main(String[] args) {
Class cls = elemental.json.JsonValue.class;
System.out.println(cls);
}
And still got the same error. Any class from the “elemental” package cannot be found.
I checked my classpath and yes, the GWT Elemental Jar is there. But as its very old, then there seems to be some issue with it. I am suspecting that this combo does not work with Java 8. Anyone else with the same problem?
17249638.zip (57.5 KB)