Problem Integrating CustomComponent

Hello,

I am currently using a CustomComponent in my project, more specifically ContextMenu custom component from http://vaadin.com/directory#addon/69. I added the .java files from the ContextMenu packet to my own project, and then i proceeded to recompile the widgets. The output of the compilation was stored under WebContent/VAADIN/widgetsets.

Then I try to run the project and I get this error:

“Requested resource [VAADIN/widgetsets/com.example.importtool.gwt.Widgetset/com.example.importtool.gwt.Widgetset.nocache.js]
not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.”

The path VAADIN/widgetsets/com.example.importtool.gwt.Widgetset/com.example.importtool.gwt.Widgetset.nocache.js
does indeed exists, but I can’t figure out why the class loader or filesystem can’t find it.

Am I missing something when I compile the widgets?

Or if my post was not clear enough to determine what I am missing, what are the steps required to get a CustomWidget working properly without getting the “requested resource not found” error?

Thanks .

Normally, you should not need to extract anything from add-on JARs but just add the JAR in your project and recompile the widgetset. If you do extract something from the JAR, you should also get its GWT module definition and any other relevant files, and then explicitly select which widgetset to compile (your master widgetset) etc.

Did everything work when not using the add-on and a custom widgetset? If yes, I assume your servlet is correctly serving /VAADIN.

On which server or portal are you running the application?

One common problem is the cache or work directories of Tomcat sometimes not being refreshed correctly from Eclipse. You could try to explicitly clean the work directories (right click on the server in Eclipse) and re-deploy from scratch.

Thanks for the tip Henri.

I decided to add the .jar directly as a dependency to the project.

However, I was still facing the same problems.

In order to fix the issue I had to switch the gwt-maven-plugin to 1.1 instead of the late one which is1.2. It seems that the 1.2 version of gwt-maven-plugin is unstable, if anyone reads this post and stumbles across the same issue I would recommend using other version instead of 1.2.