SpringMVC+quartz 报错

配置文件:

```<!-- 执行调度任务业务类 -->

<!--  配置执行类和方法 -->
<bean id="consultJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
    <property name="targetObject" ref="consultJob"></property>
    <property name="targetMethod" value="consultTypeCopy"></property>
    <property name="concurrent" value="false"></property>
</bean>

<!--  配置定时执行时间 -->
<bean id="consultTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
    <property name="jobDetail" ref="consultJobDetail"></property>
    <property name="cronExpression">
        <value>0/10 * * * * ?</value>
    </property>
</bean>

<!--  配置调度资源 -->
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"
      lazy-init="false" autowire="no">
    <property name="autoStartup" value="true"></property>
    <property name="startupDelay" value="0"/>
    <property name="triggers">
        <list>
            <ref local="consultTrigger"/>
        </list>
    </property>
</bean>
报错信息:

```Caused by: org.quartz.JobPersistenceException: The job (DEFAULT.consultJobDetail) referenced by the trigger does not exist.
    at org.quartz.simpl.RAMJobStore.storeTrigger(RAMJobStore.java:422)
    at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:932)
    at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:258)
    at org.springframework.scheduling.quartz.SchedulerAccessor.addTriggerToScheduler(SchedulerAccessor.java:312)
    at org.springframework.scheduling.quartz.SchedulerAccessor.registerJobsAndTriggers(SchedulerAccessor.java:235)
    at org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:512)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
    ... 57 more

使用 RAMJobStore 模式,不需要持久化到数据,启动时抛出如上异常?求解答!!

5个回答

Autowire注入时候报错了?错误信息太少了~是不是和autowire="no"有关~

qq_34121797
Doutzen丶 没有用到Autowire注入,去掉autowire="no" 也是报错,详细报错信息我贴在三楼 麻烦再瞅瞅 谢谢!
接近 3 年之前 回复
sun1021873926
夕阳雨晴 嗯嗯,关于RAM内存倒是没有接触过哈。
接近 3 年之前 回复
qq_34121797
Doutzen丶 感谢回答,链接给出的方案看过,但是我的需求是不需要持久化,quartz没有配置数据源,使用RAMJobStore 只存放在RAM内存中。
接近 3 年之前 回复

```F:\apache-tomcat-7.0.67\bin\catalina.bat run
[2017-09-10 10:51:34,492] Artifact consult-server-web:war: Server is not connected. Deploy is not available.
Using CATALINA_BASE: "C:\Users\Administrator.IntelliJIdea2016.2\system\tomcat\Unnamed_com_bytc_consult_2"
Using CATALINA_HOME: "F:\apache-tomcat-7.0.67"
Using CATALINA_TMPDIR: "F:\apache-tomcat-7.0.67\temp"
Using JRE_HOME: "D:\JAVA\jdk\jre"
Using CLASSPATH: "F:\apache-tomcat-7.0.67\bin\bootstrap.jar;F:\apache-tomcat-7.0.67\bin\tomcat-juli.jar"
Connected to the target VM, address: '127.0.0.1:53833', transport: 'socket'
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version: Apache Tomcat/7.0.67
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built: Dec 7 2015 13:07:11 UTC
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number: 7.0.67.0
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name: Windows 10
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version: 10.0
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture: amd64
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home: D:\JAVA\jdk\jre
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version: 1.8.0_144-b01
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor: Oracle Corporation
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE: C:\Users\Administrator.IntelliJIdea2016.2\system\tomcat\Unnamed_com_bytc_consult_2
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME: F:\apache-tomcat-7.0.67
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:53833,suspend=y,server=n
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcom.sun.management.jmxremote=
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcom.sun.management.jmxremote.port=1103
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcom.sun.management.jmxremote.ssl=false
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.rmi.server.hostname=127.0.0.1
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.util.logging.config.file=C:\Users\Administrator.IntelliJIdea2016.2\system\tomcat\Unnamed_com_bytc_consult_2\conf\logging.properties
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=F:\apache-tomcat-7.0.67\endorsed
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=C:\Users\Administrator.IntelliJIdea2016.2\system\tomcat\Unnamed_com_bytc_consult_2
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=F:\apache-tomcat-7.0.67
九月 10, 2017 10:51:38 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.io.tmpdir=F:\apache-tomcat-7.0.67\temp
九月 10, 2017 10:51:38 上午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.1.
九月 10, 2017 10:51:38 上午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
九月 10, 2017 10:51:39 上午 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized (OpenSSL 1.0.1m 19 Mar 2015)
九月 10, 2017 10:51:41 上午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-apr-8084"]
九月 10, 2017 10:51:41 上午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-apr-8009"]
九月 10, 2017 10:51:41 上午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 4877 ms
九月 10, 2017 10:51:41 上午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
九月 10, 2017 10:51:41 上午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.67
九月 10, 2017 10:51:41 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-apr-8084"]
九月 10, 2017 10:51:41 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
九月 10, 2017 10:51:41 上午 org.apache.catalina.startup.Catalina start
信息: Server startup in 185 ms
Connected to server
[2017-09-10 10:51:42,239] Artifact consult-server-web:war: Artifact is being deployed, please wait...
九月 10, 2017 10:51:43 上午 org.apache.catalina.deploy.WebXml setVersion
警告: Unknown version string [3.1]. Default version will be used.
九月 10, 2017 10:51:46 上午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
DEBUG [RMI TCP Connection(7)-127.0.0.1] LogFactory.setImplementation(128) | Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter.
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.getClass(101) | Class not found: org.jboss.vfs.VFS
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.setInvalid(137) | JBoss 6 VFS API is not available in this environment.
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.getClass(101) | Class not found: org.jboss.vfs.VirtualFile
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.getInstance(68) | VFS implementation org.apache.ibatis.io.JBoss6VFS is not valid in this environment.
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.getInstance(80) | Using VFS adapter org.apache.ibatis.io.DefaultVFS
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.findJarForResource(197) | Find JAR URL: jar:file:/F:/apache-tomcat-7.0.67/webapps/consultservice/WEB-INF/lib/core-1.0-SNAPSHOT.jar!/com/bytc/domain/consult
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.findJarForResource(203) | Inner URL: file:/F:/apache-tomcat-7.0.67/webapps/consultservice/WEB-INF/lib/core-1.0-SNAPSHOT.jar!/com/bytc/domain/consult
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.findJarForResource(214) | Extracted JAR URL: file:/F:/apache-tomcat-7.0.67/webapps/consultservice/WEB-INF/lib/core-1.0-SNAPSHOT.jar
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.isJar(291) | Found JAR: file:/F:/apache-tomcat-7.0.67/webapps/consultservice/WEB-INF/lib/core-1.0-SNAPSHOT.jar
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.list(64) | Listing jar:file:/F:/apache-tomcat-7.0.67/webapps/consultservice/WEB-INF/lib/core-1.0-SNAPSHOT.jar!/com/bytc/domain/consult
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.listResources(178) | Found resource: /com/bytc/domain/consult/ConsultAttachment.class
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.listResources(178) | Found resource: /com/bytc/domain/consult/ConsultContent.class
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.listResources(178) | Found resource: /com/bytc/domain/consult/ConsultDeviceType.class
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.listResources(178) | Found resource: /com/bytc/domain/consult/ConsultType.class
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.listResources(178) | Found resource: /com/bytc/domain/consult/ConsultUserType.class
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.addIfMatching(250) | Checking to see if class com.bytc.domain.consult.ConsultAttachment matches criteria [is assignable to Object]
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.addIfMatching(250) | Checking to see if class com.bytc.domain.consult.ConsultContent matches criteria [is assignable to Object]
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.addIfMatching(250) | Checking to see if class com.bytc.domain.consult.ConsultDeviceType matches criteria [is assignable to Object]
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.addIfMatching(250) | Checking to see if class com.bytc.domain.consult.ConsultType matches criteria [is assignable to Object]
DEBUG [RMI TCP Connection(7)-127.0.0.1] ResolverUtil.addIfMatching(250) | Checking to see if class com.bytc.domain.consult.ConsultUserType matches criteria [is assignable to Object]
INFO [RMI TCP Connection(7)-127.0.0.1] PropertiesFactoryBean.loadProperties(172) | Loading properties file from URL [file:/opt/local/boYuConfig/quartz.properties]
INFO [RMI TCP Connection(7)-127.0.0.1] StdSchedulerFactory.instantiate(1172) | Using default implementation for ThreadExecutor
INFO [RMI TCP Connection(7)-127.0.0.1] SchedulerSignalerImpl.(61) | Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
INFO [RMI TCP Connection(7)-127.0.0.1] QuartzScheduler.(240) | Quartz Scheduler v.2.2.3 created.
INFO [RMI TCP Connection(7)-127.0.0.1] RAMJobStore.initialize(155) | RAMJobStore initialized.
INFO [RMI TCP Connection(7)-127.0.0.1] QuartzScheduler.initialize(305) | Scheduler meta-data: Quartz Scheduler (v2.2.3) 'org.springframework.scheduling.quartz.SchedulerFactoryBean#0' with instanceId 'NON_CLUSTERED'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.
Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.

INFO [RMI TCP Connection(7)-127.0.0.1] StdSchedulerFactory.instantiate(1327) | Quartz scheduler 'org.springframework.scheduling.quartz.SchedulerFactoryBean#0' initialized from an externally provided properties instance.
INFO [RMI TCP Connection(7)-127.0.0.1] StdSchedulerFactory.instantiate(1331) | Quartz scheduler version: 2.2.3
INFO [RMI TCP Connection(7)-127.0.0.1] QuartzScheduler.setJobFactory(2311) | JobFactory set to: org.springframework.scheduling.quartz.AdaptableJobFactory@c5ab451
INFO [RMI TCP Connection(7)-127.0.0.1] StdSchedulerFactory.instantiate(1172) | Using default implementation for ThreadExecutor
INFO [RMI TCP Connection(7)-127.0.0.1] SchedulerSignalerImpl.(61) | Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
INFO [RMI TCP Connection(7)-127.0.0.1] QuartzScheduler.(240) | Quartz Scheduler v.2.2.3 created.
INFO [RMI TCP Connection(7)-127.0.0.1] RAMJobStore.initialize(155) | RAMJobStore initialized.
INFO [RMI TCP Connection(7)-127.0.0.1] QuartzScheduler.initialize(305) | Scheduler meta-data: Quartz Scheduler (v2.2.3) 'org.springframework.scheduling.quartz.SchedulerFactoryBean#1' with instanceId 'NON_CLUSTERED'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.
Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.

INFO [RMI TCP Connection(7)-127.0.0.1] StdSchedulerFactory.instantiate(1327) | Quartz scheduler 'org.springframework.scheduling.quartz.SchedulerFactoryBean#1' initialized from an externally provided properties instance.
INFO [RMI TCP Connection(7)-127.0.0.1] StdSchedulerFactory.instantiate(1331) | Quartz scheduler version: 2.2.3
INFO [RMI TCP Connection(7)-127.0.0.1] QuartzScheduler.setJobFactory(2311) | JobFactory set to: org.springframework.scheduling.quartz.AdaptableJobFactory@62893fb9
WARN [RMI TCP Connection(7)-127.0.0.1] XmlWebApplicationContext.refresh(546) | Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.scheduling.quartz.SchedulerFactoryBean#1' defined in class path resource [context/consult-spring-quartz.xml]: Invocation of init method failed; nested exception is org.quartz.JobPersistenceException: The job (DEFAULT.consultJobDetail) referenced by the trigger does not exist.
INFO [RMI TCP Connection(7)-127.0.0.1] SchedulerFactoryBean.destroy(765) | Shutting down Quartz Scheduler
INFO [RMI TCP Connection(7)-127.0.0.1] QuartzScheduler.shutdown(694) | Scheduler org.springframework.scheduling.quartz.SchedulerFactoryBean#0_$_NON_CLUSTERED shutting down.
INFO [RMI TCP Connection(7)-127.0.0.1] QuartzScheduler.standby(613) | Scheduler org.springframework.scheduling.quartz.SchedulerFactoryBean#0_$_NON_CLUSTERED paused.
INFO [RMI TCP Connection(7)-127.0.0.1] QuartzScheduler.shutdown(771) | Scheduler org.springframework.scheduling.quartz.SchedulerFactoryBean#0_$_NON_CLUSTERED shutdown complete.
ERROR [RMI TCP Connection(7)-127.0.0.1] ContextLoader.initWebApplicationContext(351) | Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.scheduling.quartz.SchedulerFactoryBean#1' defined in class path resource [context/consult-spring-quartz.xml]: Invocation of init method failed; nested exception is org.quartz.JobPersistenceException: The job (DEFAULT.consultJobDetail) referenced by the trigger does not exist.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:753)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5077)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5591)
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.manageApp(HostConfig.java:1836)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.quartz.JobPersistenceException: The job (DEFAULT.consultJobDetail) referenced by the trigger does not exist.
at org.quartz.simpl.RAMJobStore.storeTrigger(RAMJobStore.java:422)
at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:932)
at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:258)
at org.springframework.scheduling.quartz.SchedulerAccessor.addTriggerToScheduler(SchedulerAccessor.java:312)
at org.springframework.scheduling.quartz.SchedulerAccessor.registerJobsAndTriggers(SchedulerAccessor.java:235)
at org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:512)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
... 57 more
九月 10, 2017 10:51:50 上午 org.apache.catalina.core.StandardContext startInternal
严重: One or more listeners failed to start. Full details will be found in the appropriate container log file
九月 10, 2017 10:51:50 上午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/consultservice] startup failed due to previous errors
九月 10, 2017 10:51:51 上午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
严重: The web application [/consultservice] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#1_QuartzSchedulerThread] but has failed to stop it. This is very likely to create a memory leak.
[2017-09-10 10:51:51,177] Artifact consult-server-web:war: Error during artifact deployment. See server log for details.
九月 10, 2017 10:51:52 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory F:\apache-tomcat-7.0.67\webapps\manager
九月 10, 2017 10:51:52 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory F:\apache-tomcat-7.0.67\webapps\manager has finished in 203 ms

项目启动 初始化quartz配置的时候 出错的,实例化 SchedulerFactoryBean 出错的,感觉是关联指定的执行调度任务的类 出错的 。执行任务类 就是个普通的java类 没有继承没有实现 

qq_34121797
Doutzen丶 这个方案也看过的,这个quartz持久化 需要配置数据源等,但是我这边不需要持久化 应该不用额外的配置数据源吧
接近 3 年之前 回复

Invocation of init method failed; nested exception is org.quartz.JobPersistenceException: The job (DEFAULT.consultJobDetail) referenced by the trigger does not exist.检查一下个配置文件中trigger的配置。找不到trigger

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
SpringMVC+quartz 报错

配置文件: ```<!-- 执行调度任务业务类 --> <bean id="consultJob" class="com.bytc.consult.quartz.ConsultRedisJob"> </bean> <!-- 配置执行类和方法 --> <bean id="consultJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="consultJob"></property> <property name="targetMethod" value="consultTypeCopy"></property> <property name="concurrent" value="false"></property> </bean> <!-- 配置定时执行时间 --> <bean id="consultTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean"> <property name="jobDetail" ref="consultJobDetail"></property> <property name="cronExpression"> <value>0/10 * * * * ?</value> </property> </bean> <!-- 配置调度资源 --> <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="false" autowire="no"> <property name="autoStartup" value="true"></property> <property name="startupDelay" value="0"/> <property name="triggers"> <list> <ref local="consultTrigger"/> </list> </property> </bean> ``` 报错信息: ```Caused by: org.quartz.JobPersistenceException: The job (DEFAULT.consultJobDetail) referenced by the trigger does not exist. at org.quartz.simpl.RAMJobStore.storeTrigger(RAMJobStore.java:422) at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:932) at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:258) at org.springframework.scheduling.quartz.SchedulerAccessor.addTriggerToScheduler(SchedulerAccessor.java:312) at org.springframework.scheduling.quartz.SchedulerAccessor.registerJobsAndTriggers(SchedulerAccessor.java:235) at org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:512) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ... 57 more ``` 使用 RAMJobStore 模式,不需要持久化到数据,启动时抛出如上异常?求解答!!

Springmvc集成的quartz 启动问题

Springmvc集成的quartz 启动问题,如何不随着容器启动,而是使用控制器启动?

如何在Quartz的Job类中获取到Service?

请问如何在Quartz的Job类中获取到Service,我在Job类中获取Service都是Null。 使用网上的方法也没有效果,求助! 报错信息 ``` java.lang.NullPointerException at com.wufu.util.SpringContextUtil.getBean(SpringContextUtil.java:26) at com.xinfu.quartz.QuartzJob.execute(QuartzJob.java:27) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) ``` 声明定时任务 ``` long time = System.currentTimeMillis()+2000; SchedulerFactory sf = new StdSchedulerFactory(); Scheduler sched = sf.getScheduler(); Date runTime = DateBuilder.evenSecondDate(testTimestampToDate(time)); JobDetail job = JobBuilder.newJob(QuartzJob.class) .withIdentity("job1", "group1") .usingJobData("param", 389) .build(); Trigger trigger = TriggerBuilder.newTrigger() .withIdentity("trigger1", "group1") .startAt(runTime) .build(); ``` Job类 ``` public class QuartzJob extends ApplicationObjectSupport implements Job { @Override public void execute(JobExecutionContext content) throws JobExecutionException { try { RefundService rs = (RefundService)SpringContextUtil.getBean("RefundService"); RefundService rs2 = (RefundService) SpringContextUtil.getBeanByClass(RefundService.class); System.out.println(rs.refund()); System.out.println(rs2.refund()); }catch (Exception e){ e.printStackTrace(); } } } ``` 获取Bean工具类 ``` @Component public class SpringContextUtil implements ApplicationContextAware { private static ApplicationContext context; @Override @SuppressWarnings("static-access" ) public void setApplicationContext(ApplicationContext contex) throws BeansException { this.context = contex; } public static Object getBean(String beanName){ return context.getBean(beanName); } public static String getMessage(String key){ return context.getMessage(key, null, Locale.getDefault()); } public static Object getBeanByClass(Class elementType) { return context.getBean(elementType); } } ``` ApplicationContext.xml ``` <bean id="SpringContextUtil" class="com.XXX.util.SpringContextUtil" lazy-init="false"></bean> <bean id="RefundService" class="com.XXX.serv.RefundService" ></bean> ```

关于使用spring配置quartz定时任务报错的提问

各位大神好,我参考http://kevin19900306.iteye.com/blog/1397744这篇文章,想在spring中配置定时任务,我的jar包版本quartz2.1.7和spring3.2.9 配置文件如下:<!-- 定义目标bean和bean中的方法 --> <bean id="SpringQtzJob" class="com.cares.tabcopy.SpringQtz" /> <bean id="SpringQtzJobMethod" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject"> <ref bean="SpringQtzJob" /> </property> <property name="targetMethod"> <value>execute</value> </property> </bean> <bean id="CronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean"> <property name="jobDetail" ref="SpringQtzJobMethod"></property> <property name="cronExpression" value="0/5 * * * * ?"></property> </bean> <bean id="SpringJobSchedulerFactoryBean" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref bean="CronTriggerBean" /> </list> </property> </bean> 但是tomcat启动报错: 严重: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'airportController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.cares.service.UserService com.cares.controller.BaseController.userService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SpringQtzJobMethod' defined in class path resource [springmvc-servlet.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:633) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:651) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:602) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:665) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:521) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:462) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) at javax.servlet.GenericServlet.init(GenericServlet.java:158) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1282) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1195) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1085) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5349) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5641) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1092) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1984) 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: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.cares.service.UserService com.cares.controller.BaseController.userService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SpringQtzJobMethod' defined in class path resource [springmvc-servlet.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:517) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286) ... 33 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SpringQtzJobMethod' defined in class path resource [springmvc-servlet.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1037) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:983) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck(AbstractAutowireCapableBeanFactory.java:807) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:737) at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:529) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:359) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:335) at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:187) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:902) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:860) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:775) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:489) ... 35 more Caused by: java.lang.ExceptionInInitializerError at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1030) ... 46 more Caused by: java.lang.IllegalStateException: Incompatible Quartz API: java.lang.ClassNotFoundException: org.quartz.JobExecutionContext at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean.<clinit>(MethodInvokingJobDetailFactoryBean.java:101) ... 53 more 请大神帮忙看看,万谢

SpringMVC+Spring Controller自动装配失败

使用SpringMVC+Hibernate+Spring做demo练习,但是启动时报错,说是Controller里依赖的LoginService无法自动装配。 我自己写了个Main类做测试,Dao和Service都是可以自动装配的,唯独Controller不可以,网上看了好多类似的问题,但是也没有解决我的问题,希望哪位高手能帮我解答下,谢谢。 启动时报错: ``` 严重: StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'indexController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.ssg.design.bk.service.LoginService com.ssg.design.bk.controller.IndexController.loginService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.ssg.design.bk.service.LoginService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:292) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:700) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:658) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:624) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:672) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:543) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:785) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445) at org.apache.catalina.startup.Embedded.start(Embedded.java:825) at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMojo.java:558) at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:255) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216) at org.apache.maven.cli.MavenCli.main(MavenCli.java:160) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.ssg.design.bk.service.LoginService com.ssg.design.bk.controller.IndexController.loginService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.ssg.design.bk.service.LoginService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:508) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289) ... 49 more ```

springmvc+mybatis+quartz的项目启动出错了,求大神指点

看不懂什么情况,求大神指点下 ``` jackson-mapper-asl严重: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Quartz-spring]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) 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:649) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1245) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1895) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name SpringMVC at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3320) at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3299) at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1438) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1357) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:889) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:386) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5412) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 11 more 2016-3-8 15:19:07 org.apache.catalina.startup.HostConfig deployDirectory 严重: Error deploying web application directory G:\apache-tomcat-7.0.59\webapps\Quartz-spring java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Quartz-spring]] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1245) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1895) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:662) 2016-3-8 15:19:07 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory G:\apache-tomcat-7.0.59\webapps\Quartz-spring has finished in 3,484 ms 2016-3-8 15:19:07 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-bio-8080"] ``` ![图片说明](https://img-ask.csdn.net/upload/201603/08/1457422415_31374.png)

quartz与mysql使用同一个数据源,请求不到连接

最近在做项目合并 本来的quartz与mysql合并到同一个数据库 我将quartz的DataSource设置为原来的mysql数据源(BoneCP) 在服务器报错 ``` 2020-01-07 11:40:10.163 [schedulerFactoryBean_QuartzSchedulerThread] ERROR [org.quartz.core.ErrorLogger-2460] An error occurred while scanning for the next triggers to fire. org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'springNonTxDataSource.schedulerFactoryBean': java.sql.SQLException: Timed out waiting for a free available connection. at org.quartz.impl.jdbcjobstore.JobStoreCMT.getNonManagedTXConnection(JobStoreCMT.java:168) at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3774) at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTriggers(JobStoreSupport.java:2759) at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:264) Caused by: java.sql.SQLException: Timed out waiting for a free available connection. at com.jolbox.bonecp.BoneCP.getConnection(BoneCP.java:503) at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:114) at org.springframework.scheduling.quartz.LocalDataSourceJobStore$2.getConnection(LocalDataSourceJobStore.java:135) at org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:108) at org.quartz.impl.jdbcjobstore.JobStoreCMT.getNonManagedTXConnection(JobStoreCMT.java:165) ... 3 common frames omitted ``` BoneCP设置由原来的2个分区2个最大连接 改为4个分区5个最大连接 还是报这个错 ![图片说明](https://img-ask.csdn.net/upload/202001/08/1578475058_741073.png) 另外 quartz.properties的配置数据源 直接写数据库配置能成功 但是如果写成${}这种形式就不能成功 ``` org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'myDS': java.sql.SQLException: Connections could not be acquired from the underlying database! at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:777) at org.quartz.impl.jdbcjobstore.JobStoreTX.getNonManagedTXConnection(JobStoreTX.java:71) at org.quartz.impl.jdbcjobstore.JobStoreSupport.doCheckin(JobStoreSupport.java:3213) at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.manage(JobStoreSupport.java:3836) at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.initialize(JobStoreSupport.java:3821) at org.quartz.impl.jdbcjobstore.JobStoreSupport.schedulerStarted(JobStoreSupport.java:688) at org.quartz.core.QuartzScheduler.start(QuartzScheduler.java:580) at org.quartz.impl.StdScheduler.start(StdScheduler.java:142) at org.springframework.scheduling.quartz.SchedulerFactoryBean$1.run(SchedulerFactoryBean.java:708) Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database! at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529) at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128) at org.quartz.utils.PoolingConnectionProvider.getConnection(PoolingConnectionProvider.java:247) at org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:108) at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:774) ... 8 common frames omitted Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source. at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319) at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525) ... 12 common frames omitted ```

在java timer定时器中调用dao层会报错

现在在做一个web项目,使用spring+springMVC+hibernate框架, 问题描述: 项目中有一个扫描的功能,分即时任务、定时任务、周期任务三种,即时任务已经实现了,现在使用java.util.Timer、java.util.TimerTask类做定时任务,重写TimerTask的run方法,在run方法中调用之前已经没有问题的即时任务扫描方法。每次运行定时任务时,会卡在dao层方法的调用上,因为在即时任务的扫描方法中调用了dao层的数据操作方法,报错“No Session found for current thread”。 即时任务的执行流程:前台提交即时任务扫描请求->控制器调用service层的立即扫描方法startImmediateTask(); 定时任务的执行流程:前台提交定时任务扫描请求->控制器调用service层的定时扫描方法startTimerTask()->调用立即扫描方法startImmediateTask()。 下面附上代码和配置文件,请各位大牛帮忙解决啊! service层代码 ```java /** * 开始定时扫描任务 * @param blTask */ public void startTimerTask(final BLTask blTask) { Date startDate = blTask.getStartTime(); TimerTask task = new TimerTask() { @Override public void run() { // 调用扫描方法 startImmediateTask(blTask); } }; Timer timer = new Timer(); timer.schedule(task, startDate); } /** * 开始即时扫描任务 * @param blTask */ public void startImmediateTask(BLTask blTask) { BLScanParam blScanParam = new BLScanParam(); BLPolicyGroup blPolicyGroup = null; // 策略组 List<BLCheckItem> blCheckItems = null; // 检查项 Map<Long, BLCheckScript> blCheckScriptMap = new HashMap<Long, BLCheckScript>(); // 检查脚本 Long pgId = null; // 策略组ID String alias = null; // 策略别名、检查项别名 Long osType = blTask.getOsType(); // 操作系统类型 List<Long> csIds = new ArrayList<Long>(); // 检查脚本ID数组 blScanParam.setBlTask(blTask); pgId = blTask.getPgId(); // 通过策略组ID查找策略组 blPolicyGroup = blPolicyGroupDao.get(pgId); if (blPolicyGroup == null) { return; } blScanParam.setBlPolicyGroup(blPolicyGroup); alias = blPolicyGroup.getAlias(); // 通过别名、操作系统类别查找所有匹配的检查项 blCheckItems = blCheckItemDao.queryByProerties(new String[]{"alias", "osType"}, new Object[]{alias, osType}); if (blCheckItems == null || blCheckItems.size() <= 0) { return; } blScanParam.setBlCheckItems(blCheckItems); for (BLCheckItem blCheckItem : blCheckItems) { csIds.add(blCheckItem.getCsId()); } int size = csIds.size(); // 获取当前策略组下的所有检查项的检测脚本 List<BLCheckScript> blCheckScripts = blCheckScriptDao.queryByProerties("csId", (Long[])csIds.toArray(new Long[size])); for (BLCheckScript blCheckScript : blCheckScripts) { // 获取当前策略组下的所有检测脚本,并放入map中 blCheckScriptMap.put(blCheckScript.getCsId(), blCheckScript); } blScanParam.setBlCheckScriptMap(blCheckScriptMap); // 分割ip为数组,传入TaskDispatch String[] ips = getIps(blTask.getIpArea()); TaskDispatch taskDispatch = new TaskDispatch(ips, blScanParam); taskDispatch.StartTask(); // 将当前TaskDispatch对象的引用放入taskDispatchMap中,供停止任务时使用 taskDispatchMap.put(blTask.getTkId(), taskDispatch); } ``` BaseDao的部分代码 ```java public class BaseDao<E> implements Dao<E> { public SessionFactory getSessionFactory() { return this.sessionFactory; } public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } public Session getSession() { return this.sessionFactory.getCurrentSession(); } @Resource(name = "sessionFactory") public void setSF(SessionFactory sessionFactory) { setSessionFactory(sessionFactory); } } ``` applicationContext.xml ```xml <?xml version="1.0" encoding="UTF-8"?> <context:annotation-config /> <context:component-scan base-package="com.djbh" /> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="com.mysql.jdbc.Driver" /> <property name="jdbcUrl" value="jdbc:mysql://192.168.1.247:3306/djbh_db?useUnicode=true&amp;characterEncoding=utf-8" /> <property name="user" value="root" /> <property name="password" value="mysql" /> <!-- <property name="driverClass" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" /> <property name="jdbcUrl" value="jdbc:sqlserver://localhost:1433;DatabaseName=DJBH_DB" /> <property name="user" value="sa" /> <property name="password" value="123456" /> --> <property name="acquireIncrement" value="3" /> <property name="idleConnectionTestPeriod" value="120" /> <property name="initialPoolSize" value="3" /> <property name="minPoolSize" value="3" /> <property name="maxPoolSize" value="15" /> <property name="numHelperThreads" value="3" /> <property name="preferredTestQuery" value="select 1" /> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop> <!-- <prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop> --> <!-- <prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop> --> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.use_outer_join">true</prop> <prop key="hibernate.jdbc.fetch_size">30</prop> <prop key="hibernate.jdbc.batch_size">30</prop> <prop key="hibernate.jdbc.batch_versioned_data">true</prop> <prop key="hibernate.cache.use_second_level_cache">true</prop> <prop key="hibernate.cache.use_query_cache">true</prop> <prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</prop> <prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</prop> <prop key="hibernate.current_session_context_class">org.springframework.orm.hibernate4.SpringSessionContext</prop> <prop key="hibernate.hbm2ddl.auto">update</prop> <prop key="javax.persistence.validation.mode">none</prop> </props> </property> <property name="dataSource" ref="dataSource" /> <property name="packagesToScan"> <list> <value>com.djbh.model</value> </list> </property> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <tx:annotation-driven transaction-manager="transactionManager" /> <!-- 启动对@AspectJ注解的支持 --> <aop:aspectj-autoproxy/> </beans> ``` springmvc-servlet.xml ```xml <?xml version="1.0" encoding="UTF-8"?> <mvc:annotation-driven/> <mvc:resources location="/static/" mapping="/static/**"/> <mvc:resources location="/attachment/report_html/" mapping="/attachment/report_html/**"/> <context:component-scan base-package="com.djbh.controller" /> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass"><value>org.springframework.web.servlet.view.JstlView</value></property> <property name="prefix"><value>/WEB-INF/page/</value></property> <property name="suffix"><value>.jsp</value></property> </bean> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basename" value="messages" /> <property name="useCodeAsDefaultMessage" value="true" /> </bean> <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <!--<property name="maxUploadSize" value="10485760"></property> --> </bean> <aop:aspectj-autoproxy proxy-target-class="true" /> </beans> ``` web.xml ```xml <?xml version="1.0" encoding="UTF-8"?> <display-name>djbh</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath*:applicationContext*.xml </param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class>core.web.SystemInitListener</listener-class> </listener> <filter> <filter-name>loginFilter</filter-name> <filter-class>core.web.LoginFilter</filter-class> </filter> <filter-mapping> <filter-name>loginFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter> <filter-name>openSessionInViewFilter</filter-name> <filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class> <init-param> <param-name>singleSession</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>openSessionInViewFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter> <filter-name>characterEncoding</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>characterEncoding</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <servlet> <servlet-name>springmvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springmvc</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>login.jsp</welcome-file> </welcome-file-list> </web-app> ```

获取Scheduler报错,初始化失败

Scheduler sched = gSchedulerFactory.getScheduler(); 初始化报错: Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.quartz.simpl.RAMJobStore

Quartz 我一个调度器多调度多个任务,但是有时候不执行是为什么?

我是一个调度器去调度多个 jobDetail trigger ,但是有时候 调度不执行,也不报错,多个任务的jobDetail组名称和trigger组名用的是一个,和这个有关系吗? 代码如下:新增调度任务: ``` // 启动调度器 JobDetail jobDetail = JobBuilder.newJob(IotSchedulerTime.class).withIdentity(jobDetailName,jobDetailGroup).usingJobData("command", command).usingJobData("jobDetailName",jobDetailName).build(); // 表达式调度构建器(即任务执行的时间) CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(cron); // 按新的cronExpression表达式构建一个新的trigger CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(triggerName,triggerGroup).withSchedule(scheduleBuilder).build(); scheduler.start(); scheduler.scheduleJob(jobDetail, trigger); ``` 删除代码: ``` TriggerKey triggerKey = TriggerKey.triggerKey(triggerName, triggerGroup); scheduler.pauseTrigger(triggerKey);// 停止触发器 scheduler.unscheduleJob(triggerKey);// 移除触发器 scheduler.deleteJob(JobKey.jobKey(jobDeatailName, jobDetailGroup));// 删除任务 ```

xxl-job项目启动,tomcat报错

再使用xxl-job 时,用到了jfinal执行器,所有运行正常,但是当jfinal连接数据库后,项目无法发布,tomcat报错 017-10-26 19:57:58,994 - xxl-job-admin - INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - <Mapped URL path [/favicon.ico] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'> 2017-10-26 19:57:59,002 - xxl-job-admin - INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - <Mapped URL path [/static/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#1'> 2017-10-26 19:57:59,010 - xxl-job-admin - INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - <Mapped URL path [/**/*.html] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#2'> 2017-10-26 19:57:59,065 - xxl-job-admin - INFO [org.springframework.web.servlet.DispatcherServlet] - <FrameworkServlet 'springmvc': initialization completed in 866 ms> 26-Oct-2017 19:57:59.097 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive G:\apache-tomcat-8.0.28\webapps\xxl-job-admin.war has finished in 6,832 ms 26-Oct-2017 19:57:59.102 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive G:\apache-tomcat-8.0.28\webapps\xxl-job-jfinal-lbh.war 26-Oct-2017 19:58:00.867 InfO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 26-Oct-2017 19:58:00.975 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more Filters failed to start. Full details will be found in the appropriate container log file 26-Oct-2017 19:58:00.975 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/xxl-job-jfinal-lbh] startup failed due to previous errors 26-Oct-2017 19:58:00.997 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [xxl-job-jfinal-lbh] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Object.wait(Native Method) java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143) com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43) 26-Oct-2017 19:58:01.002 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive G:\apache-tomcat-8.0.28\webapps\xxl-job-jfinal-lbh.war has finished in 1,900 ms 26-Oct-2017 19:58:01.012 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-apr-8080"] 26-Oct-2017 19:58:01.019 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-apr-8009"] 26-Oct-2017 19:58:01.020 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 8810 ms 2017-10-26 19:58:18,144 - xxl-job-admin - INFO [org.springframework.scheduling.quartz.SchedulerFactoryBean] - <Starting Quartz Scheduler now, after delay of 20 seconds> 2017-10-26 19:58:18,174 - xxl-job-admin - INFO [org.springframework.scheduling.quartz.LocalDataSourceJobStore] - <ClusterManager: detected 1 failed or restarted instances.> 2017-10-26 19:58:18,175 - xxl-job-admin - INFO [org.springframework.scheduling.quartz.LocalDataSourceJobStore] - <ClusterManager: Scanning for instance "DESKTOP-UL9DUO61509017877267"'s failed in-progress jobs.> 2017-10-26 19:58:18,185 - xxl-job-admin - INFO [org.quartz.core.QuartzScheduler] - <Scheduler quartzScheduler_$_DESKTOP-UL9DUO61509019077711 started.> 找了很久也没找到问题的根源.请教下有谁能帮忙么....

web.xml加载bean.xml获取不到bean属性的值?也没有报错日志

以下是web.xml的代码截图 ![图片说明](https://img-ask.csdn.net/upload/201712/21/1513842619_200884.png) 以下是bean.xml的配置: <beans> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location" value="classpath:../conf/system.properties"/> <property name="ignoreUnresolvablePlaceholders"><value>true</value></property> </bean> <bean id="log4jInitializer" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> <property name="staticMethod"><value>org.springframework.util.Log4jConfigurer.initLogging</value> </property> <property name="arguments"><list><value>classpath:../conf/log4j.xml</value><value>2000</value></list></property> </bean> <!-- <bean id="RSAUtil" class="com.ailk.toptea.ebomc.tomcat.RSAUtil"> <property name="rSAKeyStore"><value>${catalina.home}/webapps/ROOT/WEB-INF/conf/RSAKey.txt</value></property> </bean> --> <bean name="PasswdTask" class="com.ailk.toptea.ebomc.tomcat.user.PasswdTask" /> <bean id="jobDetail_PasswdTask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="PasswdTask" /> <property name="targetMethod" value="start" /> </bean> <bean id="cronTrigger_PasswdTask" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="jobDetail_PasswdTask" /> <property name="cronExpression"> <value>0 0/5 * * * ?</value> </property> </bean> <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref bean="cronTrigger_PasswdTask" /> </list> </property> </bean> <!--scheme数据源配置 --> <!-- 20150728 add by gongzf, begin... --> <!--scheme数据源配置 --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName"><value>${scheme.jdbc.driverClassName}</value></property> <property name="url"><value>${scheme.jdbc.url}</value></property> <property name="username"><value>${scheme.jdbc.username}</value></property> <property name="password"><value>${scheme.jdbc.password}</value></property> <property name="maxActive"><value>${scheme.db.maxActive}</value></property> <property name="maxIdle"><value>${scheme.db.maxIdle}</value></property> <property name="maxWait"><value>${scheme.db.maxWait}</value></property> <property name="testOnBorrow" value="true"/> <property name="testWhileIdle" value="true"/> <property name="validationQuery" value="select 1 from dual"/> </bean> <bean id="DataBaseManager" class="com.ailk.toptea.ebomc.util.DataBaseManager"> <property name="dataSource"> <ref bean="dataSource"/> </property> <property name="apiKey"> <value>${baidu.apiKey}</value> </property> <property name="secretKey"> <value>${baidu.secretKey}</value> </property> <property name="pushToken"> <value>${ebomc.pushToken}</value> </property> <property name="iOSUpdatePath"> <value>${ebomc.iOSUpdatePath}</value> </property> <property name="host"> <value>${apns.host}</value> </property> <property name="port"> <value>${apns.port}</value> </property> <property name="cerPath"> <value>${apns.cerPath}</value> </property> <property name="cerPwd"> <value>${apns.cerPwd}</value> </property> </bean> <bean id="urlconfig" init-method="init" class="com.ailk.toptea.ebomc.util.URLConfig"> <property name="file"> <value>url.xml</value> </property> </bean> </beans> 以下是工程目录截图: ![图片说明](https://img-ask.csdn.net/upload/201712/21/1513842879_847204.png)

java.sql.SQLException: 关闭的连接

项目启动正常,访问正常,就是在使用quartz定时跑任务的时候超过五分钟执行就会报错,试过关闭防火墙、修改等待超时时间都没有效果,除了这个其他一切正常,项目中使用springmvc+myBatis,请大神帮忙

项目启动的时候报出来这个问题,但是我数据库存在要用的表,有没有大神会解决这个问题

org.hibernate.exception.SQLGrammarException: ORA-00942: 表或视图不存在 at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:122) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110) at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:129) at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81) at com.sun.proxy.$Proxy31.executeQuery(Unknown Source) at org.hibernate.loader.Loader.getResultSet(Loader.java:1962) at org.hibernate.loader.Loader.doQuery(Loader.java:829) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289) at org.hibernate.loader.Loader.doList(Loader.java:2447) at org.hibernate.loader.Loader.doList(Loader.java:2433) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2263) at org.hibernate.loader.Loader.list(Loader.java:2258) at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:122) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1535) at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:374) at cn.com.infosec.external.dao.hibernate4.CommonHibernateDao.listAll(CommonHibernateDao.java:142) at cn.com.infosec.external.service.impl.CommonService.listAll(CommonService.java:64) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at com.sun.proxy.$Proxy23.listAll(Unknown Source) at cn.com.infosec.external.common.RARole.init(RARole.java:30) at cn.com.infosec.external.servlet.SystemInitServlet.init(SystemInitServlet.java:144) at javax.servlet.GenericServlet.init(GenericServlet.java:158) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1269) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1182) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1072) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5368) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5660) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.sql.SQLException: ORA-00942: 表或视图不存在 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216) at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:810) at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039) at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:850) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3384) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122) ... 42 more

spring-mabatis.xml报错不知道什么原因请各位大神帮忙解答

Context initialization failed。。。。。class path resource [spring-mybatis.xml] cannot be opened because it does not exist![图片说明](https://img-ask.csdn.net/upload/201504/22/1429708397_525890.png)

项目启动失败了,大神看看是哪里的问题

下面是报错信息和springmvc的配置 ``` jackson-mapper-asl严重: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Quartz-spring]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) 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:649) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1245) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1895) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name SpringMVC at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3320) at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3299) at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1438) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1357) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:889) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:386) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5412) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 11 more 2016-3-8 15:19:07 org.apache.catalina.startup.HostConfig deployDirectory 严重: Error deploying web application directory G:\apache-tomcat-7.0.59\webapps\Quartz-spring java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Quartz-spring]] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1245) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1895) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:662) 2016-3-8 15:19:07 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory G:\apache-tomcat-7.0.59\webapps\Quartz-spring has finished in 3,484 ms 2016-3-8 15:19:07 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-bio-8080"] ``` ``` <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>Archetype Created Web Application</display-name> <context-param> <param-name>webAppRootKey</param-name> <param-value>webApp.root</param-value> </context-param> <!-- Spring和mybatis的配置文件 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/config/spring-mybatis.xml, /WEB-INF/config/applicationContext.xml </param-value> </context-param> <!-- 编码过滤器 --> <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <async-supported>true</async-supported> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- Spring监听器 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- 防止Spring内存溢出监听器 --> <listener> <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class> </listener> <!-- Spring MVC servlet --> <servlet> <servlet-name>SpringMVC</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/config/spring-mvc.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> <async-supported>true</async-supported> </servlet> <servlet-mapping> <servlet-name>SpringMVC</servlet-name> <!-- 此处可以可以配置成*.do,对应struts的后缀习惯 --> <url-pattern>/</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>/index.jsp</welcome-file> </welcome-file-list> </web-app> ```

druid连接池获取连接超时异常

项目使用spring+springmvc+hibernate,数据库使用oracle11.2.0.1.0,允许的最大连接数为300,数据库服务器防火墙是关闭的。项目中有个定时任务(每天凌晨执行)使用jdbcTemplate同步数据。druid连接池异常信息如下: ``` [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-3] WARN com.alibaba.druid.pool.DruidDataSource - get connection timeout retry : 1 [2019-11-02 03:00:02.002] [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-3] ERROR org.quartz.core.JobRunShell - Job DEFAULT.syncSyldDataDetail threw an unhandled Exception: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 1000, active 0, maxActive 350, creating 1 at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81) ~[spring-jdbc-5.0.8.RELEASE.jar:5.0.8.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:371) ~[spring-jdbc-5.0.8.RELEASE.jar:5.0.8.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:578) ~[spring-jdbc-5.0.8.RELEASE.jar:5.0.8.RELEASE] at com.aqkk.task.SyncSyldData.start(SyncSyldData.java:33) ~[classes/:?] at com.aqkk.task.SyncSyldDataJob.executeInternal(SyncSyldDataJob.java:17) ~[classes/:?] at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75) ~[spring-context-support-5.0.8.RELEASE.jar:5.0.8.RELEASE] at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-2.3.0.jar:?] at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.3.0.jar:?] Caused by: com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 1000, active 0, maxActive 350, creating 1 at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1512) ~[druid-1.1.10.jar:1.1.10] at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:1255) ~[druid-1.1.10.jar:1.1.10] at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:5007) ~[druid-1.1.10.jar:1.1.10] at com.alibaba.druid.filter.stat.StatFilter.dataSource_getConnection(StatFilter.java:680) ~[druid-1.1.10.jar:1.1.10] at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:5003) ~[druid-1.1.10.jar:1.1.10] at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1233) ~[druid-1.1.10.jar:1.1.10] at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1225) ~[druid-1.1.10.jar:1.1.10] at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:90) ~[druid-1.1.10.jar:1.1.10] at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:151) ~[spring-jdbc-5.0.8.RELEASE.jar:5.0.8.RELEASE] at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115) ~[spring-jdbc-5.0.8.RELEASE.jar:5.0.8.RELEASE] at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78) ~[spring-jdbc-5.0.8.RELEASE.jar:5.0.8.RELEASE] ... 7 more [2019-11-02 03:00:02.002] [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-3] ERROR org.quartz.core.ErrorLogger - Job (DEFAULT.syncSyldDataDetail threw an exception. org.quartz.SchedulerException: Job threw an unhandled exception. at org.quartz.core.JobRunShell.run(JobRunShell.java:213) [quartz-2.3.0.jar:?] at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.3.0.jar:?] Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 1000, active 0, maxActive 350, creating 1 at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81) ~[spring-jdbc-5.0.8.RELEASE.jar:5.0.8.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:371) ~[spring-jdbc-5.0.8.RELEASE.jar:5.0.8.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:578) ~[spring-jdbc-5.0.8.RELEASE.jar:5.0.8.RELEASE] at com.aqkk.task.SyncSyldData.start(SyncSyldData.java:33) ~[classes/:?] at com.aqkk.task.SyncSyldDataJob.executeInternal(SyncSyldDataJob.java:17) ~[classes/:?] at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75) ~[spring-context-support-5.0.8.RELEASE.jar:5.0.8.RELEASE] at org.quartz.core.JobRunShell.run(JobRunShell.java:202) ~[quartz-2.3.0.jar:?] ... 1 more Caused by: com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 1000, active 0, maxActive 350, creating 1 at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1512) ~[druid-1.1.10.jar:1.1.10] at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:1255) ~[druid-1.1.10.jar:1.1.10] ``` druid配置信息如下: ``` <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close"> <property name="url" value="${db.jdbcUrl}"/> <property name="username" value="${db.user}"/> <property name="password" value="${db.password}"/> <property name="driverClassName" value="${db.driver}"/> <!-- 配置初始化大小、最小、最大 --> <property name="initialSize" value="1"/> <property name="minIdle" value="20"/> <property name="maxActive" value="350"/> <!-- 配置获取连接等待超时的时间 --> <property name="maxWait" value="1000"/> <!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 --> <property name="timeBetweenEvictionRunsMillis" value="10000"/> <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 --> <property name="minEvictableIdleTimeMillis" value="30000"/> <property name="testWhileIdle" value="true"/> <property name="validationQuery" value="SELECT 1 FROM DUAL"/> <property name="testOnBorrow" value="false"/> <property name="testOnReturn" value="false"/> <!-- 打开PSCache,并且指定每个连接上PSCache的大小 --> <property name="poolPreparedStatements" value="true"/> <property name="maxPoolPreparedStatementPerConnectionSize" value="20"/> <!-- 开启Druid的监控统计功能 --> <property name="filters" value="stat" /> </bean> ``` 为啥凌晨执行定时任务获取不到连接,9点上班系统又是正常运行的呢?

Java调用Thread.sleep()方法的神奇问题

写了几行代码测试锁的问题,结果发现了一个调用Thread.sleep()的问题: ```public class Main { public static int value = 0; public static int value2 = 0; public static AtomicInteger aValue = new AtomicInteger(0); public static synchronized void increment2(){ value2++; } public static void main(String[] args) throws InterruptedException { for(int i=0;i<1000;i++){ new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } value++; Main.increment2(); Main.aValue.getAndIncrement(); } }).start(); } Thread.sleep(100); //问题在这一行!!!!!**** System.out.println(Main.aValue); } } 问题是: 理论上,我创造1000个线程分别对变量加一,执行完循环后,如果不加Thread.sleep(),打印出的三个value全是0,但是只有加上sleep,才能打印出理想结果,我想不明白这是什么原理。

spring+mybatis出现NoSuchBeanDefinitionException

问题描述:已进行mapper层,dataSource的测试也显示同一个异常: Test类: public class Test { ApplicationContext ac; @Before public void Before(){ ac=new ClassPathXmlApplicationContext(new String[]{"classpath*:spring-mybatis.xml"}); } @org.junit.Test public void Test1(){ Object s=ac.getBean("propertyConfigurer"); System.out.println(s); } } org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'propertyConfigurer' is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687) at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1168) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:281) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:956) at com.dao.Test.Test1(Test.java:26)

Spring build Path提示错误

<bean> <context:component-scan base-package="com.java.spring.aop.impl"> </context:component-scan> <!---添加下方,就报-> ** <aop:aspectj-autoproxy></aop:aspectj-autoproxy>** <bean> <!-报错提示-> Build path is incomplete. Cannot find class file for org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!

实现简单的文件系统

实验内容: 通过对具体的文件存储空间的管理、文件的物理结构、目录结构和文件操作的实现,加深对文件系统内部功能和实现过程的理解。 要求: 1.在内存中开辟一个虚拟磁盘空间作为文件存储器,在其上实现一个简

MIPS单周期CPU-组成原理实验-华中科技大学

使用logisim布线完成的MIPS单周期CPU,可支持28条指令。跑马灯的代码已经装入了寄存器,可以直接开启时钟运行。

2019数学建模A题高压油管的压力控制 省一论文即代码

2019数学建模A题高压油管的压力控制省一完整论文即详细C++和Matlab代码,希望对同学们有所帮助

基于QT和OpenCV的五子棋实现源码

一个简单的五子棋应用,基于QT和OpenCV的实现源码,通过相邻棋子判断是否获胜,不包含人工智能算法,适合新手入门

Git 实用技巧

这几年越来越多的开发团队使用了Git,掌握Git的使用已经越来越重要,已经是一个开发者必备的一项技能;但很多人在刚开始学习Git的时候会遇到很多疑问,比如之前使用过SVN的开发者想不通Git提交代码为什么需要先commit然后再去push,而不是一条命令一次性搞定; 更多的开发者对Git已经入门,不过在遇到一些代码冲突、需要恢复Git代码时候就不知所措,这个时候哪些对 Git掌握得比较好的少数人,就像团队中的神一样,在队友遇到 Git 相关的问题的时候用各种流利的操作来帮助队友于水火。 我去年刚加入新团队,发现一些同事对Git的常规操作没太大问题,但对Git的理解还是比较生疏,比如说分支和分支之间的关联关系、合并代码时候的冲突解决、提交代码前未拉取新代码导致冲突问题的处理等,我在协助处理这些问题的时候也记录各种问题的解决办法,希望整理后通过教程帮助到更多对Git操作进阶的开发者。 本期教程学习方法分为“掌握基础——稳步进阶——熟悉协作”三个层次。从掌握基础的 Git的推送和拉取开始,以案例进行演示,分析每一个步骤的操作方式和原理,从理解Git 工具的操作到学会代码存储结构、演示不同场景下Git遇到问题的不同处理方案。循序渐进让同学们掌握Git工具在团队协作中的整体协作流程。 在教程中会通过大量案例进行分析,案例会模拟在工作中遇到的问题,从最基础的代码提交和拉取、代码冲突解决、代码仓库的数据维护、Git服务端搭建等。为了让同学们容易理解,对Git简单易懂,文章中详细记录了详细的操作步骤,提供大量演示截图和解析。在教程的最后部分,会从提升团队整体效率的角度对Git工具进行讲解,包括规范操作、Gitlab的搭建、钩子事件的应用等。 为了让同学们可以利用碎片化时间来灵活学习,在教程文章中大程度降低了上下文的依赖,让大家可以在工作之余进行学习与实战,并同时掌握里面涉及的Git不常见操作的相关知识,理解Git工具在工作遇到的问题解决思路和方法,相信一定会对大家的前端技能进阶大有帮助。

实用主义学Python(小白也容易上手的Python实用案例)

原价169,限时立减100元! 系统掌握Python核心语法16点,轻松应对工作中80%以上的Python使用场景! 69元=72讲+源码+社群答疑+讲师社群分享会&nbsp; 【哪些人适合学习这门课程?】 1)大学生,平时只学习了Python理论,并未接触Python实战问题; 2)对Python实用技能掌握薄弱的人,自动化、爬虫、数据分析能让你快速提高工作效率; 3)想学习新技术,如:人工智能、机器学习、深度学习等,这门课程是你的必修课程; 4)想修炼更好的编程内功,优秀的工程师肯定不能只会一门语言,Python语言功能强大、使用高效、简单易学。 【超实用技能】 从零开始 自动生成工作周报 职场升级 豆瓣电影数据爬取 实用案例 奥运冠军数据分析 自动化办公:通过Python自动化分析Excel数据并自动操作Word文档,最终获得一份基于Excel表格的数据分析报告。 豆瓣电影爬虫:通过Python自动爬取豆瓣电影信息并将电影图片保存到本地。 奥运会数据分析实战 简介:通过Python分析120年间奥运会的数据,从不同角度入手分析,从而得出一些有趣的结论。 【超人气老师】 二两 中国人工智能协会高级会员 生成对抗神经网络研究者 《深入浅出生成对抗网络:原理剖析与TensorFlow实现》一书作者 阿里云大学云学院导师 前大型游戏公司后端工程师 【超丰富实用案例】 0)图片背景去除案例 1)自动生成工作周报案例 2)豆瓣电影数据爬取案例 3)奥运会数据分析案例 4)自动处理邮件案例 5)github信息爬取/更新提醒案例 6)B站百大UP信息爬取与分析案例 7)构建自己的论文网站案例

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

C/C++跨平台研发从基础到高阶实战系列套餐

一 专题从基础的C语言核心到c++ 和stl完成基础强化; 二 再到数据结构,设计模式完成专业计算机技能强化; 三 通过跨平台网络编程,linux编程,qt界面编程,mfc编程,windows编程,c++与lua联合编程来完成应用强化 四 最后通过基于ffmpeg的音视频播放器,直播推流,屏幕录像,

三个项目玩转深度学习(附1G源码)

从事大数据与人工智能开发与实践约十年,钱老师亲自见证了大数据行业的发展与人工智能的从冷到热。事实证明,计算机技术的发展,算力突破,海量数据,机器人技术等,开启了第四次工业革命的序章。深度学习图像分类一直是人工智能的经典任务,是智慧零售、安防、无人驾驶等机器视觉应用领域的核心技术之一,掌握图像分类技术是机器视觉学习的重中之重。针对现有线上学习的特点与实际需求,我们开发了人工智能案例实战系列课程。打造:以项目案例实践为驱动的课程学习方式,覆盖了智能零售,智慧交通等常见领域,通过基础学习、项目案例实践、社群答疑,三维立体的方式,打造最好的学习效果。

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

Python界面版学生管理系统

前不久上传了一个控制台版本的学生管理系统,这个是Python界面版学生管理系统,这个是使用pycharm开发的一个有界面的学生管理系统,基本的增删改查,里面又演示视频和完整代码,有需要的伙伴可以自行下

Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂

linux“开发工具三剑客”速成攻略

工欲善其事,必先利其器。Vim+Git+Makefile是Linux环境下嵌入式开发常用的工具。本专题主要面向初次接触Linux的新手,熟练掌握工作中常用的工具,在以后的学习和工作中提高效率。

JAVA初级工程师面试36问(完结)

第三十一问: 说一下线程中sleep()和wait()区别? 1 . sleep()是让正在执行的线程主动让出CPU,当时间到了,在回到自己的线程让程序运行。但是它并没有释放同步资源锁只是让出。 2.wait()是让当前线程暂时退让出同步资源锁,让其他线程来获取到这个同步资源在调用notify()方法,才会让其解除wait状态,再次参与抢资源。 3. sleep()方法可以在任何地方使用,而wait()只能在同步方法或同步块使用。 ...

java jdk 8 帮助文档 中文 文档 chm 谷歌翻译

JDK1.8 API 中文谷歌翻译版 java帮助文档 JDK API java 帮助文档 谷歌翻译 JDK1.8 API 中文 谷歌翻译版 java帮助文档 Java最新帮助文档 本帮助文档是使用谷

我以为我对Mysql事务很熟,直到我遇到了阿里面试官

太惨了,面试又被吊打

智鼎(附答案).zip

并不是完整题库,但是有智鼎在线2019年9、10、11三个月的试题,有十七套以上题目,普通的网申行测题足以对付,可以在做题时自己总结一些规律,都不是很难

Visual Assist X 破解补丁

vs a's'sixt插件 支持vs2008-vs2019 亲测可以破解,希望可以帮助到大家

150讲轻松搞定Python网络爬虫

【为什么学爬虫?】 &nbsp; &nbsp; &nbsp; &nbsp;1、爬虫入手容易,但是深入较难,如何写出高效率的爬虫,如何写出灵活性高可扩展的爬虫都是一项技术活。另外在爬虫过程中,经常容易遇到被反爬虫,比如字体反爬、IP识别、验证码等,如何层层攻克难点拿到想要的数据,这门课程,你都能学到! &nbsp; &nbsp; &nbsp; &nbsp;2、如果是作为一个其他行业的开发者,比如app开发,web开发,学习爬虫能让你加强对技术的认知,能够开发出更加安全的软件和网站 【课程设计】 一个完整的爬虫程序,无论大小,总体来说可以分成三个步骤,分别是: 网络请求:模拟浏览器的行为从网上抓取数据。 数据解析:将请求下来的数据进行过滤,提取我们想要的数据。 数据存储:将提取到的数据存储到硬盘或者内存中。比如用mysql数据库或者redis等。 那么本课程也是按照这几个步骤循序渐进的进行讲解,带领学生完整的掌握每个步骤的技术。另外,因为爬虫的多样性,在爬取的过程中可能会发生被反爬、效率低下等。因此我们又增加了两个章节用来提高爬虫程序的灵活性,分别是: 爬虫进阶:包括IP代理,多线程爬虫,图形验证码识别、JS加密解密、动态网页爬虫、字体反爬识别等。 Scrapy和分布式爬虫:Scrapy框架、Scrapy-redis组件、分布式爬虫等。 通过爬虫进阶的知识点我们能应付大量的反爬网站,而Scrapy框架作为一个专业的爬虫框架,使用他可以快速提高我们编写爬虫程序的效率和速度。另外如果一台机器不能满足你的需求,我们可以用分布式爬虫让多台机器帮助你快速爬取数据。 &nbsp; 从基础爬虫到商业化应用爬虫,本套课程满足您的所有需求! 【课程服务】 专属付费社群+每周三讨论会+1v1答疑

JavaWEB商城项目(包括数据库)

功能描述:包括用户的登录注册,以及个人资料的修改.商品的分类展示,详情,加入购物车,生成订单,到银行支付等!另外还有收货地址的和我的收藏等常用操作.环境(JDK 1.7 ,mysql 5.5,Ecli

Python数据挖掘简易入门

&nbsp; &nbsp; &nbsp; &nbsp; 本课程为Python数据挖掘方向的入门课程,课程主要以真实数据为基础,详细介绍数据挖掘入门的流程和使用Python实现pandas与numpy在数据挖掘方向的运用,并深入学习如何运用scikit-learn调用常用的数据挖掘算法解决数据挖掘问题,为进一步深入学习数据挖掘打下扎实的基础。

一学即懂的计算机视觉(第一季)

图像处理和计算机视觉的课程大家已经看过很多,但总有“听不透”,“用不了”的感觉。课程致力于创建人人都能听的懂的计算机视觉,通过生动、细腻的讲解配合实战演练,让学生真正学懂、用会。 【超实用课程内容】 课程内容分为三篇,包括视觉系统构成,图像处理基础,特征提取与描述,运动跟踪,位姿估计,三维重构等内容。课程理论与实战结合,注重教学内容的可视化和工程实践,为人工智能视觉研发及算法工程师等相关高薪职位就业打下坚实基础。 【课程如何观看?】 PC端:https://edu.csdn.net/course/detail/26281 移动端:CSDN 学院APP(注意不是CSDN APP哦) 本课程为录播课,课程2年有效观看时长,但是大家可以抓紧时间学习后一起讨论哦~ 【学员专享增值服务】 源码开放 课件、课程案例代码完全开放给你,你可以根据所学知识,自行修改、优化 下载方式:电脑登录https://edu.csdn.net/course/detail/26281,点击右下方课程资料、代码、课件等打包下载

软件测试2小时入门

本课程内容系统、全面、简洁、通俗易懂,通过2个多小时的介绍,让大家对软件测试有个系统的理解和认识,具备基本的软件测试理论基础。 主要内容分为5个部分: 1 软件测试概述,了解测试是什么、测试的对象、原则、流程、方法、模型;&nbsp; 2.常用的黑盒测试用例设计方法及示例演示;&nbsp; 3 常用白盒测试用例设计方法及示例演示;&nbsp; 4.自动化测试优缺点、使用范围及示例‘;&nbsp; 5.测试经验谈。

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

课程主要面向嵌入式Linux初学者、工程师、学生 主要从一下几方面进行讲解: 1.linux学习路线、基本命令、高级命令 2.shell、vi及vim入门讲解 3.软件安装下载、NFS、Samba、FTP等服务器配置及使用

2019 Python开发者日-培训

本次活动将秉承“只讲技术,拒绝空谈”的理念,邀请十余位身处一线的Python技术专家,重点围绕Web开发、自动化运维、数据分析、人工智能等技术模块,分享真实生产环境中使用Python应对IT挑战的真知灼见。此外,针对不同层次的开发者,大会还安排了深度培训实操环节,为开发者们带来更多深度实战的机会。

快速入门Android开发 视频 教程 android studio

这是一门快速入门Android开发课程,顾名思义是让大家能快速入门Android开发。 学完能让你学会如下知识点: Android的发展历程 搭建Java开发环境 搭建Android开发环境 Android Studio基础使用方法 Android Studio创建项目 项目运行到模拟器 项目运行到真实手机 Android中常用控件 排查开发中的错误 Android中请求网络 常用Android开发命令 快速入门Gradle构建系统 项目实战:看美图 常用Android Studio使用技巧 项目签名打包 如何上架市场

机器学习初学者必会的案例精讲

通过六个实际的编码项目,带领同学入门人工智能。这些项目涉及机器学习(回归,分类,聚类),深度学习(神经网络),底层数学算法,Weka数据挖掘,利用Git开源项目实战等。

4小时玩转微信小程序——基础入门与微信支付实战

这是一个门针对零基础学员学习微信小程序开发的视频教学课程。课程采用腾讯官方文档作为教程的唯一技术资料来源。杜绝网络上质量良莠不齐的资料给学员学习带来的障碍。 视频课程按照开发工具的下载、安装、使用、程序结构、视图层、逻辑层、微信小程序等几个部分组织课程,详细讲解整个小程序的开发过程

相关热词 c# 不能序列化继承类 c# char* 调用 c# 开发dll模板 c#添加控件到工具箱 c#控制台组合数 编程计算猴子吃桃问题c# c# wpf 背景透明 随机抽取号码软件c# c# 开发环境 c# 属性和字段
立即提问