Jruby-rack-worker 未在 WebLogic 上启动

Jruby-rack-worker not starting on WebLogic

我有一个 Jruby 项目,它使用的后台进程需要每 x 分钟 运行。我正在使用 Jruby-rack-worker + delayed_cron_job 库。我已按照以下 jruby-rack-worker 说明进行操作:

  1. 复制lib文件夹下的jruby-rack-worker.jar文件

  2. my web.xml 位于配置文件夹下:

  3. 我的工人 rb 文件:

  1. 我的GEM文件:

    gem 'jruby-rack-worker', :platform => :jruby, :require => nil
    gem'delayed_cron_job'

WebLogic 上部署 WAR 文件后,我检查了日志文件,我可以看到部署完成后,它正在尝试启动 Worker 但没有任何反应:

####<Jul 7, 2017, 6:48:00,489 PM SGT> <Info> <CONCURRENCY> <voldemort-PC> <AdminServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000020> <1499424480489> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-2162600> <Creating ManagedThreadFactory "DefaultManagedThreadFactory" (partition="DOMAIN", module="null", application="myrubyapp")> 
####<Jul 7, 2017, 6:48:00,489 PM SGT> <Info> <CONCURRENCY> <voldemort-PC> <AdminServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000020> <1499424480489> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-2162610> <Creating ManagedExecutorService "DefaultManagedExecutorService" (partition="DOMAIN", module="null", application="myrubyapp", workmanager="default")> 
####<Jul 7, 2017, 6:48:00,490 PM SGT> <Info> <CONCURRENCY> <voldemort-PC> <AdminServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000020> <1499424480490> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-2162611> <Creating ManagedScheduledExecutorService "DefaultManagedScheduledExecutorService" (partition="DOMAIN", module="null", application="myrubyapp", workmanager="default")> 
####<Jul 7, 2017, 6:48:00,490 PM SGT> <Info> <Deployer> <voldemort-PC> <AdminServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000020> <1499424480490> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-149059> <Module myrubyapp.war of application myrubyapp is transitioning from STATE_NEW to STATE_PREPARED on server AdminServer.> 
####<Jul 7, 2017, 6:48:02,884 PM SGT> <Info> <Deployer> <voldemort-PC> <AdminServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000020> <1499424482884> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-149060> <Module myrubyapp.war of application myrubyapp successfully transitioned from STATE_NEW to STATE_PREPARED on server AdminServer.> 
####<Jul 7, 2017, 6:48:02,911 PM SGT> <Info> <Deployer> <voldemort-PC> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000021> <1499424482911> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-149059> <Module myrubyapp.war of application myrubyapp is transitioning from STATE_PREPARED to STATE_ADMIN on server AdminServer.> 
####<Jul 7, 2017, 6:48:02,927 PM SGT> <Info> <Deployer> <voldemort-PC> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000021> <1499424482927> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-149060> <Module myrubyapp.war of application myrubyapp successfully transitioned from STATE_PREPARED to STATE_ADMIN on server AdminServer.> 
####<Jul 7, 2017, 6:48:03,96 PM SGT> <Info> <ServletContext-/myrubyapp> <voldemort-PC> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <weblogic> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000021> <1499424483096> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000000> <INFO: jruby 9.1.5.0 (2.3.1) 2016-09-07 036ce39 Java HotSpot(TM) 64-Bit Server VM 25.131-b11 on 1.8.0_131-b11 +jit [mswin32-x86_64]> 
####<Jul 7, 2017, 6:48:03,97 PM SGT> <Info> <ServletContext-/myrubyapp> <voldemort-PC> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <weblogic> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000021> <1499424483097> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000000> <INFO: using a shared (threadsafe!) runtime> 
####<Jul 7, 2017, 6:48:24,321 PM SGT> <Info> <ServletContext-/myrubyapp> <voldemort-PC> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <weblogic> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000021> <1499424504321> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000000> <I, [2017-07-07T10:48:24.309000 #9420]  INFO -- : [ActiveJob] [CronJobs] [859cb101-2c4b-4995-ad08-d453c7f26b35] Performing CronJobs from Inline(default)
> 
####<Jul 7, 2017, 6:48:24,705 PM SGT> <Info> <Common> <voldemort-PC> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <weblogic> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000021> <1499424504705> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000628> <Created "1" resources for pool "myapp-staging-ds", out of which "1" are available and "0" are unavailable.> 
####<Jul 7, 2017, 6:48:28,253 PM SGT> <Info> <ServletContext-/myrubyapp> <voldemort-PC> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <weblogic> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000021> <1499424508253> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000000> <I, [2017-07-07T10:48:28.253000 #9420]  INFO -- : [ActiveJob] [CronJobs] [859cb101-2c4b-4995-ad08-d453c7f26b35] Performed CronJobs from Inline(default) in 3930.0ms
> 
####<Jul 7, 2017, 6:48:28,255 PM SGT> <Info> <ServletContext-/myrubyapp> <voldemort-PC> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <weblogic> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000021> <1499424508255> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000000> <I, [2017-07-07T10:48:28.255000 #9420]  INFO -- : [ActiveJob] Enqueued CronJobs (Job ID: 859cb101-2c4b-4995-ad08-d453c7f26b35) to Inline(default)
> 
####<Jul 7, 2017, 6:48:30,292 PM SGT> <Info> <ServletContext-/myrubyapp> <voldemort-PC> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <weblogic> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000021> <1499424510292> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000000> <INFO: [org.kares.jruby.rack.DefaultWorkerManager] started 1 worker(s)> 
####<Jul 7, 2017, 6:48:30,356 PM SGT> <Info> <Deployer> <voldemort-PC> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000021> <1499424510356> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-149059> <Module myrubyapp.war of application myrubyapp is transitioning from STATE_ADMIN to STATE_ACTIVE on server AdminServer.> 
####<Jul 7, 2017, 6:48:30,356 PM SGT> <Info> <Deployer> <voldemort-PC> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000021> <1499424510356> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-149060> <Module myrubyapp.war of application myrubyapp successfully transitioned from STATE_ADMIN to STATE_ACTIVE on server AdminServer.> 
####<Jul 7, 2017, 6:48:30,377 PM SGT> <Info> <Deployer> <voldemort-PC> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000022> <1499424510377> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-149074> <Successfully completed deployment task: [Deployer:149026]deploy application myrubyapp on AdminServer..> 
####<Jul 7, 2017, 6:48:30,404 PM SGT> <Info> <ServletContext-/myrubyapp> <voldemort-PC> <AdminServer> <jruby-rack-worker#1> <weblogic> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000021> <1499424510404> <[severity-value: 64] [rid: 0:3] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000000> <I, [2017-07-07T10:48:30.401000 #9420]  INFO -- : 2017-07-07T10:48:30+0000: [Worker(host:voldemort-PC pid:9420 thread:jruby-rack-worker#1)] Starting job worker
> 
####<Jul 7, 2017, 6:48:34,991 PM SGT> <Info> <Health> <voldemort-PC> <AdminServer> <weblogic.GCMonitor> <<anonymous>> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000006> <1499424514991> <[severity-value: 64] [rid: 0:1] [partition-id: 0] [partition-name: DOMAIN] > <BEA-310002> <21% of the total memory in the server is free.> 
####<Jul 7, 2017, 6:50:34,994 PM SGT> <Info> <Health> <voldemort-PC> <AdminServer> <weblogic.GCMonitor> <<anonymous>> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000006> <1499424634994> <[severity-value: 64] [rid: 0:1] [partition-id: 0] [partition-name: DOMAIN] > <BEA-310002> <35% of the total memory in the server is free.> 

这里缺少什么,我怎么知道 JobWorker 是否成功启动或为什么没有启动?

你没看错,你的日志输出确认工作人员已启动,很好!

####<Jul 7, 2017, 6:48:30,404 PM SGT> <Info> <ServletContext-/myrubyapp> <voldemort-PC> <AdminServer> <jruby-rack-worker#1> <weblogic> <> <ef7dc28a-6fde-4131-b1b0-41f2bd3db01b-00000021> <1499424510404> <[severity-value: 64] [rid: 0:3] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000000> <I, [2017-07-07T10:48:30.401000 #9420]  INFO -- : 2017-07-07T10:48:30+0000: [Worker(host:voldemort-PC pid:9420 thread:jruby-rack-worker#1)] Starting job worker

您可能没有在 DJ 的队列中放置任何东西...因此没有看到任何工作完成。

delayed_cron_job 不会自动神奇地启动 - 可能您的 worker rb 文件没有被任何东西加载。您应该触发加载此类工作文件,但在重新启动时要小心,因为您可能需要删除以前的计划。