Widgetset Not Found (inside JAR)

I am using Maven, not sure if that is significant or not, with Eclipse and Tomcat. I’ve compiled my widgesets into a jar and included that jar in my WEB-INF/lib folder. This is working fine in one project (an older version of my current one), but when I restructured things a bit and did the exact same thing in another project it has stopped working. I have tried comparing my two projects, but I can’t determine what is different about them that would cause this problem in the one but not in the other. I am getting the following error in my logs…

Aug 17, 2012 8:40:11 AM com.vaadin.terminal.gwt.server.AbstractApplicationServlet serveStaticResourcesInVAADIN
INFO: Requested resource [VAADIN/widgetsets/com.mycompany.mygui.custom.widgetset.MyVaadinGuiWidgetset/com.mycompany.mygui.custom.widgetset.MyVaadinGuiWidgetset.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.

Then I get an alert box pop-up in my browser with the following message:
Failed to load the widgetset:
/Project_MyCustomGUIClient_War/VAADIN/widgetsets/com.mycompany.mygui.custom.widgetset.MyVaadinGuiWidgetset/com.mycompany.mygui.custom.widgetset.MyVaadinGuiWidgetset.nocache.js?1345210811533

I actually remember seeing this problem happen before in my original project too, but somehow I ended up getting it to work consistently. Now I can’t remember what it was I did to correct it though.

I have no VAADIN folder directly in my war, but I have a lib folder with a jar that has a VAADIN folder and then the widgetsets stuff under that. As I said, it is working fine like this in one project but not another. I took the original project and restructured some things, and now this part isn’t working anymore. Any ideas what may be different in my project that’s not working now?

Shouldn’t jars in my lib folder always be in my classpath? I don’t understand why I am getting the message saying the nocache.js file is not found since it is in that exact path listed inside my Jar file. Also, I’m not sure how to go about debugging or investigating this further? Any thoughts on what I might try?

Thanks,
Will

I still need help on this, but I have discovered something interesting. The resources available inside other jar files in my lib directory can be accessed without any problem from the browser URL line, but resources inside the widgetset jar cannot be.

For example here are some test results… (All these jars are inside my WEB-INF/lib folder.)
http://localhost:8080/AbC_MyAppCustomGUIClient_War/VAADIN/widgetsets/com.mycompany.abcgui.custom.widgetset.AbcVaadinGuiWidgetset/0A9476898799A150D840F0B1C3672921.cache.png


VAADIN\widgetsets\com.mycompany.abcgui.custom.widgetset.AbcVaadinGuiWidgetset\0A9476898799A150D840F0B1C3672921.cache.png


This one didn’t work. [this is inside widgetsets jar]

http://localhost:8080/AbC_MyAppCustomGUIClient_War/VAADIN/themes/mycompany_blue/help/mylogo.png
This one worked! [this is inside themes jar]

http://localhost:8080/AbC_MyAppCustomGUIClient_War/VAADIN/widgetsets/com.mycompany.abcgui.custom.widgetset.AbcVaadinGuiWidgetset/ie6pngfix/blank.gif
This one didn’t work. [this is inside widgetsets jar]

http://localhost:8080/AbC_MyAppCustomGUIClient_War/VAADIN/themes/runo/icons/32/arrow-down.png
This one worked. [this is inside vaadin-6.7.4.jar]

[Log message]

Aug 17, 2012 8:40:11 AM com.vaadin.terminal.gwt.server.AbstractApplicationServlet serveStaticResourcesInVAADIN
INFO: Requested resource [VAADIN/widgetsets/com.mycompany.abcgui.custom.widgetset.AbcVaadinGuiWidgetset/com.mycompany.abcgui.custom.widgetset.AbcVaadinGuiWidgetset.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.

[Pop-up alert message]

Failed to load the widgetset:
/XyZ_MyAppCustomGUIClient_War/VAADIN/widgetsets/com.mycompany.xyzgui.custom.widgetset.XyzVaadinGuiWidgetset/com.mycompany.xyzgui.custom.widgetset.XyzVaadinGuiWidgetset.nocache.js?1345210811533

What could keep a jar file from being loaded in the war’s lib directory?

Could it be that a jar takes a long time to load
( since it is 8.7 MB )
and times out before the resource can be found? Just speculating / brain-storming here. Thanks for any tips or ideas.

(Unfortunately, now when I went back to my original project it has started doing this too! I have no idea why. I didn’t change anything in it.) It makes me think this could be a Tomcat or browser caching thing, perhaps? Any ideas or thoughts are welcome.

Okay, so I did a maven clean on the widgetset jar and on the war that references it as a dependency in my original project. Then I rebuilt the widgetset with maven and after that the war. Then I deployed my war to Tomcat again. This time it worked!

After this I switched back to my newer project. I cleaned Tomcat, maven cleaned the widgetset and the war that uses it. Then I built the widgetset over again with maven and then the war. After this I deployed the war to Tomcat and it worked in the new project too.

So, apparently something wasn’t building correctly in the widgetset jar? I still don’t know exactly what the cause of this was, unless for some reason sometimes the widgetset builds don’t work correctly and in that case you need to just rebuild them again. For some reason the whole jar seemed to not be loaded before, even though it was on the classpath. So, again, I don’t know exactly what happened, but it seems I know how to correct it now. I hope this post is of use to someone in the future.