boc-tothefuture / openhab-jruby

JRuby Libraries for Openhab
Eclipse Public License 2.0
6 stars 9 forks source link

Errors in metadata handling when dealing with certain data #631

Closed jimtng closed 1 year ago

jimtng commented 1 year ago

Problem 1, addressed in #628

2022-08-09 22:38:13.797 [WARN ] [ore.internal.scheduler.SchedulerImpl] - Scheduled job '<unknown>' failed and stopped
org.jruby.exceptions.ArgumentError: (ArgumentError) wrong number of arguments (given 1, expected 2)
        at org.jruby.RubyEnumerable.each_with_object(org/jruby/RubyEnumerable.java:1148) ~[?:?]
        at RUBY.to_ruby_array(/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0/lib/openhab/dsl/items/metadata.rb:111) ~[?:?]
        at openhab.conf.scripts.ruby.lib.gem_home.gems.openhab_minus_scripting_minus_4_dot_44_dot_0.lib.openhab.dsl.items.metadata.to_ruby(/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0/lib/openhab/dsl/items/metadata.rb:119) ~[?:?]
        at openhab.conf.scripts.ruby.lib.gem_home.gems.openhab_minus_scripting_minus_4_dot_44_dot_0.lib.openhab.dsl.items.metadata.to_ruby_hash(/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0/lib/openhab/dsl/items/metadata.rb:98) ~[?:?]
        at org.jruby.RubyHash.each(org/jruby/RubyHash.java:1519) ~[?:?]
        at org.jruby.java.proxies.MapJavaProxy.each(org/jruby/java/proxies/MapJavaProxy.java:582) ~[?:?]
        at org.jruby.RubyEnumerable.each_with_object(org/jruby/RubyEnumerable.java:1148) ~[?:?]
        at RUBY.to_ruby_hash(/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0/lib/openhab/dsl/items/metadata.rb:98) ~[?:?]
        at openhab.conf.scripts.ruby.lib.gem_home.gems.openhab_minus_scripting_minus_4_dot_44_dot_0.lib.openhab.dsl.items.metadata.to_ruby(/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0/lib/openhab/dsl/items/metadata.rb:117) ~[?:?]
        at RUBY.initialize(/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0/lib/openhab/dsl/items/metadata.rb:31) ~[?:?]
        at org.jruby.RubyClass.new(org/jruby/RubyClass.java:888) ~[?:?]
        at RUBY.[](/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0/lib/openhab/dsl/items/metadata.rb:143) ~[?:?]
        at RUBY.dig(/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0/lib/openhab/dsl/items/metadata.rb:178) ~[?:?]
        at RUBY.<main>(/openhab/conf/automation/jsr223/ruby/personal/fetch_data.rb:122) ~[?:?]
        at RUBY.timer_block(/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0/lib/openhab/dsl/timers/timer.rb:86) ~[?:?]
        at RUBY.thread_local(/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0/lib/openhab/core/thread_local.rb:24) ~[?:?]
        at RUBY.thread_local(/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0/lib/openhab/core/thread_local.rb:36) ~[?:?]
        at RUBY.timer_block(/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0/lib/openhab/dsl/timers/timer.rb:85) ~[?:?]
        at org.jruby.ext.thread.Mutex.synchronize(org/jruby/ext/thread/Mutex.java:171) ~[?:?]
        at RUBY.timer_block(/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0/lib/openhab/dsl/timers/timer.rb:83) ~[?:?]
jimtng commented 1 year ago

Problem 2, after applying #628, a different issue occurred

1:11:30.237 [WARN ] [ommon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.NoClassDefFoundError: org/jruby/RubyHash$BaseCollection
        at java.lang.Class.getDeclaringClass0(Native Method) ~[?:?]
        at java.lang.Class.getEnclosingClass(Class.java:1517) ~[?:?]
        at org.jruby.javasupport.binding.ClassInitializer.initialize(ClassInitializer.java:27) ~[?:?]
        at org.jruby.javasupport.binding.Initializer.setupProxyClass(Initializer.java:55) ~[?:?]
        at org.jruby.javasupport.Java.createProxyClass(Java.java:550) ~[?:?]
        at org.jruby.javasupport.Java.generateClassProxy(Java.java:508) ~[?:?]
        at org.jruby.javasupport.Java.createProxyClassForClass(Java.java:464) ~[?:?]
        at org.jruby.javasupport.JavaSupport$1.computeValue(JavaSupport.java:84) ~[?:?]
        at org.jruby.javasupport.JavaSupport$1.computeValue(JavaSupport.java:76) ~[?:?]
        at org.jruby.util.collections.MapBasedClassValue.get(MapBasedClassValue.java:25) ~[?:?]
        at org.jruby.javasupport.JavaSupport.getProxyClassFromCache(JavaSupport.java:275) ~[?:?]
        at org.jruby.javasupport.Java.getProxyClass(Java.java:431) ~[?:?]
        at org.jruby.javasupport.Java.getInstance(Java.java:288) ~[?:?]
        at org.jruby.javasupport.Java.getInstance(Java.java:270) ~[?:?]
        at org.jruby.javasupport.JavaUtil.convertJavaToUsableRubyObject(JavaUtil.java:191) ~[?:?]
        at org.jruby.javasupport.binding.ConstantField.install(ConstantField.java:23) ~[?:?]
        at org.jruby.javasupport.binding.MethodGatherer.lambda$installConstants$3(MethodGatherer.java:468) ~[?:?]
        at java.util.HashMap.forEach(HashMap.java:1337) ~[?:?]
        at org.jruby.javasupport.binding.MethodGatherer.installConstants(MethodGatherer.java:468) ~[?:?]
        at org.jruby.javasupport.binding.MethodGatherer.initialize(MethodGatherer.java:148) ~[?:?]
        at org.jruby.javasupport.binding.ClassInitializer.initialize(ClassInitializer.java:63) ~[?:?]
        at org.jruby.javasupport.binding.Initializer.setupProxyClass(Initializer.java:55) ~[?:?]
        at org.jruby.javasupport.Java.createProxyClass(Java.java:550) ~[?:?]
        at org.jruby.javasupport.Java.generateClassProxy(Java.java:508) ~[?:?]
        at org.jruby.javasupport.Java.createProxyClassForClass(Java.java:464) ~[?:?]
        at org.jruby.javasupport.JavaSupport$1.computeValue(JavaSupport.java:84) ~[?:?]
        at org.jruby.javasupport.JavaSupport$1.computeValue(JavaSupport.java:76) ~[?:?]
        at org.jruby.util.collections.MapBasedClassValue.get(MapBasedClassValue.java:25) ~[?:?]
        at org.jruby.javasupport.JavaSupport.getProxyClassFromCache(JavaSupport.java:275) ~[?:?]
        at org.jruby.javasupport.Java.getProxyClass(Java.java:431) ~[?:?]
        at org.jruby.javasupport.Java.getInstance(Java.java:288) ~[?:?]
        at org.jruby.javasupport.Java.getInstance(Java.java:270) ~[?:?]
        at org.jruby.javasupport.JavaUtil.convertJavaToUsableRubyObject(JavaUtil.java:191) ~[?:?]
        at org.jruby.javasupport.ext.JavaUtil$List.to_a(JavaUtil.java:533) ~[?:?]
        at org.jruby.javasupport.ext.JavaUtil$List$INVOKER$s$0$0$to_a.call(JavaUtil$List$INVOKER$s$0$0$to_a.gen) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:351) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:144) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:345) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188) ~[?:?]
        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:218) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:372) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:175) ~[?:?]
        at openhab.conf.scripts.ruby.lib.gem_home.gems.openhab_minus_scripting_minus_4_dot_44_dot_0_dot_1.lib.openhab.dsl.items.metadata.invokeOther12:to_ruby_array(/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0.1/lib/openhab/dsl/items/metadata.rb:117) ~[?:?]
        at openhab.conf.scripts.ruby.lib.gem_home.gems.openhab_minus_scripting_minus_4_dot_44_dot_0_dot_1.lib.openhab.dsl.items.metadata.RUBY$method$to_ruby$0(/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0.1/lib/openhab/dsl/items/metadata.rb:117) ~[?:?]
        at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:165) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:185) ~[?:?]
        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:218) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:173) ~[?:?]
        at openhab.conf.scripts.ruby.lib.gem_home.gems.openhab_minus_scripting_minus_4_dot_44_dot_0_dot_1.lib.openhab.dsl.items.metadata.invokeOther1:to_ruby(/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0.1/lib/openhab/dsl/items/metadata.rb:96) ~[?:?]
        at openhab.conf.scripts.ruby.lib.gem_home.gems.openhab_minus_scripting_minus_4_dot_44_dot_0_dot_1.lib.openhab.dsl.items.metadata.RUBY$block$to_ruby_hash$0(/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0.1/lib/openhab/dsl/items/metadata.rb:96) ~[?:?]
        at org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:151) ~[?:?]
        at org.jruby.runtime.MixedModeIRBlockBody.yieldDirect(MixedModeIRBlockBody.java:111) ~[?:?]
        at org.jruby.runtime.BlockBody.yield(BlockBody.java:106) ~[?:?]
        at org.jruby.runtime.Block.yield(Block.java:188) ~[?:?]
        at org.jruby.RubyArray.to_h(RubyArray.java:2116) ~[?:?]
        at org.jruby.RubyArray$INVOKER$i$0$0$to_h.call(RubyArray$INVOKER$i$0$0$to_h.gen) ~[?:?]
        at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:560) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:85) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:94) ~[?:?]
        at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:546) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:361) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188) ~[?:?]
        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:218) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:372) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:175) ~[?:?]
        at openhab.conf.scripts.ruby.lib.gem_home.gems.openhab_minus_scripting_minus_4_dot_44_dot_0_dot_1.lib.openhab.dsl.items.metadata.invokeOther14:to_ruby_hash(/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0.1/lib/openhab/dsl/items/metadata.rb:115) ~[?:?]
        at openhab.conf.scripts.ruby.lib.gem_home.gems.openhab_minus_scripting_minus_4_dot_44_dot_0_dot_1.lib.openhab.dsl.items.metadata.RUBY$method$to_ruby$0(/openhab/conf/scripts/ruby/lib/gem_home/gems/openhab-scripting-4.44.0.1/lib/openhab/dsl/items/metadata.rb:115) ~[?:?]
        at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:165) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:185) ~[?:?]
        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:218) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:372) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:175) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:316) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:183) ~[?:?]
        at org.jruby.RubyClass.newInstance(RubyClass.java:888) ~[?:?]
        at org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen) ~[?:?]
        at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrOneOrNBlock.call(JavaMethod.java:354) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:372) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:175) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:316) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188) ~[?:?]
        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:218) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:372) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:175) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:316) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:92) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:238) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:225) ~[?:?]
        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:226) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:393) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:206) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:325) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:116) ~[?:?]
        at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:136) ~[?:?]
        at org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:177) ~[?:?]
        at org.jruby.runtime.BlockBody.yield(BlockBody.java:116) ~[?:?]
        at org.jruby.runtime.Block.yieldNonArray(Block.java:224) ~[?:?]
        at org.jruby.RubyBasicObject.yieldUnder(RubyBasicObject.java:1756) ~[?:?]
        at org.jruby.RubyBasicObject.instance_exec(RubyBasicObject.java:2677) ~[?:?]
        at org.jruby.RubyBasicObject$INVOKER$i$0$3$instance_exec.call(RubyBasicObject$INVOKER$i$0$3$instance_exec.gen) ~[?:?]
        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:222) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:383) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:185) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:338) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:92) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:238) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:225) ~[?:?]
        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:226) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:393) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:206) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:325) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:116) ~[?:?]
        at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:136) ~[?:?]
        at org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:76) ~[?:?]
        at org.jruby.runtime.Block.yieldSpecific(Block.java:157) ~[?:?]
        at org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:498) ~[?:?]
        at org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:76) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:176) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:104) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:183) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:338) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:383) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:185) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:192) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:337) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:92) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:238) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:225) ~[?:?]
        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:226) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:393) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:206) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:325) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:128) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:329) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:87) ~[?:?]
        at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:549) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:361) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:116) ~[?:?]
        at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:136) ~[?:?]
        at org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:76) ~[?:?]
        at org.jruby.runtime.Block.yieldSpecific(Block.java:157) ~[?:?]
        at org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:498) ~[?:?]
        at org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:76) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:176) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:104) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:383) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:185) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:192) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:337) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:116) ~[?:?]
        at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:136) ~[?:?]
        at org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:76) ~[?:?]
        at org.jruby.runtime.Block.yieldSpecific(Block.java:157) ~[?:?]
        at org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:498) ~[?:?]
        at org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:76) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:176) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:104) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:383) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:185) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:338) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:383) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:185) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:192) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:337) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:92) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:238) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:225) ~[?:?]
        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:226) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:393) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:206) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:325) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:92) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:238) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:225) ~[?:?]
        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:226) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:393) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:206) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:325) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:116) ~[?:?]
        at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:136) ~[?:?]
        at org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:76) ~[?:?]
        at org.jruby.runtime.Block.yieldSpecific(Block.java:157) ~[?:?]
        at org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:498) ~[?:?]
        at org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:76) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:176) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:104) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:383) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:185) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:192) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:337) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201) ~[?:?]
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:383) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:185) ~[?:?]
        at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:192) ~[?:?]
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:337) ~[?:?]
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[?:?]
        at org.jruby.ir.interpreter.Interpreter.INTERPRET_ROOT(Interpreter.java:96) ~[?:?]
        at org.jruby.ir.interpreter.Interpreter.execute(Interpreter.java:81) ~[?:?]
        at org.jruby.ir.interpreter.Interpreter.execute(Interpreter.java:30) ~[?:?]
        at org.jruby.ir.IRTranslator.execute(IRTranslator.java:42) ~[?:?]
        at org.jruby.Ruby.runInterpreter(Ruby.java:1294) ~[?:?]
        at org.jruby.Ruby.runInterpreter(Ruby.java:1298) ~[?:?]
        at org.jruby.embed.internal.EmbedEvalUnitImpl.run(EmbedEvalUnitImpl.java:119) ~[?:?]
        at org.jruby.embed.jsr223.JRubyEngine.doEval(JRubyEngine.java:99) ~[?:?]
        at org.jruby.embed.jsr223.JRubyEngine.eval(JRubyEngine.java:126) ~[?:?]
        at org.jruby.embed.jsr223.JRubyEngine.eval(JRubyEngine.java:152) ~[?:?]
        at org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl.loadScript(ScriptEngineManagerImpl.java:189) ~[?:?]
        at org.openhab.core.automation.module.script.rulesupport.loader.ScriptFileWatcher.createAndLoad(ScriptFileWatcher.java:251) ~[?:?]
        at org.openhab.core.automation.module.script.rulesupport.loader.ScriptFileWatcher.importFile(ScriptFileWatcher.java:231) ~[?:?]
        at org.openhab.core.automation.module.script.rulesupport.loader.ScriptFileWatcher.lambda$2(ScriptFileWatcher.java:223) ~[?:?]
        at java.util.Optional.ifPresent(Optional.java:183) ~[?:?]
        at org.openhab.core.automation.module.script.rulesupport.loader.ScriptFileWatcher.importFileWhenReady(ScriptFileWatcher.java:221) ~[?:?]
        at org.openhab.core.automation.module.script.rulesupport.loader.ScriptFileWatcher.processWatchEvent(ScriptFileWatcher.java:198) ~[?:?]
        at org.openhab.core.service.WatchQueueReader.lambda$5(WatchQueueReader.java:357) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.lang.ClassNotFoundException: org.jruby.RubyHash$BaseCollection cannot be found by org.openhab.automation.jrubyscripting_3.4.0.202208091233
        at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:529) ~[org.eclipse.osgi-3.17.200.jar:?]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:524) ~[org.eclipse.osgi-3.17.200.jar:?]
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:416) ~[org.eclipse.osgi-3.17.200.jar:?]
        at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168) ~[org.eclipse.osgi-3.17.200.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
        ... 268 more

metadata.rb line 117:

            when String then String.new(value)
jimtng commented 1 year ago

I resolved this by converting the metadata to json using Gson, then parse it back using Ruby's json.