1

I'm using Wildfly 9 to deploy two web applications (wars) simultaneously. I recently upgraded the version of quartz used by one of the applications and now I'm getting the following error when I deploy:

Caused by: org.quartz.SchedulerConfigException: Unable to instantiate InstanceIdGenerator class: org.quartz.simpl.SimpleInstanceIdGenerator cannot be cast to org.quartz.spi.InstanceIdGenerator [See nested exception: java.lang.ClassCastException: org.quartz.simpl.SimpleInstanceIdGenerator cannot be cast to org.quartz.spi.InstanceIdGenerator]
    at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:814)
    at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1519)
    at org.springframework.scheduling.quartz.SchedulerFactoryBean.createScheduler(SchedulerFactoryBean.java:597)
    at org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:480)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1631)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568)
    ... 42 more

Caused by: java.lang.ClassCastException: org.quartz.simpl.SimpleInstanceIdGenerator cannot be cast to org.quartz.spi.InstanceIdGenerator
    at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:811)
    ... 47 more

As far as I can tell, Wildfly doesn't use quartz (does it?), so I assume there is a classloading confilct with the quartz dependency from the other application. I tried to add a quartz exclusion in Jboss-deployment-structure, but the conflict persists. This is my jboss-deployment-structure:

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
    <deployment>
        <dependencies>
            <module name="deployment.urtdsm-historian"/>

            <!-- ANTLR -->
            <module name="org.antlr" />

            <!-- ASM -->
            <module name="asm.asm" />

            <!-- APACHE COMMONS -->
            <module name="org.apache.commons.beanutils" />
            <module name="org.apache.commons.codec" />
            <module name="org.apache.commons.collections" />
            <module name="org.apache.commons.io" />
            <module name="org.apache.commons.pool" />

            <!-- JAVAX.VALIDATION -->
            <module name="javax.validation.api" />

            <!-- DOM4J -->
            <module name="org.dom4j" />

            <!-- JTA -->
            <module name="javax.transaction.api" />

            <!-- WOODSTOX -->
            <module name="org.codehaus.woodstox" />

            <!-- JETTISON -->
            <module name="org.codehaus.jettison" />

            <!-- JACKSON -->
            <module name="org.codehaus.jackson.jackson-core-asl" />
            <module name="org.codehaus.jackson.jackson-mapper-asl" />

            <!-- JAVASSIST -->
            <module name="org.javassist" />

            <!-- APACHE NEETHI -->
            <module name="org.apache.neethi" />

        </dependencies>

        <exclusions>
            <module name="org.hibernate" />
            <module name="org.hibernate.validator" />
            <module name="org.slf4j" />
            <module name="org.slf4j.impl" />
            <module name="org.apache.commons.logging" />
            <module name="org.apache.log4j" />
            <module name="org.jboss.logging" />
            <module name="org.jboss.logging.jul-to-slf4j-stub" />
            <module name="org.jboss.logmanager" />
            <module name="org.jboss.logmanager.log4j" />
            <module name="com.sun.xml.bind" />
            <module name="org.quartz-scheduler" />
        </exclusions>

        <exclude-subsystems>
             <subsystem name="webservices" />
             <subsystem name="weld" />
         </exclude-subsystems>
    </deployment>
    <module name="deployment.urtdsm-historian">
        <dependencies>
            <module name="deployment.urtdsm-historian-0.1-SNAPSHOT.war">
                <exports>                   
                    <exclude path="org/hibernate/**" />
                    <exclude path="org/springframework/orm/**" />
                    <exclude path="org/springframework/transaction/**" />
                    <exclude path="org/quartz-scheduler/**" />
                    <include path="com/tdf/**" />
                    <include path="com/psymetrix/**" />
                    <include path="org/springframework/**" />
                    <include path="org/aopalliance/**" />
                    <include path="org/aspectj/**" />
                    <include path="org/postgresql/**" />
                </exports>
            </module>
        </dependencies>
    </module>
</jboss-deployment-structure>

I can't find much in the way of documentation on classloading conflicts between two deployed wars. Am I doing something wrong here? Any help would be appreciated. Thanks.

Quartz - 2.2.1

Wildfly - 9.0.1

thesecretmaster
  • 1,950
  • 1
  • 27
  • 39
user3029642
  • 909
  • 3
  • 10
  • 23

1 Answers1

0

I fixed the issue by excluding Spring scheduling. My Quartz exclusion was working, but Quartz was still getting in via the dependency chain.

user3029642
  • 909
  • 3
  • 10
  • 23