Vaadin grid ClassNotFoundException: guava BiMap

I’m trying to use vaadin grid and I get the following error:


CloseDetails <<Logout
java.lang.ClassNotFoundException: com.google.gwt.thirdparty.guava.common.collect.BiMap 
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381) 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) 
    at com.vaadin.data.RpcDataProviderExtension.<init>(RpcDataProviderExtension.java:808) 
    at com.vaadin.ui.Grid.internalSetContainerDataSource(Grid.java:4043) 
    at com.vaadin.ui.Grid.<init>(Grid.java:3635) 
    at com.vaadin.ui.Grid.<init>(Grid.java:3600) 
    at com.company.flux.web.WebMigrationReportEditCompanion.initBox(WebMigrationReportEditCompanion.java:36) 
    at com.company.flux.gui.migrationreport.MigrationReportEdit$1.actionPerform(MigrationReportEdit.java:89) 
    at com.haulmont.cuba.web.gui.components.WebAbstractTable.handleClickAction(WebAbstractTable.java:640) 
    at com.haulmont.cuba.web.gui.components.WebAbstractTable.lambda$initComponent$4fd149ee$1(WebAbstractTable.java:535) 
    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:497) 
    at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:508) 
    at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:198) 
    at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:161) 
    at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:1003) 
    at com.vaadin.ui.Table.handleClickEvent(Table.java:3180) 
    at com.vaadin.ui.Table.changeVariables(Table.java:2956) 
    at com.haulmont.cuba.web.toolkit.ui.CubaTable.changeVariables(CubaTable.java:208) 
    at com.vaadin.server.communication.ServerRpcHandler.changeVariables(ServerRpcHandler.java:508) 
    at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:327) 
    at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:202) 
    at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:95) 
    at com.haulmont.cuba.web.sys.CubaVaadinServletService$CubaUidlRequestHandler.lambda$synchronizedHandleRequest$65(CubaVaadinServletService.java:281) 
    at com.haulmont.cuba.web.sys.CubaVaadinServletService.withUserSession(CubaVaadinServletService.java:171) 
    at com.haulmont.cuba.web.sys.CubaVaadinServletService$CubaUidlRequestHandler.synchronizedHandleRequest(CubaVaadinServletService.java:281) 
    at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41) 
    at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1408) 
    at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:356) 
    at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:226) 
    at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:149) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) 

Do I have to import the missing library or is it a known issue?

Hi Francis,
It is the problem with guava library version. Vaadin has own guava in dependencies, but we use original guava 18.0 instead.
We will fix it shortly and release it as soon as possible.

Temporary fix (I’ve attached example project):

  1. Add com.vaadin.external.google:guava:16.0.1.vaadin1 to web module dependencies using Project properties - Advanced
  2. Change code of your build.gradle in"configure(webModule)" section:
    
    task deploy(dependsOn: [assemble, cleanConf], type: CubaDeployment) {
        appName = 'app'
        appJars('cuba-web', 'cuba-client', 'cuba-gui', 'cuba-global', 
                'app-global', 'app-gui', 'app-web')
    } << {
        // add this code
        def tomcatRootDir = new File(project.cuba.tomcat.dir).canonicalPath
        project.copy {
            from project.configurations.compile
            into "${tomcatRootDir}/shared/lib"
            include { details ->
                return details.file.name.startsWith('guava')
            }
        }
    }
    

grid-test.zip (25.8K)

Hi,
the problem is fixed in the platform version 6.0.9.