impactcentre / ocrevalUAtion

OCR evaluation brought to you by University of Alicante
Apache License 2.0
66 stars 27 forks source link

Exception raised when comparing two simple text files on Mac OSX #6

Closed nicholasjhenry closed 10 years ago

nicholasjhenry commented 10 years ago

This looks like an awesome tool and would love to get it running, but throws an exception when trying to generate a report. Please let me know if you require any more information or suggest how I can debug this issue. Unfortunately I'm not a Java developer, otherwise I would be digging into this myself.

Platform

Mac OSX 10.9 ocrevalUAtion 1.2.0

$ java -showversion
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

Exception

Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
        at eu.digitisation.io.TextContent.<init>(TextContent.java:88)
        at eu.digitisation.ocr.Report.report(Report.java:42)
        at eu.digitisation.MainGUI.actionPerformed(MainGUI.java:125)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
        at java.awt.Component.processMouseEvent(Component.java:6414)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3275)
        at java.awt.Component.processEvent(Component.java:6179)
        at java.awt.Container.processEvent(Container.java:2084)
        at java.awt.Component.dispatchEventImpl(Component.java:4776)
        at java.awt.Container.dispatchEventImpl(Container.java:2142)
        at java.awt.Component.dispatchEvent(Component.java:4604)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4618)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4279)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4209)
        at java.awt.Container.dispatchEventImpl(Container.java:2128)
        at java.awt.Window.dispatchEventImpl(Window.java:2492)
        at java.awt.Component.dispatchEvent(Component.java:4604)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:717)
        at java.awt.EventQueue.access$400(EventQueue.java:82)
        at java.awt.EventQueue$2.run(EventQueue.java:676)
        at java.awt.EventQueue$2.run(EventQueue.java:674)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:97)
        at java.awt.EventQueue$3.run(EventQueue.java:690)
        at java.awt.EventQueue$3.run(EventQueue.java:688)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:687)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.util.regex.PatternSyntaxException: Unknown character property name {general_category=Zl} near index 33
(\p{Space}|\p{general_category=Zl}|\p{general_category=Zp})+
                                 ^
        at java.util.regex.Pattern.error(Pattern.java:1713)
        at java.util.regex.Pattern.charPropertyNodeFor(Pattern.java:2437)
        at java.util.regex.Pattern.family(Pattern.java:2412)
        at java.util.regex.Pattern.sequence(Pattern.java:1831)
        at java.util.regex.Pattern.expr(Pattern.java:1752)
        at java.util.regex.Pattern.group0(Pattern.java:2530)
        at java.util.regex.Pattern.sequence(Pattern.java:1806)
        at java.util.regex.Pattern.expr(Pattern.java:1752)
        at java.util.regex.Pattern.compile(Pattern.java:1460)
        at java.util.regex.Pattern.<init>(Pattern.java:1133)
        at java.util.regex.Pattern.compile(Pattern.java:823)
        at java.lang.String.replaceAll(String.java:2189)
        at eu.digitisation.io.StringNormalizer.reduceWS(StringNormalizer.java:40)
        at eu.digitisation.io.FileType.<clinit>(FileType.java:53)
        ... 39 more
nicholasjhenry commented 10 years ago

Trying ocrevalUAtion-1.2.0-jar-with-dependencies.jar doesn't start up at all. Throws this exception:

Exception in thread "main" sun.misc.ServiceConfigurationError: javax.imageio.spi.ImageOutputStreamSpi: Provider com.sun.media.imageioimpl.stream.ChannelImageOutputStreamSpi could not be instantiated: java.lang.IllegalArgumentException: vendorName == null!
        at sun.misc.Service.fail(Service.java:120)
        at sun.misc.Service.access$200(Service.java:111)
        at sun.misc.Service$LazyIterator.next(Service.java:284)
        at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(IIORegistry.java:190)
        at javax.imageio.spi.IIORegistry.<init>(IIORegistry.java:121)
        at javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:142)
        at apple.awt.CToolkit.registerDefaultServices(CToolkit.java:1340)
        at apple.awt.CToolkit.<init>(CToolkit.java:148)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:357)
        at java.lang.Class.newInstance(Class.java:310)
        at java.awt.Toolkit$2.run(Toolkit.java:859)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:826)
        at java.awt.Window.getToolkit(Window.java:1177)
        at java.awt.Window.init(Window.java:397)
        at java.awt.Window.<init>(Window.java:433)
        at java.awt.Frame.<init>(Frame.java:403)
        at java.awt.Frame.<init>(Frame.java:368)
        at javax.swing.JFrame.<init>(JFrame.java:158)
        at eu.digitisation.MainGUI.<init>(MainGUI.java:41)
        at eu.digitisation.MainGUI.main(MainGUI.java:135)
Caused by: java.lang.IllegalArgumentException: vendorName == null!
        at javax.imageio.spi.IIOServiceProvider.<init>(IIOServiceProvider.java:59)
        at javax.imageio.spi.ImageOutputStreamSpi.<init>(ImageOutputStreamSpi.java:74)
        at com.sun.media.imageioimpl.stream.ChannelImageOutputStreamSpi.<init>(ChannelImageOutputStreamSpi.java:64)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:357)
        at java.lang.Class.newInstance(Class.java:310)
        at sun.misc.Service$LazyIterator.next(Service.java:282)
        ... 22 more
nicholasjhenry commented 10 years ago

Upgrading to Java 7 (not enabled by default by Apple) resolved the problem.

rccarrasco commented 10 years ago

It seems that Java 6 does not define two Unicode character classes used by the program. We must look for the best option to allow execution under Java 6 without loosing this feature. I open an issue