Hi everyone.
I am a begginer with Vaadin and I’m traying to do a sample project with a client-server RPC, and I’m using this wiki
and when i execute my app it shows this exception in the UI.
Here is what i have.

package com.example.documentmanager.client;

import com.vaadin.annotations.Theme;
import com.vaadin.navigator.Navigator;
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.UI;

public class DocUI extends UI {

private static Navigator navigator;
public static final String PPAL_VIEW = "";
public static final String FILE_VIEW = "fileView";

protected void init(VaadinRequest request) {
    navigator = new Navigator(this, this);
    navigator.addView(PPAL_VIEW, new PrincipalView());
    navigator.addView(FILE_VIEW, new FileView());        

public static Navigator getAppNavigator(){
    return navigator;


package com.example.documentmanager.client;

import java.util.Locale;
import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
import com.vaadin.server.ThemeResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;

public class PrincipalView extends Widget implements View {

private FilesystemContainer docs;
private Table documentList;    
private Button viewInfoButton;
private FieldGroup fileInfo;
private FormLayout fileFields;

private String[] columns = new String[]

{“Name”, “Icon”, “Size”, “Last Modified”};

public PrincipalView() {

private void buildComponents() {
    VerticalLayout ppalLayout = new VerticalLayout();
    docs = new FilesystemContainer(new File("C:/TEMP/javadoc/"));
    documentList = new Table();    
    viewInfoButton = new Button("File Info");
    fileFields = new FormLayout();
    HorizontalSplitPanel split =  new HorizontalSplitPanel();
    VerticalLayout vl = new VerticalLayout();
    vl.setExpandRatio(documentList, 1);

private void createFileInfo(){
    fileInfo = new FieldGroup();
    for (String fieldName : columns) {
        TextField field = new TextField(fieldName);
        if (fieldName.equals("Icon")) {
            field.setConverter(new Converter<String, ThemeResource>(){
                public ThemeResource convertToModel(String value,
                        Class<? extends ThemeResource> targetType,
                        Locale locale)
                        throws {
                    return (value != null && value.length() > 0 ? new ThemeResource(value) : null);
                public String convertToPresentation(ThemeResource value,
                        Class<? extends String> targetType, Locale locale)
                        throws {
                    return (value != null ? value.getResourceId() : "");
                public Class<ThemeResource> getModelType() {
                    return ThemeResource.class;
                public Class<String> getPresentationType() {
                    return String.class;
        fileInfo.bind(field, fieldName);

public void enter(ViewChangeEvent event) {

public Button getViewInfoButton() {
    return viewInfoButton;

public Table getDocumentList() {
    return documentList;

public FieldGroup getFileInfo() {
    return fileInfo;

[/code]ServerRpc and ServerRpcImpl

package com.example.documentmanager.shared.servicerpc;

import com.vaadin.shared.communication.ServerRpc;

public interface DocumentManagerServerRpc extends ServerRpc {
public void setFileSelectedInSession(File file);

package com.example.documentmanager.shared.servicerpc;


public class DocumentManagerServerRpcImpl implements DocumentManagerServerRpc {
private static final long serialVersionUID = -2746786739091368385L;

public void setFileSelectedInSession(File file) {
    System.out.println("El archivo es: " + file.getName());


package com.example.documentmanager.server;

import com.example.documentmanager.shared.servicerpc.DocumentManagerServerRpc;
import com.example.documentmanager.shared.servicerpc.DocumentManagerServerRpcImpl;
import com.vaadin.ui.AbstractComponent;

public class PrincipalViewComponent extends AbstractComponent {

private static final long serialVersionUID = 2867497095079533979L;

DocumentManagerServerRpc rpc = new DocumentManagerServerRpcImpl();

public PrincipalViewComponent() {


package com.example.documentmanager.client;


import com.example.documentmanager.server.PrincipalViewComponent;
import com.example.documentmanager.shared.servicerpc.DocumentManagerServerRpc;
import com.vaadin.client.communication.RpcProxy;
import com.vaadin.client.ui.AbstractComponentConnector;
import com.vaadin.shared.ui.Connect;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;

public class PrincipalViewConnector extends AbstractComponentConnector {

private DocumentManagerServerRpc rpc = RpcProxy.create(DocumentManagerServerRpc.class, this);

public PrincipalViewConnector() {

private void bindEvents() {
    getWidget().getViewInfoButton().addClickListener(new ClickListener() {
        public void buttonClick(ClickEvent event) {
    getWidget().getDocumentList().addValueChangeListener(new ValueChangeListener() {
        public void valueChange(ValueChangeEvent event) {
            rpc.setFileSelectedInSession((File) event.getProperty().getValue());

public PrincipalView getWidget() {
    return (PrincipalView) super.getWidget();

protected Widget createWidget() {
    return GWT.create(PrincipalView.class);



<?xml version="1.0" encoding="UTF-8"?>
 Uncomment the following to compile the widgetset for one browser only.
 Multiple browsers can be specified as a comma separated list. The
 supported user agents at the moment of writing were:
 The value gecko1_8 is used for Firefox and safari is used for webkit
 based browsers including Google Chrome.
<!-- <set-property name="user.agent" value="safari"/> -->

 To enable SuperDevMode, uncomment this line.
 See for more
 information and instructions.
<!-- <set-configuration-property name="devModeRedirectEnabled" value="true" /> -->
[/code]web.xml [code] <?xml version="1.0" encoding="UTF-8"?> DocumentManager Vaadin production mode productionMode false Document Manager com.vaadin.server.VaadinServlet Vaadin UI class to use UI com.example.documentmanager.client.DocUI Legacy mode to return the value of the property as a string from AbstractProperty.toString() legacyPropertyToString false Application widgetset widgetset com.example.documentmanager.client.DocumentManagerWidgetset Document Manager /* index.html index.htm index.jsp default.html default.htm default.jsp [/code]When I execute this i have this: [code] java.lang.ClassNotFoundException: org.apache.catalina.loader.WebappClassLoader.loadClass( org.apache.catalina.loader.WebappClassLoader.loadClass( org.apache.tomee.catalina.LazyStopWebappClassLoader.loadClass( com.example.documentmanager.client.DocUI.init( com.vaadin.ui.UI.doInit( com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI( com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest( com.vaadin.server.SynchronizedRequestHandler.handleRequest( com.vaadin.server.VaadinService.handleRequest( com.vaadin.server.VaadinServlet.service( javax.servlet.http.HttpServlet.service( [/code]And another question: At the wiki i said before there are a lot of comments about compiling and, as i'm using the eclipse plugin, i can not see the option to compile the application. Where is it or How can i compile with eclipse??

Thank you very much with these two questions

You seem have made quite a few mistakes when creating your widget. The main one being that you’re using Server-side vaadin classes in your client-side GWT component. If i look at it at least 90% of the class you’re using in PrincipalView are server side classes and as a result can’t be used in the widget class.
Are you sure you need a client side widget and not e.g. just a composite using CustomComponent? (Information:

Thank your for your answer.
1- Wich ones are the classes form the server side?? and
2- Yes, I had a Vertical Layout but i changed it to a Widget because i couldn’t use it in my Connector (the getWidget method). So, if i change it to a VerticalLayout (or CustomComponent), how can i use it in my Connector??


All of those for example:;;;

You can’t use a VerticalLayout in a connector.
You have to understand that the standard Vaadin components like VerticalLayout, Button, Textfield, CustomComponent, … already consist out of a serverside which is the one you add to layouts (e.g. com.vaadin.ui.Button) a connector (don’t know the name exactly) and a client side (com.vaadin.client.ui.VButton i think).Why exactly do you want/need to use a connector? When you use standard Vaadin components the data is already one the server side…

Thank you Marius for taking your time to help me. I really appreciate it.
All I wan to do is, when i click in some component in my UI (Table, Button, etc.), I want to execute a method in my server-side using AJAX or RPC calls (I guess is the same thing??).
I followed the example of the Wiki
but it is a really simple example with a Label as a Widget (That’s why i create a Widget).
I cannot find an example using a verticalLayout or a CustomComponent.

The thing is that when using Table, Button, … and you add a Listener to them you are already on the server side.
So if you want for example execute a statement to a Database when a button is clicked you can directly do that inside the buttonclick method of the ClickListener without the use of RPC/Ajax.
The standard components already have the RPC or State handling inside them so that you don’t necessarily have to bother with it.
If you actually want/need to use RPC for…i don’t know what reason…you can create a widget but only use gwt classes.
Like using the
Button instead of the com.vaadin.ui.Button.
If you look at the tutorial on the wiki you can see that the label used in there is not a com.vaadin.ui server side Label but instead a GWT client side label.
Does this clear it up a bit?

That’s awsome.
Yes, this clear it up a lot (I guess).
I’m going to try it.
Thank you very much Marius.