mausch / QuartzNetWebConsole

Embeddable Quartz.Net web console
Other
160 stars 62 forks source link

QuartzNetWebConsole with ADO.NET job store #18

Closed AnalogJ closed 2 years ago

AnalogJ commented 11 years ago

I've added the webconsole to an MVC3 project, and unfortunately the default httpHandler and handler registration in the web.config does not seem to properly setup routing to the /quartz/index page. I even tried adding a routes.IgnoreRoute("quartz/{*pathInfo}"); line in the RegisterRoutes method which is called during Applciation_Start() however it did not work. It would be nice if QuartzNetWebConsole supported a .axd extension as well to access the index page, as .axd pages are ignored by the MVC3 routing engine by default.

mausch commented 11 years ago

Make sure the IgnoreRoute is the first line in the RegisterRoutes method

AnalogJ commented 11 years ago

You're right, the IgnoreRoute does actually seem to be working now, its acutally a Quartz controller error that I'm seeing. I've been playing around with Quartz web console for a while and I wasn't looking closely at the errors. Heres the proper stack trace:

[NotImplementedException: The method or operation is not implemented.]
   Quartz.Impl.AdoJobStore.JobStoreSupport.IsTriggerGroupPaused(String groupName) in c:\Work\OpenSource\quartznet\src\Quartz\Impl\AdoJobStore\JobStoreSupport.cs:914
   Quartz.Core.QuartzScheduler.IsTriggerGroupPaused(String groupName) in c:\Work\OpenSource\quartznet\src\Quartz\Core\QuartzScheduler.cs:2359
   Quartz.Impl.StdScheduler.IsTriggerGroupPaused(String groupName) in c:\Work\OpenSource\quartznet\src\Quartz\Impl\StdScheduler.cs:63
   QuartzNetWebConsole.Controllers.IndexController.<Execute>b__0(String t) in g:\prg\QuartzNetWebConsole\QuartzNetWebConsole\Controllers\IndexController.cs:14
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +85
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +217
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +78
   QuartzNetWebConsole.Controllers.IndexController.Execute(HttpContextBase context) in g:\prg\QuartzNetWebConsole\QuartzNetWebConsole\Controllers\IndexController.cs:13
   MiniMVC.Controller.ProcessRequest(HttpContext context) in G:\prg\MiniMVC\MiniMVC\Controller.cs:27
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

It looks like theres an issue with the IsTriggerGroupPaused method. Not sure if this helps, but I;m using Quartz.Net 2.0.1

mausch commented 11 years ago

The stack trace indicates that IsTriggerGroupPaused is not supported for the ADO.NET job store. I use the in-memory job store so I don't know what is or isn't supported in other job store implementations. QuartzNetWebConsole should probably catch this exception and show "N/A". What do you think? Are you up for forking and changing this?

AnalogJ commented 11 years ago

Sure, I'll pull down the source and take a look. A small caveat though, the Quartz scheduler I'm integrating in my source is still in an experimental branch, so there no guarantee that I'll be able to do a pull request anytime soon.

mausch commented 11 years ago

I wrapped IsJobGroupPaused / IsTriggerGroupPaused in a43573ba1d859e87a4b36a8bc0ae503c7a7848ff . If there's anything else that needs to be wrapped, you can do it in ISchedulerWrapper.

mausch commented 11 years ago

Ping! Can you confirm if this working for you as expected?

mausch commented 11 years ago

Ping! Can you confirm if this working for you as expected?

AnalogJ commented 11 years ago

Hey @mausch I finally got around to updating my QuartzNetWebConsole version from nuget. It looks like I can finally see the WebConsole in my app. So thanks.

With just some cursory clicking I did notice that the Job Groups links work properly, but the Trigger Groups produce the following error when I click on them.

The method or operation is not implemented.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.NotImplementedException: The method or operation is not implemented.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[NotImplementedException: The method or operation is not implemented.]
   Quartz.Impl.AdoJobStore.JobStoreSupport.IsTriggerGroupPaused(String groupName) in     c:\Work\OpenSource\Quartz.NET\quartznet\src\Quartz\Impl\AdoJobStore\JobStoreSupport.cs:859
   Quartz.Core.QuartzScheduler.IsTriggerGroupPaused(String groupName) in c:\Work\OpenSource\Quartz.NET\quartznet\src\Quartz\Core\QuartzScheduler.cs:2381
   Quartz.Impl.StdScheduler.IsTriggerGroupPaused(String groupName) in c:\Work\OpenSource\Quartz.NET\quartznet\src\Quartz\Impl\StdScheduler.cs:63
   QuartzNetWebConsole.Controllers.TriggerGroupController.Execute(HttpContextBase context, Func`1 getScheduler) in g:\prg\QuartzNetWebConsole\QuartzNetWebConsole\Controllers\TriggerGroupController.cs:22
   QuartzNetWebConsole.ControllerFactory.<.ctor>b__8(HttpContextBase ctx) in g:\prg\QuartzNetWebConsole\QuartzNetWebConsole\ControllerFactory.cs:31
  MiniMVC.HttpHandler.ProcessRequest(HttpContext context) in g:\prg\MiniMVC\MiniMVC\HttpHandler.cs:17
  System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341
  System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
mausch commented 11 years ago

@AnalogJ Please add that method to ISchedulerWrapper / SchedulerWrapper as I did in a43573ba1d859e87a4b36a8bc0ae503c7a7848ff

AnalogJ commented 11 years ago

Hey @mausch, Hopefully I'm not misunderstanding what you want me to do because the method IsTriggerGroupPaused is already wrapped in the ISchedulerWrapper. Actually the stack trace looks very similar to the original error that showed up months ago.

If you could point me in the right direction I could definitely make a pull request.

Thanks

mausch commented 11 years ago

@AnalogJ you're right. The problem is that TriggerGroupController and TriggersByJobController are currently using IScheduler instead of ISchedulerWrapper.

mausch commented 11 years ago

Applied that change in 53b9fed8a78be6e45d019f42cdc255ce9a5bdf35 , give it a try.

AnalogJ commented 11 years ago

Hey @mausch, I know this a bit to ask, but is there any way you could upload that commit to nuget as a pre-release package. I admit, I'm asking out of complete lazyness, but it would definitely make it just that much easier for me to test. But if you're too busy I can definitely just pull down the code and compile it myself.

mausch commented 11 years ago

I'll make a release after this issue is closed.

mausch commented 10 years ago

Versions 0.3.0+ include these fixes. Have the issues been fixed?