Java BeanCreationException:创建名为';org.springframework.context.annotation.internalPersistenceAnnotationProcessor';:

Java BeanCreationException:创建名为';org.springframework.context.annotation.internalPersistenceAnnotationProcessor';:,java,spring,hibernate,configuration,autowired,Java,Spring,Hibernate,Configuration,Autowired,BeanCreationException:创建名为“org.springframework.context.annotation.internalPersistenceAnnotationProcessor”的bean时出错:bean实例化失败;嵌套的异常是java.lang.ClassFormatError:类文件javax/persistence/PersistenceContextType中非本机或抽象的方法中缺少代码属性 获取以下错误: ... 12 more 2015-07-

BeanCreationException:创建名为“org.springframework.context.annotation.internalPersistenceAnnotationProcessor”的bean时出错:bean实例化失败;嵌套的异常是java.lang.ClassFormatError:类文件javax/persistence/PersistenceContextType中非本机或抽象的方法中缺少代码属性

获取以下错误:

    ... 12 more
2015-07-06 23:03:06 [main] DEBUG DefaultListableBeanFactory:512 - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@105fece7: 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,baseSpringConfig,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor,org.openrepose.dbutil.spring.config.DbUtilsSpringConfig,sessionFactory,dataSource,hibernateUtil,hibernateUtils,org.openrepose.dao.model.spring.config.DaoSpringConfig,clientAuthConfigDao,ipIdentityConfigDao,rackspaceAuthorizationDao,quotaDao,rateLimitingConfigurationDao,systemModelDao,rackspaceAuthorizationConverter,ipIdentityConfigConverter,quotaConverter,rateLimitingConfigurationBase,clientAuthConfigConverter,rateLimitingConfigurationConverter,systemModelConverter,systemModelBase,quotaBase,ipIdentityConfigBase,clientAuthConfigBase,rackspaceAuthorizationBase]; root of factory hierarchy
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor': Instantiation of bean failed; nested exception is java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/persistence/PersistenceContextType
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1093)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1038)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:199)
    at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:615)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:465)
    at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:84)
    at org.openrepose.base.test.TestManagerBase.main(TestManagerBase.java:71)
Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/persistence/PersistenceContextType
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
    at java.lang.Class.getMethod0(Class.java:3018)
    at java.lang.Class.getMethod(Class.java:1784)
    at org.springframework.util.ClassUtils.getMethodIfAvailable(ClassUtils.java:668)
    at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.<clinit>(PersistenceAnnotationBeanPostProcessor.java:173)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1086)
    ... 12 more
用于Dao自动布线

package org.openrepose.dao.model.spring.config;

import org.openrepose.dao.model.constants.DaoSpringConfigConstants;
import org.openrepose.dao.model.implementation.clientauthentication.ClientAuthDAO;
import org.openrepose.dao.model.implementation.clientauthorization.ClientAuthorizationDAO;
import org.openrepose.dao.model.implementation.ipidentity.IpIdentityDAO;
import org.openrepose.dao.model.implementation.quota.QuotaDAO;
import org.openrepose.dao.model.implementation.ratelimit.RatelimitDAO;
import org.openrepose.dao.model.implementation.systemmodel.SystemModelDAO;
import org.openrepose.dao.model.interfaces.IModelDao;
import org.openrepose.dbutil.spring.config.DbUtilsSpringConfig;
import org.openrepose.entities.clientauthentication.ClientAuthConfigEO;
import org.openrepose.entities.clientauthorization.RackspaceAuthorizationConfigEO;
import org.openrepose.entities.ipidentity.IpIdentityConfigEO;
import org.openrepose.entities.quota.QuotaLimitsConfigEO;
import org.openrepose.entities.ratelimit.RateLimitConfigEO;
import org.openrepose.entities.systemmodel.SystemModelConfigEO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Scope;

/**
 * Spring IoC configuration. This class is responsible for autowiring the all
 * service exposed by Dao layer
 * 
 * @author Nitin gupta (gupta.nitin@snapdeal.com)
 *
 */
@Configuration
@ComponentScan({ "org.openrepose.dao" })
@Import(DbUtilsSpringConfig.class)
public class DaoSpringConfig {

    @Autowired
    @Bean(name = DaoSpringConfigConstants.DAO_CLIENT_AUTH)
    @Scope("singleton")
    public IModelDao<ClientAuthConfigEO> getClientAuth() {
        return new ClientAuthDAO();
    }

    @Autowired
    @Bean(name = DaoSpringConfigConstants.DAO_IP_IDENTITY)
    @Scope("singleton")
    public IModelDao<IpIdentityConfigEO> getIpIdentity() {
        return new IpIdentityDAO();
    }

    @Autowired
    @Bean(name = DaoSpringConfigConstants.DAO_RATE_LIMIT)
    @Scope("singleton")
    public IModelDao<RateLimitConfigEO> getRateLimit() {
        return new RatelimitDAO();
    }

    @Autowired
    @Bean(name = DaoSpringConfigConstants.DAO_SYSTEM_MODEL)
    @Scope("singleton")
    public IModelDao<SystemModelConfigEO> getSystemModel() {
        return new SystemModelDAO();
    }

    @Autowired
    @Bean(name = DaoSpringConfigConstants.DAO_CLIENT_AUTHORIZATION)
    @Scope("singleton")
    public IModelDao<RackspaceAuthorizationConfigEO> getClientAuthorization() {
        return new ClientAuthorizationDAO();
    }

    @Autowired
    @Bean(name = DaoSpringConfigConstants.DAO_QUOTA)
    @Scope("singleton")
    public IModelDao<QuotaLimitsConfigEO> getQuotaLimits() {
        return new QuotaDAO();
    }

}
package org.openrepose.base.spring.config;

import org.openrepose.base.bos.constants.BaseSpringConfigConstants;
import org.openrepose.base.clientauthentication.bos.ClientAuthConfig;
import org.openrepose.base.clientauthentication.service.implementation.ClientAuthBaseImpl;
import org.openrepose.base.clientauthorization.bos.RackspaceAuthorization;
import org.openrepose.base.clientauthorization.service.implementation.ClientAuthorizationBaseImpl;
import org.openrepose.base.conversion.utility.IObjectConverter;
import org.openrepose.base.interfaces.IModelBase;
import org.openrepose.base.ipidentity.bos.IpIdentityConfig;
import org.openrepose.base.ipidentity.service.implementation.IpIdentityBaseImpl;
import org.openrepose.base.quota.bos.Limits;
import org.openrepose.base.quota.service.implementation.QuotaBaseImpl;
import org.openrepose.base.ratelimit.bos.RateLimitingConfiguration;
import org.openrepose.base.ratelimit.service.implementation.RateLimitBaseImpl;
import org.openrepose.base.systemmodel.bos.SystemModel;
import org.openrepose.base.systemmodel.service.implementation.SystemModelBaseImpl;
import org.openrepose.dao.model.spring.config.DaoSpringConfig;
import org.openrepose.entities.clientauthentication.ClientAuthConfigEO;
import org.openrepose.entities.clientauthorization.RackspaceAuthorizationConfigEO;
import org.openrepose.entities.ipidentity.IpIdentityConfigEO;
import org.openrepose.entities.quota.QuotaLimitsConfigEO;
import org.openrepose.entities.ratelimit.RateLimitConfigEO;
import org.openrepose.entities.systemmodel.SystemModelConfigEO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Scope;

/**
 * Spring IoC configuration. This class is responsible for autowiring the all
 * service exposed by Base layer
 * 
 * @author Nitin gupta (gupta.nitin@snapdeal.com)
 *
 */
@Configuration
@ComponentScan({ "org.openrepose.base" })
@Import({DaoSpringConfig.class} )
public class BaseSpringConfig {

    @Autowired
    @Bean(name = BaseSpringConfigConstants.OBJECT_CONVERTER_CLIENT_AUTH)
    @Scope("singleton")
    public IObjectConverter<ClientAuthConfig, ClientAuthConfigEO> getClientAuthConverter() {
        return new ClientAuthConfig();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.OBJECT_CONVERTER_CLIENT_AUTHORIZATION)
    @Scope("singleton")
    public IObjectConverter<RackspaceAuthorization, RackspaceAuthorizationConfigEO> getRackspaceAuthorizationConverter() {
        return new RackspaceAuthorization();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.OBJECT_CONVERTER_IP_IDENTITY)
    @Scope("singleton")
    public IObjectConverter<IpIdentityConfig, IpIdentityConfigEO> getIpIdentityConverter() {
        return new IpIdentityConfig();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.OBJECT_CONVERTER_QUOTA)
    @Scope("singleton")
    public IObjectConverter<Limits, QuotaLimitsConfigEO> getQuotaConverter() {
        return new Limits();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.OBJECT_CONVERTER_RATE_LIMIT)
    @Scope("singleton")
    public IObjectConverter<RateLimitingConfiguration, RateLimitConfigEO> getRateLimitConverter() {
        return new RateLimitingConfiguration();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.OBJECT_CONVERTER_SYSTEM_MODEL)
    @Scope("singleton")
    public IObjectConverter<SystemModel, SystemModelConfigEO> getSystemModelConverter() {
        return new SystemModel();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.BASE_SYSTEM_MODEL)
    @Scope("singleton")
    public IModelBase<SystemModel> getSystemModelBase() {
        return new SystemModelBaseImpl();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.BASE_RATE_LIMIT)
    @Scope("singleton")
    public IModelBase<RateLimitingConfiguration> getRateLimitBase() {
        return new RateLimitBaseImpl();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.BASE_QUOTA)
    @Scope("singleton")
    public IModelBase<Limits> getLimitsBase() {
        return new QuotaBaseImpl();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.BASE_IP_IDENTITY)
    @Scope("singleton")
    public IModelBase<IpIdentityConfig> getIpIdentityConfigBase() {
        return new IpIdentityBaseImpl();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.BASE_CLIENT_AUTH)
    @Scope("singleton")
    public IModelBase<ClientAuthConfig> getClientAuthBase() {
        return new ClientAuthBaseImpl();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.BASE_CLIENT_AUTHORIZATION)
    @Scope("singleton")
    public IModelBase<RackspaceAuthorization> getRackspaceAuthorizationBase() {
        return new ClientAuthorizationBaseImpl();
    }

}
package org.openresose.dao.model.spring.config;
导入org.openresose.dao.model.constants.DaoSpringConfigConstants;
导入org.openresose.dao.model.implementation.clientauthentication.ClientAuthDAO;
导入org.openresose.dao.model.implementation.clientauthorization.ClientAuthorizationDAO;
导入org.openresose.dao.model.implementation.ipidentity.IpIdentityDAO;
导入org.openresose.dao.model.implementation.quota.QuotaDAO;
导入org.openresose.dao.model.implementation.ratelimit.RatelimitDAO;
导入org.openresose.dao.model.implementation.systemmodel.SystemModelDAO;
导入org.openresose.dao.model.interfaces.IModelDao;
导入org.openrespose.dbutil.spring.config.DbUtilsSpringConfig;
导入org.openrespose.entities.clientauthentication.ClientAuthConfigEO;
导入org.openresose.entities.clientauthorization.RackspaceAuthorizationConfigEO;
导入org.openresose.entities.ipidentity.ipidentityConfigGeo;
导入org.openresose.entities.quota.QuotaLimitsConfigEO;
导入org.openresose.entities.ratelimit.ratelimiteconfigeo;
导入org.openresose.entities.systemmodel.SystemModelConfigEO;
导入org.springframework.beans.factory.annotation.Autowired;
导入org.springframework.context.annotation.Bean;
导入org.springframework.context.annotation.ComponentScan;
导入org.springframework.context.annotation.Configuration;
导入org.springframework.context.annotation.import;
导入org.springframework.context.annotation.Scope;
/**
*Spring IoC配置。这个类负责自动连接all
*Dao层公开的服务
* 
*@作者尼廷·古普塔(古普塔)。nitin@snapdeal.com)
*
*/
@配置
@组件扫描({“org.openrespose.dao})
@导入(DbUtilsSpringConfig.class)
公共类DaoSpringConfig{
@自动连线
@Bean(name=DaoSpringConfigConstants.DAO\u CLIENT\u AUTH)
@范围(“单例”)
公共IModelDao getClientAuth(){
返回新的ClientAuthDAO();
}
@自动连线
@Bean(name=DaoSpringConfigConstants.DAO\u IP\u标识)
@范围(“单例”)
公共IModelDao getIpIdentity(){
返回新的IpIdentityDAO();
}
@自动连线
@Bean(名称=DaoSpringConfigConstants.DAO\u速率\u限制)
@范围(“单例”)
公共IModelDao getRateLimit(){
返回新的RatelimitDAO();
}
@自动连线
@Bean(name=DaoSpringConfigConstants.DAO\u系统\u模型)
@范围(“单例”)
公共IModelDao getSystemModel(){
返回新的SystemModelDAO();
}
@自动连线
@Bean(name=DaoSpringConfigConstants.DAO\u客户端\u授权)
@范围(“单例”)
公共IModelDao getClientAuthorization(){
返回新的ClientAuthorizationDAO();
}
@自动连线
@Bean(name=DaoSpringConfigConstants.DAO\u配额)
@范围(“单例”)
公共IModelDao getQuotaLimits(){
返回新的QuotaDAO();
}
}
用于基本自动布线

package org.openrepose.dao.model.spring.config;

import org.openrepose.dao.model.constants.DaoSpringConfigConstants;
import org.openrepose.dao.model.implementation.clientauthentication.ClientAuthDAO;
import org.openrepose.dao.model.implementation.clientauthorization.ClientAuthorizationDAO;
import org.openrepose.dao.model.implementation.ipidentity.IpIdentityDAO;
import org.openrepose.dao.model.implementation.quota.QuotaDAO;
import org.openrepose.dao.model.implementation.ratelimit.RatelimitDAO;
import org.openrepose.dao.model.implementation.systemmodel.SystemModelDAO;
import org.openrepose.dao.model.interfaces.IModelDao;
import org.openrepose.dbutil.spring.config.DbUtilsSpringConfig;
import org.openrepose.entities.clientauthentication.ClientAuthConfigEO;
import org.openrepose.entities.clientauthorization.RackspaceAuthorizationConfigEO;
import org.openrepose.entities.ipidentity.IpIdentityConfigEO;
import org.openrepose.entities.quota.QuotaLimitsConfigEO;
import org.openrepose.entities.ratelimit.RateLimitConfigEO;
import org.openrepose.entities.systemmodel.SystemModelConfigEO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Scope;

/**
 * Spring IoC configuration. This class is responsible for autowiring the all
 * service exposed by Dao layer
 * 
 * @author Nitin gupta (gupta.nitin@snapdeal.com)
 *
 */
@Configuration
@ComponentScan({ "org.openrepose.dao" })
@Import(DbUtilsSpringConfig.class)
public class DaoSpringConfig {

    @Autowired
    @Bean(name = DaoSpringConfigConstants.DAO_CLIENT_AUTH)
    @Scope("singleton")
    public IModelDao<ClientAuthConfigEO> getClientAuth() {
        return new ClientAuthDAO();
    }

    @Autowired
    @Bean(name = DaoSpringConfigConstants.DAO_IP_IDENTITY)
    @Scope("singleton")
    public IModelDao<IpIdentityConfigEO> getIpIdentity() {
        return new IpIdentityDAO();
    }

    @Autowired
    @Bean(name = DaoSpringConfigConstants.DAO_RATE_LIMIT)
    @Scope("singleton")
    public IModelDao<RateLimitConfigEO> getRateLimit() {
        return new RatelimitDAO();
    }

    @Autowired
    @Bean(name = DaoSpringConfigConstants.DAO_SYSTEM_MODEL)
    @Scope("singleton")
    public IModelDao<SystemModelConfigEO> getSystemModel() {
        return new SystemModelDAO();
    }

    @Autowired
    @Bean(name = DaoSpringConfigConstants.DAO_CLIENT_AUTHORIZATION)
    @Scope("singleton")
    public IModelDao<RackspaceAuthorizationConfigEO> getClientAuthorization() {
        return new ClientAuthorizationDAO();
    }

    @Autowired
    @Bean(name = DaoSpringConfigConstants.DAO_QUOTA)
    @Scope("singleton")
    public IModelDao<QuotaLimitsConfigEO> getQuotaLimits() {
        return new QuotaDAO();
    }

}
package org.openrepose.base.spring.config;

import org.openrepose.base.bos.constants.BaseSpringConfigConstants;
import org.openrepose.base.clientauthentication.bos.ClientAuthConfig;
import org.openrepose.base.clientauthentication.service.implementation.ClientAuthBaseImpl;
import org.openrepose.base.clientauthorization.bos.RackspaceAuthorization;
import org.openrepose.base.clientauthorization.service.implementation.ClientAuthorizationBaseImpl;
import org.openrepose.base.conversion.utility.IObjectConverter;
import org.openrepose.base.interfaces.IModelBase;
import org.openrepose.base.ipidentity.bos.IpIdentityConfig;
import org.openrepose.base.ipidentity.service.implementation.IpIdentityBaseImpl;
import org.openrepose.base.quota.bos.Limits;
import org.openrepose.base.quota.service.implementation.QuotaBaseImpl;
import org.openrepose.base.ratelimit.bos.RateLimitingConfiguration;
import org.openrepose.base.ratelimit.service.implementation.RateLimitBaseImpl;
import org.openrepose.base.systemmodel.bos.SystemModel;
import org.openrepose.base.systemmodel.service.implementation.SystemModelBaseImpl;
import org.openrepose.dao.model.spring.config.DaoSpringConfig;
import org.openrepose.entities.clientauthentication.ClientAuthConfigEO;
import org.openrepose.entities.clientauthorization.RackspaceAuthorizationConfigEO;
import org.openrepose.entities.ipidentity.IpIdentityConfigEO;
import org.openrepose.entities.quota.QuotaLimitsConfigEO;
import org.openrepose.entities.ratelimit.RateLimitConfigEO;
import org.openrepose.entities.systemmodel.SystemModelConfigEO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Scope;

/**
 * Spring IoC configuration. This class is responsible for autowiring the all
 * service exposed by Base layer
 * 
 * @author Nitin gupta (gupta.nitin@snapdeal.com)
 *
 */
@Configuration
@ComponentScan({ "org.openrepose.base" })
@Import({DaoSpringConfig.class} )
public class BaseSpringConfig {

    @Autowired
    @Bean(name = BaseSpringConfigConstants.OBJECT_CONVERTER_CLIENT_AUTH)
    @Scope("singleton")
    public IObjectConverter<ClientAuthConfig, ClientAuthConfigEO> getClientAuthConverter() {
        return new ClientAuthConfig();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.OBJECT_CONVERTER_CLIENT_AUTHORIZATION)
    @Scope("singleton")
    public IObjectConverter<RackspaceAuthorization, RackspaceAuthorizationConfigEO> getRackspaceAuthorizationConverter() {
        return new RackspaceAuthorization();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.OBJECT_CONVERTER_IP_IDENTITY)
    @Scope("singleton")
    public IObjectConverter<IpIdentityConfig, IpIdentityConfigEO> getIpIdentityConverter() {
        return new IpIdentityConfig();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.OBJECT_CONVERTER_QUOTA)
    @Scope("singleton")
    public IObjectConverter<Limits, QuotaLimitsConfigEO> getQuotaConverter() {
        return new Limits();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.OBJECT_CONVERTER_RATE_LIMIT)
    @Scope("singleton")
    public IObjectConverter<RateLimitingConfiguration, RateLimitConfigEO> getRateLimitConverter() {
        return new RateLimitingConfiguration();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.OBJECT_CONVERTER_SYSTEM_MODEL)
    @Scope("singleton")
    public IObjectConverter<SystemModel, SystemModelConfigEO> getSystemModelConverter() {
        return new SystemModel();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.BASE_SYSTEM_MODEL)
    @Scope("singleton")
    public IModelBase<SystemModel> getSystemModelBase() {
        return new SystemModelBaseImpl();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.BASE_RATE_LIMIT)
    @Scope("singleton")
    public IModelBase<RateLimitingConfiguration> getRateLimitBase() {
        return new RateLimitBaseImpl();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.BASE_QUOTA)
    @Scope("singleton")
    public IModelBase<Limits> getLimitsBase() {
        return new QuotaBaseImpl();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.BASE_IP_IDENTITY)
    @Scope("singleton")
    public IModelBase<IpIdentityConfig> getIpIdentityConfigBase() {
        return new IpIdentityBaseImpl();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.BASE_CLIENT_AUTH)
    @Scope("singleton")
    public IModelBase<ClientAuthConfig> getClientAuthBase() {
        return new ClientAuthBaseImpl();
    }

    @Autowired
    @Bean(name = BaseSpringConfigConstants.BASE_CLIENT_AUTHORIZATION)
    @Scope("singleton")
    public IModelBase<RackspaceAuthorization> getRackspaceAuthorizationBase() {
        return new ClientAuthorizationBaseImpl();
    }

}
package org.openrespose.base.spring.config;
导入org.openresose.base.bos.constants.BaseSpringConfigConstants;
导入org.openresose.base.clientauthentication.bos.ClientAuthConfig;
导入org.openresose.base.clientauthentication.service.implementation.ClientAuthBaseImpl;
导入org.openresose.base.clientauthorization.bos.RackspaceAuthorization;
导入org.openresose.base.clientauthorization.service.implementation.ClientAuthorizationBaseImpl;
导入org.openresose.base.conversion.utility.IObjectConverter;
导入org.openresose.base.interfaces.IModelBase;
导入org.openrespose.base.ipidentity.bos.IpIdentityConfig;
导入org.openresose.base.ipidentity.service.implementation.IpIdentityBaseImpl;
导入org.openresose.base.quota.bos.Limits;
导入org.openresose.base.quota.service.implementation.QuotaBaseImpl;
导入org.openresose.base.ratelimit.bos.rateliminingconfiguration;
导入org.openresose.base.ratelimit.service.implementation.RateLimitBaseImpl;
导入org.openresose.base.systemmodel.bos.systemmodel;
导入org.openresose.base.systemmodel.service.implementation.SystemModelBaseImpl;
导入org.openresose.dao.model.spring.config.DaoSpringConfig;
导入org.openrespose.entities.clientauthentication.ClientAuthConfigEO;
导入org.openresose.entities.clientauthorization.RackspaceAuthorizationConfigEO;
导入org.openresose.entities.ipidentity.ipidentityConfigGeo;
导入org.openresose.entities.quota.QuotaLimitsConfigEO;
导入org.openresose.entities.ratelimit.ratelimiteconfigeo;
导入org.openresose.entities.systemmodel.SystemModelConfigEO;
导入org.springframework.beans.factory.annotation.Autowired;
导入org.springframework.context.annotation.Bean;
导入org.springframework.context.annotation.ComponentScan;
导入org.springframework.context.annotation.Configuration;
导入org.springframework.context.annotation.import;
导入org.springframework.context.annotation.Scope;
/**
*Spring IoC配置。这个类负责自动连接all
*由基础层公开的服务
* 
*@作者尼廷·古普塔(古普塔)。nitin@snapdeal.com)
*
*/
@配置
@组件扫描({“org.openrespose.base”})
@导入({DaoSpringConfig.class})
公共类BaseSpringConfig{
@自动连线
@Bean(name=BaseSpringConfigConstants.OBJECT\u CONVERTER\u CLIENT\u AUTH)
@范围(“单例”)
公共IObjectConverter getClientAuthConverter(){
返回新的ClientAuthConfig();
}
@自动连线
@Bean(name=BaseSpringConfigConstants.OBJECT\u CONVERTER\u CLIENT\u AUTHORIZATION)
@范围(“单例”)
公共IObjectConverter getRackspaceAuth
@SuppressWarnings("resource")
AbstractApplicationContext context1 = new AnnotationConfigApplicationContext(BaseSpringConfig.class);
@SuppressWarnings({ "unchecked", "unused" })
IObjectConverter<SystemModel, SystemModelConfigEO> c2 = (IObjectConverter<SystemModel, SystemModelConfigEO>) context1
        .getBean(BaseSpringConfigConstants.OBJECT_CONVERTER_SYSTEM_MODEL);
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.openrepose</groupId>
        <artifactId>profile-support</artifactId>
        <version>7.1.0.3-SNAPSHOT</version>
    </parent>
    <artifactId>repose-config-base</artifactId>
    <dependencies>
        <dependency>
            <groupId>org.glassfish.main.extras</groupId>
            <artifactId>glassfish-embedded-all</artifactId>
            <version>3.1.1.2</version>
            <scope>test</scope>
        </dependency>
        <!-- Spring 4 dependencies -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
        </dependency>


        <!-- logs -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>

        <dependency>
            <groupId>org.openrepose</groupId>
            <artifactId>repose-config-models</artifactId>
            <version>7.1.0.3-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.openrepose</groupId>
            <artifactId>repose-config-daos</artifactId>
            <version>7.1.0.3-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.openrepose</groupId>
            <artifactId>repose-config-catalog</artifactId>
            <version>7.1.0.3-SNAPSHOT</version>
        </dependency>
    </dependencies>
</project>
<dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>8.0</version>
 </dependency>