NoClassDefFoundError when I'm trying to use OpenLayers 3

Good evening.
I would like to display geoPoint on a map embedded into my vaadin application. So, i followed the related tutorial and my project build well.
I added following dependencies to my pom.xml :

<dependency>
            <groupId>org.vaadin.addon</groupId>
            <artifactId>v-ol3</artifactId>
            <version>2.0</version>
        </dependency>
        <dependency>
            <groupId>org.vaadin</groupId>
            <artifactId>gwt-ol3</artifactId>
            <version>2.0</version>
        </dependency

But, at the runtime, i’ve got error : ava.lang.NoClassDefFoundError: org/vaadin/addon/vol3/layer/OLLayer.

I tried some maven update, clean compile, clean install and all commands succeeded. But the problem is still there…

There is my code which call OL3 :

OLMap map=new OLMap();
            map.setView(createView());
            map.setSizeFull();
            vl.addComponent(map);
            vl.setExpandRatio(map, 1.0f);
           
            OLVectorLayer vectorLayer=new OLVectorLayer(createVectorSource());
            vectorLayer.setLayerVisible(false);
            map.addLayer(vectorLayer)

I think need help…
Thanks.

Hi,

do you have a multi-level project setup? Perhaps you’re adding your dependencies to the wrong pom.xml?

-Olli

Hi,
I think you need only the dependency to

<<groupId>org.vaadin.addon</groupId> <artifactId>v-ol3</artifactId> and not also to the gwt-ol3, as the gwt-ol3 provides the client-side GWT wrappers for the v-ol3 api (i.e. it’s included in v-ol3, no need to declare it again). However I don’t know if that is the cause of these errors, but could be.
Have you taken a look at the v-ol3 demo app in Github (
https://github.com/VOL3/v-ol3-demo
)? It has a VectorLayerMap implementation, and that could help you forward.

-Katri