• Class: java.lang.NullPointerException

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #39126  by bigearl
 
I am trying to set up a automated OCR server, to test the possibility as of expanding it as a Professional version across several sites. On a box running Debian Wheezy I have installed OpenKM 6.3 and Tesseract 3.2, I am trying to import a file however I continue to receive this error "Class: java.lang.NullPointerException"

I have found a post regarding this and tried following along however I am a new user to OpenKM and have trouble understanding the posts.

Thank You
 #39127  by bigearl
 
Logs
Code: Select all
2015-04-20 22:08:00,995 [http-bio-0.0.0.0-8080-exec-9] ERROR com.openkm.servlet.admin.OmrServlet-
java.lang.NullPointerException
        at com.openkm.omr.ImageManipulation.<init>(ImageManipulation.java:66)
        at com.openkm.omr.OMRHelper.trainingTemplate(OMRHelper.java:91)
        at com.openkm.servlet.admin.OmrServlet.doPost(OmrServlet.java:174)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:701)
 #39196  by jllort
 
When you change ocr engine also must change the class related with it, see http://wiki.openkm.com/index.php/Third- ... ation:_OCR

Go to administration -> configuration parameters and there you got a list of registered.text.extractors

If you want to add distinc ocr, tesseract or cuneiform, then must create your own textextractor and do minimal source code modification. The error in the second post seems is caused by OMR, probaly with relation with uncomplete ocr change configuration.
 #39248  by jllort
 
It seems you missed some steps ( firs of all, have you tried to configure the example what comes on wiki ).

The problem is here:
Code: Select all
Gray8Image grayimage = ImageUtil.readImage(template.getCanonicalPath());
ImageManipulation image = new ImageManipulation(grayimage);
It seems that "grayimage" is null. What kind of image are you using ? At least you need 200 dpi as is indicated in documentation.
 #39378  by bigearl
 
If you want to add distinc ocr, tesseract or cuneiform, then must create your own textextractor and do minimal source code modification. The error in the second post seems is caused by OMR, probaly with relation with uncomplete ocr change configuration.
Can you link me to more information on doing this?
Gray8Image grayimage = ImageUtil.readImage(template.getCanonicalPath());
ImageManipulation image = new ImageManipulation(grayimage);
Where are these settings located? What are they currently? and what do they need to be changed to?
 #39379  by bigearl
 
I have verified that Tesseract is installed and I can run it by command line. However I continue to receive the same error.

Application error
Class: java.lang.NullPointerException
Message: null
 #39381  by jllort
 
And you're using the samples ?
Did you changed the text extractor class to get tesseract running http://wiki.openkm.com/index.php/Third- ... ation:_OCR ( Administration -> configuration parameters -> registered.text.extractors ).

Anyway seeing the error, really the error has no relation with OCR engine, cuneiform or tesseract the problem I suspect is with the image you're uploading, the format or resolution, because for some reason you're getting a null here
Code: Select all
Gray8Image grayimage = ImageUtil.readImage(template.getCanonicalPath());
This is into Helper.java class, the best option will be debug the code to understand what happening. Here you got our portable dev environment http://sourceforge.net/projects/openkmportabledev/ my suggestion is try on this direction.
 #39390  by bigearl
 
Thank you for your assistance, I have tried the portable edition with no luck. Like I said I do not know where to locate
Gray8Image grayimage = ImageUtil.readImage(template.getCanonicalPath());
I have ensured that I have completed the installation as directed and configured per the instructions. I have repeated on a second server also. Where I have encountered the same errors.
 #39420  by jllort
 
You should debug and stack trace log is telling you anything you need:
Code: Select all
java.lang.NullPointerException
        at com.openkm.omr.ImageManipulation.<init>(ImageManipulation.java:66)
        at com.openkm.omr.OMRHelper.trainingTemplate(OMRHelper.java:91)
        at com.openkm.servlet.admin.OmrServlet.doPost(OmrServlet.java:174)
From OmrServlet.java:174 jumps to OMRHelper.java:91 and then here you got the ImageManipulation.java:66 ( CTRL+Shift+R to looking for classes by name on eclipse)
 #39422  by bigearl
 
I appreciate all your time with this. However I feel that your directions here would only help someone whom already is very familiar with this software, which I am not. Without context or reference to the code/configurations you continue to make, they will not help me.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.