You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
the following scripts works well in jruby-complete-1.7.3.jar, but after change to 1.7.27, it raise the following error:
Caused by : (NameError) cannot link Java class hc.server.util.scheduler (java.lang.NoClassDefFoundError: hc/server/util/scheduler (wrong name: hc/server/util/Scheduler))
org.jruby.javasupport.JavaUtilities.get_proxy_or_package_under_package(org/jruby/javasupport/JavaUtilities.java:54)
RUBY.method_missing(file:/Users/homecenter/Documents/eclipse_workspace/homecenter/jruby.jar!/jruby/java/java_package_module_template.rb:14)
RUBY.(root)(<script>:26)
------------------scripts------------------
#encoding:utf-8
the instance var "scheduler" is class hc.server.util.Scheduler
the instance var "weeklyCalendar" is class hc.server.util.scheduler.WeeklyJobCalendar
all other scripts works well.
Environment
jruby-complete-1.7.27.jar in jdk1.7.0_51
Darwin Home-CentermatoMacBook-2.local 15.6.0 Darwin Kernel Version 15.6.0: Mon Oct 2 22:20:08 PDT 2017; root:xnu-3248.71.4~1/RELEASE_X86_64 x86_64
The text was updated successfully, but these errors were encountered:
you did not specify how the class-path is setup e.g. I am sure if you required the proper .jar in the .rb script it would work. I see it as an issue with class-loading, old 1.7.x had several bugs thus would highly recommend to upgrade to a newer 1.7 or even better 9K. JRuby 1.7.x has EOLed so you're pretty much on your own.
Hello,
the following scripts works well in jruby-complete-1.7.3.jar, but after change to 1.7.27, it raise the following error:
Caused by : (NameError) cannot link Java class hc.server.util.scheduler (java.lang.NoClassDefFoundError: hc/server/util/scheduler (wrong name: hc/server/util/Scheduler))
org.jruby.javasupport.JavaUtilities.get_proxy_or_package_under_package(org/jruby/javasupport/JavaUtilities.java:54)
RUBY.method_missing(file:/Users/homecenter/Documents/eclipse_workspace/homecenter/jruby.jar!/jruby/java/java_package_module_template.rb:14)
RUBY.(root)(<script>:26)
------------------scripts------------------
#encoding:utf-8
import Java::hc.server.util.Assistant
import Java::hc.server.ui.ProjectContext
import Java::hc.server.util.json.JSONObject
ctx = ProjectContext::getProjectContext()
puts "step1"
scheduler = ctx.getScheduler("MyScheduler1")# Important Java Class : hc.server.util.Scheduler
puts "step2"
scheduler.start()
puts "step3"
hasTrigger = scheduler.hasTrigger("Trigger1")
if hasTrigger == false
puts "add job, calendar, trigger..."
scheduler.addJob("job1", "puts "exeute job1"")
scheduler.addCronTrigger("Trigger1", "/30 * * * * ?", nil, "job1")#trigger "job1" when "Calendar1" every 30 seconds and exclude sunday
scheduler.addCronTrigger("Trigger1", "/30 * * * * ?", nil, "job1")#trigger "job1" when "Calendar1" every 30 seconds and exclude sunday
#puts "Trigger1 next fire time : " + scheduler.getTriggerNextFireTime("Trigger1").toString()
#scheduler.triggerJob("job1")
else
#puts "Trigger1 end time : " + scheduler.getTriggerNextFireTime("Trigger1").toString()
end
weeklyCalendar = Java::hc.server.util.scheduler.WeeklyJobCalendar::new()
------------------end scripts------------------
Environment
jruby-complete-1.7.27.jar in jdk1.7.0_51
Darwin Home-CentermatoMacBook-2.local 15.6.0 Darwin Kernel Version 15.6.0: Mon Oct 2 22:20:08 PDT 2017; root:xnu-3248.71.4~1/RELEASE_X86_64 x86_64
The text was updated successfully, but these errors were encountered: