Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JRuby 1.7.5 doesn't compile valid class files #1136

Closed
rtyler opened this issue Oct 16, 2013 · 5 comments
Closed

JRuby 1.7.5 doesn't compile valid class files #1136

rtyler opened this issue Oct 16, 2013 · 5 comments
Milestone

Comments

@rtyler
Copy link

@rtyler rtyler commented Oct 16, 2013

I'm hoping this isn't a warbler-based bug, but given the stack trace, I'm assuming it has more to do with the JRuby 1.7.5 compiler.

Under 1.7.4 bundle exec warble jar:clean gemjar compiled runnable jar will create a properly runnable jar file.

Under 1.7.5, a jar-file will be created, but upon running it, the following exception will be raised:

-> % java -jar smb-full.jar -T
Exception in thread "main" java.lang.ClassFormatError: Extra bytes at the end of class file JarMain
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

Looks like this issue might be the underlying reason for the exception.

FWIW, using:

-> % java -version
java version "1.7.0_40"
OpenJDK Runtime Environment (IcedTea 2.4.1) (suse-8.18.1-x86_64)
OpenJDK 64-Bit Server VM (build 24.0-b50, mixed mode)
``
@headius
Copy link
Member

@headius headius commented Oct 21, 2013

Damn, I saw this issue once recently and can't remember what caused it. I'll investigate.

@rtyler
Copy link
Author

@rtyler rtyler commented Oct 21, 2013

If there's anything you need help with in terms of hunting it down, find me on the IRC channel, I'll be around :)

@headius
Copy link
Member

@headius headius commented Oct 22, 2013

If you can provide simple steps to build an app this way (I have not used this feature of warbler in a long time) I can try to reproduce here.

I did find a couple other JRuby issues indicating that conflicts with certain versions of the ASM bytecode library could be to blame.

Also this: jruby/warbler#196

And this one claims to fix the problem in warbler: jruby/warbler#197

@rtyler
Copy link
Author

@rtyler rtyler commented Nov 7, 2013

@headius Unfortunately, besides giving you access to a proprietary codebase, I can't really reproduce this This does occur on 1.7.6 as well as 1.7.5 though

I'll try to run warbler from HEAD to see if it generates a good jar file.

@rtyler
Copy link
Author

@rtyler rtyler commented Nov 13, 2013

As far as I can tell, this has been corrected as of warbler in 1.4.0 which was recently released.

@rtyler rtyler closed this Nov 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.