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

Exception in "publish" and "reserveDoi" with ipt 2.5.2 on tomcat 9 and java 11 #1691

Closed
vjrj opened this issue Dec 2, 2021 · 2 comments
Closed
Assignees
Milestone

Comments

@vjrj
Copy link
Contributor

vjrj commented Dec 2, 2021

Following these java 11 issues #1687 we are having problems after upgrading the ipt from 2.5.0 to 2.5.2, in an ubuntu 20.04 running tomcat 9 and java 11.

During publish:

ERROR 02-Dec-2021 08:15:53 [org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler] - Exception occurred during processing request: Method "publish" failed for object org.gbif.ipt.action.manage.OverviewAction@4c87c9ef
ognl.MethodFailedException: Method "publish" failed for object org.gbif.ipt.action.manage.OverviewAction@4c87c9ef
(...)
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
        at org.gbif.doi.service.datacite.RestJsonApiDataCiteService.update(RestJsonApiDataCiteService.java:299) ~[gbif-doi-2.16.jar:2.16]

and with reserveDoi:

ERROR 02-Dec-2021 08:51:33 [org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler] - Exception occurred during processing request: Method "reserveDoi" failed for object org.gbif.ipt.action.manage.OverviewAction@4add0425
ognl.MethodFailedException: Method "reserveDoi" failed for object org.gbif.ipt.action.manage.OverviewAction@4add0425
(...)
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
        at org.gbif.doi.service.datacite.RestJsonApiDataCiteService.reserve(RestJsonApiDataCiteService.java:177) ~[gbif-doi-2.16.jar:2.16]

We were using tomcat 9, and java 11, and ipt 2.5.0 without these issues.

I'll try some of the workarounds described here:
https://stackoverflow.com/a/43574427/642847

@vjrj vjrj changed the title Exception in "publish" and "reserveDoi" with ipt 2.5.2 on tomcat 9 Exception in "publish" and "reserveDoi" with ipt 2.5.2 on tomcat 9 and java 11 Dec 2, 2021
@vjrj
Copy link
Contributor Author

vjrj commented Dec 2, 2021

This patch solved the issue for us (let's see if we didn't introduce any other issue):

diff --git a/pom.xml b/pom.xml
index 5b6488e86..e2683ca17 100644
--- a/pom.xml
+++ b/pom.xml
@@ -65,6 +65,8 @@
     <itext.version>2.1.7</itext.version>
     <javassist.version>3.12.1.GA</javassist.version>
     <javax.mail.version>1.4.7</javax.mail.version>
+    <jaxb-api.version>2.3.1</jaxb-api.version>
+    <jaxb-runtime.version>2.3.1</jaxb-runtime.version>
     <jersey.version>1.19.4</jersey.version>
     <jetty-maven-plugin.version>9.4.7.v20170914</jetty-maven-plugin.version>
     <jsp-api.version>2.0</jsp-api.version>
@@ -653,6 +655,20 @@
       <artifactId>owasp-java-html-sanitizer</artifactId>
       <version>${owasp-java-html-sanitizer.version}</version>
     </dependency>
+
+    <!-- API,java.xml.bind module (needed for java 11 and jaxb) -->
+    <dependency>
+      <groupId>javax.xml.bind</groupId>
+      <artifactId>jaxb-api</artifactId>
+      <version>${jaxb-api.version}</version>
+    </dependency>
+
+    <!-- Runtime, com.sun.xml.bind module (needed for java 11) -->
+    <dependency>
+      <groupId>org.glassfish.jaxb</groupId>
+      <artifactId>jaxb-runtime</artifactId>
+      <version>${jaxb-runtime.version}</version>
+    </dependency>
   </dependencies>
 
   <profiles>

@mike-podolskiy90 mike-podolskiy90 self-assigned this Dec 22, 2021
mike-podolskiy90 added a commit that referenced this issue Dec 22, 2021
@mike-podolskiy90
Copy link
Contributor

Thank you @vjrj for this, I added those dependencies

@mike-podolskiy90 mike-podolskiy90 added this to the 2.5.6 milestone Dec 22, 2021
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

No branches or pull requests

2 participants