Chart Addon and CDI

I want to use the Vaadin Charts Addon. In my test projekt (Vaadin 7) without the vaadin-cdi implementation it works well.

But than i implemented CDI:

  • changed web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">  
</web-app>
  • changed VaadinUI → add Annotation
    @CDIUI

  • i have compiled the widgetset again and the
    AppWidgetSet.gwt.xml
    file looks right and have the two inherits for the addon.
    [i]

[/i]
But the browser always shows the error that the widgetset for the addon isn’t compiled instead of the component.


Widgetset does not contain implementation for com.vaadin.addon.charts.Chart. Check its component connector’s @Connect 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.

Do i have to add another annotation?

Hi Daniel,

I had the same problem and solved it by configuring the VaadinServlet again in the web.xml:


<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

    <servlet>
    <servlet-name>vaadinServlet</servlet-name>
    <servlet-class>
        com.vaadin.server.VaadinServlet
    </servlet-class>

    <init-param>
      <param-name>uiprovider</param-name>
      <param-value>com.vaadin.cdi.internal.CDIUIProvider</param-value>
    </init-param>

    <!-- If not using the default widget set-->
    <init-param>
      <param-name>widgetset</param-name>
      <param-value>com.optible.vaadin.widgetset.VaadinWidgetset</param-value>
    </init-param>
  </servlet>

  <servlet-mapping>
    <servlet-name>vaadinServlet</servlet-name>
    <url-pattern>/vaadin/*</url-pattern>
 </servlet-mapping>
  <servlet-mapping>
    <servlet-name>vaadinServlet</servlet-name>
    <url-pattern>/VAADIN/*</url-pattern>
 </servlet-mapping>
  <servlet-mapping>
    <servlet-name>vaadinServlet</servlet-name>
    <url-pattern>/app/*</url-pattern>
 </servlet-mapping>

The last servlet mapping is needed because I do not map directly to “/*”:


@CDIUI
@URLMapping("/app/*")

Hope that helps.

BTW: The web.xml you posted

Regards,
Thomas

yes thats the solution. thanks you a lot :slight_smile: