<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"  
       destroy-method="close" abstract="false" scope="singleton" lazy-init="false">   
    <property name="driverClass" value="org.apache.derby.jdbc.EmbeddedDriver" />  
    <property name="jdbcUrl" value="jdbc:derby:D:/derbytest;create=true" />  
    <property name="checkoutTimeout" value="30000" />  
    <property name="maxIdleTime" value="120" />  
    <property name="maxPoolSize" value="10" />  
    <property name="minPoolSize" value="1" />  
    <property name="initialPoolSize" value="1" />  
    <property name="maxStatements" value="0" />  
    <property name="maxStatementsPerConnection" value="0" />  
    <property name="idleConnectionTestPeriod" value="30" />  
   </bean> Caused by: java.sql.SQLSyntaxErrorException: Table/View 'QRTZ_LOCKS' does not exist.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)
at org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:213)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.quartz.impl.jdbcjobstore.AttributeRestoringConnectionInvocationHandler.invoke(AttributeRestoringConnectionInvocationHandler.java:73)
at $Proxy30.prepareStatement(Unknown Source)
at org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.executeSQL(StdRowLockSemaphore.java:81)
... 69 more
Caused by: java.sql.SQLException: Table/View 'QRTZ_LOCKS' does not exist.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
... 90 more
Caused by: ERROR 42X05: Table/View 'QRTZ_LOCKS' does not exist.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.sql.compile.FromBaseTable.bindTableDescriptor(Unknown Source)
at org.apache.derby.impl.sql.compile.FromBaseTable.bindNonVTITables(Unknown Source)
at org.apache.derby.impl.sql.compile.FromList.bindTables(Unknown Source)
at org.apache.derby.impl.sql.compile.SelectNode.bindNonVTITables(Unknown Source)
at org.apache.derby.impl.sql.compile.DMLStatementNode.bindTables(Unknown Source)
at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(Unknown Source)
at org.apache.derby.impl.sql.compile.CursorNode.bindStatement(Unknown Source)
at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
... 84 more

解决方案 »

  1.   


    <bean name="uiTaskJob" class="org.springframework.scheduling.quartz.JobDetailBean">
           <property name="jobClass" value="com.xx.schedule.UiTaskTrigger"/>
           <property name="jobDataAsMap">
             <map>
                <entry key="uiJobService">
                  <ref bean="uiJobService"/>
               </entry>
            </map>
           </property>
       </bean>
       
        <bean name="policyTaskJob" class="org.springframework.scheduling.quartz.JobDetailBean">
           <property name="jobClass" value="com.xx.schedule.PolicyTrigger" />
           <property name="jobDataAsMap">
             <map>
               <entry key="policyService">
                  <ref bean="policyService"/>
               </entry>
            </map>
           </property>
       </bean>


    <bean id="uiTaskTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
            <property name="jobDetail" ref="uiTaskJob" />
            <property name="startDelay" value="5000" />
            <property name="repeatInterval" value="30000" />
       </bean>
       
        <bean id="policyTaskTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
            <property name="jobDetail" ref="policyTaskJob" />
            <property name="startDelay" value="5000" />
            <property name="repeatInterval" value="60000" />
       </bean>
       
       
       <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
    <property name="triggers">
    <list>
       <ref bean="uiTaskTrigger" />
       <ref bean="policyTaskTrigger" />
    </list>
    </property>
       </bean>
    去掉schedule就可以了,难道我用内置derby和spring的quartz冲突吗???
      

  2.   

    明白了,quartz把我的dataSources当做它的配置了,晕C3P0老打印警告,有什么办法去掉吗
    java.sql.SQLWarning: Database 'D:/derbytest1' not created, connection made to existing database instead.