You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "Robin van den Bogaard (Jira)" <ji...@apache.org> on 2022/02/11 16:13:00 UTC

[jira] [Closed] (FOP-3052) NoSuchFieldError: RAW_PDF after upgrading to 2.7

     [ https://issues.apache.org/jira/browse/FOP-3052?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robin van den Bogaard closed FOP-3052.
--------------------------------------
    Resolution: Not A Problem

> NoSuchFieldError: RAW_PDF after upgrading to 2.7
> ------------------------------------------------
>
>                 Key: FOP-3052
>                 URL: https://issues.apache.org/jira/browse/FOP-3052
>             Project: FOP
>          Issue Type: Bug
>    Affects Versions: 2.7
>            Reporter: Robin van den Bogaard
>            Priority: Major
>
> After upgrading form 2.6 to 2.7 alot of our tests fail that had to unmarshal a file to byte[].
> {noformat}
>  org.opentest4j.AssertionFailedError: Unexpected exception type thrown ==> expected: <java.lang.IllegalArgumentException> but was: <java.lang.NoSuchFieldError>
>     at org.junit.jupiter.api.AssertThrows.assertThrows(AssertThrows.java:65)
>     at org.junit.jupiter.api.AssertThrows.assertThrows(AssertThrows.java:37)
>     at org.junit.jupiter.api.Assertions.assertThrows(Assertions.java:3082)
>     at nl.topicus.onderwijs.eldkoppelding.logic.EldDossiersSerializerTest.testFromByteArray_geenArgument(EldDossiersSerializerTest.java:42)
>     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>     at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
>     at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
>     at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
>     at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
>     at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
>     at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
>     at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
>     at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
>     at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
>     at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
>     at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
>     at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
>     at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
>     at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
>     at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:214)
>     at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
>     at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:210)
>     at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)
>     at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:66)
>     at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
>     at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
>     at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
>     at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
>     at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
>     at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
>     at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
>     at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
>     at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
>     at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
>     at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
>     at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
>     at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
>     at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
>     at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
>     at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
>     at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
>     at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
>     at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
>     at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
>     at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
>     at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
>     at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
>     at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
>     at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
>     at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
>     at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
>     at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
>     at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
>     at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
>     at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
>     at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
>     at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
>     at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
>     at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
>     at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
>     at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
>     at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
>     at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
>     at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
>     at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71)
>     at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
>     at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
>     at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
>     at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
>     at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
> Caused by: java.lang.NoSuchFieldError: RAW_PDF
>     at org.apache.fop.render.afp.AFPImageHandlerRawStream.<clinit>(AFPImageHandlerRawStream.java:43)
>     at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>     at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>     at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>     at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
>     at org.apache.xmlgraphics.util.Service.providers(Service.java:85)
>     at org.apache.fop.render.ImageHandlerRegistry.discoverHandlers(ImageHandlerRegistry.java:163)
>     at org.apache.fop.render.ImageHandlerRegistry.<init>(ImageHandlerRegistry.java:68)
>     at org.apache.fop.apps.FopFactory.<init>(FopFactory.java:104)
>     at org.apache.fop.apps.FopFactory.newInstance(FopFactory.java:124)
>     at org.apache.fop.apps.FopFactoryBuilder.build(FopFactoryBuilder.java:124)
>     at org.apache.fop.apps.FopFactory$1.run(FopFactory.java:151)
>     at org.apache.fop.apps.FopFactory$1.run(FopFactory.java:149)
>     at java.base/java.security.AccessController.doPrivileged(Native Method)
>     at org.apache.fop.apps.FopFactory.newInstance(FopFactory.java:148)
>     at nl.topicus.onderwijs.eldkoppelding.logic.serialize.EldDossiersSerializer.<clinit>(EldDossiersSerializer.java:66)
>     at nl.topicus.onderwijs.eldkoppelding.logic.EldDossiersSerializerTest.lambda$testFromByteArray_geenArgument$1(EldDossiersSerializerTest.java:43)
>     at org.junit.jupiter.api.AssertThrows.assertThrows(AssertThrows.java:55)
>     ... 72 more{noformat}
>  
> We initialize our context like so:
> {noformat}
> static
> {
>    try
>    {
>       CONTEXT = JAXBContext.newInstance("our.package");
>    }
>    catch (JAXBException e)
>    {
>       throw new RuntimeException(e);
>    }
>    FOPFACTORY = FopFactory.newInstance(new File(".").toURI());
>    TRANSFORMERFACTORY = TransformerFactory.newInstance();
> } {noformat}
>  
> and unmarshal like this:
> {noformat}
> Unmarshaller um = CONTEXT.createUnmarshaller();
> Object object = (um.unmarshal(new ByteArrayInputStream(bytes))); {noformat}
>  
>  
> Reverting to 2.6 solves the problem. We found no way to disable the AFP feature added in 2.7. Do we need to change anything to be able to upgrade to 2.7?



--
This message was sent by Atlassian Jira
(v8.20.1#820001)