GithubHelp home page GithubHelp logo

dropwizard-sundial's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dropwizard-sundial's Issues

Sundial Scheduler failed to initialize: Unexpected problem: No resource for MyJob

I'm getting the following and I really have no idea what I am doing wrong. Double-checked everything, made a very simple example based on your README.md - it's always the same problem! :-(

INFO  [2017-11-15 16:20:59,562] org.eclipse.jetty.server.Server: jetty-9.4.7.v20170914
INFO  [2017-11-15 16:20:59,574] org.knowm.sundial.ee.SundialInitializerListener: Sundial Initializer Servlet loaded, initializing Scheduler...
INFO  [2017-11-15 16:20:59,587] org.quartz.core.SchedulerSignalerImpl: Initialized Scheduler Signaler of type: class org.quartz.core.SchedulerSignalerImpl
INFO  [2017-11-15 16:20:59,590] org.quartz.core.RAMJobStore: RAMJobStore initialized.
INFO  [2017-11-15 16:20:59,590] org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin: Initializing XMLSchedulingDataProcessorPlugin Plug-in.
INFO  [2017-11-15 16:20:59,590] org.quartz.plugins.management.ShutdownHookPlugin: Registering Quartz shutdown hook.
INFO  [2017-11-15 16:20:59,590] org.knowm.sundial.plugins.AnnotationJobTriggerPlugin: Initializing AnnotationJobTriggerPlugin Plug-in.
INFO  [2017-11-15 16:20:59,612] org.quartz.plugins.xml.XMLSchedulingDataProcessor: Parsing XML file: jobs.xml
INFO  [2017-11-15 16:20:59,694] org.quartz.plugins.xml.XMLSchedulingDataProcessor: Adding 1 jobs, 1 triggers.
INFO  [2017-11-15 16:20:59,694] org.quartz.plugins.xml.XMLSchedulingDataProcessor: Scheduled job: name: 'MyJob', Job Class: de.ddb.jobs.MyJob, description: null isConcurrencyAllowed: false, jobDataMap: [MyParam=42] 
INFO  [2017-11-15 16:20:59,694] org.quartz.plugins.xml.XMLSchedulingDataProcessor: Scheduled trigger: Trigger 'MyJob-Trigger',  triggerClass: CronTriggerImpl, jobName: MyJob, jobDataMap: empty, calendar: null, misfireInstruction: 0, priority: 5, nextFireTime: null, cronEx: 0/45 * * * * ?, timeZone: Europe/Berlin
INFO  [2017-11-15 16:20:59,696] org.knowm.sundial.plugins.AnnotationJobTriggerPlugin: Loading annotated jobs from de.ddb.jobs.MyJob.
ERROR [2017-11-15 16:20:59,698] org.knowm.sundial.ee.SundialInitializerListener: Sundial Scheduler failed to initialize: 
! java.lang.RuntimeException: Unexpected problem: No resource for de/ddb/jobs/MyJob
! at org.quartz.classloading.CascadingClassLoadHelper.getJobClasses(CascadingClassLoadHelper.java:227)
! at org.knowm.sundial.plugins.AnnotationJobTriggerPlugin.start(AnnotationJobTriggerPlugin.java:88)
! at org.quartz.QuartzScheduler.startPlugins(QuartzScheduler.java:1113)
! at org.quartz.QuartzScheduler.start(QuartzScheduler.java:211)
! at org.knowm.sundial.ee.SundialInitializerListener.contextInitialized(SundialInitializerListener.java:122)
! at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:890)
! at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:532)
! at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:853)
! at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:344)
! at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:785)
! at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
! at com.codahale.metrics.jetty9.InstrumentedHandler.doStart(InstrumentedHandler.java:103)
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
! at org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:273)
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
! at org.eclipse.jetty.server.handler.StatisticsHandler.doStart(StatisticsHandler.java:252)
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
! at org.eclipse.jetty.server.Server.start(Server.java:449)
! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
! at org.eclipse.jetty.server.Server.doStart(Server.java:416)
! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
! at io.dropwizard.cli.ServerCommand.run(ServerCommand.java:53)
! at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:44)
! at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:85)
! at io.dropwizard.cli.Cli.run(Cli.java:75)
! at io.dropwizard.Application.run(Application.java:93)
! at de.ddb.MyApplication.main(MyApplication.java:27)

I am using Version 1.2.0.

Creates new scheduled object on every run.

I see that sundial creates a new instance of scheduled object on every run. Can we avoid it and use the java timer like design. You create the object once and invokes the doRun() method on every schedule.

404 on Control Scheduler asynchronously via Curl

Hello Tim,

I used sundial in one of our applications successfully... however, I'm getting a 404 when I run the curl command to alter the config or to stop the scheduler. For example, I have the applications running on port 9006 and hence the command be -

curl -X POST "http://localhost:9006/admin/tasks/stopjob?JOB_NAME=OMIJob"

But I do not see that the job is stopped. Also, when executed, I received a 404 on my log as follows -

{"@timestamp":"2016-04-12T16:30:17.051-05:00","level":"ERROR","message":"Web Application Exception occurred","message_id":"71f3df1b-1fec-4a55-8512-f770d33f2e50","caller_class_name":"com.srini.soa.errors.mappers.WebAppExceptionMapper","caller_method_name":"toResponse","caller_file_name":"WebAppExceptionMapper.java","caller_line_number":26,"stack_trace":"j.w.r.NotFoundException: HTTP 404 Not Found\n\tat o.g.j.s.ServerRuntime$2.run(ServerRuntime.java:323) ~[jersey-server-2.22.1.jar:na]\n\tat o.g.j.i.Errors$1.call(Errors.java:271) [jersey-common-2.22.1.jar:na]\n\tat o.g.j.i.Errors$1.call(Errors.java:267)\n\tat o.g.j.i.Errors.process(Errors.java:315)\n\tat o.g.j.i.Errors.process(Errors.java:297)\n\tat o.g.j.i.Errors.process(Errors.java:267)\n\tat o.g.j.p.i.RequestScope.runInScope(RequestScope.java:317)\n\tat o.g.j.s.ServerRuntime.process(ServerRuntime.java:305) [jersey-server-2.22.1.jar:na]\n\tat o.g.j.s.ApplicationHandler.handle(ApplicationHandler.java:1154)\n\tat o.g.j.s.WebComponent.serviceImpl(WebComponent.java:471) [jersey-container-servlet-core-2.22.1.jar:na]\n\tat o.g.j.s.WebComponent.service(WebComponent.java:425)\n\tat o.g.j.s.ServletContainer.service(ServletContainer.java:383)\n\tat o.g.j.s.ServletContainer.service(ServletContainer.java:336)\n\tat o.g.j.s.ServletContainer.service(ServletContainer.java:223)\n\tat i.d.j.NonblockingServletHolder.handle(NonblockingServletHolder.java:49) [dropwizard-jetty-0.9.1.jar:0.9.1]\n\tat o.e.j.s.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669) [jetty-servlet-9.2.13.v20150730.jar:9.2.13.v20150730]\n\tat o.e.j.s.UserAgentFilter.doFilter(UserAgentFilter.java:83) [jetty-servlets-9.2.13.v20150730.jar:9.2.13.v20150730]\n\tat o.e.j.s.GzipFilter.doFilter(GzipFilter.java:300)\n\tat i.d.j.BiDiGzipFilter.doFilter(BiDiGzipFilter.java:132) [dropwizard-jetty-0.9.1.jar:0.9.1]\n\tat o.e.j.s.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) [jetty-servlet-9.2.13.v20150730.jar:9.2.13.v20150730]\n\tat i.d.s.ThreadNameFilter.doFilter(ThreadNameFilter.java:29) [dropwizard-servlets-0.9.1.jar:0.9.1]\n\tat o.e.j.s.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) [jetty-servlet-9.2.13.v20150730.jar:9.2.13.v20150730]\n\tat i.d.j.f.AllowedMethodsFilter.handle(AllowedMethodsFilter.java:43) [dropwizard-jersey-0.9.1.jar:0.9.1]\n\tat i.d.j.f.AllowedMethodsFilter.doFilter(AllowedMethodsFilter.java:38)\n\tat o.e.j.s.ServletHandler$CachedChain.doFilter(ServletHan..."}
{"@timestamp":"2016-04-12T16:30:17.052-05:00","thread_name":"dw-114","message":"HTTP Response Log Entry","message_id":"71f3df1b-1fec-4a55-8512-f770d33f2e50","http_headers":{"Content-Length":"0","Date":"Tue, 12 Apr 2016 21:30:17 GMT"},"http_status_code":404,"response_time":2}
0:0:0:0:0:0:0:1 - - [12/Apr/2016:21:30:17 +0000] "POST /admin/tasks/stopjob?JOB_NAME=OMIJob HTTP/1.1" 404 0 "-" "curl/7.43.0" 3

Do I have to explicitly implement /admin/tasks/stopjob resources?
What am I missing here? Would you know?

Thanks,
Sripos

Adding job manually

Hi @timmolter

I tried to add a job manually but everytime sundial throws an exception

SundialJobScheduler.addJob("emailJob","EmailJob");
SundialJobScheduler.addCronTrigger("testJob", "emailJob", "23 58 12 6 4 ?");

com.xeiam.sundial.SundialJobScheduler: ERROR ADDING JOB!!!
! java.lang.ClassNotFoundException: EmailJob

Tasks API for managing the jobs return 404

Hi, In my set up of dropwizard 0.9.2, /admin/tasks/startjob or /tasks/startjob as well as the other calls do not exist. I receive 404.

I don't use jobs.xml but I don't think the issue is related to that.
In the startup dropwizard lists only two tasks /tasks/log-level and /tasks/gc. The Sundial jobs are not listed.

How to wait until threads spawned by job are complete?

If I have job with a @SimpleTrigger it keeps firing even with isConcurrencyAllowed = false before the threads of that job are complete.

How do I go about telling the job to wait until it's spawned threads are complete before attempting to start again?

Using JDBI

Hey all

Just curious if there's a good example for accessing the database object Dropwizard uses for my web requests within jobs. Is it a matter of adding that object to the application context?

Thanks

Jobs cannot be loaded if the project is inside a directory with a space in its name

So I constantly ran into this error:

INFO  [2016-05-18 13:20:15,003] org.quartz.classloading.CascadingClassLoadHelper: Package: 'nl.glu.voteapp.jobs' becomes Resource: 'file:/E:/Development/Studenten%20App/glu-app-backend/target/classes/nl/glu/voteapp/jobs'
ERROR [2016-05-18 13:20:15,006] org.knowm.sundial.ee.SundialInitializerListener: Sundial Scheduler failed to initialize: 
! java.lang.NullPointerException: null

Then I removed the space in the directory name and it worked. I guess the fix is to not encode the directory path so that it doesn't add the %20 but instead uses a normal space.

Not able to start job manually

Whenever I do a POST to /tasks/startjob?JOB_NAME={JobClassName} I get the following error:

WARN  [2020-10-21 10:14:19,988] org.eclipse.jetty.server.HttpChannel: /tasks/startjob
! java.lang.AbstractMethodError: Receiver class org.knowm.dropwizard.sundial.tasks.StartJobTask does not define or inherit an implementation of the resolved method 'abstract void execute(java.util.Map, java.io.PrintWriter)' of abstract class io.dropwizard.servlets.tasks.Task.

I'm using dropwizard-sundial version 1.3.1 and dropwizard 2.0.13

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.