Hello,
As an exercise, I am trying to add image capture + display + upload to my Maven/Vaadin/SpringBoot App using the
lib-gwt-imageupload
UI Component but, after many failed attempts to plug it in, I have hit a wall.
I have tried to put my head around the
Vaadin Touchkit Parking Ticket Demo
(which uses lib-gwt-imageupload) but so many things are going on in there that it is overwhelmingly complex from a Vaadin beginner standpoint.
The lib-gwt-imageupload web page unfortunately do not offer any help and the small excerpt on the book (page 682) mentioning it, sends you in a ‘spin’ by forwarding you back to the Touchkit Parking Ticket example. Back to square one lol
Anyway, my latest attempt was to ditch my main app temporarily and try a few tests using a basic and solid base such as the
spring-vaadin-touchkit
example (which I have set to the standard widgetset solution, as suggested in the source). Unfortunately, adding what I felt was the relevant/needed dependencies in pom.xml (see marks in the listing below):
[code]
<?xml version="1.0" encoding="UTF-8"?>
4.0.0
<groupId>io.spring</groupId>
<artifactId>spring-vaadin-touchkit</artifactId>
<version>0.0.1-SNAPSHOT</version>
<description>Vaadin Spring + Vaadin TouchKit integration example</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<version.vaadin>7.5.9</version.vaadin>
<vaadin.plugin.version>${version.vaadin}</vaadin.plugin.version>
<start-class>crud.Application</start-class>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.5.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-spring-boot</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
<version>${version.vaadin}</version>
<exclusions>
<!-- Remove some obsolete stuff not needed by server side Vaadin apps -->
<exclusion>
<artifactId>vaadin-theme-compiler</artifactId>
<groupId>com.vaadin</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.vaadin.addon</groupId>
<artifactId>vaadin-touchkit-agpl</artifactId>
<version>4.0.3</version>
<exclusions>
<!-- For some reason latest touchkit depends on vaadin-themes, which is not needed -->
<exclusion>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-themes</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.vaadin</groupId>
<artifactId>viritin</artifactId>
<version>1.37</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client</artifactId>
<scope>provided</scope>
<version>${version.vaadin}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiler</artifactId>
<scope>provided</scope>
<version>${version.vaadin}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<!-- This is needed for fallback app displayed for non webkit browsers -->
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiled</artifactId>
<version>${version.vaadin}</version>
</dependency>
<dependency>
<groupId>org.vaadin.juho</groupId>
<artifactId>lib-gwt-imageupload</artifactId>
<version>0.0.3</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!-- If not using cdn.virit.in, remove previous plugin and uncomment this one -->
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.plugin.version}</version>
<configuration>
<extraJvmArgs>-Xmx1024M -Xss1024k</extraJvmArgs>
<webappDirectory>${basedir}/target/classes/VAADIN/widgetsets</webappDirectory>
<draftCompile>false</draftCompile>
<compileReport>false</compileReport>
<style>OBF</style>
<strict>true</strict>
<runTarget>http://localhost:8080/simple</runTarget>
<module>AppWidgetset</module>
</configuration>
<executions>
<execution>
<goals>
<goal>update-widgetset</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
in.virit.vwscdn
</groupId>
<artifactId>
vwscdn-maven-plugin
</artifactId>
<versionRange>
[1.3.4,)
</versionRange>
<goals>
<goal>generate</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
[/code]The app fails to launch:
[code]
/\ / ’ __ _ () __ __ _ \ \ \
( ( )__ | '_ | '| | ’ / ` | \ \ \
\/ )| |)| | | | | || (| | ) ) ) )
’ || .__|| ||| |_, | / / / /
=========||==============|/=////
:: Spring Boot :: (v1.2.5.RELEASE)
2016-02-29 19:06:22.912 INFO 4600 — [ main]
org.vaadin.tkspring.Application : Starting Application on XTreme with PID 4600 (F:\My_Devs\MetaConcept\Ingeo\r&d\studies\vaadin-spring-touchkit\target\classes started by Monty in F:\My_Devs\MetaConcept\Ingeo\r&d\studies\vaadin-spring-touchkit)
2016-02-29 19:06:22.946 INFO 4600 — [ main]
ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@f4d528: startup date [Mon Feb 29 19:06:22 CET 2016]
; root of context hierarchy
2016-02-29 19:06:23.628 INFO 4600 — [ main]
o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean ‘beanNameViewResolver’: replacing [Root bean: class [null]
; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]
] with [Root bean: class [null]
; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]
]
2016-02-29 19:06:23.902 WARN 4600 — [ main]
ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor’: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/validation/ParameterNameProvider
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:199)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:615)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:465)
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 org.vaadin.tkspring.Application.main(Application.java:12)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.NoClassDefFoundError: javax/validation/ParameterNameProvider
at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:41)
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:269)
at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:223)
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor$Jsr303ValidatorFactory.run(ConfigurationPropertiesBindingPostProcessor.java:381)
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.afterPropertiesSet(ConfigurationPropertiesBindingPostProcessor.java:174)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
… 20 common frames omitted
Caused by: java.lang.ClassNotFoundException: javax.validation.ParameterNameProvider
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
… 27 common frames omitted
2016-02-29 19:06:23.906 INFO 4600 — [ main]
.b.l.ClasspathLoggingApplicationListener : Application failed to start with classpath: [file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/charsets.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/deploy.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/javaws.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/jce.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/jfr.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/jfxswt.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/jsse.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/management-agent.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/plugin.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/resources.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/rt.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/ext/access-bridge-32.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/ext/cldrdata.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/ext/dnsns.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/ext/jaccess.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/ext/jfxrt.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/ext/localedata.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/ext/nashorn.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/ext/sunec.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/ext/sunjce_provider.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/ext/sunmscapi.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/ext/sunpkcs11.jar, file:/C:/Program%20Files%20(x86)/Java/jdk1.8.0_25/jre/lib/ext/zipfs.jar, file:/F:/My_Devs/MetaConcept/Ingeo/r&d/studies/vaadin-spring-touchkit/target/classes/, file:/C:/Users/Monty/.m2/repository/org/springframework/boot/spring-boot-starter-actuator/1.2.5.RELEASE/spring-boot-starter-actuator-1.2.5.RELEASE.jar, file:/C:/Users/Monty/.m2/repository/org/springframework/boot/spring-boot-starter/1.2.5.RELEASE/spring-boot-starter-1.2.5.RELEASE.jar, file:/C:/Users/Monty/.m2/repository/org/springframework/boot/spring-boot-starter-logging/1.2.5.RELEASE/spring-boot-starter-logging-1.2.5.RELEASE.jar, file:/C:/Users/Monty/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.12/jcl-over-slf4j-1.7.12.jar, file:/C:/Users/Monty/.m2/repository/org/slf4j/jul-to-slf4j/1.7.12/jul-to-slf4j-1.7.12.jar, file:/C:/Users/Monty/.m2/repository/org/slf4j/log4j-over-slf4j/1.7.12/log4j-over-slf4j-1.7.12.jar, file:/C:/Users/Monty/.m2/repository/ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar, file:/C:/Users/Monty/.m2/repository/ch/qos/logback/logback-core/1.1.3/logback-core-1.1.3.jar, file:/C:/Users/Monty/.m2/repository/org/yaml/snakeyaml/1.14/snakeyaml-1.14.jar, file:/C:/Users/Monty/.m2/repository/org/springframework/boot/spring-boot-actuator/1.2.5.RELEASE/spring-boot-actuator-1.2.5.RELEASE.jar, file:/C:/Users/Monty/.m2/repository/org/springframework/spring-context/4.1.7.RELEASE/spring-context-4.1.7.RELEASE.jar, file:/C:/Users/Monty/.m2/repository/org/springframework/spring-core/4.1.7.RELEASE/spring-core-4.1.7.RELEASE.jar, file:/C:/Users/Monty/.m2/repository/org/springframework/boot/spring-boot-starter-web/1.2.5.RELEASE/spring-boot-starter-web-1.2.5.RELEASE.jar, file:/C:/Users/Monty/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/1.2.5.RELEASE/spring-boot-starter-tomcat-1.2.5.RELEASE.jar, file:/C:/Users/Monty/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/8.0.23/tomcat-embed-core-8.0.23.jar, file:/C:/Users/Monty/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/8.0.23/tomcat-embed-el-8.0.23.jar, file:/C:/Users/Monty/.m2/repository/org/apache/tomcat/embed/tomcat-embed-logging-juli/8.0.23/tomcat-embed-logging-juli-8.0.23.jar, file:/C:/Users/Monty/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/8.0.23/tomcat-embed-websocket-8.0.23.jar, file:/C:/Users/Monty/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.4.6/jackson-databind-2.4.6.jar, file:/C:/Users/Monty/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.4.6/jackson-annotations-2.4.6.jar, file:/C:/Users/Monty/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.4.6/jackson-core-2.4.6.jar, file:/C:/Users/Monty/.m2/repository/org/hibernate/hibernate-validator/5.1.3.Final/hibernate-validator-5.1.3.Final.jar, file:/C:/Users/Monty/.m2/repository/org/jboss/logging/jboss-logging/3.1.3.GA/jboss-logging-3.1.3.GA.jar, file:/C:/Users/Monty/.m2/repository/com/fasterxml/classmate/1.0.0/classmate-1.0.0.jar, file:/C:/Users/Monty/.m2/repository/org/springframework/spring-web/4.1.7.RELEASE/spring-web-4.1.7.RELEASE.jar, file:/C:/Users/Monty/.m2/repository/org/springframework/spring-aop/4.1.7.RELEASE/spring-aop-4.1.7.RELEASE.jar, file:/C:/Users/Monty/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/C:/Users/Monty/.m2/repository/org/springframework/spring-beans/4.1.7.RELEASE/spring-beans-4.1.7.RELEASE.jar, file:/C:/Users/Monty/.m2/repository/org/springframework/spring-webmvc/4.1.7.RELEASE/spring-webmvc-4.1.7.RELEASE.jar, file:/C:/Users/Monty/.m2/repository/org/springframework/spring-expression/4.1.7.RELEASE/spring-expression-4.1.7.RELEASE.jar, file:/C:/Users/Monty/.m2/repository/com/vaadin/vaadin-spring-boot/1.0.0/vaadin-spring-boot-1.0.0.jar, file:/C:/Users/Monty/.m2/repository/com/vaadin/vaadin-spring/1.0.0/vaadin-spring-1.0.0.jar, file:/C:/Users/Monty/.m2/repository/org/slf4j/slf4j-api/1.7.12/slf4j-api-1.7.12.jar, file:/C:/Users/Monty/.m2/repository/org/springframework/boot/spring-boot/1.2.5.RELEASE/spring-boot-1.2.5.RELEASE.jar, file:/C:/Users/Monty/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.2.5.RELEASE/spring-boot-autoconfigure-1.2.5.RELEASE.jar, file:/C:/Users/Monty/.m2/repository/com/vaadin/vaadin-server/7.5.9/vaadin-server-7.5.9.jar, file:/C:/Users/Monty/.m2/repository/com/vaadin/vaadin-sass-compiler/0.9.12/vaadin-sass-compiler-0.9.12.jar, file:/C:/Users/Monty/.m2/repository/com/vaadin/external/flute/flute/1.3.0.gg2/flute-1.3.0.gg2.jar, file:/C:/Users/Monty/.m2/repository/com/vaadin/vaadin-shared/7.5.9/vaadin-shared-7.5.9.jar, file:/C:/Users/Monty/.m2/repository/com/vaadin/external/streamhtmlparser/streamhtmlparser-jsilver/0.0.10.vaadin1/streamhtmlparser-jsilver-0.0.10.vaadin1.jar, file:/C:/Users/Monty/.m2/repository/com/vaadin/external/google/guava/16.0.1.vaadin1/guava-16.0.1.vaadin1.jar, file:/C:/Users/Monty/.m2/repository/org/jsoup/jsoup/1.8.1/jsoup-1.8.1.jar, file:/C:/Users/Monty/.m2/repository/com/vaadin/addon/vaadin-touchkit-agpl/4.0.3/vaadin-touchkit-agpl-4.0.3.jar, file:/C:/Users/Monty/.m2/repository/org/vaadin/viritin/1.37/viritin-1.37.jar, file:/C:/Users/Monty/.m2/repository/org/vaadin/addon/confirmdialog/2.1.3/confirmdialog-2.1.3.jar, file:/C:/Users/Monty/.m2/repository/org/commonjava/googlecode/markdown4j/markdown4j/2.2-cj-1.0/markdown4j-2.2-cj-1.0.jar, file:/C:/Users/Monty/.m2/repository/commons-beanutils/commons-beanutils/1.9.2/commons-beanutils-1.9.2.jar, file:/C:/Users/Monty/.m2/repository/org/apache/commons/commons-lang3/3.3.2/commons-lang3-3.3.2.jar, file:/C:/Users/Monty/.m2/repository/javax/el/javax.el-api/2.2.4/javax.el-api-2.2.4.jar, file:/C:/Users/Monty/.m2/repository/org/w3c/css/sac/1.3/sac-1.3.jar, file:/C:/Users/Monty/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA.jar, file:/C:/Users/Monty/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar, file:/C:/Users/Monty/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar, file:/C:/Users/Monty/.m2/repository/com/vaadin/vaadin-client-compiled/7.5.9/vaadin-client-compiled-7.5.9.jar, file:/C:/Users/Monty/.m2/repository/org/vaadin/juho/lib-gwt-imageupload/0.0.3/lib-gwt-imageupload-0.0.3.jar, file:/C:/Users/Monty/.m2/repository/org/vectomatic/lib-gwt-file/0.3.4/lib-gwt-file-0.3.4.jar, file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2015.0.2/lib/idea_rt.jar]
2016-02-29 19:06:23.907 ERROR 4600 — [ main]
o.s.boot.SpringApplication : Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor’: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/validation/ParameterNameProvider
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:199)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:615)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:465)
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 org.vaadin.tkspring.Application.main(Application.java:12)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.NoClassDefFoundError: javax/validation/ParameterNameProvider
at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:41)
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:269)
at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:223)
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor$Jsr303ValidatorFactory.run(ConfigurationPropertiesBindingPostProcessor.java:381)
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.afterPropertiesSet(ConfigurationPropertiesBindingPostProcessor.java:174)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
… 20 common frames omitted
Caused by: java.lang.ClassNotFoundException: javax.validation.ParameterNameProvider
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
… 27 common frames omitted
Exception in thread “main” org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor’: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/validation/ParameterNameProvider
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:199)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:615)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:465)
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 org.vaadin.tkspring.Application.main(Application.java:12)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.NoClassDefFoundError: javax/validation/ParameterNameProvider
at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:41)
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:269)
at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:223)
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor$Jsr303ValidatorFactory.run(ConfigurationPropertiesBindingPostProcessor.java:381)
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.afterPropertiesSet(ConfigurationPropertiesBindingPostProcessor.java:174)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
… 20 more
Caused by: java.lang.ClassNotFoundException: javax.validation.ParameterNameProvider
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
… 27 more
Process finished with exit code 1
[/code]The structure of the app
spring-vaadin-touchkit
src
main
java
org.vaadin.tkstring
client
TakePhoto.java
Application.java
MainUI.java
SpringAwareTouchKitServlet.java
AppWidgetset.gwt.xml
resources
webapp
pom.xml
README.
is the same as in the spring-vaadin-touchkit example to which I have added a “client” package, an AppWidgetset.gwt.xml file and a “TakePhoto” class:
[code]
package org.vaadin.tkspring.client;
import com.google.gwt.dom.client.Style;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.addon.touchkit.gwt.client.ui.VerticalComponentGroupWidget;
import com.vaadin.client.ui.VButton;
import com.vaadin.client.ui.VCssLayout;
import org.vaadin.juho.imageupload.client.*;
/**
*
*/
public class TakePhoto extends VerticalComponentGroupWidget {
private final SimplePanel imagePanel;
private String thumbnailUrl;
private boolean imageLoaded;
// private final TicketViewModuleListener listener;
private final VButton removeButton = new VButton();
private final VButton takePhotoButton = new VButton();
private final ImageUpload fileUpload = new ImageUpload();
private void setImagePanelScale() {
Widget parent = imagePanel.getParent();
int width = parent.getOffsetWidth();
imagePanel.getElement().getStyle().setFontSize(width, Style.Unit.PX);
}
public TakePhoto(/*final TicketViewModuleListener listener*/) {
// this.listener = listener;
VCssLayout innerLayout = new VCssLayout();
// innerLayout.addStyleName(“photoinnerlayout”);
imagePanel = new SimplePanel();
// imagePanel.addStyleName(“imagepanel”);
innerLayout.add(imagePanel);
takePhotoButton.getElement().setId("uploadbutton");
// takePhotoButton.setStyleName(“parkingbutton”);
// takePhotoButton.addStyleName(“blue”);
// takePhotoButton.addStyleName(“textcentered”);
takePhotoButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
fileUpload.click();
}
});
fileUpload.setCapture(true);
EXIFOrientationNormalizer normalizer = new EXIFOrientationNormalizer();
normalizer.setMaxWidth(1024);
normalizer.setMaxHeight(1024);
fileUpload.addImageManipulator(normalizer);
fileUpload.addImageLoadedHandler(new ImageLoadedHandler() {
@Override
public void onImageLoaded(ImageLoadedEvent event) {
setImage(event.getImageData().getDataURL());
}
});
ImageTransformer thumbnailGenerator = new ImageTransformer();
thumbnailGenerator.setImageDataSource(fileUpload);
thumbnailGenerator.setMaxWidth(75);
thumbnailGenerator.setMaxHeight(75);
thumbnailGenerator.addImageLoadedHandler(new ImageLoadedHandler() {
@Override
public void onImageLoaded(ImageLoadedEvent event) {
thumbnailUrl = event.getImageData().getDataURL();
}
});
VCssLayout buttonsLayout = new VCssLayout();
// buttonsLayout.addStyleName(“buttonslayout”);
buttonsLayout.add(fileUpload);
buttonsLayout.add(takePhotoButton);
removeButton.getElement().setId("removebutton");
removeButton.setText("Remove");
// removeButton.setStyleName(“parkingbutton”);
// removeButton.addStyleName(“blue”);
// removeButton.addStyleName(“textcentered”);
removeButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
removeImage();
}
});
buttonsLayout.add(removeButton);
innerLayout.add(buttonsLayout);
add(innerLayout);
Window.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(final ResizeEvent event) {
setImagePanelScale();
}
});
}
private void setImage(String dataURL) {
// OfflineDataService.setCachedImage(dataURL);
imageLoaded = true;
imagePanel.getElement().getStyle()
.setBackgroundImage("url(" + dataURL + ")");
takePhotoButton.setText("Replace...");
// takePhotoButton.removeStyleName(“empty”);
imagePanel.setVisible(true);
removeButton.setVisible(true);
// listener.fieldsChanged();
setImagePanelScale();
}
private void removeImage() {
imageLoaded = false;
thumbnailUrl = null;
takePhotoButton.setText("Take a photo");
// takePhotoButton.addStyleName(“empty”);
imagePanel.setVisible(false);
removeButton.setVisible(false);
// listener.fieldsChanged();
setImagePanelScale();
}
}
[/code]What I have noticed:
- The lib-gwt-imageupload component is not added automatically to the Widgeset.gwt.xml file - I have therefore added it manually - is this normal?
- After proceeding commenting out the added dependencies one by one, It would seem that the culprits causing the app launch to fail and crash are the vaadin-client and vaadin-client-compiler dependencies.
Thank you for reading up until here - as I said, I have hit a wall and do not know where to look any more (other than here) for a solution to implement a simple example to make this thing work as expected.
Any help/examples or anyone willing to explain the best practice on how to handle this (type of) component (which doesn’t seem to behave like the others) - greatly appreciated.
Thanks in advance!