Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pom.xml: Add JAXB dependency #132

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

obgm
Copy link

@obgm obgm commented Jan 26, 2021

Since JDK9, JAXB is deprecated and was entirely removed in JDK11.
This change adds version 2.3.0 (used in JDK9) as an explicit dependency to instruct maven to include it in the generated archive.

Since JDK9, JAXB is deprecated and was entirely removed in JDK11.
This change adds version 2.3.0 (used in JDK9) as an explicit
dependency to instruct maven to include it in the generated archive.
Copy link

@MG-ng MG-ng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solves the error for me too

@fkleedorfer
Copy link

Dear maintainers (@sarahtattersall and @sjdayday ... right?) it would be great if this PR was merged! It is very limited in scope but allows for PIPE to be useful beyond Java 8. Thanks!

@fkleedorfer
Copy link

Wait... this PR is not enough, it only adds the JAXB-API, but no implementation. Saving a petri net in PIPE-gui still fails, complaining about the missing JAXB implementation:

Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Failed to write!
        at pipe.controllers.application.PipeApplicationController.saveAsCurrentPetriNet(PipeApplicationController.java:192)
        at pipe.actions.gui.AbstractSaveAction.saveNet(AbstractSaveAction.java:65)
        at pipe.actions.gui.AbstractSaveAction.saveAsOperation(AbstractSaveAction.java:53)
        at pipe.actions.gui.SaveAction.actionPerformed(SaveAction.java:41)
        at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
        at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
        at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
        at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
        at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:369)
        at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1012)
        at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1056)
        at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
        at java.desktop/java.awt.Component.processMouseEvent(Component.java:6614)
        at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
        at java.desktop/java.awt.Component.processEvent(Component.java:6379)
        at java.desktop/java.awt.Container.processEvent(Container.java:2263)
        at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4990)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4822)
        at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4919)
        at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4548)
        at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4489)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
        at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2769)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4822)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath.
 - with linked exception:
[java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory]
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:278)
        at javax.xml.bind.ContextFinder.find(ContextFinder.java:421)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:721)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:662)
        at uk.ac.imperial.pipe.io.PetriNetIOImpl.<init>(PetriNetIOImpl.java:73)
        at uk.ac.imperial.pipe.io.PetriNetIOImpl.<init>(PetriNetIOImpl.java:90)
        at uk.ac.imperial.pipe.models.manager.PetriNetManagerImpl.savePetriNet(PetriNetManagerImpl.java:112)
        at pipe.controllers.application.PipeApplicationController.saveAsCurrentPetriNet(PipeApplicationController.java:190)
        ... 41 more
Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        at javax.xml.bind.ServiceLoaderUtil.nullSafeLoadClass(ServiceLoaderUtil.java:122)
        at javax.xml.bind.ServiceLoaderUtil.safeLoadClass(ServiceLoaderUtil.java:155)
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:276)

Adding the jaxb implementation dependency fixes this. I'll prepare a PR to that effect.

In order to run on Java 9+, this dependency needs to be stated explicitly. If only the API is added, compiling works, but saving a petri net in PIPE-gui does not. Adding the implementation fixes the latter, too.
@fkleedorfer
Copy link

Should not be merged before obgm#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants