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

Andreas Lehmkühler reassigned PDFBOX-5677:
------------------------------------------

    Assignee: Andreas Lehmkühler

> FileSystemFontProvider::scanFonts fail because OpenTypeFont::getCFF returns 
> null unexpectedly
> ---------------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-5677
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5677
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.29, 3.0.0 PDFBox
>         Environment: Server version name:   Apache Tomcat/9.0.80
> OS Name:               Linux
> OS Version:            6.5.0-1-MANJARO
> Architecture:          amd64
> Java Home:             /usr/lib/jvm/zulu-17
> JVM Version:           17.0.8+7-LTS
> JVM Vendor:            Azul Systems, Inc.
>            Reporter: Tamas Rasztik
>            Assignee: Andreas Lehmkühler
>            Priority: Major
>         Attachments: 2023-09-08_error.png
>
>
> Under Linux there could be fonts (e.g Cantarell-VF.otf) where 
> OpenTypeFont::isPostScropt returns true, however OpenTypeFont::getCFF returns 
> null therefore a NullPointerException is thrown and FileSystemFontProvider 
> initialisation fails.
> These fonts could be ignored by the FileSystemProvider.
> {code:java}
> 08-Sep-2023 10:10:09.633 SEVERE [RMI TCP Connection(2)-127.0.0.1] 
> org.apache.catalina.core.StandardContext.listenerStart Exception sending 
> context initialized event to listener instance of class 
> [org.springframework.web.context.ContextLoaderListener]
>     org.springframework.beans.factory.BeanCreationException: Error creating 
> bean with name 'smartformAction' defined in BeanDefinition defined in 
> ServletContext resource [/WEB-INF/classes/applicationContext_Default.xml]: 
> Initialization of bean failed; nested exception is 
> org.springframework.aop.framework.AopConfigException: Unexpected AOP 
> exception; nested exception is java.lang.IllegalStateException: Unable to 
> load cache item
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:628)
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
>         at 
> org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
>         at 
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
>         at 
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
>         at 
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
>         at 
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:936)
>         at 
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:921)
>         at 
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
>         at 
> org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:399)
>         at 
> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:278)
>         at 
> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
>         at 
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4462)
>         at 
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4914)
>         at 
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
>         at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:683)
>         at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:658)
>         at 
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:662)
>         at 
> org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1782)
>         at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
>         at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.base/java.lang.reflect.Method.invoke(Method.java:568)
>         at 
> org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:294)
>         at 
> java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:814)
>         at 
> java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:802)
>         at 
> org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:460)
>         at 
> org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:408)
>         at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
>         at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.base/java.lang.reflect.Method.invoke(Method.java:568)
>         at 
> org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:294)
>         at 
> java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:814)
>         at 
> java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:802)
>         at 
> java.management/com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:472)
>         at 
> java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1472)
>         at 
> java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1310)
>         at 
> java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
>         at 
> java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1412)
>         at 
> java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
>         at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
>         at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.base/java.lang.reflect.Method.invoke(Method.java:568)
>         at 
> java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:360)
>         at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
>         at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
>         at 
> java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
>         at 
> java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
>         at 
> java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
>         at 
> java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
>         at 
> java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
>         at 
> java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
>         at 
> java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
>         at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
>         at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
>         at java.base/java.lang.Thread.run(Thread.java:833)
>     Caused by: org.springframework.aop.framework.AopConfigException: 
> Unexpected AOP exception; nested exception is 
> java.lang.IllegalStateException: Unable to load cache item
>         at 
> org.springframework.aop.framework.CglibAopProxy.getProxy(CglibAopProxy.java:215)
>         at 
> org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110)
>         at 
> org.springframework.aop.scope.ScopedProxyFactoryBean.setBeanFactory(ScopedProxyFactoryBean.java:117)
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1826)
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1791)
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
>         ... 57 more
>     Caused by: java.lang.IllegalStateException: Unable to load cache item
>         at 
> org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:79)
>         at 
> org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34)
>         at 
> org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:134)
>         at 
> org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:319)
>         at 
> org.springframework.cglib.proxy.Enhancer.createHelper(Enhancer.java:572)
>         at 
> org.springframework.cglib.proxy.Enhancer.createClass(Enhancer.java:419)
>         at 
> org.springframework.aop.framework.ObjenesisCglibAopProxy.createProxyClassAndInstance(ObjenesisCglibAopProxy.java:57)
>         at 
> org.springframework.aop.framework.CglibAopProxy.getProxy(CglibAopProxy.java:206)
>         ... 62 more
>     Caused by: java.lang.ExceptionInInitializerError
>         at 
> org.apache.pdfbox.pdmodel.font.FontMapperImpl.getProvider(FontMapperImpl.java:158)
>         at 
> org.apache.pdfbox.pdmodel.font.FontMapperImpl.findFont(FontMapperImpl.java:416)
>         at 
> org.apache.pdfbox.pdmodel.font.FontMapperImpl.findFontBoxFont(FontMapperImpl.java:379)
>         at 
> org.apache.pdfbox.pdmodel.font.FontMapperImpl.getFontBoxFont(FontMapperImpl.java:353)
>         at 
> org.apache.pdfbox.pdmodel.font.PDType1Font.<init>(PDType1Font.java:127)
>         at 
> com.hubwoo.focs.app.action.SmartformAction.<clinit>(SmartformAction.java:40)
>         at java.base/java.lang.Class.forName0(Native Method)
>         at java.base/java.lang.Class.forName(Class.java:467)
>         at 
> org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:604)
>         at 
> org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:363)
>         at 
> org.springframework.cglib.proxy.Enhancer.generate(Enhancer.java:585)
>         at 
> org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:110)
>         at 
> org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:108)
>         at 
> org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54)
>         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>         at 
> org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61)
>         ... 69 more
>     Caused by: java.lang.NullPointerException: Cannot invoke 
> "org.apache.fontbox.ttf.CFFTable.getFont()" because the return value of 
> "org.apache.fontbox.ttf.OpenTypeFont.getCFF()" is null
>         at 
> org.apache.pdfbox.pdmodel.font.FileSystemFontProvider.addTrueTypeFontImpl(FileSystemFontProvider.java:693)
>         at 
> org.apache.pdfbox.pdmodel.font.FileSystemFontProvider.addTrueTypeFont(FileSystemFontProvider.java:635)
>         at 
> org.apache.pdfbox.pdmodel.font.FileSystemFontProvider.scanFonts(FileSystemFontProvider.java:379)
>         at 
> org.apache.pdfbox.pdmodel.font.FileSystemFontProvider.<init>(FileSystemFontProvider.java:354)
>         at 
> org.apache.pdfbox.pdmodel.font.FontMapperImpl$DefaultFontProvider.<clinit>(FontMapperImpl.java:139)
>         ... 85 more
>  {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to