| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 772 人关注过本帖
标题:求教Spring+jdo配置了以后无法执行
只看楼主 加入收藏
benswallow
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2010-11-24
收藏
 问题点数:0 回复次数:1 
求教Spring+jdo配置了以后无法执行
applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.
       xmlns:xsi="http://www.
       xmlns:aop="http://www.
       xmlns:context="http://www.
       xmlns:tx="http://www.
       xsi:schemaLocation="http://www.
           http://www.
           http://www. http://www.
            http://www. http://www.
            http://www. http://www.         
    <context:annotation-config/>      
    <bean id="persistenceManagerFactory" class="org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean">
        <property name="configLocation" value="classpath:jpox.properties"/>
      </bean>   
      <bean id="pmfProxy" class="org.springframework.orm.jdo.TransactionAwarePersistenceManagerFactoryProxy">
        <property name="targetPersistenceManagerFactory" ref="persistenceManagerFactory"/>      
      </bean>
    <bean id="txManager" class="org.springframework.orm.jdo.JdoTransactionManager">
        <property name="persistenceManagerFactory" ref="pmfProxy"></property>
    </bean>
    <tx:annotation-driven transaction-manager="txManager"/>
  <bean id="userDao" class="com.wxOA.privilege.dao.impl.UserDaoImpl">
  </bean>
</beans>

java文件
@Transactional
public class UserDaoImpl implements IUserDao {
    @Resource private PersistenceManagerFactory persistenceManagerFactory;
    public void saveOrupdate_user(User user) throws Exception {
        persistenceManagerFactory.getPersistenceManager().makeTransactional(user);
    }
}

打印信息
log4j:ERROR Could not find value for key log4j.appender.warn
log4j:ERROR Could not instantiate appender named "warn".
0    [main] INFO  org.springframework.context.support.ClassPathXmlApplicationContext  - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@9ed927: startup date [Wed Nov 24 15:30:16 CST 2010]; root of context hierarchy
94   [main] INFO  org.springframework.beans.factory.xml.XmlBeanDefinitionReader  - Loading XML bean definitions from class path resource [applicationContext.xml]
125  [main] DEBUG org.springframework.beans.factory.xml.DefaultDocumentLoader  - Using JAXP provider [com.]
172  [main] DEBUG org.springframework.beans.factory.xml.PluggableSchemaResolver  - Trying to resolve XML entity with public id [null] and system id [http://www.]
172  [main] DEBUG org.springframework.beans.factory.xml.PluggableSchemaResolver  - Loading schema mappings from [META-INF/spring.schemas]
187  [main] DEBUG org.springframework.beans.factory.xml.PluggableSchemaResolver  - Loaded schema mappings: {http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www.}
187  [main] DEBUG org.springframework.beans.factory.xml.PluggableSchemaResolver  - Found XML schema [http://www.] in classpath: org/springframework/beans/factory/xml/spring-beans-3.0.xsd
250  [main] DEBUG org.springframework.beans.factory.xml.PluggableSchemaResolver  - Trying to resolve XML entity with public id [null] and system id [http://www.]
250  [main] DEBUG org.springframework.beans.factory.xml.PluggableSchemaResolver  - Found XML schema [http://www.] in classpath: org/springframework/context/config/spring-context-3.0.xsd
265  [main] DEBUG org.springframework.beans.factory.xml.PluggableSchemaResolver  - Trying to resolve XML entity with public id [null] and system id [http://www.]
265  [main] DEBUG org.springframework.beans.factory.xml.PluggableSchemaResolver  - Found XML schema [http://www.] in classpath: org/springframework/beans/factory/xml/spring-tool-3.0.xsd
265  [main] DEBUG org.springframework.beans.factory.xml.PluggableSchemaResolver  - Trying to resolve XML entity with public id [null] and system id [http://www.]
265  [main] DEBUG org.springframework.beans.factory.xml.PluggableSchemaResolver  - Found XML schema [http://www.] in classpath: org/springframework/transaction/config/spring-tx-3.0.xsd
312  [main] DEBUG org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader  - Loading bean definitions
328  [main] DEBUG org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver  - Loaded NamespaceHandler mappings: {http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www., http://www.}
437  [main] DEBUG org.springframework.beans.factory.xml.XmlBeanDefinitionReader  - Loaded 13 bean definitions from location pattern [applicationContext.xml]
437  [main] DEBUG org.springframework.context.support.ClassPathXmlApplicationContext  - Bean factory for org.springframework.context.support.ClassPathXmlApplicationContext@9ed927: org.springframework.beans.factory.support.DefaultListableBeanFactory@4a6cbf: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,persistenceManagerFactory,pmfProxy,txManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,userDao]; root of factory hierarchy
484  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
484  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
515  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Eagerly caching bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' to allow for resolving potential circular references
515  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Finished creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
594  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'
594  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating instance of bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'
625  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Eagerly caching bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor' to allow for resolving potential circular references
625  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Finished creating instance of bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'
625  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'
625  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating instance of bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'
625  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Eagerly caching bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor' to allow for resolving potential circular references
625  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Finished creating instance of bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'
625  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'
625  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating instance of bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'
640  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Eagerly caching bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor' to allow for resolving potential circular references
640  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Finished creating instance of bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'
640  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor'
640  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating instance of bean 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor'
640  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Eagerly caching bean 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor' to allow for resolving potential circular references
640  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Finished creating instance of bean 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor'
640  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating shared instance of singleton bean 'org.springframework.aop.config.internalAutoProxyCreator'
640  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating instance of bean 'org.springframework.aop.config.internalAutoProxyCreator'
656  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Eagerly caching bean 'org.springframework.aop.config.internalAutoProxyCreator' to allow for resolving potential circular references
656  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Getting BeanInfo for class [org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator]
672  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Caching PropertyDescriptors for class [org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator]
672  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'advisorAdapterRegistry' of type [org.springframework.aop.framework.adapter.AdvisorAdapterRegistry]
672  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'applyCommonInterceptorsFirst' of type [boolean]
672  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'beanClassLoader' of type [java.lang.ClassLoader]
672  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'beanFactory' of type [org.springframework.beans.factory.BeanFactory]
672  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'class' of type [java.lang.Class]
687  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'customTargetSourceCreators' of type [[Lorg.springframework.aop.framework.autoproxy.TargetSourceCreator;]
687  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'exposeProxy' of type [boolean]
687  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'frozen' of type [boolean]
687  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'interceptorNames' of type [[Ljava.lang.String;]
687  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'opaque' of type [boolean]
687  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'optimize' of type [boolean]
687  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'order' of type [int]
687  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'proxyClassLoader' of type [java.lang.ClassLoader]
687  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'proxyTargetClass' of type [boolean]
719  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Finished creating instance of bean 'org.springframework.aop.config.internalAutoProxyCreator'
719  [main] DEBUG org.springframework.context.support.ClassPathXmlApplicationContext  - Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@e0cc23]
719  [main] DEBUG org.springframework.context.support.ClassPathXmlApplicationContext  - Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@b4e29b]
719  [main] INFO  org.springframework.beans.factory.support.DefaultListableBeanFactory  - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@4a6cbf: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,persistenceManagerFactory,pmfProxy,txManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,userDao]; root of factory hierarchy
719  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
719  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'
719  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'
734  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'
734  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor'
734  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating shared instance of singleton bean 'persistenceManagerFactory'
734  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating instance of bean 'persistenceManagerFactory'
734  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Eagerly caching bean 'persistenceManagerFactory' to allow for resolving potential circular references
734  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Getting BeanInfo for class [org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean]
734  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Caching PropertyDescriptors for class [org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean]
734  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'beanClassLoader' of type [java.lang.ClassLoader]
734  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'class' of type [java.lang.Class]
734  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'configLocation' of type [org.springframework.]
734  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'jdoDialect' of type [org.springframework.orm.jdo.JdoDialect]
734  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'jdoProperties' of type [java.util.Properties]
734  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'jdoPropertyMap' of type [java.util.Map]
734  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'object' of type [javax.jdo.PersistenceManagerFactory]
734  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'objectType' of type [java.lang.Class]
734  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'persistenceManagerFactoryName' of type [java.lang.String]
734  [main] DEBUG org.springframework.beans.CachedIntrospectionResults  - Found bean property 'singleton' of type [boolean]
750  [main] DEBUG org.springframework.beans.TypeConverterDelegate  - Converting String to [interface org.springframework.] using property editor [org.springframework.]
765  [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Invoking afterPropertiesSet() on bean with name 'persistenceManagerFactory'
765  [main] INFO  org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean  - Loading JDO config from [class path resource [jpox.properties]]
765  [main] INFO  org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean  - Building new JDO PersistenceManagerFactory
906  [main] INFO  org.springframework.beans.factory.support.DefaultListableBeanFactory  - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@4a6cbf: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,persistenceManagerFactory,pmfProxy,txManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,userDao]; root of factory hierarchy
搜索更多相关主题的帖子: Spring jdo 
2010-11-24 15:31
jfei
Rank: 4
来 自:郑州
等 级:业余侠客
帖 子:92
专家分:268
注 册:2011-8-27
收藏
得分:0 
key log4j.appender.warn,
org.springframework.beans.factory.xml.PluggableSchemaResolver  - Found XML schema
这些是错误类型,看看里面的类中有没有这个方法
    <bean id="userDao" class="com.wxOA.privilege.dao.impl.UserDaoImpl">

  <bean id="persistenceManagerFactory" class="org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean">
        <property name="configLocation" value="classpath:jpox.properties"/>
      </bean>   
      <bean id="pmfProxy" class="org.springframework.orm.jdo.TransactionAwarePersistenceManagerFactoryProxy">
        <property name="targetPersistenceManagerFactory" ref="persistenceManagerFactory"/>      
      </bean>
    <bean id="txManager" class="org.springframework.orm.jdo.JdoTransactionManager">
        <property name="persistenceManagerFactory" ref="pmfProxy"></property>
    </bean>
    <tx:annotation-driven transaction-manager="txManager"/>
  </bean>
这上面的参数值,参数数据都对?
以上bean环环相扣,这个id="userDao"的bean放在第一个试试

虾米们!!!有意者加QQ 2434202652,2632939128联系我
2012-03-09 17:23
快速回复:求教Spring+jdo配置了以后无法执行
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022043 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved