jasimcse / fsnet

Automatically exported from code.google.com/p/fsnet
0 stars 0 forks source link

Tray desktop jar file does not contain dependencies #239

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. launch trayDesktop application
2. right click on configuration

What is the expected output? What do you see instead?

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: 
com/jgoodies/forms/layout/FormLayout
    at fr.univartois.ili.fsnet.trayDesktop.views.ConfigurationPanel.<init>(ConfigurationPanel.java:41)
    at fr.univartois.ili.fsnet.trayDesktop.views.ConfigurationFrame.<init>(ConfigurationFrame.java:47)
    at fr.univartois.ili.fsnet.trayDesktop.TrayLauncher.showConfigFrame(TrayLauncher.java:41)
    at fr.univartois.ili.fsnet.trayDesktop.views.FSNetTray$1.actionPerformed(FSNetTray.java:75)
    at java.awt.MenuItem.processActionEvent(MenuItem.java:627)
    at java.awt.MenuItem.processEvent(MenuItem.java:586)
    at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:317)
    at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:305)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:602)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.ClassNotFoundException: 
com.jgoodies.forms.layout.FormLayout
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

The reason for that problem is that the required dependency is not bundled with 
the jar file.

Original issue reported on code.google.com by daniel.l...@gmail.com on 13 Feb 2011 at 4:48

GoogleCodeExporter commented 9 years ago
In Eclipse try:
run as > Maven clean
run as > Maven package

Original comment by jonathan...@gmail.com on 16 Feb 2011 at 4:37

GoogleCodeExporter commented 9 years ago
I have the same problem by building trayDesktop out of Eclipse (maven in 
command line).

The deliverables MUST work by building the project out of eclipse simply 
because this procedure is documented in the wiki.

Original comment by mat.boni...@gmail.com on 16 Feb 2011 at 6:09

GoogleCodeExporter commented 9 years ago
I do not understand, i have made those command lines with mvn and the genereted 
jar work.

Original comment by jonathan...@gmail.com on 16 Feb 2011 at 8:57

GoogleCodeExporter commented 9 years ago
I confirm that it works now also for me.
I noted that junit is included in the jar while it shouldn't.
It would be nice to get rid of it before the 0.7 release :)

Original comment by daniel.l...@gmail.com on 17 Feb 2011 at 8:14

GoogleCodeExporter commented 9 years ago
r1679 fixes the issue, thanks.

Original comment by daniel.l...@gmail.com on 17 Feb 2011 at 9:55

GoogleCodeExporter commented 9 years ago
I think we should use the includeScope and excludeScope option of the 
maven-dependency-plugin instead of  explicitely declare the specific artifact 
that we want to exclude.

   <configuration>
      <excludeScope>test</excludeScope>
   </configuration>

see documentation for more details : 
http://maven.apache.org/plugins/maven-dependency-plugin/unpack-dependencies-mojo
.html#includeScope

http://maven.apache.org/plugins/maven-dependency-plugin/unpack-dependencies-mojo
.html#excludeScope

Original comment by mat.boni...@gmail.com on 18 Feb 2011 at 8:40

GoogleCodeExporter commented 9 years ago
I use only <includeScope>compile</includeScope> because an error occure with 
<excludeScope>test</excludeScope>

Original comment by jonathan...@gmail.com on 18 Feb 2011 at 10:53