Vaadin Spring Boot Starter throws MalformedParameterizedTypeException on ap

Hi, I’m a Spring Boot backend developer who is trying to ease his way in to Vaadin. I love the concept and as I understand it, Vaadin has a lot in commmon with GWT, which I used on several projects years ago.

I’m trying to get a Spring Boot app to use Vaadin, primarily because I loath front-end/JS/HTML coding and love the idea that Vaadin wil generate all the front-end “stuff” for me.

I created a simple [Spring Boot & Vaadin project]
(https://github.com/bitbythecron/vaadin-spring-example) and uploaded it to GitHub. From what I can tell, I may have discovered a bug in the Vaadin Spring Boot Starter library. In that GitHub example, I’m pretty sure that I’ve pulled in the correct versions of the correct dependencies to get a simple starter app up and running, however on app startup I get this:

java.lang.reflect.MalformedParameterizedTypeException: null
	at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:58)
	at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(ParameterizedTypeImpl.java:51)
	at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:92)
	at sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:105)
	at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:140)
	at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
	at sun.reflect.generics.repository.MethodRepository.getReturnType(MethodRepository.java:68)
	at java.lang.reflect.Method.getGenericReturnType(Method.java:255)
	at org.springframework.core.MethodParameter.getGenericParameterType(MethodParameter.java:382)
	at org.springframework.core.SerializableTypeWrapper$MethodParameterTypeProvider.getType(SerializableTypeWrapper.java:337)
	at org.springframework.core.SerializableTypeWrapper.forTypeProvider(SerializableTypeWrapper.java:149)
	at org.springframework.core.ResolvableType.forType(ResolvableType.java:1346)
	at org.springframework.core.ResolvableType.forMethodParameter(ResolvableType.java:1249)
	at org.springframework.core.ResolvableType.forMethodParameter(ResolvableType.java:1217)
	at org.springframework.core.ResolvableType.forMethodReturnType(ResolvableType.java:1160)

The full stack trace can be found by going to that GitHub project, cloning it and running the commands to package and run it.

It is important to note here that, although no Vaadin-specific classes seem to show up on the full stack trace, if you comment out the com.vaadin:vaadin-spring-boot-starter:13.0.8 dependency in the build file, and then comment out the Vaadin API code in the EmployeeEditor and MainView classes (so that it compiles again), the problem goes away and the app starts up just fine!

So there is clearly something in that Vaadin Spring Boot Starter that the core Spring Boot framework doesn’t like. Please advise!

And sorry if this isn’t the right place to report it, I’m happy to report it elsewhere if there’s a better way to go about it!

Have you tried using a newer version of the Spring Boot Gradle plugin, perhaps 2.0.0.RELEASE or newer?

Erik Lumme:
Have you tried using a newer version of the Spring Boot Gradle plugin, perhaps 2.0.0.RELEASE or newer?

I recomment that too. Out of curiosity I just copied the code from his repository to plain maven based spring boot starter project from vaadin.com/start and it worked ok. I saw also some dependencies in gradle file that are not needed.

Could you please create a ticket for this?
This is just a forum and not an issue tracker.
We will care about it if you create a ticket [here]
(https://github.com/vaadin/spring/issues).
Otherwise it will be just forgotten.

Thank you.

The problem that you met is due to a missmatch in spring versions.
To get the project up and running just update the build.gradle dependencies I had the project running fine with the following configuration:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:2.1.0.RELEASE")
    }
}

plugins {
    id 'java-library'
}

apply plugin: 'org.springframework.boot'

repositories {
    mavenLocal()
    mavenCentral()
    jcenter()
}

dependencies {
    compile(
        'ch.qos.logback:logback-classic:1.2.3'
        ,'org.slf4j:jul-to-slf4j:1.7.25'
        ,'org.apache.commons:commons-lang3:3.7'
        ,'commons-io:commons-io:2.6'
        ,'org.apache.commons:commons-text:1.2'
        ,'com.google.guava:guava:23.0'
        ,'com.vaadin:vaadin-spring-boot-starter:13.0.8'
        ,'org.springframework.boot:spring-boot-starter-actuator:2.1.0.RELEASE'
        ,'org.springframework.boot:spring-boot-starter-data-jpa:2.1.0.RELEASE'
        ,'com.h2database:h2:1.4.197'
    )

}

sourceCompatibility = 1.8
targetCompatibility = 1.8
String buildName = 'vaadin-spring-example'

jar {
    baseName = buildName
}

Thanks to everyone who pitched in with a quick response, especially you Mikael Grankvist, your solution worked immediately!

It is really refreshing to see a responsive support community, you all made me an instant fan of Vaadin!

Thank you again!