Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getTimeStamp() not found in runnable jar, but is found otherwise

I've have trouble deploying an application that runs fine within eclipse, but generates the following error when creating a runnable jar (using the option: extract required libraries into generated JAR):

org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NoSuchMethodError: org.apache.log4j.spi.LoggingEvent.getTimeStamp()J)
        at org.eclipse.swt.SWT.error(Unknown Source)
        at org.eclipse.swt.SWT.error(Unknown Source)
        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Unknown Source)
        at org.eclipse.swt.widgets.Display.runAsyncMessages(Unknown Source)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)

I'm using log4j-1.2.16.jar and it's included in the generated jar.

I'm not sure where to troubleshoot, I've tried to find other (older) instances of org.apache.log4j.spi.LoggingEvent in other jars that are included, but so far I did not find any.

like image 724
Roalt Avatar asked Feb 24 '23 05:02

Roalt


1 Answers

It says, that there is not method org.apache.log4j.spi.LoggingEvent.getTimeStamp() Find again your classes, that are on class path and you should find class org.apache.log4j.spi.LoggingEvent twice. One with method one without method.

like image 61
bugs_ Avatar answered Feb 26 '23 20:02

bugs_