Menu

#651 org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct

Bug
open
nobody
None
1
2019-07-24
2019-07-19
No

Hello,

I have been using Magic Assistant for the last couple of years and recently moved over to a new Mac but I can't get it to run. I'm hitting this. I do run Eclipse too for dev work and have the latest version installed. Does Magic Assistant depend on an old version of Eclipse or something?

Thanks,
Ben

!ENTRY org.eclipse.osgi 4 0 2019-07-19 15:26:50.766
!MESSAGE Application error
!STACK 1
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:386)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:294)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultHeadlessContext(E4Application.java:490)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultContext(E4Application.java:504)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:203)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:632)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at com.reflexit.magiccards_rcp.MAApplication.start(MAApplication.java:105)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:151)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:375)
... 22 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.6.1.v20160712-0927
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:410)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)

Discussion

  • Ben Titmarsh

    Ben Titmarsh - 2019-07-24

    Please could I get some advice on this? Struggling to find a fix.

     
  • Alena Laskavaia

    Alena Laskavaia - 2019-07-24

    This is not eclipse its java. Its not compatible with java you have.
    You can install recommended java (and you can keep directly in MA folder so it does not interfere with rest). It needs java 1.8

     
  • Ben Titmarsh

    Ben Titmarsh - 2019-07-24

    I have Java 7, 8 and 11 all installed already. How do I point Magic Assistant to my Java 8 installation?

     
  • Alena Laskavaia

    Alena Laskavaia - 2019-07-24

    I don't know on what platform you are, but should be magicassistan.ini file which can be used to change where it is taking java. Can you search other forum posts or bugs? I think I posted this already somewhere..

     
  • Alena Laskavaia

    Alena Laskavaia - 2019-07-24

    Something like this in magicassistant.ini

    -vm
    features/com.qnx.tools.jre.win32.x86_64_1.8.192/jdk8u192-b12-jre/bin

    2 lines
    replace second one to path to actual java bin

     

    Last edit: Alena Laskavaia 2019-07-24
  • Alena Laskavaia

    Alena Laskavaia - 2019-07-24

    You can also copy whole jre (java distribution) into root of MA installation, it has to be
    called "jre" exactly. And inside should be "bin" folder with java (well whole thing needs to be copied)

     
  • Ben Titmarsh

    Ben Titmarsh - 2019-07-24

    Thanks for your assistance. I am on MacOS. Here is the contents of my magicassistant.ini. I can't see anything like the line you are talking about, just a couple of Eclipse thing then some standard vmargs. Is it the launcher library which needs to change?

    -startup
    ../Eclipse/plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar
    --launcher.library
    ../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.401.v20161122-1740
    -vmargs
    -Dfile.encoding=utf-8
    -Dorg.eclipse.ecf.provider.filetransfer.httpclient.retrieve.connectTimeout=120000
    -Dorg.eclipse.ecf.provider.filetransfer.httpclient.retrieve.readTimeout=120000
    -Dsun.net.client.defaultReadTimeout=60000
    -Dorg.eclipse.ecf.provider.filetransfer.retrieve.readTimeout=30000
    -Dorg.eclipse.ecf.provider.filetransfer.retrieve.retryAttempts=3
    -Dorg.eclipse.ecf.provider.filetransfer.retrieve.closeTimeout=15000
    -XstartOnFirstThread
    -Dorg.eclipse.swt.internal.carbon.smallFonts

    As for the second approach. I've got the jre folder that you refer to for Java 8. I "Show the Package Contents" of the app and see the following structure

    Contents/Home
    Contents/Eclipse
    Contents/Info.plist

    I have put the jre folder in the root (same level as Contents, the Contents folder itself and both the Eclipse and MacOS folders) but it doesn't make a difference in any case.

    For complete clarity I get the error after the app loads up and I choose my workspace.

    Thanks for your continued support!

     
  • Alena Laskavaia

    Alena Laskavaia - 2019-07-24

    Sorry mac is very diffrent so not sure where jre folder suppose to be,
    but for .ini add -vm lines before -vmargs

    i.e.
    -vm
    /path/to/java/bin
    -vmargs
    ...

     
  • Ben Titmarsh

    Ben Titmarsh - 2019-07-24

    That worked! Thank you

     

Anonymous
Anonymous

Add attachments
Cancel