jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Ramirez <juan.rami...@intraway.com>
Subject Re: Could not initialize class org.apache.jmeter.gui.util.MenuFactory
Date Sat, 23 Jul 2016 20:38:14 GMT
Hi!

Now it is clear that there is a problem with my java setup (everything
installed with pacman, btw).

[Sat, 23 Jul 17:29:14][ichramm@wilderjager][~/Downloads]
$ javac JSR223Test.java
[Sat, 23 Jul 17:29:19][ichramm@wilderjager][~/Downloads]
$ /usr/lib/jvm/java-7-openjdk/bin/java JSR223Test

Engine: @IMPLEMENTATION.VERSION@
Version: @IMPLEMENTATION.VERSION@
Language: ECMAScript
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
       at
com.sun.script.javascript.RhinoScriptEngineFactory.getParameter(RhinoScriptEngineFactory.java:67)
       at
com.sun.script.util.ScriptEngineFactoryBase.getLanguageVersion(ScriptEngineFactoryBase.java:54)
       at JSR223Test.main(JSR223Test.java:15)
[Sat, 23 Jul 17:29:23][ichramm@wilderjager][~/Downloads]
$ /usr/lib/jvm/java-8-openjdk/bin/java JSR223Test
Engine: Oracle Nashorn
Version: 1.8.0_92
Language: ECMAScript
LanguageVersion: ECMA - 262 Edition 5.1



I updated jmeter.sh to run Java 8 and it works just fine so I guess I
should stick to it.

I'm heading to Archlinux forum now, I let you know when a find a solution
that works for java 7 :p

Many thanks to both of you!

Juan



On Sat, Jul 23, 2016 at 4:22 PM, Felix Schumacher <
felix.schumacher@internetallee.de> wrote:

> Am 23.07.2016 um 19:46 schrieb Juan Ramirez:
>
>> Deepak,
>>
>> Thanks for your input, I think you got pretty close to the origin of the
>> problem.
>>
>> Te class RhinoScriptEngineFactory is being loaded from the file
>> /usr/lib/jvm/java-7-openjdk/jre/lib/rt.jar. I disassembled that file and
>> found something very interesting:
>>
>>    public Object getParameter(String key)
>>    {
>>      String implVer = ScriptRuntime.getMessage0("implementation.version");
>>      String[] parts = implVer.split(" ");
>>      if (key.equals("javax.script.name")) {
>>        return "javascript";
>>      }
>>      if (key.equals("javax.script.engine")) {
>>        return parts[0];
>>      }
>>      if (key.equals("javax.script.engine_version")) {
>>        return implVer;
>>      }
>>      if (key.equals("javax.script.language")) {
>>        return "ECMAScript";
>>      }
>>      if (key.equals("javax.script.language_version")) {
>>        return parts[1];
>>      }
>>      if (key.equals("THREADING")) {
>>        return "MULTITHREADED";
>>      }
>>      throw new IllegalArgumentException("Invalid key");
>>    }
>>
>>
>> I wouldn't trust my disassemble to match line numbers correctly in most
>> cases but, to my surprise, the line 67 corresponds to the code:
>>
>>     return parts[1];
>>
>> which is very much likely to throw an ArrayIndexOutOfBoundsException (the
>> only one actually, because parts has at least one element).
>>
>> With that being said, the only way for that function to fail is that
>> *implVer* is empty or it contains no spaces. My money is on *implVer*
>> being
>> empty, which leads me to the next question:
>>
>>     Why would the runtime return empty for implementation.version?
>>
>> Is it because there is no implementation.?
>>
> I would think it is a mismatch of classes in the classpath (as pointed out
> by Deepak).
>
> Can you try to compile and run the attached java class? It should list all
> the ScriptEngines that are available to your jre.
>
> Have you added anything to the default jmeter installation?
>
> Regards,
>  Felix
>
>
>>
>>
>>
>>
>> On Sat, Jul 23, 2016 at 2:18 PM, Deepak Shetty <shettyd@gmail.com> wrote:
>>
>> Can you see if anything you downloaded has RhinoScriptEngineFactory ?
>>> There
>>> is no way that the JDK 1.7 RhinoScriptEngineFactory can throw an error at
>>> line 67
>>>
>>>
>>>
>>> http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7u40-b43/com/sun/script/javascript/RhinoScriptEngineFactory.java?av=f
>>>
>>> Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
>>> at
>>>
>>>
>>> com.sun.script.javascript.RhinoScriptEngineFactory.getParameter(RhinoScriptEngineFactory.java:67)
>>>
>>> An alternative is to add -verbose:class to your startup to see which jar
>>> this file is being read from
>>>
>>>
>>> On Sat, Jul 23, 2016 at 8:17 AM, Juan Ramirez <juan.ramirez@intraway.com
>>> >
>>> wrote:
>>>
>>> ​Hi, here is the information you've asked, as extracted from the log
>>>>
>>> file.
>>>
>>>> Thanks!
>>>>
>>>> ​
>>>>
>>>> jmeter.JMeter: Version 3.0 r1743807
>>>> jmeter.JMeter: java.version=1.7.0_101
>>>> jmeter.JMeter: java.vm.name=OpenJDK 64-Bit Server VM
>>>> jmeter.JMeter: os.name=Linux
>>>> jmeter.JMeter: os.arch=amd64
>>>> jmeter.JMeter: os.version=4.6.4-1-ARCH
>>>> jmeter.JMeter: file.encoding=UTF-8
>>>> jmeter.JMeter: Max memory     =3713531904
>>>> jmeter.JMeter: Available Processors =4
>>>> jmeter.JMeter: Default Locale=English (United States)
>>>> jmeter.JMeter: JMeter  Locale=English (United States)
>>>>
>>>>
>>>> On Jul 23, 2016 4:38 AM, "Felix Schumacher" <
>>>> felix.schumacher@internetallee.de> wrote:
>>>>
>>>>
>>>>> Am 22. Juli 2016 17:24:32 MESZ, schrieb Juan Ramirez <
>>>>> juan.ramirez@intraway.com>:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I've just downloaded JMeter on and Archlinux system, Java 7, no extra
>>>>>> plugins.
>>>>>>
>>>>> Which version of java do you use exactly? And which jmeter version have
>>>>> you downloaded?
>>>>>
>>>>> Regards,
>>>>> Felix
>>>>>
>>>>> I'm having a problem trying to get the context menu to work, it fails
>>>>>> on
>>>>>> initialization.
>>>>>>
>>>>>> The first error that pops out in the screen is:
>>>>>>
>>>>>> Uncaught Exception java.lang.ExceptionInInitializerError. See log
file
>>>>>> for
>>>>>> details.
>>>>>> Uncaught Exception java.lang.
>>>>>> ​​
>>>>>> NoClassDefFoundError: Could not initialize class
>>>>>> org.apache.jmeter.gui.util.MenuFactory. See log file for details.
>>>>>>
>>>>>> Then, in the log file, more information can be read:
>>>>>>
>>>>>> jmeter.gui.util.MenuFactory: Could not instantiate
>>>>>> org.apache.jmeter.assertions.JSR223Assertion
>>>>>> java.lang.ExceptionInInitializerError
>>>>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>>>>>> Method)
>>>>>>         ...
>>>>>> at java.beans.Introspector.getBeanInfo(Introspector.java:163)
>>>>>> at
>>>>>>
>>>>>
>>>> org.apache.jmeter.testbeans.gui.TestBeanGUI.<init>(TestBeanGUI.java:168)
>>>>
>>>>> at
>>>>>>
>>>>>
>>>>>
>>>> org.apache.jmeter.gui.util.MenuFactory.initializeMenus(MenuFactory.java:488)
>>>>
>>>>> at
>>>>>> org.apache.jmeter.gui.util.MenuFactory.<clinit>(MenuFactory.java:160)
>>>>>> ...
>>>>>> ...
>>>>>> Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
>>>>>> at
>>>>>>
>>>>>
>>>>>
>>>> com.sun.script.javascript.RhinoScriptEngineFactory.getParameter(RhinoScriptEngineFactory.java:67)
>>>>
>>>>> at
>>>>>>
>>>>>
>>>>>
>>>> com.sun.script.util.ScriptEngineFactoryBase.getLanguageVersion(ScriptEngineFactoryBase.java:54)
>>>>
>>>>> at
>>>>>>
>>>>>
>>>>>
>>>> org.apache.jmeter.util.JSR223BeanInfoSupport.<clinit>(JSR223BeanInfoSupport.java:61)
>>>>
>>>>> ... 33 more
>>>>>>
>>>>>>
>>>>>> I thought that maybe the problem was related to Rhino so I downloaded
>>>>>> and
>>>>>> copied the .JARS to the lib/ folder but that didn't help.
>>>>>>
>>>>>> I'm attaching the log file, any help will be appreciated.
>>>>>>
>>>>>> Thanks!
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>>>> For additional commands, e-mail: user-help@jmeter.apache.org
>>>>>
>>>>>
>>>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>



-- 
Juan Ramírez
Intraway Corp.
Solution developer, Business development.

Visit our website at http://www.intraway.com
Proud to be an ISO 9001:2008 certified company

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message