You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Tong Sun <su...@gmail.com> on 2021/02/02 22:18:25 UTC

Bug? JMeter is not using the default groovy

Hi,

I've already set the default groovy version, but it seems that JMeter
insists something of its own:

--------------------------------
$ groovy --version
Groovy Version: 2.4.12 JVM: 1.8.0_261 Vendor: Oracle Corporation OS: Mac OS X

$ jmeter -f -n -t $jmxf.jmx
Creating summariser <summary>
CStarting standalone test @ Tue Feb 02 17:01:38 EST 2021 (1612303298756)
Waiting for possible Shutdown/StopTestNow/HeapDump/ThreadDump message
on port 4445
Uncaught Exception java.lang.ExceptionInInitializerError in thread
Thread[StandardJMeterEngine,5,main]. See log file for details.

$ grep -A18 'Uncaught ' jmeter.log
2021-02-02 17:01:39,132 ERROR o.a.j.JMeter: Uncaught exception in
thread Thread[StandardJMeterEngine,5,main]
java.lang.ExceptionInInitializerError: null
        at org.codehaus.groovy.jsr223.GroovyScriptEngineFactory.getLanguageVersion(GroovyScriptEngineFactory.java:95)
~[groovy-jsr223-3.0.3.jar:3.0.3]
        at org.apache.jmeter.util.JSR223BeanInfoSupport.<clinit>(JSR223BeanInfoSupport.java:70)
~[ApacheJMeter_core.jar:5.3]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method) ~[?:1.8.0_261]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
~[?:1.8.0_261]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
~[?:1.8.0_261]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
~[?:1.8.0_261]
        at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_261]
        at com.sun.beans.finder.InstanceFinder.instantiate(InstanceFinder.java:96)
~[?:1.8.0_261]
        at com.sun.beans.finder.InstanceFinder.find(InstanceFinder.java:66)
~[?:1.8.0_261]
        at java.beans.Introspector.findExplicitBeanInfo(Introspector.java:448)
~[?:1.8.0_261]
        at java.beans.Introspector.<init>(Introspector.java:398) ~[?:1.8.0_261]
        at java.beans.Introspector.getBeanInfo(Introspector.java:173)
~[?:1.8.0_261]
        at org.apache.jmeter.testbeans.TestBeanHelper.prepare(TestBeanHelper.java:67)
~[ApacheJMeter_core.jar:5.3]
        at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(StandardJMeterEngine.java:202)
~[ApacheJMeter_core.jar:5.3]
        at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:380)
~[ApacheJMeter_core.jar:5.3]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_261]
Caused by: groovy.lang.GroovyRuntimeException: Conflicting module
versions. Module [groovy-xml is loaded in version 3.0.3 and you are
trying to load version 2.4.12

--------------------------------

So how to tell my JMeter not to use groovy v3.0.3 but v2.4.12?

Note this only happens when running JMeter in -n(NON_GUI) mode. GUI
mode is somehow fine.

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Bug? JMeter is not using the default groovy

Posted by "glinius@live.com" <gl...@live.com>.
For sure it's not a JMeter bug, it's an example of  Jar Hell
<https://dzone.com/articles/what-is-jar-hell>   where you have multiple
versions of the same library in the  CLASSPATH
<https://docs.oracle.com/javase/tutorial/essential/environment/paths.html>  


There are groovy-*.jar libraries in JMeter Classpath
<https://jmeter.apache.org/usermanual/get-started.html#classpath>   (lib
folder of your JMeter installation) and JMeter automatically loads them on
start and if you're adding more Groovy libraries to the classpath by any
means it results in 2 same libraries of different versions with undefined
order when it comes to classloading. 

If you want to use your own Groovy - remove JMeter's version and vice versa. 

Just in case if you cannot remove JMeter's libraries, the latest version of
JMeter which was shipped with Groovy 2.4.12 was  JMeter 3.3
<https://www.blazemeter.com/blog/whats-new-in-jmeter-3.3>  

Also  according to JMeter Best Practices you should always be using the
latest version of JMeter
<https://jmeter.apache.org/usermanual/best-practices.html>   which is 
JMeter 5.4.1
<http://www.jmeter-archive.org/ANNOUNCE-Apache-JMeter-5-4-1-released-td5739226.html>  
as of now and it comes with Groovy 3.0.7 so switching to JMeter's groovy or
upgrading your installed SDK might be a viable solution.



--
Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org