错误一: 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_10\bin;C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin 错误二: struts的配置文件里面 是不是要添加一个 listener 标签 标签内容是 org.springframework.web.context.ContextLoaderListener你加了没有?
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<!-- <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>-->
<!-- 定义数据源Bean,使用C3P0数据源实现 -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<!-- 指定连接数据库的驱动 -->
<property name="driverClass" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
<!-- 指定连接数据库的URL -->
<property name="jdbcUrl" value="jdbc:microsoft:sqlserver://128.1.37.238:1433;DatabaseName=db_OfficeAuto" />
<!-- 指定连接数据库的用户名 -->
<property name="user" value="sa"/>
<!-- 指定连接数据库的密码 -->
<property name="password" value="zgs"/>
<!-- 指定连接数据库连接池的最大连接数 -->
<property name="maxPoolSize" value="20"/>
<!-- 指定连接数据库连接池的最小连接数 -->
<property name="minPoolSize" value="1"/>
<!-- 指定连接数据库连接池的初始化连接数 -->
<property name="initialPoolSize" value="1"/>
<!-- 指定连接数据库连接池的连接的最大空闲时间 -->
<property name="maxIdleTime" value="20"/>
</bean>
<!--定义了Hibernate的SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="mappingResources">
<list>
<value>hibernate/Sysmenu.hbm.xml</value>
<value>hibernate/Users.hbm.xml</value>
<value>hibernate/Employee.hbm.xml</value>
<value>hibernate/VCheckPurview.hbm.xml</value>
<value>hibernate/Purview.hbm.xml</value>
<value>hibernate/VCheckMenu.hbm.xml</value>
<value>hibernate/MainContent.hbm.xml</value>
<value>hibernate/Register.hbm.xml</value>
<value>hibernate/Department.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.jdbc.batch_size">20</prop>
</props>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
<!-- 事务拦截器bean需要依赖注入一个事务管理器 -->
<property name="transactionManager" ref="transactionManager"/>
<property name="transactionAttributes">
<!-- 下面定义事务传播属性-->
<props>
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean> <!-- 定义BeanNameAutoProxyCreator-->
<bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<!-- 指定对满足哪些bean name的bean自动生成业务代理 -->
<property name="beanNames">
<!-- 下面是所有需要自动创建事务代理的bean-->
<list>
<value>loginImpl</value>
<value>menuImpl</value>
</list>
<!-- 此处可增加其他需要自动创建事务代理的bean-->
</property>
<!-- 下面定义BeanNameAutoProxyCreator所需的事务拦截器-->
<property name="interceptorNames">
<list>
<!-- 此处可增加其他新的Interceptor -->
<value>transactionInterceptor</value>
</list>
</property>
</bean>
</beans>///////////////////////请个位大虾帮我!!
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_10\bin;C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin
错误二:
struts的配置文件里面 是不是要添加一个 listener 标签
标签内容是 org.springframework.web.context.ContextLoaderListener你加了没有?
其他没有加c3p0的项目没问题,但也会有 "错误一".前天还好好的,昨天同事将我的桌面和我的文件夹同步到服务器上就出现这问题.救救我呀!web.xml:<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml,classpath:daoContext.xml,classpath:serviceContext.xml</param-value>
</context-param>
<!-- 用于初始化Spring容器的Listener -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- 定义Struts2的FilterDispathcer的Filter -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<!-- FilterDispatcher用来初始化struts2并且处理所有的WEB请求。 -->
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>struts.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.custom.i18n.resources" value="messageResource"/>
<constant name="struts.i18n.encoding" value="UTF-8" />
<package name="home.action" extends="struts-default">
<global-results>
<result name="exit">../home/main.jsp</result>
</global-results>
<action name="LoginAction" class="home.action.LoginAction">
<result name="toFrameset">../home/indexFrameset.jsp</result>
<result name="toLogin">login.jsp</result>
</action>
<action name="MenuAction" class="home.action.MenuAction">
<result name="toXMLData">../share/xmlData.jsp</result>
</action>
</package>
<package name="sysManage.action" extends="struts-default">
<global-results>
<result name="exit">../home/main.jsp</result>
</global-results>
<action name="passwordAction" class="sysManage.action.PasswordAction">
<result name="toTextData">../share/textData.jsp</result>
</action>
<action name="userNameAction" class="sysManage.action.UserNameAction">
<result name="toTextData">../share/textData.jsp</result>
</action>
<action name="purviewAction" class="sysManage.action.PurviewAction">
<result name="toXMLData">../share/xmlData.jsp</result>
<result name="toTextData">../share/textData.jsp</result>
</action>
<action name="userManageAction" class="sysManage.action.UserManageAction">
<result name="toXMLData">../share/xmlData.jsp</result>
<result name="toTextData">../share/textData.jsp</result>
</action>
<action name="projectManageAction" class="sysManage.action.ProjectManageAction">
<result name="toTextData">../share/textData.jsp</result>
<result name="toXMLData">../share/xmlData.jsp</result>
</action>
</package>
<package name="janitor.action" extends="struts-default">
<global-results>
<result name="exit">../home/main.jsp</result>
</global-results>
<action name="contentManageAction" class="janitor.action.MainContentAction">
<result name="toXMLData">../share/xmlData.jsp</result>
<result name="toTextData">../share/textData.jsp</result>
</action>
<action name="queryRegisterAction" class="janitor.action.QueryRegisterAction">
<result name="toXMLData">../share/xmlData.jsp</result>
</action>
<action name="janitorAction" class="janitor.action.JanitorAction">
<result name="toXMLData">../share/xmlData.jsp</result>
</action>
</package>
</struts>
运行后在
C:\Program Files\Apache Software Foundation\Tomcat 6.0\work\Catalina\localhost\EOffice
下只有文件
SESSIONS.ser