I am creating simple Vaadin application using the latest Vaadin version (8.2.0).
I can successfully built and deployed my war application, but when run, it hits the following error. Can you please help?
Note: I am able to see the method in the class, I don’t know why it keep complaint NoSuchMethodError. and I am sure there is ONLY one version in my built path
23:58:55,022 ERROR [io.undertow.request]
(default task-42) UT005023: Exception handling request to /project-war/: javax.servlet.ServletException: com.vaadin.server.ServiceException: java.lang.NoSuchMethodError: com.vaadin.ui.Notification.show(Ljava/lang/String;Lcom/vaadin/ui/Notification$Type;)V
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:447)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
…
Caused by: com.vaadin.server.ServiceException: java.lang.NoSuchMethodError: com.vaadin.ui.Notification.show(Ljava/lang/String;Lcom/vaadin/ui/Notification$Type;)V
at com.vaadin.server.VaadinService.handleExceptionDuringRequest(VaadinService.java:1653)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1613)
at com.vaadin.cdi.server.VaadinCDIServletService.handleRequest(VaadinCDIServletService.java:92)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:445)
… 39 more
Caused by: java.lang.NoSuchMethodError: com.vaadin.ui.Notification.show(Ljava/lang/String;Lcom/vaadin/ui/Notification$Type;)V
at org.vaadin.cdiviewmenu.ViewMenuUI.handleNavigationError(ViewMenuUI.java:64)
at org.vaadin.cdiviewmenu.ViewMenuUI$1.navigateTo(ViewMenuUI.java:36)
at com.vaadin.ui.UI.doInit(UI.java:776)
at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:224)
at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:76)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1601)
… 41 more
have you tried to
mvn clean install ? That might help.
Also, it looks like the error is thrown on
Notification.show method with the parameters String and Notification.Type. Is cleaning doesn’t help, does removing this line helps? And if so, could you paste it here?
I have attached my source code for your reference.
The logic is very simple: When I enter the URL, it trigger the MainUI.java, then it will call the LoginView logic, suppose, the screen will be shown, but it hit the ViewMenuUI Notification.show method issue.
I am just wondering could this be related to one regression issue we had with Notifications in Vaadin 8.2.0, the good news is that the fix is on the way:
https://github.com/vaadin/framework/pull/10504
The error seems disappeared after I haved downgraded to 8.1.7.
But I hit another error,
Caused by: org.jboss.weld.exceptions.UnsatisfiedResolutionException: WELD-001334: Unsatisfied dependencies for type LoginViewPresenter with qualifiers @Default
at org.jboss.weld.bean.builtin.InstanceImpl.get(InstanceImpl.java:109)
at com.abt.app.framework.web.security.LoginViewImpl.generatePresenter(LoginViewImpl.java:85)
at com.abt.app.framework.web.security.LoginViewImpl.generatePresenter(LoginViewImpl.java:1)
at com.abt.app.framework.web.AbstractView.postConstruct(AbstractView.java:34)
… 79 more
During deployment, I saw 2 warning message, any impact?
13:30:08,563 INFO [io.undertow.servlet]
(ServerService Thread Pool – 10) Initializing Shiro environment
13:30:08,563 INFO [org.apache.shiro.web.env.EnvironmentLoader]
(ServerService Thread Pool – 10) Starting Shiro environment initialization.
13:30:08,619 INFO [org.apache.shiro.web.env.EnvironmentLoader]
(ServerService Thread Pool – 10) Shiro environment initialized in 56 ms.
13:30:08,620 INFO [com.vaadin.cdi.internal.ContextDeployer]
(ServerService Thread Pool – 10) Initializing web context for path /myproject-war
13:30:08,620 INFO [com.vaadin.cdi.internal.ContextDeployer]
(ServerService Thread Pool – 10) Discovering Vaadin UIs…
13:30:08,620 INFO [com.vaadin.cdi.internal.ContextDeployer]
(ServerService Thread Pool – 10) 2 beans inheriting from UI discovered!
13:30:08,621 WARNING [com.vaadin.cdi.internal.ContextDeployer]
(ServerService Thread Pool – 10) UI without CDIUI annotation found: org.vaadin.cdiviewmenu.ViewMenuUI, it is not available in CDI deployment
13:30:08,621 INFO [com.vaadin.cdi.internal.ContextDeployer]
(ServerService Thread Pool – 10) Vaadin UI com.abt.app.framework.web.MainUI is marked as @CDIUI without context path, this UI is accessible from context root of deployment
13:30:08,621 INFO [com.vaadin.cdi.internal.ContextDeployer]
(ServerService Thread Pool – 10) Available Vaadin UIs for CDI deployment
[/ => MainUI]
13:30:08,622 WARNING [com.vaadin.cdi.internal.ContextDeployer]
(ServerService Thread Pool – 10) Vaadin related servlet is defined in deployment descriptor, automated deployment of VaadinCDIServlet is now disabled
13:30:08,622 INFO [com.vaadin.cdi.internal.ContextDeployer]
(ServerService Thread Pool – 10) Done deploying Vaadin UIs
13:30:08,661 INFO [org.wildfly.extension.undertow]
(ServerService Thread Pool – 10) WFLYUT0021: Registered web context: ‘/myproject-war’ for server ‘default-server’
13:30:08,718 INFO [org.jboss.as.server]
(DeploymentScanner-threads - 1) WFLYSRV0016: Replaced deployment “myproject-war.war” with deployment “myproject-war.war”
Note: MainUI.java and login view are package in another jar component. Anything I need to do before calling?
Just a heads-up: Since Vaadin Framework 8.2.0 changed the signature of
Notification.show , any dependency compiled with a version previous to 8.2.0 that uses the
Notification.show method will break in client modules compiled with 8.2.0.