OpenLayers and Vaadin 6

Greetings everyone,

I started tinkering with Vaadin 6 and the Openlayers addon. Everything went smoothly so far, until I tried to reproject a Bounds object. By jus adding this line to my code:

Projection projectionMap = Projection.get(“EPSG:900913”);

I got these exceptions:

javax.servlet.ServletException: java.lang.UnsatisfiedLinkError: org.vaadin.vol.client.wrappers.Projection.get(Ljava/lang/String;)Lorg/vaadin/vol/client/wrappers/Projection;
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.handleServiceException(AbstractApplicationServlet.java:1010)
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:548)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause

java.lang.UnsatisfiedLinkError: org.vaadin.vol.client.wrappers.Projection.get(Ljava/lang/String;)Lorg/vaadin/vol/client/wrappers/Projection;
org.vaadin.vol.client.wrappers.Projection.get(Native Method)
com.test.vaadinmap.PanelOne.buildVerticalLayout_1(PanelOne.java:151)
com.test.vaadinmap.PanelOne.buildPanel_1(PanelOne.java:116)
com.test.vaadinmap.PanelOne.buildVerticalSplitPanel_1(PanelOne.java:97)
com.test.vaadinmap.PanelOne.buildMainLayout(PanelOne.java:80)
com.test.vaadinmap.PanelOne.(PanelOne.java:60)
com.test.vaadinmap.VaadinMap.init(VaadinMap.java:23)
com.vaadin.Application.start(Application.java:551)
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.startApplication(AbstractApplicationServlet.java:1219)
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:484)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

I tried adding the OpenLayers.js under a public folder, the widgetsset folder etc, and even changed the addon inherit declaration to

or

Nothing worked. What am I missing?

Thanks in advance, sorry if this is too trivial, but I’m newbie to Vaadin tricks.

mantesat

Hi,

It looks to me that you are using a client side class in server side code. This is due to bit a naive modularization in Vaadin thus all irrelevant client stuff ends up on the server side developers classpath. If you are using Eclipse add this to your type filters: “org.vaadin.vol.client.*”

To set the projection to be use setApiProjection method in the OpenLayersMap. IIRC that for vectors you can also define projection per component.

cheers,
matti