ssh2基础配置(含错误提示)
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
struts2.1版本前web.xml配置代码
struts2.1版本后web.xml配置代码
目前我们使用的是struts2.3.4
struts-2.3.4版本中所有的Jar包文件,配置最基础的structs2所需的6个必须的jar文件为:
commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
freemarker-2.3.19.jar
ognl-3.0.5.jar
struts2-core-2.3.4.jar
xwork-core-2.3.4.jar
报错:
ng.IllegalArgumentException: Javassist library is missing in classpath! Please add missed dependency!
缺少javassist-3.11.0.GA.jar
报错:
ng.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
缺少commons-lang3-3.1.jar
struts配置完成,建立struts.xml
配置spring,在web.xml中添加代码
报错:
ng.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
缺少spring.jar
报错:
ng.NoClassDefFoundError: org/apache/commons/logging/LogFactory
缺少commons-logging.jar
报错:
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
创建applicationContext.xml放在WEB-INF目录下(此时该文件代码如下:)
添加代码
报错:
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [mons.dbcp.BasicDataSource] for bean with name 'datasource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is ng.ClassNotFoundException: mons.dbcp.BasicDataSource
缺少commons-pool-1.4.jar和commons-dbcp.jar
添加代码
先导入hibernate3.jar
启动报错:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.LocalSessionFactoryBean]: Constructor threw exception; nested exception is ng.NoClassDefFoundError: org/dom4j/DocumentException
缺少dom4j-1.6.1.jar
报错:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.LocalSessionFactoryBean]: Constructor threw exception; nested exception is ng.NoClassDefFoundError: org/slf4j/LoggerFactory
缺少slf4j-api-1.5.2.jar和slf4j-nop-1.5.2.jar
报错:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is ng.NoClassDefFoundError: javax/transaction/TransactionManager
缺少jta-1.1.jar
报错:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is ng.NoClassDefFoundError: org/apache/commons/collections/map/LRUMap
缺少commons-collections-3.1.jar
基础配置完成