VaadinVisualizations + Embedded Jetty -Widgetset does not contain implement

Hi,

Widgetset does not contain implementation for org.vaadin.vaadinvisualizations.AreaChart. Check its @ClientWidget mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions. Unrendered UIDL:

I get the error above after adding VaadinVisualizations2.1.jar, I also added gwt-visualization.jar too.

Thing is, I am running vaadin from embedded Jetty instance similar to this, so I don’t have any web.xml etc.:

		Server webServer = new Server(8080);

		WebAppContext webHandler = new WebAppContext();
		webHandler.setContextPath("/");
		webHandler.setResourceBase("./src/");

		ServletHolder vaadinLoader = new ServletHolder(new ApplicationServlet());

		vaadinLoader.setInitParameter("productionMode", "true");
		vaadinLoader.setInitParameter("application",
				"com.some.ExampleApplication");
		webHandler.addServlet(vaadinLoader, "/*");

		webServer.setHandler(webHandler);

		webServer.start();
		webServer.join();

But when I try to add a sub-window like so:



				Window window = new Window();
				
				// Add a AreaChart	
				AreaChart ac = new AreaChart();	
				ac.setOption("legend", "bottom");	
				
				ac.addXAxisLabel("Year");	
				ac.addArea("Expenses");	
				ac.addArea("Sales");	
				ac.add("2004", new double[]{100,200});	
				ac.add("2005", new double[]{75,100});	
				ac.add("2006", new double[]{32,234});	
				ac.add("2007", new double[]{25,2534});	
				ac.add("2008", new double[]{2343,12});	
				ac.setSizeFull();
				
				window.addComponent(ac);
				
				addWindow(window);

I have read I need to add some web.xml or something similar, but I’m not entirely sure how this will work with Embedded Jetty. Because I am not using any web.xml configurations.

All other non-addon vaadin code works, and I can access files like this without any issues:

http://localhost:8080/VAADIN/widgetsets/com.vaadin.terminal.gwt.DefaultWidgetSet/com.vaadin.terminal.gwt.DefaultWidgetSet.nocache.js?1337777976910

Does anybody have any suggestions?

I got a bit further with this now, I know I have to compile the widgetset manually.

Right now I don’t have a WebContent, so I created a webcontent, and set this as the resource base

		webHandler.setResourceBase("./WebContent");

Then I used the ant script (build-widgetset.xml) to compile the widgetset, target directory was WebContent/VAADIN/widgetset

Then I copied the VAADIN theme into the WebContent/VAADIN/theme directory

Next I had to move the servlet from /* to /site/* like so

webHandler.addServlet(vaadinLoader, "/site/*");

This means now the system is accessible with my built widgets using the ant script, and the css etc is being used from the theme.

The next issue I have is this, when compiling the widget set I get:

     [java]
 Compiling module com.vaadin.terminal.gwt.DefaultWidgetSet
     [java]
    Scanning for additional dependencies: jar:file:/Users/mariusz/Documents/workspace-j2ee/Monitoring/lib/vaadin-6.7.6.jar!/com/vaadin/terminal/gwt/client/WidgetSet.java
     [java]
       Computing all possible rebind results for 'com.vaadin.terminal.gwt.client.WidgetMap'
     [java]
          Rebinding com.vaadin.terminal.gwt.client.WidgetMap
     [java]
             Invoking generator com.vaadin.terminal.gwt.widgetsetutils.EagerWidgetMapGenerator
     [java]
                Detecting Vaadin components in classpath to generate WidgetMapImpl.java ...
     [java]
 May 24, 2012 11:23:08 AM com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getPaintablesHavingWidgetAnnotation
     [java]
 INFO: Searching for paintables..
     [java]
                [WARN]
 Widget class org.vaadin.vaadinvisualizations.widgetset.client.ui.VColumnChart was not found. The component org.vaadin.vaadinvisualizations.ColumnChart will not be included in the widgetset.

Basically it can’t find the class org.vaadin.vaadinvisualizations.widgetset.client.ui.VColumnChart.

But my classpath in the ant script contains:

         <pathelement path="${gwt-location}/VaadinVisualizations2.1.jar" />

So I’m puzzled why it can’t find this class, when it is in that jar, and it has that jar in the classpath.

Well, I added the timeline vaadin add-on, and compiled the widgets, and it works fine on both client and server.

I guess this proves, that the way I’m adding the add-on is correct.

You can see it also showed that the widgetset will include the implementation:

     [java]
                Widget set will contain implementations for following components: 
     [java]
                	com.vaadin.addon.timeline.Timeline

But I still can’t get it to find the vaadin visualizations jar file:

     [java]
                [WARN]
 Widget class org.vaadin.vaadinvisualizations.widgetset.client.ui.VAreaChartImage was not found. The component org.vaadin.vaadinvisualizations.AreaChartImage will not be included in the widgetset.

I also debug the classpath in the ant script and can see the VaadinVisualizations2.1.jar in the classpath, also gwt-visualization.jar and whatever else I’d imagine is required.

Hello,

We are also running our application from within embedded jetty, but we made our project like a normal vaadin project which can be packed in a WAR file.
We have no problem using addons and third party jar files with this solution.

We have two different start applications, one for development inside eclipse and one for production.

We struggled a little bit to set the WebAppContext right, but here is what we ended up with:

*** When we start jetty from within eclipse we do like this:

Server server = new Server(port);

WebAppContext webapp = new WebAppContext();
webapp.setContextPath(“/”);
webapp.setResourceBase(“WebContent”);
webapp.setClassLoader(Thread.currentThread().getContextClassLoader());
server.setHandler(webapp);
server.start();

*** In production mode we do like this:

Server server = new Server(port);
WebAppContext webapp = new WebAppContext();

String warFile = getBaseLocation() + “nameOfYourApplication.war”;

webapp.setContextPath(“/”);
webapp.setWar(warFile);
server.setHandler(webapp);
server.start();

*** getBaseLocation() ****

private static String getBaseLocation()
{
ProtectionDomain protectionDomain = StartServer.class.getProtectionDomain();
URL location = protectionDomain.getCodeSource().getLocation();

    String name = location.toString();
    
    int index = 0;
    
    for(index= name.length() -1; index>0; index--) 
    	if(name.substring(index).startsWith("/")) break;
    	
    return name.substring(0, index) + "/";
}

I fixed this issue now.

After adding -logLevel DEBUG to the gwt compiler, and it told me it couldn’t find an include class in gwt-visualizations.

Then I realised I was using an old version of gwt-visualization.jar 1.0.2

once I got 1.1.2 I can see it is resolved. Hopefully that is the end of it.

Thanks for listening

Hi,

I missed your post.

We havn’t gone to production yet, however I will look at your solution as we get closer. Thankyou for that.