MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Related Tools (https://www.mobileread.com/forums/forumdisplay.php?f=238)
-   -   [The Older version] Calibre2opds V2 (https://www.mobileread.com/forums/showthread.php?t=64095)

dpierron 01-22-2010 09:36 AM

I made a new release :
  • corrected a bug : when a recent books subcatalog is split by letter, the links to letter subcatalogs are broken
  • modified the HTML pages to make the popup menus work in IE (this time it should work)
  • books with no file attached can be included in the catalog by using the --includeemptybooks option
  • the books ids are now generated by using the uuid included in the Calibre database (they will be really unique now)

Thanks to all the nice guys (and gals) who helped me on this release !

JoelMBenge 01-22-2010 11:23 PM

This is fantastic and I'm looking forward to using this once I root my nook.

But I'm feeling really thickheaded here. Running OSX 10.5.8 and getting:

daxiweida:bin joel$ ./calibre2opds ~/Documents/eBooks/
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java :676)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader .java:260)
at java.net.URLClassLoader.access$100(URLClassLoader. java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 17)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 52)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:375)
daxiweida:bin joel$

Now, I suspect this is just a mismatch in Java versions. But I can't for the life of me figure out what to do next. I'm not a neophyte, but we just has a baby three weeks ago and I think the sleep deprivation is getting to me.

What is the correct Java version we need here and if you can throw me a bone about updating it. Software Updates isn't showing me any missing updates (aside from the more recent security update).

UPDATE:

I did some googlin' and tweaked my JAVA prefs to ensure Java 6 was at the top and verified with terminal. Still no dice.

daxiweida:bin joel$ java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248-9M3125)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode)
daxiweida:bin joel$ ./calibre2opds ~/Documents/eBooks/
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java :676)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader .java:260)
at java.net.URLClassLoader.access$100(URLClassLoader. java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 17)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 52)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:375)
daxiweida:bin joel$

dpierron 01-23-2010 04:46 AM

Hi Joel, and welcome to this thread !

The error you describe is definitively a version number mismatch between the Java VM you run and the one that compiled the class files in calibre2opds distribution archive...

What's weird is that we have the exact same version of Java : 1.6.0_17...

Wait, now that I say it it's not the _exact_ same version, as the patch number differs a bit : mine is b04, yours is b01...

java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248-10M3025)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode)

Maybe that's where the problem comes from ?

Did anybody else encounter this problem ? Did anybody else run calibre2odps 1.0.5 successfully ?

All best,
David.

iandix 01-23-2010 05:39 AM

I have it running well on Fedora 12

JoelMBenge 01-23-2010 03:01 PM

So, I went to ADC and downloaded the Java 10.5 update four. Also, just for kicks, I downloaded calibre2opds 1.0.4. I have a feeling I'm doing something boneheaded here.

daxiweida:bin joel$ java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248-9M3125)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode)
daxiweida:bin joel$ ./calibre2opds ~/Documents/eBooks/
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java :676)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader .java:260)
at java.net.URLClassLoader.access$100(URLClassLoader. java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 17)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 52)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:375)
daxiweida:bin joel$

Sheesh, this is why I got out of IT. ;P

dpierron 01-23-2010 05:27 PM

Joel, there's definitively something weird with your Java environement. Unfortunately, I don't see how I can help you further.
Rest assured that if I have the slightest idea, I'll immediately email you !
Until then, i'm sorry that calibre2opds does not work...

Good luck, and if you have additional info please post it, maybe the situation will evolve...

dpierron 01-23-2010 05:29 PM

Thanks to Ian, I noticed a bad regression bug in calibre2opds version 1.0.5 : the HTML catalogs were missing the download links ; I posted a new release (1.0.6) that corrects this regression.
Please stop using 1.0.5 and install 1.0.6 instead...
Sorry about this !

JoelMBenge 01-23-2010 05:45 PM

No worries. I'll keep fiddling with it. It's got to be something simple I'm just not seeing.

EDIT:

Is there any major difference between your 1.6.0_17-b04-248-10M3025 and my 1.6.0_17-b04-248-9M3125?

dpierron 01-24-2010 07:42 AM

How would I know ? This is the standard Java VM that came with my Snow Leopard install, prolly updated by the automatic update manager...

But it looks like a very minor version number difference...

The only thing I thought about is that the java VM run by the script is not the same as the one that is in your path ; the only way of testing this would be to add an "echo $JAVACMD" line just before the script runs java, at line 92.

I'm following the thread you started on macrumors, btw, so congrats on your newborn baby !

JoelMBenge 01-24-2010 09:32 AM

Thanks. Well, the thread in MacRumors did help. I forced JAVA_VERSION="1.6" and the script seems to have run. So there's something up with what my environment is reporting and what's being called by the script maybe?

Anyhow, I'm now off to get this up on Dropbox and test with my iPhone.

Awesome work, I'm excited.

dpierron 01-29-2010 09:34 AM

Calibre2OPDS 1.0.7
 
Hi folks,

Here's a new release, which corrects some bugs, adds breadcrumb navigation and page numbers in the HTML pages.
And it now runs with Java 1.5 (instead of 1.6) so this will make a lot of people happy ;)

Full change log :
  • updated the code and the prerequisites to make calibre2opds run with Java 1.5
  • added a link to calibre2opds.css in the XML files to help itimpi in his research
  • added the page numbers when paginating, and replaced the "next page" link in the HTML catalogs with a CSS button
  • corrected a bug : if the book folder in Calibre contained a / character, it would be encoded as a %2F in the book URLs, choking some browsers/web servers...
  • added navigation "breadcrumbs" in the HTML catalogs

Enjoy !
David.

dpierron 01-30-2010 11:21 AM

As Ian pointed out, there was a regression bug in 1.0.7 : recent books section were not populated.
I corrected this in 1.0.8, which is available here.

Sorry for the inconvenience !
David.

dpierron 01-30-2010 11:28 AM

Joel, I can see (on MacRumors) that you solved your problem ; anyhow, you'll be happy to hear that, since 1.0.7, calibre2opds runs with Java 1.5 !

itimpi 01-30-2010 01:20 PM

My experiments with stylesheets are looking good - but it appears I need a xsl stylesheet rather than a css one! Any chance of adding a link for one of those at the top (just before the css one) for the next revision

dpierron 01-31-2010 05:23 AM

Well, I'm sorry but it seems that I'm a lousy programmer...
Itimpi pointed out yet another regression bug in 1.0.8 : paths were again encoded with %2F instead of '/'
I don't know how my correction for this problem got reverted, but I had to make a new release (1.0.9).

Sorry for the inconvenience !
David.


All times are GMT -4. The time now is 07:32 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.