首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

s2sh错误

2012-12-18 
s2sh异常jdk1.6, tomcat7.0 ,struts2.3.4,spring3.2,hibernate4.警告: [SetContextPropertiesRule]{Contex

s2sh异常
jdk1.6, tomcat7.0 ,struts2.3.4,spring3.2,hibernate4.
警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:  did not find a matching property.
2012-11-12 22:28:46 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath
2012-11-12 22:28:46 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
2012-11-12 22:28:51 org.apache.coyote.AbstractProtocol start
用这个方法没用: http://blog.csdn.net/c_4818/article/details/6818481

求大家指导
[最优解释]
应该是spring 配置问题
[其他解释]
把你的配置文件代码贴出来,你在配置某个bean是设置source属性出错,该bean没有这个属性。
[其他解释]

classpath:jdbc.properties
 
文件位置放对了吗
[其他解释]
你的错误信息没copy全吧,这样没办法处理,一般来说属于jar包问题,再就是hibernate4里不支持hibernate模板了,不要一成不变的去做事
[其他解释]
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-3.0.xsd
           http://www.springframework.org/schema/aop
           http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
           http://www.springframework.org/schema/tx 
           http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<context:annotation-config />
<context:component-scan base-package="com.assistant" />



<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>classpath:jdbc.properties</value>
</property>
</bean>

<bean id="dataSource" destroy-method="close"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="${jdbc.driverClassName}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
</bean>



<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />

 <property name="packagesToScan">


<list>
<value>com.assistant.model</value>

</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hbm2ddl.auto">create</prop>
<prop key="current_session_context_class">thread</prop>
<prop key="javax.persistence.validation.mode">none</prop>
</props>
</property>
</bean>

<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>

<bean id="txManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>

<aop:config>
<aop:pointcut id="bussinessService"
expression="execution(public * com.assistant.service.*.*(..))" />
<aop:advisor pointcut-ref="bussinessService"
advice-ref="txAdvice" />
</aop:config>

<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="exists" read-only="true" />
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="delete*" propagation="REQUIRED"/>
<tx:method name="save*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>

</beans>
[其他解释]

引用:
Java code?1classpath:jdbc.properties 
文件位置放对了吗

放在src下面,这样放没问题吧
[其他解释]
引用:
你的错误信息没copy全吧,这样没办法处理,一般来说属于jar包问题,再就是hibernate4里不支持hibernate模板了,不要一成不变的去做事

我把hibernate改成3了,还是有问题

热点排行