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

Export fails with NoClassDefFoundError: org/apache/fop/apps/FopFactory #3

Open
vera opened this issue Aug 13, 2024 · 3 comments
Open

Comments

@vera
Copy link

vera commented Aug 13, 2024

When I try to reexport a dataset's metadata after installing the ddipdf exporter jar, the export is not created and I get the following error in the Dataverse log:

dev_dataverse> [#|2024-08-13T10:13:32.165+0000|INFO|Payara 6.2024.6|edu.harvard.iq.dataverse.DatasetServiceBean|_ThreadID=269;_ThreadName=__ejb-thread-pool1;_TimeMillis=1723544012165;_LevelValue=800;|
dev_dataverse>   Error exporting dataset: ...; org/apache/fop/apps/FopFactory
dev_dataverse> jakarta.ejb.EJBException: org/apache/fop/apps/FopFactory
dev_dataverse> 	at com.sun.ejb.containers.EJBContainerTransactionManager.processSystemException(EJBContainerTransactionManager.java:723)
dev_dataverse> 	at com.sun.ejb.containers.EJBContainerTransactionManager.completeNewTx(EJBContainerTransactionManager.java:652)
dev_dataverse> 	at com.sun.ejb.containers.EJBContainerTransactionManager.postInvokeTx(EJBContainerTransactionManager.java:492)
dev_dataverse> 	at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4601)
dev_dataverse> 	at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2134)
dev_dataverse> 	at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2104)
dev_dataverse> 	at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:220)
dev_dataverse> 	at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:90)
dev_dataverse> 	at jdk.proxy73/jdk.proxy73.$Proxy417.exportAllFormatsInNewTransaction(Unknown Source)
dev_dataverse> 	at edu.harvard.iq.dataverse.harvest.server.__EJB31_Generated__OAIRecordServiceBean__Intf____Bean__.exportAllFormatsInNewTransaction(Unknown Source)
dev_dataverse> 	at edu.harvard.iq.dataverse.DatasetServiceBean.exportDataset(DatasetServiceBean.java:785)
dev_dataverse> 	at edu.harvard.iq.dataverse.DatasetServiceBean.reExportDatasetAsync(DatasetServiceBean.java:770)
...
dev_dataverse> Caused by: java.lang.NoClassDefFoundError: org/apache/fop/apps/FopFactory
dev_dataverse> 	at io.gdcc.export.ddipdf.DdiPdfExportUtil.datasetPdfDDI(DdiPdfExportUtil.java:34)

Dataverse is running in Docker (mvn -Pct clean package docker:run). Not sure if I made a mistake installing the jar. Thanks in advance for your assistance

@qqmyers
Copy link
Member

qqmyers commented Aug 13, 2024

FWIW: Looks like somewhere in the pom file changes we lost including the dependency on fop in the final jar.

@pdurbin
Copy link
Member

pdurbin commented Aug 23, 2024

I'm getting a different error:

dev_dataverse> [#|2024-08-23T18:41:58.868+0000|INFO|Payara 6.2024.6|io.gdcc.export.ddipdf.FileResolver|_ThreadID=128;_ThreadName=http-thread-pool::http-listener-1(5);_TimeMillis=1724438518868;_LevelValue=800;|
dev_dataverse>   In File Resolver: file:/io/gdcc/spi/export/ddipdf/i18n.inc.xsl null|#]
dev_dataverse> 
dev_dataverse> [#|2024-08-23T18:41:58.894+0000|SEVERE|Payara 6.2024.6|io.gdcc.export.ddipdf.DdiPdfExportUtil|_ThreadID=128;_ThreadName=http-thread-pool::http-listener-1(5);_TimeMillis=1724438518894;_LevelValue=1000;|
dev_dataverse>   Cannot invoke "String.length()" because "<parameter2>" is null|#]

In Firefox, it looks like an empty PDF is created? I'm not sure:

Screenshot 2024-08-23 at 2 42 27 PM

I had to build the JAR myself. It would be nice to have a link to a released JAR like we do for other exporters instead of "TBD": https://github.com/gdcc/dataverse-exporters#list-of-known-exporters

@qqmyers qqmyers mentioned this issue Oct 24, 2024
@qqmyers
Copy link
Member

qqmyers commented Oct 24, 2024

FWIW: If I build using
mvn assembly:assembly -DdescriptorId=jar-with-dependencies,
I get a ./target/ddi-pdf-1.1.0-SNAPSHOT-jar-with-dependencies.jar file (building from PR #4)
Just doing a mvn deploy only created a ddi-pdf-1.1.0-SNAPSHOT.jar w/o the classes from the dependencies.

So - I guess a 'fix' for this would be to document the build process in the README

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

3 participants