eclipselink PersistenceUnitLoadingEception in executable JAR

前端 未结 6 1611
别那么骄傲
别那么骄傲 2021-01-13 09:57

I am developing a stand-alone java application which uses eclipselink. It is all fine when I execute the app from eclipse IDE. But I\'ve exported an executable JAR file, and

6条回答
  •  天命终不由人
    2021-01-13 10:34

    I was using EclipseLink 2.3.2, with Eclipse Indigo, and was still getting the error.

    Then, like a fool, I realized that I was choosing "Package required libraries into generated JAR" instead of "Extract required libraries into generated JAR" works.

    Not sure what the difference is, although I've noticed that some of my JARs only work when I create when using "Package required...", and others only work when I create them using "Extract required...".

    Not sure why that is. Ultimately, I don't really care, as long as the resulting JAR has no external dependencies.

    BTW, the other option that was proposed (modifying the JAR's manifest file) didn't work for me. I extracted the manifext (jar xf MYJAR.jar META-INF/MANIFEST.MF), added Eclipse-BundleShape: dir, injected it into the jar (jar umf META-INF/MANIFEST.MF MYJAR.jar), and verified that the manifest changed. Same error.

提交回复
热议问题