[TR-103] Desktop search cant open files on 64bit Windows Created: 11/Mar/10  Updated: 30/Mar/11  Resolved: 30/Mar/11

Status: Resolved
Project: Terrier Core
Component/s: .applications
Affects Version/s: 1.0.1, 1.0.2, 1.1.0, 1.1.1, 2.0, 2.1, 2.2, 2.2.1, 3.0
Fix Version/s: 3.5

Type: Bug Priority: Major
Reporter: Craig Macdonald Assignee: Richard McCreadie
Resolution: Fixed  
Labels: None

Attachments: File TR-103.v1.patch    

 Description   
Exception in thread "main" java.lang.UnsatisfiedLinkError: ...\terrier\var\winfileopen.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at uk.ac.gla.terrier.applications.desktop.filehandling.WindowsFileOpener.loadLibrary(WindowsFileOpener.java:69)
at uk.ac.gla.terrier.applications.desktop.filehandling.WindowsFileOpener.<clinit>(WindowsFileOpener.java:41)
at it.ir.terrier.app.desktop.NDesktopTerrier.<init>(NDesktopTerrier.java:1176)
at it.ir.terrier.app.desktop.NDesktopTerrier.main(NDesktopTerrier.java:967)


 Comments   
Comment by Craig Macdonald [ 11/Mar/10 ]

Java 6 has a java.awt.Desktop class, which allows access to the underlying OS to open files. See http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html - I'd be inclined to replace the .dll file etc with this in 3.1.

Comment by Craig Macdonald [ 14/Mar/10 ]

After some searching, I found this solution. It has methods for mac/unix/windows. It uses java.awt.Desktop when it can (indeed using reflection, so java6 is not required), but falls back to other methods. On windows, rundll32.exe is used to prevent the need for native code. We need to test on 64bit windows. Is there a rundll64 equivalent? Should we prefer this on 64bit windows, in case rundll32 dissapears in the future.

http://www.davidc.net/programming/java/browsing-urls-and-opening-files

Comment by Craig Macdonald [ 06/May/10 ]

Here is an initial patch. I have tested this on Mac. Needs testing on Windows.

Comment by Craig Macdonald [ 18/Feb/11 ]

Tagging for 3.1

Comment by Richard McCreadie [ 15/Mar/11 ]

INFO - Collection #0 took 110seconds to index (234 documents)

INFO - 1 lexicons to merge
INFO - Optimising structure lexicon
INFO - Started building the block inverted index...
INFO - creating block inverted index
INFO - Iteration 1 of 1 iterations
INFO - Scanning lexicon for 2000000 pointers
INFO - time to process part of lexicon: 0.125
INFO - time to traverse direct file: 0.125
INFO - time to write inverted file: 0.047
INFO - time to perform one iteration: 0.297
INFO - number of pointers processed: 98035
INFO - Finished generating inverted file, rewriting lexicon
INFO - Optimising structure lexicon
INFO - Finished building the block inverted index...
INFO - Time elapsed for inverted file: 2
INFO - Structure meta reading lookup file into memory
ERROR - Couldn't load an index structure called meta
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.terrier.structures.Index.loadIndexStructure(Index.java:414)
at org.terrier.structures.Index.getIndexStructure(Index.java:323)
at org.terrier.structures.Index.loadIndices(Index.java:245)
at org.terrier.structures.Index.<init>(Index.java:184)
at org.terrier.structures.Index.createIndex(Index.java:648)
at org.terrier.structures.Index.createIndex(Index.java:701)
at org.terrier.applications.desktop.DesktopTerrier.loadIndices(DesktopTerrier.java:1175)
at org.terrier.applications.desktop.DesktopTerrier.runIndex(DesktopTerrier.java:1131)
at org.terrier.applications.desktop.DesktopTerrier.access$12(DesktopTerrier.java:1081)
at org.terrier.applications.desktop.DesktopTerrier$8$1.run(DesktopTerrier.java:499)
Caused by: java.io.EOFException
at java.io.DataInputStream.readFully(Unknown Source)
at java.io.DataInputStream.readLong(Unknown Source)
at org.terrier.structures.CompressingMetaIndex.loadIndex(CompressingMetaIndex.java:1015)
at org.terrier.structures.CompressingMetaIndex.<init>(CompressingMetaIndex.java:790)

Comment by Craig Macdonald [ 30/Mar/11 ]

Above was probably viz TR-116. Richard has been retesting.

Comment by Richard McCreadie [ 30/Mar/11 ]

Patch has been tested on both 32 and 64bit windows 7 machines. Desktop search can now correctly open files without error.

Generated at Thu Dec 14 02:34:36 GMT 2017 using JIRA 7.1.1#71004-sha1:d6b2c0d9b7051e9fb5e4eb8ce177ca56d91d7bd8.