eclipse-ee4j / glassfish-fighterfish

FighterFish project
Other
6 stars 11 forks source link

JPA enhancement can cause Java EE deployment failure due to IllegalStateException #40

Open bjetal opened 4 years ago

bjetal commented 4 years ago

When deploying an OSGi bundle with a JPA persistence unit, I noticed the following in the logs:

[2020-01-09T11:42:41.518-0500] [glassfish 5.1] [SEVERE] [] [] [tid: _ThreadID=97 _ThreadName=Thread-10] [timeMillis: 1578588161518] [levelValue: 1000] [[
  java.lang.IllegalArgumentException: Unkown policy
        at org.glassfish.osgijpa.JPAExtender.executeTask(JPAExtender.java:279)
        at org.glassfish.osgijpa.JPAExtender.bundleChanged(JPAExtender.java:201)
        at org.apache.felix.framework.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:915)
        at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:834)
        at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:516)
        at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4579)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2174)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316)
]]

Looking at the code this is the result of a missing break statement in the ASYCHRONOUS switch case in JPAExtender.executeTask.

bshannon commented 4 years ago

Can you submit a PR with the fix?

bjetal commented 4 years ago

Patch is attached. fighterfish-40.patch.txt

bshannon commented 4 years ago

Um, that's great, but are you able to submit it as a Pull Request? Please see the instructions linked at the bottom of this page. (Those are written for the GlassFish repository, but the same general approach applies.)

bjetal commented 4 years ago

Submitted (Pull request 42)