Bug 1040820 - Quartz component throws CCE during deployment
Summary: Quartz component throws CCE during deployment
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: Build Process
Version: 6.0.0 GA
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ER8
: 6.0.0
Assignee: Julian Coleman
QA Contact: Jiri Sedlacek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-12 07:46 UTC by Jiri Pechanec
Modified: 2015-08-02 23:45 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)

Description Jiri Pechanec 2013-12-12 07:46:38 UTC
Try camel-quartz-binding or camel-sql-binding. A CCE is thrown during dpeloyment preventing the use of appliaction

08:38:13,593 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."switchyard-quickstart-camel-quartz-binding.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.unit."switchyard-quickstart-camel-quartz-binding.jar".SwitchYardService: org.switchyard.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route V1CamelQuartzBindingModel/GreetingService@_GreetingService_quartz_1#-511958337: Route[[From[quartz://EverySecondJob?cron=*%20*%20*%20*%20*%2... because of Failed to resolve endpoint: quartz://EverySecondJob?cron=*+*+*+*+*+%3F due to: Cannot auto create component: quartz
	at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:80)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
	at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
Caused by: org.switchyard.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route V1CamelQuartzBindingModel/GreetingService@_GreetingService_quartz_1#-511958337: Route[[From[quartz://EverySecondJob?cron=*%20*%20*%20*%20*%2... because of Failed to resolve endpoint: quartz://EverySecondJob?cron=*+*+*+*+*+%3F due to: Cannot auto create component: quartz
	at org.switchyard.component.camel.common.handler.InboundHandler.<init>(InboundHandler.java:69)
	at org.switchyard.component.camel.common.deploy.BaseBindingActivator.createInboundHandler(BaseBindingActivator.java:51)
	at org.switchyard.component.camel.common.deploy.BaseBindingActivator.activateBinding(BaseBindingActivator.java:43)
	at org.switchyard.deploy.internal.Deployment.deployServiceBindings(Deployment.java:618)
	at org.switchyard.deploy.internal.Deployment.start(Deployment.java:145)
	at org.switchyard.as7.extension.deployment.SwitchYardDeployment.start(SwitchYardDeployment.java:101)
	at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:73)
	... 5 more
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route V1CamelQuartzBindingModel/GreetingService@_GreetingService_quartz_1#-511958337: Route[[From[quartz://EverySecondJob?cron=*%20*%20*%20*%20*%2... because of Failed to resolve endpoint: quartz://EverySecondJob?cron=*+*+*+*+*+%3F due to: Cannot auto create component: quartz
	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:177)
	at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:731)
	at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1803)
	at org.apache.camel.impl.DefaultCamelContext.addRouteDefinitions(DefaultCamelContext.java:675)
	at org.apache.camel.impl.DefaultCamelContext.addRouteDefinition(DefaultCamelContext.java:680)
	at org.switchyard.component.camel.common.handler.InboundHandler.<init>(InboundHandler.java:67)
	... 11 more
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: quartz://EverySecondJob?cron=*+*+*+*+*+%3F due to: Cannot auto create component: quartz
	at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:488)
	at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:61)
	at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:187)
	at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:108)
	at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:114)
	at org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:72)
	at org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:90)
	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:857)
	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:172)
	... 16 more
Caused by: org.apache.camel.RuntimeCamelException: Cannot auto create component: quartz
	at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:329)
	at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:462)
	... 24 more
Caused by: org.quartz.SchedulerConfigException: Unable to instantiate class load helper class: org.quartz.simpl.CascadingClassLoadHelper cannot be cast to org.quartz.spi.ClassLoadHelper [See nested exception: java.lang.ClassCastException: org.quartz.simpl.CascadingClassLoadHelper cannot be cast to org.quartz.spi.ClassLoadHelper]
	at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:683)
	at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1465)
	at org.apache.camel.component.quartz.QuartzComponent.createScheduler(QuartzComponent.java:475)
	at org.apache.camel.component.quartz.QuartzComponent.getScheduler(QuartzComponent.java:361)
	at org.apache.camel.component.quartz.QuartzComponent.startScheduler(QuartzComponent.java:328)
	at org.apache.camel.component.quartz.QuartzComponent.onCamelContextStarted(QuartzComponent.java:188)
	at org.apache.camel.impl.DefaultCamelContext.addStartupListener(DefaultCamelContext.java:975)
	at org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:1774)
	at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:324)
	... 25 more
Caused by: java.lang.ClassCastException: org.quartz.simpl.CascadingClassLoadHelper cannot be cast to org.quartz.spi.ClassLoadHelper
	at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:680)
	... 33 more

08:38:13,623 ERROR [org.jboss.as.server] (management-handler-thread - 1) JBAS015870: Deploy of deployment "switchyard-quickstart-camel-quartz-binding.jar" was rolled back with the following failure message: 
{"JBAS014671: Failed services" => {"jboss.deployment.unit.\"switchyard-quickstart-camel-quartz-binding.jar\".SwitchYardService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"switchyard-quickstart-camel-quartz-binding.jar\".SwitchYardService: org.switchyard.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route V1CamelQuartzBindingModel/GreetingService@_GreetingService_quartz_1#-511958337: Route[[From[quartz://EverySecondJob?cron=*%20*%20*%20*%20*%2... because of Failed to resolve endpoint: quartz://EverySecondJob?cron=*+*+*+*+*+%3F due to: Cannot auto create component: quartz
    Caused by: org.switchyard.SwitchYardException: org.apache.camel.FailedToCreateRouteException: Failed to create route V1CamelQuartzBindingModel/GreetingService@_GreetingService_quartz_1#-511958337: Route[[From[quartz://EverySecondJob?cron=*%20*%20*%20*%20*%2... because of Failed to resolve endpoint: quartz://EverySecondJob?cron=*+*+*+*+*+%3F due to: Cannot auto create component: quartz
    Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route V1CamelQuartzBindingModel/GreetingService@_GreetingService_quartz_1#-511958337: Route[[From[quartz://EverySecondJob?cron=*%20*%20*%20*%20*%2... because of Failed to resolve endpoint: quartz://EverySecondJob?cron=*+*+*+*+*+%3F due to: Cannot auto create component: quartz
    Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: quartz://EverySecondJob?cron=*+*+*+*+*+%3F due to: Cannot auto create component: quartz
    Caused by: org.apache.camel.RuntimeCamelException: Cannot auto create component: quartz
    Caused by: org.quartz.SchedulerConfigException: Unable to instantiate class load helper class: org.quartz.simpl.CascadingClassLoadHelper cannot be cast to org.quartz.spi.ClassLoadHelper [See nested exception: java.lang.ClassCastException: org.quartz.simpl.CascadingClassLoadHelper cannot be cast to org.quartz.spi.ClassLoadHelper]
    Caused by: java.lang.ClassCastException: org.quartz.simpl.CascadingClassLoadHelper cannot be cast to org.quartz.spi.ClassLoadHelper"}}

Comment 1 Keith Babo 2013-12-12 16:26:51 UTC
I don't see this in community, but I can reproduce it in FSW 6 ER7.  The difference with the FSW build is that there are two modules containing quartz (both at version 1.8.5):

(1) ./system/layers/soa/org/apache/camel/quartz/main/module.xml
(2) ./system/layers/soa/com/opensymphony/quartz/main/module.xml

#1 comes in via SwitchYard.  #2 comes in via Drools/jBPM modules.  These could normally live together in peace, but it turns out that org.kie.lib exports the quartz dependency.  A number of other modules in FSW 6 have been modified to depend on org.kie.lib (including org.apache.camel) and those export the dependency again.  This ends up bringing both versions of quartz into the application class path and BOOM!  

One solution to the problem is to simply remove the export of quartz in org.kie.lib.  I have tested this approach in addressing the issue reported in this BZ and it works.  I have not performed a full evaluation to determine if this has any impact on the Drools/jBPM side.

Another solution is to use the same module for quartz 1.8.5.  I tried to slam this in quickly and it didn't work, so I imagine some additional massaging is required to the module.xml to work for both SY/Camel and Drools/jBPM.

Something important to note here is that ALL dependencies in org.kie.lib are marked as exported, which means they are visible to any module that imports it.  Further, ALL modules which depend on org.kie.lib turn around and export it as well.  One of these modules is org.apache.camel, which means it touches pretty much everything in FSW.  I'm not trying to be alarmist here, but it seems to me this collapses the module class loader space into a single class loader space for all these dependencies.  It's not clear to me what impact this will have for user applications which want to include dependencies on their own modules independent of what we use inside the runtime.

One other thing I noticed with the org.kie.lib dependency on com.opensymphony.quartz - I looked at the module definition for com.opensymphony.quartz and it depends on org.kie.lib (and exports the dependency).  This doesn't look right to me.

Comment 2 Keith Babo 2013-12-12 17:23:03 UTC
Two points of clarification:

> Something important to note here is that ALL dependencies in org.kie.lib are
> marked as exported, which means they are visible to any module that imports
> it.  Further, ALL modules which depend on org.kie.lib turn around and export
> it as well.  One of these modules is org.apache.camel, which means it
> touches pretty much everything in FSW.  

When I say "export it as well", I mean that all modules which depend on org.kie.lib also export org.kie.lib, which means that modules which do not directly depend on org.kie.lib end up with visibility to all of org.kie.lib anyway (since it exports everything).


> One other thing I noticed with the org.kie.lib dependency on
> com.opensymphony.quartz - I looked at the module definition for
> com.opensymphony.quartz and it depends on org.kie.lib (and exports the
> dependency).  This doesn't look right to me.

In case it's not clear from the description, this is a circular dependency.

Comment 3 Julian Coleman 2013-12-15 11:30:47 UTC
See also:
  https://bugzilla.redhat.com/show_bug.cgi?id=1038713

Comment 4 Julian Coleman 2013-12-15 12:00:44 UTC
Removed BPMS modules from FSW with:

  make-mead branch 6.0.0-fsw commit b14d36bdcb6e687d1f7fd03d696876200620bb64

    BZ-1040820
    Revert "DTGov and SwitchYard now rely on Drools/jBPM modules."

    This reverts commit fa5d2bc0de6d45823327595156d126cd782b99bb.

  ip branch 6.0.0-fsw commit 312b05cec6a6fe5768fdaf983ab4f2d2bca80f62

    BZ-1040820
    Revert "BZ-1038705
            Exclude BPMS org/apache/commons/logging module."
    Revert "IPFSW-33 Removed drools/kie/jbpm modules from sy and replace from bpms-modules"
    Revert "IPFSW-33 BPMS Modulization work"
    
    This reverts commits d0ae700b68e15ccd7987c53bd8e2d19b00bc4903
                         d8709854fdf82a3bf505e84526dafdc6ffd495ad
                         e1e61b7cc202289b646420b7538568dcd4e41a5e

Comment 5 Jiri Pechanec 2013-12-20 09:55:57 UTC
Verified in ER8


Note You need to log in before you can comment on or make changes to this bug.