Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Maven generated jar does not instantiate Display
Maven generated jar does not instantiate Display [message #893136] Mon, 02 July 2012 20:07
Eclipse User
Hello SWT-Pros ;-)

I have developed a Java-Desktop-Program in which I used eclipse swt. In
the development phase (mostly) everything was fine when I run it via
eclipse.
But now, as I want to pack it into a jar, I encounter a very strange
behaviour.

For the jar packaging I'm using maven (the maven-assembly-plugin) as
follows:
------------- START part from pom.xml -------------
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution></execution>
</executions>
<configuration>
<archive>
<manifest>

<mainClass>de.kannewischer.csi.view.MainApplication</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>

</plugins>
</build>

....

<dependencies>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>swt</artifactId>
<version>3.7-win32-win32-x86_64</version>
</dependency>
....


------------- END part from pom.xml -------------

When I run mvn assembly:assembly and try to run the generated jar
nothing happens, while the main screen should be displayed.

Even if I try to log an exception nothing is written to the logfile.
I tried to do this in the following way:

protected void openMyself()
{
Logging.LOGGER.entering(this.getClass().getName(),
"openMyself");
Logging.LOGGER.info("trying to create display");
try
{
// HERE IT (obviously) FAILS !
display = new Display();
Logging.LOGGER.info("trying to open window");
Shell shell = open(display);
while (!shell.isDisposed())
{
if (!display.readAndDispatch())
{
display.sleep();
}
}
display.dispose();
} catch (Exception e)
{
Logging.LOGGER.throwing(this.getClass().getName(),
"openMyself", e);
}

Logging.LOGGER.exiting(this.getClass().getName(), "openMyself");
}


The last lines written to the logfile are:

02.07.2012 21:42:13 de.kannewischer.csi.view.MainSupplierView openMyself
FEINER: ENTRY
02.07.2012 21:42:13 de.kannewischer.csi.view.MainSupplierView openMyself
INFO: trying to create display

So obviously something is wrong with the instantiation of Display. But
why is no exception written to the logfile?
Did may be someone of you have a similar problem?

I'm developing on Eclipse Helios (3.6.2) on an Windows 7 64 Bit System.
As you can see in the maven snipplet swt 3.7 is used.

I find it very difficult to get an approach for the problem analysis as
no exception is thrown. What could be the problem here?

Are there other ways to bundle the jar (if the problem is somewhere there)?

I would be very happy if somebody had an idea how to solve it or where
to continue searching for a solution.

Thanks and regards

Tim
Previous Topic:SWT Cocoa - How to disable glowing buttons?
Next Topic:autocomplete in ComboViewer
Goto Forum:
  


Current Time: Sun Oct 26 04:47:05 GMT 2014

Powered by FUDForum. Page generated in 0.01902 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software