The component looks good in the demo but I have not been able to use it wit

The component looks good in the demo but I have not been able to use it with Vaadin 14 using the springframework. I get an error at the Animator animator = Animator.init(UI.getCurrent()) line. There seems to be no init() class in the Animator class declaration.

In addition, dependency version 1.0.0 is not included in the maven repository (https://mvnrepository.com/artifact/de.mekaso.vaadin.addons/compani) and the versions only go up to 0.9.0. So I am unable to add dependency version 1.0.0

Any advice?

The Animator.init(ui) method is new in Version 1.0.0, so you cannot use it in 0.9.0. I can see Version 1.0.0 (for Vaadin 14 released on Sep 01, 2019) in the link that you mentioned in your post: https://mvnrepository.com/artifact/de.mekaso.vaadin.addons/compani
It is also published in the official Vaadin-addons repository.

If you want to use Version 0.9.0 with Vaadin 14 bower compatibility mode (I think that is the problem here), you have to create an animator instance and add it to your UI.

final Animator animator = Animator.create();
add(animator);
...
AnimatedComponent animatedLabel = animator.prepareComponent(labelDiv);

You can get the fully working code for the demo-application for Version 0.9.0 on BitBucket (everything is open-source). Just look at:
https://bitbucket.org/mekasorocks/compani/src/0.9.0/compani-web/src/main/java/de/mekaso/vaadin/web/IndexView.java

This is the example for animating a label that you can see at http://companiweb-env.cwd2wp29pi.eu-central-1.elasticbeanstalk.com/

Hi Mekaso,
Thank you for replying to the message.
When add dependency version 1.0.0 to the POM file, it does not get integrated and generates an error (see the attached picture). So I am not able to use version 1.0.0. Do you have any suggestions on how to resolve this?
In addition, when when I run the code above using version 0.9.0, the line: final Animator animator = Animator.create(); generates the error below and the program crashes. Any advice?

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘com.itherial.ui.MainView’: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.itherial.ui.MainView]
: Constructor threw exception; nested exception is java.lang.IllegalStateException: Couldn’t find the definition of the element with tag ‘component-animator’ in any template file declared using ‘@JsModule’ annotations. Check the availability of the template files in your WAR file or provide alternative implementation of the method getTemplateContent() which should return an element representing the content of the template file
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1303)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1197)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:305)
at com.vaadin.flow.spring.SpringInstantiator.getOrCreate(SpringInstantiator.java:117)
at com.vaadin.flow.di.Instantiator.createRouteTarget(Instantiator.java:158)
at com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.lambda$getRouteTarget$1(AbstractNavigationStateRenderer.java:127)
at java.base/java.util.Optional.orElseGet(Optional.java:369)
at com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.getRouteTarget(AbstractNavigationStateRenderer.java:126)
at com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.createChain(AbstractNavigationStateRenderer.java:316)
at com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.handle(AbstractNavigationStateRenderer.java:195)
at com.vaadin.flow.router.Router.handleNavigation(Router.java:223)
at com.vaadin.flow.router.Router.navigate(Router.java:194)
at com.vaadin.flow.router.Router.initializeUI(Router.java:92)
at com.vaadin.flow.server.BootstrapHandler.createAndInitUI(BootstrapHandler.java:1420)
at com.vaadin.flow.server.BootstrapHandler.synchronizedHandleRequest(BootstrapHandler.java:456)
at com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1540)
at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:246)
at com.vaadin.flow.spring.SpringServlet.service(SpringServlet.java:95)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:352)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
at org.springframework.web.servlet.mvc.ServletForwardingController.handleRequestInternal(ServletForwardingController.java:141)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:177)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:52)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:645)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:74)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.itherial.ui.MainView]
: Constructor threw exception; nested exception is java.lang.IllegalStateException: Couldn’t find the definition of the element with tag ‘component-animator’ in any template file declared using ‘@JsModule’ annotations. Check the availability of the template files in your WAR file or provide alternative implementation of the method getTemplateContent() which should return an element representing the content of the template file
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:184)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1295)
… 106 more
Caused by: java.lang.IllegalStateException: Couldn’t find the definition of the element with tag ‘component-animator’ in any template file declared using ‘@JsModule’ annotations. Check the availability of the template files in your WAR file or provide alternative implementation of the method getTemplateContent() which should return an element representing the content of the template file
at com.vaadin.flow.component.polymertemplate.NpmTemplateParser.getTemplateContent(NpmTemplateParser.java:136)
at com.vaadin.flow.component.polymertemplate.TemplateDataAnalyzer.parseTemplate(TemplateDataAnalyzer.java:200)
at com.vaadin.flow.component.polymertemplate.TemplateInitializer.(TemplateInitializer.java:91)
at com.vaadin.flow.component.polymertemplate.PolymerTemplate.(PolymerTemplate.java:88)
at com.vaadin.flow.component.polymertemplate.PolymerTemplate.(PolymerTemplate.java:103)
at de.mekaso.vaadin.addon.compani.Animator.(Animator.java:33)
at de.mekaso.vaadin.addon.compani.Animator.create(Animator.java:27)
at com.itherial.ui.MainView.(MainView.java:80)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:172)
… 108 more
17833962.png

It seems the artifact was not correctly downloaded from the repository. The exception says that you use Vaadin 14 in NPM mode and are trying to use an addon that was made for Vaadin 10 - 13. So you need to use V 1.0.0 for your application.
The attached picture shows that it was not correctly downloaded from the official maven repository. This can happen and you just need to repeat the download step. Please delete the addon directory from your local repository (that is default at users/[your username]
/.m2) like de/mekaso/vaadin/addons/compani/1.0.0 .
After deleting this directory, force eclipse to download the library again (right-click the project Maven - Update Project…), click OK and the jar will be downloaded again (the URL is https://maven.vaadin.com/vaadin-addons/de/mekaso/vaadin/addons/compani/1.0.0/compani-1.0.0.jar). After it was successfully downloaded, the addon will work out of the box. Just follow the examples in the code samples section of this addon page.
Also don’t forget to add the addon-repository to your pom.xml:

<repositories>
   <repository>
	   <id>vaadin-addons</id>
	   <url>https://maven.vaadin.com/vaadin-addons</url>
   </repository>
</repositories>

Hi Mekaso, I have implemented your suggestion but it is still not working. I deleted the /.m2/de directory in my local repository. Then I ran a Maven->Reimport, which restored the addon. But I am still getting the same problem demoNstrated in the image attached. I am also using IntelliJ IDE if this may make any difference. And I get a BUILD FAILURE with the error message below when I try to run it:

[INFO]
Scanning for projects…
[INFO]

[INFO]

[INFO]
Building gateway7 1.0-SNAPSHOT
[INFO]

[INFO]

[INFO]

spring-boot-maven-plugin:2.1.7.RELEASE:run (default-cli) > test-compile @ gateway7 >>>
[INFO]


[INFO]
BUILD FAILURE
[INFO]

[INFO]
Total time: 1.423 s
[INFO]
Finished at: 2019-09-11T22:26:47-04:00
[INFO]
Final Memory: 21M/77M
[INFO]

[ERROR]
Failed to execute goal on project gateway7: Could not resolve dependencies for project com.itherial:gateway7:war:1.0-SNAPSHOT: Failed to collect dependencies at de.mekaso.vaadin.addons:compani:jar:1.0.0: Failed to read artifact descriptor for de.mekaso.vaadin.addons:compani:jar:1.0.0: Failure to find de.mekaso.vaadin.addons:compani-parent:pom:1.0.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced → [Help 1]

[ERROR]

[ERROR]
To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR]
Re-run Maven using the -X switch to enable full debug logging.
[ERROR]

[ERROR]
For more information about the errors and possible solutions, please read the following articles:
[ERROR]
[Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

Process finished with exit code 1

17835750.png

Hi,
thanks for your post. It seems the maven structure was corrupted or not properly uploaded in the 1.0.0 release. I fixed that and made a new version available for you. Please try again with V 1.0.1.

Hi Mekaso,
V 1.0.1 works like a charm. Thank you so much for your help getting it to work. Thank you also for creating such a wonderful addon.

Kind regards,