解决方案 »
- 字符串错误?应该不是单纯的下表越界啊
- 关于struts2的ModelDriven
- myeclipse中log4j配置问题
- 用jfree画图不能显示问题。
- webservice 使用JaxWsDynamicClientFactory报空指针异常
- 急::请问数据库里的一个字段值如(北京,上海,天津),我现在要取出记录值,将它们以逗号分开有几个就赋给一个字符数组??? Thanks!!!!
- 关于Oracle8.0.5的Date类型字段映射成CMP的java.sql.Date后不能存入时间的问题
- 为什么连接DB2数据库的时候会出现这样的问题!!
- 希望哪位能给一份hibernate的简单的教程,最好是中文的,谢谢!
- 初学者问题:EJB的LocalHome接口与Home接口有什么不同它们分别有什么作用.
- ie地址栏中文件路径隐藏
- request如何set parameter的值?
我也觉得是,但是不知道是那个jar,你看下我这还缺什么包
applicationContext.xml 里还需要配置什么bean 就配了数据源
entity配置在META-INF/persistence.xml 里
不行 会报这个java.lang.NoClassDefFoundError: javax/servlet/Filter
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:ehcache="http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/data/jpa
http://www.springframework.org/schema/data/jpa/spring-jpa-1.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring
http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd
">
<!-- 配置自动注入-->
<context:annotation-config/>
<!-- info3 交给spring过滤器托管 -->
<bean id="springFilter" class="com.infoservice.mvc.FilterDispatcher"></bean>
<!-- 定义实体管理器工厂 -->
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="HibernateJPAPU"/>
</bean>
<!-- 配置事务管理器 -->
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<!-- 启用 annotation事务-->
<tx:annotation-driven transaction-manager="transactionManager"/>
<jpa:repositories base-package="com.hr.dao"/>
<!-- 扫描符合@Service @Repository的类
<context:component-scan base-package="com.hr" use-default-filters="false">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Service" />
<context:include-filter type="annotation" expression="org.springframework.stereotype.Repository" />
</context:component-scan>
-->
<!--缓存机制
<ehcache:annotation-driven cache-manager="ehCacheManager" />
<bean id="ehCacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation" value="classpath:ehcache.xml" />
</bean>
-->
<!-- 配置SpringDataJpa文件
<import resource="SpringDataJPA.xml"/>
-->
<!-- SpringData指定扫描目录配置文件
<import resource="RepositoryScan.xml"/>
-->
<!-- 配置定时任务文件
<import resource="Schedule.xml"/>
-->
</beans>