Error loading class [org.springframework.scheduling.quartz.JobDetailBean] for bean with name... ...

Exception in thread “main” org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.springframework.scheduling.quartz.JobDetailBean] for bean with name ‘testJobber’ defined in class path resource [quartz/job.xml]: problem with class file or dependent class; nested exception is java.lang.IncompatibleClassChangeError: class org.springframework.scheduling.quartz.JobDetailBean has interface org.quartz.JobDetail as super class
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1281)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:575)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1347)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:913)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:617)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:934)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:93)
at com.myhexin.iadvisor.Provider.main(Provider.java:13)
Caused by: java.lang.IncompatibleClassChangeError: class org.springframework.scheduling.quartz.JobDetailBean has interface org.quartz.JobDetail as super class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access100(URLClassLoader.java:71)atjava.net.URLClassLoader1.run(URLClassLoader.java:361)
at java.net.URLClassLoader1.run(URLClassLoader.java:355)atjava.security.AccessController.doPrivileged(NativeMethod)atjava.net.URLClassLoader.findClass(URLClassLoader.java:354)atjava.lang.ClassLoader.loadClass(ClassLoader.java:423)atsun.misc.LauncherAppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:265)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:419)
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1299)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1270)
… 9 more


最近在使用quartz结合spring做分布式定时任务的时候,发现启动过程中出现了这样的错误,查阅过资料之后发现是因为spring3.x只支持quartz1.8.x的包,而我的quartz使用的是2.2.1的包。修改之后即可正常运行。
记录一下,希望能帮到遇到过同样问题的人。

发布了31 篇原创文章 · 获赞 17 · 访问量 4万+
展开阅读全文

Error creating bean with name 'dataSource' defined in ServletContext resource

01-28

struts-config.xml配置信息 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"> <struts-config> <data-sources /> <form-beans /> <global-exceptions /> <global-forwards /> <action-mappings> <action path="/login" parameter="method" type="org.springframework.web.struts.DelegatingActionProxy"> <forward name="login" path="/WEB-INF/jsp/login.jsp"></forward> <forward name="success" path="/WEB-INF/jsp/common/main.jsp"></forward> <forward name="failure" path="/WEB-INF/jsp/login.jsp"></forward> </action> <action path="/commonJump" parameter="method" type="org.springframework.web.struts.DelegatingActionProxy"> <forward name="top" path="/WEB-INF/jsp/common/top.jsp" /> <forward name="left" path="/WEB-INF/jsp/common/left.jsp" /> <forward name="right" path="/WEB-INF/jsp/common/right.jsp" /> </action> </action-mappings> <message-resources parameter="com.af.family.ApplicationResources" /> <!-- 添加支持Spring的插件 --> <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn"> <set-property property="contextConfigLocation" value="/WEB-INF/spring.xml" /> </plug-in> </struts-config> spring.xml配置信息 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="propertyConfigure" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location" value="/WEB-INF/jdbc.properties" /> </bean> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="${database.driver}"></property> <property name="url" value="${database.url}"></property> <property name="username" value="${database.username}"></property> <property name="password" value="${database.password}"></property> <property name="initialSize" value="25" /> <property name="maxActive" value="100" /> </bean> <bean id="loginDao" class="com.af.family.dao.common.LoginDaoImpl"> <property name="dataSource" ref="dataSource"></property> </bean> <!-- 对于Action组件配置,name,class。name的值是struts-config.xml中相应action的path值 --> <bean name="/login" class="com.af.family.action.LoginAction"> <property name="dao" ref="loginDao"></property> </bean> <bean name="/commonJump" class="com.af.family.action.CommonJumpAction"> </bean> </beans> 部署后出现如下错误: [color=red]严重: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring.xml]: Initialization of bean failed; nested exception is org.springframework.beans.InvalidPropertyException: Invalid property 'initialSize' of bean class [org.springframework.jdbc.datasource.DriverManagerDataSource]: No property 'initialSize' found Caused by: org.springframework.beans.InvalidPropertyException: Invalid property 'initialSize' of bean class [org.springframework.jdbc.datasource.DriverManagerDataSource]: No property 'initialSize' found [/color] at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:376) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1107) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:857) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352) at org.springframework.web.struts.ContextLoaderPlugIn.createWebApplicationContext(ContextLoaderPlugIn.java:354) at org.springframework.web.struts.ContextLoaderPlugIn.initWebApplicationContext(ContextLoaderPlugIn.java:295) at org.springframework.web.struts.ContextLoaderPlugIn.init(ContextLoaderPlugIn.java:225) at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4045) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4351) at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1105) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1203) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590) at java.lang.Thread.run(Unknown Source) 2011-1-28 13:53:11 org.apache.catalina.core.ApplicationContext log 问答

Myeclipse新导入项目报错Error creating bean with name

06-29

没分了,跪求帮助,在线等!!! 控制台错误如下: 六月 29, 2016 5:37:45 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 六月 29, 2016 5:38:05 下午 org.apache.catalina.core.StandardContext listenerStart 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SysInitBean' defined in class path resource [spring/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:605) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5003) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1263) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1978) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NullPointerException at com.jshx.sensitive.SensitiveWordUtil.readSensitiveWord(SensitiveWordUtil.java:69) at com.jshx.sensitive.SensitiveWordUtil.initKeyWord(SensitiveWordUtil.java:32) at com.jshx.core.init.SysInitBean.afterPropertiesSet(SysInitBean.java:73) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) ... 25 more 六月 29, 2016 5:38:05 下午 org.apache.catalina.core.StandardContext startInternal 严重: One or more listeners failed to start. Full details will be found in the appropriate container log file 六月 29, 2016 5:38:05 下午 org.apache.catalina.core.StandardContext startInternal 严重: Context [/cdly] startup failed due to previous errors 六月 29, 2016 5:38:05 下午 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext 六月 29, 2016 5:38:05 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc 严重: The web application [/cdly] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 六月 29, 2016 5:38:05 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 严重: The web application [/cdly] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak. 六月 29, 2016 5:38:05 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory D:\apache-tomcat-7.0.65\webapps\cdly has finished in 27,404 ms 六月 29, 2016 5:38:05 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-apr-8080"] 六月 29, 2016 5:38:05 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-apr-8009"] 六月 29, 2016 5:38:05 下午 org.apache.catalina.startup.Catalina start 信息: Server startup in 29229 ms 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览