Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vaadin 8 + Spring Boot 1.5.2: java.lang.NoSuchMethodError: org.vaadin.spring.sidebar.components.ValoSideBar$ItemButton.addClickListener(Lcom/vaadin/ui/Button$ClickListener;)V #305

Open
artlomako opened this issue Mar 16, 2017 · 4 comments

Comments

@artlomako
Copy link

artlomako commented Mar 16, 2017

I can't run my Spring Boot with Vaadin and vaadin4Spring appliction because of following exception:

java.lang.NoSuchMethodError: org.vaadin.spring.sidebar.components.ValoSideBar$ItemButton.addClickListener(Lcom/vaadin/ui/Button$ClickListener;)V
	at org.vaadin.spring.sidebar.components.ValoSideBar$ItemButton.<init>(ValoSideBar.java:188) ~[vaadin-spring-addon-sidebar-0.0.7.RELEASE.jar:na]
	at org.vaadin.spring.sidebar.components.ValoSideBar$DefaultItemComponentFactory.createItemComponent(ValoSideBar.java:287) ~[vaadin-spring-addon-sidebar-0.0.7.RELEASE.jar:na]
	at org.vaadin.spring.sidebar.components.ValoSideBar$DefaultSectionComponentFactory.createSection(ValoSideBar.java:271) ~[vaadin-spring-addon-sidebar-0.0.7.RELEASE.jar:na]
	at org.vaadin.spring.sidebar.components.ValoSideBar$DefaultSectionComponentFactory.createSection(ValoSideBar.java:254) ~[vaadin-spring-addon-sidebar-0.0.7.RELEASE.jar:na]
	at org.vaadin.spring.sidebar.components.AbstractSideBar.createSection(AbstractSideBar.java:139) ~[vaadin-spring-addon-sidebar-0.0.7.RELEASE.jar:na]
	at org.vaadin.spring.sidebar.components.AbstractSideBar.attach(AbstractSideBar.java:75) ~[vaadin-spring-addon-sidebar-0.0.7.RELEASE.jar:na]

My Java class

    package com.example;
import com.vaadin.annotations.Theme;
import com.vaadin.server.VaadinRequest;
import com.vaadin.spring.annotation.SpringUI;
import com.vaadin.ui.UI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Component;
import org.vaadin.spring.i18n.annotation.EnableI18N;
import org.vaadin.spring.sidebar.annotation.EnableSideBar;
import org.vaadin.spring.sidebar.annotation.SideBarItem;
import org.vaadin.spring.sidebar.annotation.SideBarSection;
import org.vaadin.spring.sidebar.annotation.SideBarSections;
import org.vaadin.spring.sidebar.components.ValoSideBar;
@SpringBootApplication
@EnableSideBar
@EnableI18N
public class DemoApplication {

	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
	}

	@SpringUI
	@Theme("valo")
	static class MyUI extends UI {
		@Autowired
		private ValoSideBar sideBar;

		@Override
		protected void init(VaadinRequest request) {
			setContent(sideBar);
		}
	}

	@SideBarItem(sectionId = Sections.SECTION)
	@Component
	static class MyOperation implements Runnable {
		@Override
		public void run() {
			System.out.println("run");
		}
	}

	@SideBarSections({@SideBarSection(caption = Sections.SECTION, id = Sections.SECTION)})
	@Component
	public class Sections {
		public static final String SECTION = "section";
	}
}

My pom.xml

<?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>1.5.2.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>
	</properties>

	<dependencies>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-spring-boot-starter</artifactId>
		</dependency>
		<dependency>
			<groupId>org.vaadin.spring.addons</groupId>
			<artifactId>vaadin-spring-addon-sidebar</artifactId>
			<version>0.0.7.RELEASE</version>
		</dependency>
	</dependencies>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>com.vaadin</groupId>
				<artifactId>vaadin-bom</artifactId>
				<version>8.0.0</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>

What can be wrong and how to solve this issue?

@mstahv
Copy link
Collaborator

mstahv commented Mar 21, 2017

Hi, try to build a snapshot version from the master and let us know if it can still be reproduced. The master is updated to Vaadin 8.

@artlomako
Copy link
Author

Hi, sample with 2.0.0-SNAPSHOT works fine. How can I attach this version to my Maven project? I found only 0.0.7.RELEASE on https://mvnrepository.com/.

@mstahv
Copy link
Collaborator

mstahv commented Mar 21, 2017

If you build the snapshot locally you can just use 2.0.0-SNAPSHOT in your project (locally) as well. If you have maven proxy, you can probably install the artifacts there as well.

@FearlessHyena
Copy link
Contributor

You can add http://oss.sonatype.org/content/repositories/vaadin-snapshots as a repository in your pom to download snapshots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants