Bug 457336
Summary: | Trying to invoke rhino yields traceback | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Toshio Ernie Kuratomi <a.badger> | ||||||||||
Component: | rhino | Assignee: | Lillian Angel <langel> | ||||||||||
Status: | CLOSED NEXTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||||
Severity: | low | Docs Contact: | |||||||||||
Priority: | low | ||||||||||||
Version: | 11 | CC: | lmacken, selliott4 | ||||||||||
Target Milestone: | --- | ||||||||||||
Target Release: | --- | ||||||||||||
Hardware: | All | ||||||||||||
OS: | Linux | ||||||||||||
Whiteboard: | |||||||||||||
Fixed In Version: | 1.7-0.6.r2.fc11 | Doc Type: | Bug Fix | ||||||||||
Doc Text: | Story Points: | --- | |||||||||||
Clone Of: | Environment: | ||||||||||||
Last Closed: | 2009-06-16 02:00:26 UTC | Type: | --- | ||||||||||
Regression: | --- | Mount Type: | --- | ||||||||||
Documentation: | --- | CRM: | |||||||||||
Verified Versions: | Category: | --- | |||||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||||
Embargoed: | |||||||||||||
Attachments: |
|
Description
Toshio Ernie Kuratomi
2008-07-31 00:09:28 UTC
The current version of rhino we have is old and parts of it had to be removed due to copyright issues. The only real solution to this will probably be to update to the lastest version of rhino. Okay. Any plans to do that? Unless there's another way to get it to interpret a javascript file it seems as though the current version is somewhat useless. The current version in there is not so much for using it as a tool but as a dependency for other projects (who use the class files directly). I have the newer version building in an rpm but it needs some work to patch out a few things (like automatic dependency downloading during build). Have we tried to contact upstream to resolve license issues with the new rhino? If not I'd volunteer to try to explain the problem. the new rhino doesn't have the licensing issues, its the older version that we have in fedora that had the issues (and hence why the current version in fedora is a little messed up). Any update on getting the the new rhino tested? I actually have a second package that needs rhino-1.7 to build so I'm now doubly interested in seeing this :-) rhino 1.7 is now in the repository, can we undisable these portions? Hi langel, thanks for updating rhino! I owe you next fudcon. I think there's two related issues going on here. Unfortunately, I know nothing about java so I'm only going to be able to offer a little bit of help here. 1) The treetable code that was under a bad license in 1.6 is now included in the 1.7 tarball under a BSD-like license but the build.xml in the debugger directory is not picking it up. I'll attach a patch to the spec file that illustrates this problem and a hacky way to fix it. I don't know ant but I know that someone who does could fix this more appropriately. With this fix to the build, I'm now able to use rhino to build dojo's shrinksafe, 1.3.0rc1. Yay! This fixes the more serious half of my problems. 2) The original issue reported here is that rhino cannot be invoked as a shell. Even with the build fix this is still the case (although we've progressed to a NullPointerException instead of NoClassDefFound:: $ java org.mozilla.javascript.tools.shell.Main -e 'print("i")' Exception in thread "main" java.lang.NullPointerException at org.mozilla.javascript.Kit.classOrNull(Kit.java:92) at org.mozilla.javascript.tools.shell.ShellLine.getStream(ShellLine.java:65) at org.mozilla.javascript.tools.shell.Global.init(Global.java:153) at org.mozilla.javascript.tools.shell.Global$1.run(Global.java:108) at org.mozilla.javascript.Context.call(Context.java:499) at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511) at org.mozilla.javascript.tools.shell.Global.init(Global.java:105) at org.mozilla.javascript.tools.shell.Main.processOptions(Main.java:263) at org.mozilla.javascript.tools.shell.Main.exec(Main.java:153) at org.mozilla.javascript.tools.shell.Main.main(Main.java:140) Created attachment 336137 [details]
Spec file patch to include the treetable code
Here's my hacky change to get the treetable code to build. Someone who knows ant can fix the build.xml instead of doing the symlink.
This also enables installation of the rhino script but as noted that's throwing an exception. Fixing build of treetable alone is very worthwhile for me as it allows building shrinksafe.
Oh and I built this in koji to test it: http://koji.fedoraproject.org/koji/taskinfo?taskID=1251876 thanks, i will look into it now. The treetable code still contains the proprietary Sun license headers. We cannot include these. Where are you seeing the proprietary headers? I've looked at all four files in this directory:: rhino1_7R2pre/toolsrc/org/mozilla/javascript/tools/debugger/treetable They seem to have three clause BSD:: https://fedoraproject.org/wiki/Licensing/BSD#3ClauseBSD from the rhing1_7R2pre sources that the devel build downloads: $ vi rhino1_7R2pre/toolsrc/org/mozilla/javascript/tools/debugger/treetable/AbstractCellEditor.java : /* * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * - Neither the name of Sun Microsystems nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.mozilla.javascript.tools.debugger.treetable; import javax.swing.*; import javax.swing.event.*; import java.util.EventObject; public class AbstractCellEditor implements CellEditor { .... Right. That's three clause BSD. So it's an approved open source license and fine for us to include. The old, problematic license was:: /* * TreeTableModel.java * * Copyright (c) 1998 Sun Microsystems, Inc. All Rights Reserved. * * This software is the confidential and proprietary information of Sun * Microsystems, Inc. ("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with Sun. * * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING * THIS SOFTWARE OR ITS DERIVATIVES. * */ Sun relicensed this for use in openoffice and the relicensed files were picked up when creating rhino-1.7. ah understood, ok thanks! (In reply to comment #8) > Hi langel, thanks for updating rhino! I owe you next fudcon. > > I think there's two related issues going on here. Unfortunately, I know > nothing about java so I'm only going to be able to offer a little bit of help > here. > > 1) The treetable code that was under a bad license in 1.6 is now included in > the 1.7 tarball under a BSD-like license but the build.xml in the debugger > directory is not picking it up. I'll attach a patch to the spec file that > illustrates this problem and a hacky way to fix it. I don't know ant but I > know that someone who does could fix this more appropriately. This is fixed in rawhide, and I am pushing an update into F10. > > With this fix to the build, I'm now able to use rhino to build dojo's > shrinksafe, 1.3.0rc1. Yay! This fixes the more serious half of my problems. > > 2) The original issue reported here is that rhino cannot be invoked as a shell. > Even with the build fix this is still the case (although we've progressed to a > NullPointerException instead of NoClassDefFound:: > > $ java org.mozilla.javascript.tools.shell.Main -e 'print("i")' > Exception in thread "main" java.lang.NullPointerException > at org.mozilla.javascript.Kit.classOrNull(Kit.java:92) > at org.mozilla.javascript.tools.shell.ShellLine.getStream(ShellLine.java:65) > at org.mozilla.javascript.tools.shell.Global.init(Global.java:153) > at org.mozilla.javascript.tools.shell.Global$1.run(Global.java:108) > at org.mozilla.javascript.Context.call(Context.java:499) > at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511) > at org.mozilla.javascript.tools.shell.Global.init(Global.java:105) > at org.mozilla.javascript.tools.shell.Main.processOptions(Main.java:263) > at org.mozilla.javascript.tools.shell.Main.exec(Main.java:153) > at org.mozilla.javascript.tools.shell.Main.main(Main.java:140) Not fixed yet. rhino-1.7-0.3.r2pre.1.1.fc10 has been submitted as an update for Fedora 10. http://admin.fedoraproject.org/updates/rhino-1.7-0.3.r2pre.1.1.fc10 rhino-1.7-0.3.r2pre.1.1.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report. Updating rhino to 1.7r2 final gets us a step closer: ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino1_7R2.zip http://koji.fedoraproject.org/koji/taskinfo?taskID=1318102 $ java org.mozilla.javascript.tools.shell.Main -e 'print("hi")' hi $ cat echo.js for (i in arguments) { print (arguments[i]); } $ rhino echo.js one two three one two three $ java org.mozilla.javascript.tools.shell.Main Rhino 1.7 release 0.5.r2.fc10 2009 04 23 Exception in thread "main" java.lang.NullPointerException at org.mozilla.javascript.Kit.classOrNull(Kit.java:92) at org.mozilla.javascript.tools.shell.ShellLine.getStream(ShellLine.java:65) at org.mozilla.javascript.tools.shell.Global.getIn(Global.java:829) at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:385) at org.mozilla.javascript.tools.shell.Main.processFiles(Main.java:196) at org.mozilla.javascript.tools.shell.Main$IProxy.run(Main.java:117) at org.mozilla.javascript.Context.call(Context.java:515) at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507) at org.mozilla.javascript.tools.shell.Main.exec(Main.java:179) at org.mozilla.javascript.tools.shell.Main.main(Main.java:157) So rhino1_7R2 final runs scripts from the command line. It's just lacking a shell. I'll attach my modified spec file and a minor change to the rhino script that fixes a warning whenever /usr/bin/rhino is invoked. Created attachment 341042 [details]
spec update
Simple, just a bumped release
Created attachment 341043 [details]
Fix a warning in /usr/bin/rhino
This removes xmlbeans from the jars that we load with rhino. It's an optional feature and we don't have xmlbeans in Fedora yet.
Created attachment 345997 [details]
A patch for the Rhino null pointer exception
See my comment added 2009-05-30 11:03 pm CST for details.
I believe I've fixed the null pointer exception. I've attached a patch. Keep reading for the technical details. I've looked into the null pointer exception quoted above. I believe it's a result of Rhino attempting to dynamically load the jline library. My understanding is that there are both class specific class loaders and a generic system class loader. With this fix both will be attempted, if necessary, to dynamically load a jline class. One interesting aspect of this problem is that it seems to be caused by rhino being included with the JRE. When the rhino.jar symlink in: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/rhino.jar is deleted (it points to /usr/share/java/rhino.jar) it becomes possible to run the interactive rhino shell via the "rhino" script (/usr/bin/rhino). But deleting the symlink breaks some other things (it at least stops Eclipse from seeing the Rhino libraries). Specifically, "ShellLine.class.getClassLoader()" on ShellLine.java:64 returns null in the case where the rhino interactive shell fails. I've attached my fix. It's a bit odd in that it attempts to edit both /usr/bin/rhno and the ShellLine.java. Delete the /usr/bin/rhino portion before applying if you want, or whatever makes sense in your case. Note that it adds "jline" to the library path in /usr/bin/rhino. I think doing so is harmless and it makes the interactive rhino shell more pleasant to use (it's like GNU's readline for Java). Confirmed that this patch and the update to 1.7 final fixes all outstanding issues. Here's the build I tested: http://koji.fedoraproject.org/koji/taskinfo?taskID=1385788 langel, mind if I push this out to devel and f11 as a zero-day update? selliot, did you submit your fix to upstream mozilla.org? If not I can open a bug there with your patch attached. (In reply to comment #25) > selliot, did you submit your fix to upstream mozilla.org? If not I can open a > bug there with your patch attached. I have not, but that's a good idea. I'll open the bug later today if you don't. Bug opened upstream with your fix attached: https://bugzilla.mozilla.org/show_bug.cgi?id=495785 (In reply to comment #25) > Confirmed that this patch and the update to 1.7 final fixes all outstanding > issues. Here's the build I tested: > > http://koji.fedoraproject.org/koji/taskinfo?taskID=1385788 > > langel, mind if I push this out to devel and f11 as a zero-day update? Patch looks good. please do. Thanks! > > selliot, did you submit your fix to upstream mozilla.org? If not I can open a > bug there with your patch attached. rhino-1.7-0.6.r2.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/rhino-1.7-0.6.r2.fc11 rhino-1.7-0.6.r2.fc11 has been pushed to the Fedora 11 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update rhino'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-5941 This message is a reminder that Fedora 9 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 9. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '9'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 9's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 9 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping rhino-1.7-0.6.r2.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report. |