Closed Bug 775423 Opened 13 years ago Closed 7 years ago

no error message shown when failing to load an existing java class

Categories

(Rhino Graveyard :: Core, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INACTIVE

People

(Reporter: CasianValentin.Andrei, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.2; MS-RTC LM 8) Steps to reproduce: I was using one of our programs that uses Rhino for scripting Java in Javascript. I was trying to use a jar file created by me from the latest sources instead of the "released" one (this jar / source is propietary stuff). The new jar file contained the same classes as the old one, but it was built using jdk1.7 instead of jdk1.6. Tried with the same Javascript, which was working perfectly with the old jar. I need to mention that I have little experience with Java, and also I am not able to use git here because of proxies, and it is difficult for me to produce a proper patch. Also, I have no idea how Rhino issues warnings or errors and how it should be done properly. Rhino version: 5ef60f6 (I believe it's near to the latest git at this time) JDK's: 1.6 and 1.7 Actual results: The Javascript failed to work with the newer jar, because it didn't find the classes inside it. Absolutely no error message when trying to load the classes, it just gave an exception about not finding the class. I have built Rhino and traced the issue in the Kit class, method: public static Class<?> classOrNull(ClassLoader loader, String className) This calls loader.loadClass(className); and catches the exceptions, but prints no error message. Imo, this should happen only for ClassNotFoundException. In this particular case, there was a linking exception because of the different jdk's, which passed as if the class was not found in the package. Forgot to mention that the program I was using had it's own copy of jre1.6 shipped with it, so I was trying to use a jar built with jdk1.7 on this jre1.6. I have spent some hours trying to debug the problem, because I had no idea about what Rhino is at that time. This should not happen to others in the future :) Expected results: Rhino should have given some kind of warning - like "Class could not be loaded because of linking error bla bla". That would have saved me hours.

Closing. Bug management is now done here:
https://github.com/mozilla/rhino

Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: