last day (16 days later) » 

12:40
0
Q: IllegalStateException: zip file closed

arcyI have a Java desktop application that was running fine in Java 1.8; I'm upgrading to Java 1.11 for a client, and am getting the above error. Full stacktrace: java.lang.ExceptionInInitializerError at net.sourceforge.tess4j.Tesseract.init(Tesseract.java:442) at net.sour...

How are you running it at the command line?
"java -jar DrivingRecordTool.jar" -- it is built as a "Runnable Jar" in eclipse, with necessary dependent jars included.
Ok so it's definitely a fat jar? I wonder how it's finding the native libraries if it has them, which I think it does. Yes I know the exception doesn't talk about unfound libraries but... It would be worth double checking that the dependences are packaged exactly as they were in the java 8 version
I'm not sure how I would do that, and it seems highly unlikely to be a packaging problem. The wrapper is a JNA library, which I assume is calling the DLL I installed. But that's working in eclipse.
From which directory are you running it at the command line?
12:40
The directory containing the jar file.
am here
are you here?
Yes. Did you run the dir command I gave you?
Directory of C:\Users\Ralph\AppData\Local\Temp\tess4j\win32-x86-64

09/22/2022 07:48 AM <DIR> .
09/22/2022 07:48 AM <DIR> ..
06/07/2022 09:33 PM 3,862,016 liblept1780.dll
09/22/2022 07:48 AM 4,057,088 liblept1820.dll
06/07/2022 09:33 PM 2,770,944 libtesseract410.dll
09/22/2022 07:48 AM 3,103,232 libtesseract520.dll
4 File(s) 13,793,280 bytes
2 Dir(s) 812,742,057,984 bytes free
that's what's in the tmp directory
I don't know what that means -- what would be using it? eclipse?
OK. Let's try for the hell of it
java -Djava.library.path="%TMP%\tess4j" -jar DrivingRecordTool.jar
same error
Right. I didn't hold a great deal of hope for that but worth the experiment
12:48
I agree
It doesn't HAVE to be the wrapper that's failing to be opened, but it seems a good bet
Look at the timestamps. Are they consistent with your Eclipse run or your command line run?
I loaded v5 of the Tesseract library a day or two ago; the 'libtesseract520.dll' seems consistent with that.
I've been running eclipse and command line repeatedly for the last couple of days, no good info there
You might delete them or move them out of there to somewhere else. tess4j is meant to put them there. See if it does when you run from the command line
[I wanted to answer my earlier question about how it finds the libraries, so I did ;) ]
what did you find out?
Where it puts the libraries and how
12:52
(should I include the library path in my new attempt?)
No
so it puts them in tmp every time it runs?
Should do yes
ok, puts the v5 libraries in place when I run. Same error. Where did you look that up?
In the tess4j source
12:54
are you a contributor to that, then?
No ;)
You might need one though ;)
well, put a question about this in the tesseract mailing list and didn't get anything at all useflu.
useflu
useful
Got one response from a guy suggesting I use his GUI program
I suppose I could load the source in eclipse and put trace statements in it...
I don't mind finding a contributor as much as the prospect of having to become one.
Hehe
I wonder who the third person in our chat is -- hey, user20047241 -- what's happening in your world?
Well, we've gained one piece of info from your efforts -- Tesseract is copying the libraries to a tmp directory for use at runtime.
so the tess4j library is being found and used, assuming it has the code to do that.
They're making a slim attempt to use logging. They are logging exception at WARN level in slf4j (wrong)
13:00
Well, logging is something I attempted to change recently. I've also tried to back out all my logging changes.
I've NEVER understood log4j and it's attendant add-ons etc.
It would be worth getting slf4j working
I thought I had -- it was logging things from my program, and I had (finally) gotten the xml configuration set so that it quit logging every single font interaction it had (it's somehow set to default to logging debug-level statements
I too am not an slf4j expert, though I do use it with logback. In an ideal world, it would find and use java.util.logging by default
but the
(sorry, hair-trigger return key)
Since it seems to be an error loading a jar file (most likely anyway), I was backing out recent changes that had to do with new jars
So you had logging working running in Eclipse?
13:03
yes
I'm pretty sure it was also working with Java 1.8 from the cmd line
Ah right
after some number of hours of trying this and that, the details from earlier start to fade
afk for a moment...
It might be worth dumping the classpath as the first line of main() and then run it in Eclipse. You might find logging classes in it
(which will be absent when you run it like that at the command line)
That seems a good idea.
ok, the classpath of the cmd line version is just the jar file
that would make sense; it wouldn't know to use anything else
Neither 'classpath' nor 'cp' are defined in that cmd environment
now trying to figure out how to compare the contents of the runnable jar with the items in the eclipse command line
13:32
Yes it's the Eclipse-run classpath that could be of interest
I've just discovered that the refrigerator repairman I thought was coming wants to reschedule to Sunday -- I have to get on the phone and call 8 or 10 more to see if I can get it done today.
I appreciate your help; going to have to postpone doing anything else, possibly for an hour or two.
OK ;)
 
2 hours later…
15:15
hi
15:37
They're using logback. I have another thing that's worth trying. What's the f.q. name of your main class?
 
2 hours later…
18:02
"They" who? Main class is DrivingRecordTool

  last day (16 days later) »