我在服务器CentOS上的tomcat6中部署文件战时遇到问题。
我用过
java version "1.6.0_30" Java(TM) SE Runtime Environment (build 1.6.0_30-b12) Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
Tomcat开始部署
时出现错误2012-01-05 17:19:27,763 DEBUG [java.sql.PreparedStatement] {pstm-100001} Parameters: [10000, 0]
2012-01-05 17:19:27,763 DEBUG [java.sql.PreparedStatement] {pstm-100001} Parameters: [10000, 0]
2012-01-05 17:19:27,764 DEBUG [java.sql.PreparedStatement] {pstm-100001} Types: [java.lang.Integer, java.lang.Integer]
2012-01-05 17:19:27,764 DEBUG [java.sql.PreparedStatement] {pstm-100001} Types: [java.lang.Integer, java.lang.Integer]
2012-01-05 17:19:27,766 DEBUG [java.sql.ResultSet] {rset-100002} ResultSet
2012-01-05 17:19:27,766 DEBUG [java.sql.ResultSet] {rset-100002} ResultSet
2012-01-05 17:19:27,831 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'backupScheduler' defined in file [/opt/apache-tomcat-6.0.35/webapps/egovframework-all-in-one-2.0.0/WEB-INF/classes/egovframework/spring/com/context-scheduling-sym-sym-bak.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)
这是文件context-scheduling-sym-sym-bak.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans `http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">`
<bean id="egovBackupOpertService" class="egovframework.com.sym.sym.bak.service.impl.EgovBackupOpertServiceImpl" />
<!-- 백업관리 스케줄러 -->
<bean id="backupScheduler" class="egovframework.com.sym.sym.bak.service.BackupScheduler"
init-method="init" destroy-method="destroy">
<property name="egovBackupOpertService" ref="egovBackupOpertService"/>
<property name="idgenService" ref="egovBackupResultIdGnrService"/>
</bean>
</beans>
请大家帮帮我,谢谢...:)
答案 0 :(得分:0)
您的查询中似乎有一些错误。 。 !准备好的声明本身就是这样。您的查询是否在您的数据库上执行?
答案 1 :(得分:0)
根据你的stacktrace,看起来你在egovframework.com.sym.sym.bak.service.BackupScheduler类的init()方法中有一个NullPointerException。
答案 2 :(得分:0)
正如Matthew所说,您的堆栈跟踪显示backupScheduler bean的初始化正在运行为空指针。
从查看.xml文件,您的backupScheduler bean包含对名为“egovBackupResultIdGnrService”的bean的引用
<bean id="backupScheduler" class="egovframework.com.sym.sym.bak.service.BackupScheduler"
init-method="init" destroy-method="destroy">
<property name="egovBackupOpertService" ref="egovBackupOpertService"/>
<-- THIS BEAN RIGHT HERE -->
<property name="idgenService" ref="egovBackupResultIdGnrService"/>
</bean>
但我没有看到此bean在此.xml文件中的任何位置被声明。这个bean是在其他地方宣布的吗?