문제

Iam trying to use the matlabcontrol library in vaadin. I basically want use vaadin as a GUI for better configuration of the variables.

I have a test GUI running, everything works fine, until I try to add matlabcontrol specific variables or calls. I did add the library and the matlab interface works great when testing.

I will show you an abstract example:

public class UI_Matlab extends CustomComponent {

  public UI_Matlab{
    Label matlabRox = new Label("Matlab rocks!");
    setCompositionRoot(matlabRox);
  }
}

This works fine as expected! But when I change it too:

public class UI_Matlab extends CustomComponent {

  public UI_Matlab{
    MatlabProxyFactory factory = new MatlabProxyFactory();
    Label matlabRox = new Label("Matlab rocks!");
    setCompositionRoot(matlabRox);
  }
}

I already get:

"HTTP Status 500 - com.vaadin.server.ServiceException: java.lang.NoClassDefFoundError: matlabcontrol/MatlabProxyFactory"

Additional Information:

  • Vaadin 7.0
  • Tomcat v7.0
  • Eclipse Kepler
  • matlabcontrol 4.1.0 (edited)
도움이 되었습니까?

해결책

The widget is trying to load additional classes it is depending on (MatlabProxyFactory) and cannot find them (NoClassDefFoundError is like a ClassNotFoundException, but one level "deeper", like a field or return type of the class you are loading cannot be found).

--> Check your build path or whether what you are deploying is complete wrt. dependencies.

다른 팁

I found the answere in another post: External project dependency in Vaadin

They describe it a little different, so I will add what I did.

What "hiergiltdiestfu" probably meant worked out well, but I accidently was checking the project classpath. The solution is to add the libraries to the server classpath, which means you have to add it to the tomcat classpath in my case.

Open the following in eclipse:

Run > Run Configurations > Apache Tomcat > (your Tomcat instance) > Classpath

Then add to user entries the library of your need.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top