2014-02-11 196 views
0

我使用Kundera和Spring。 kundera版本是2.10,與其他版本我得到不同的錯誤。我嘗試在kundera.properties中聲明Client類,但它沒有任何作用。 從版本2.8甚至關閉網站的例子不起作用。錯誤kundera.client屬性缺少持久性

錯誤消息

2014-02-11 13:20:13,763 INFO org.springframework.web.context.ContextLoader.initWebApplicationContext:273 - Root WebApplicationContext: initialization started 
2014-02-11 13:20:13,956 INFO org.springframework.web.context.support.XmlWebApplicationContext.prepareRefresh:510 - Refreshing Root WebApplicationContext: startup date [Tue Feb 11 13:20:13 EET 2014]; root of context hierarchy 
2014-02-11 13:20:14,079 INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions:315 - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-service.xml] 
2014-02-11 13:20:14,174 INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions:315 - Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml] 
2014-02-11 13:20:15,475 INFO org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory:285 - Building JPA container EntityManagerFactory for persistence unit 'fastoryDatastore_pu' 
2014-02-11 13:20:15,488 INFO com.impetus.kundera.persistence.EntityManagerFactoryImpl.<init>:108 - Loading Core 
2014-02-11 13:20:15,490 INFO com.impetus.kundera.loader.CoreLoader.load:41 - Loading Kundera Core Metdata ... 
2014-02-11 13:20:15,496 INFO com.impetus.kundera.persistence.EntityManagerFactoryImpl.configurePersistenceUnit:650 - Loading Persistence Unit MetaData For Persistence Unit(s) fastoryDatastore_pu. 
2014-02-11 13:20:15,501 INFO com.impetus.kundera.configure.PersistenceUnitConfiguration.configure:108 - Loading Metadata from persistence.xml ... 
2014-02-11 13:20:15,509 ERROR com.impetus.kundera.configure.PersistenceUnitConfiguration.configure:135 - kundera.client property is missing for persistence unit:fastoryDatastore_pu 
2014-02-11 13:20:15,531 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons:444 - Destroying singletons in org.s[email protected]1c904f75: defining beans [jaxb2Marshaller,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,dataDaoImpl,startController,datastoreServiceEndpoint,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,EsperConfig,httpEndpoint,transactionManager,transactionManagerContextDatabase,entityManagerFactory,emfContext,rawConveyorNotification,rawEnergyMeterA,rawEnergyMeterB,rawEnergyMeterC,rawEquipmentChangeState,rawEquipmentChangeStateRobot,rawQualityInspection,rawTHLValue,cellProductionRate,kpiCamxStates,kpiTotalProducts,kpiPalletProductionTime,parserUtility,endpointService,dateUtils,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy 
2014-02-11 13:20:15,533 ERROR org.springframework.web.context.ContextLoader.initWebApplicationContext:319 - Context initialization failed 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: kundera.client property is missing for persistence unit:fastoryDatastore_pu 
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [tut.fi.dpe.fast.datastore.configuration.EsperConfig] for bean with name 'EsperConfig' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContextAware 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) 
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) 
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117) 
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:922) 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) 
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) 
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) 
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) 
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701) 
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204) 
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199) 
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) 
    at java.util.concurrent.FutureTask.run(Unknown Source) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
    at java.lang.Thread.run(Unknown Source) 
Caused by: java.lang.IllegalArgumentException: kundera.client property is missing for persistence unit:fastoryDatastore_pu 
    at com.impetus.kundera.configure.PersistenceUnitConfiguration.configure(PersistenceUnitConfiguration.java:136) 
    at com.impetus.kundera.persistence.EntityManagerFactoryImpl.configurePersistenceUnit(EntityManagerFactoryImpl.java:656) 
    at com.impetus.kundera.persistence.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:111) 
    at com.impetus.kundera.KunderaPersistence.createContainerEntityManagerFactory(KunderaPersistence.java:63) 
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:288) 
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479) 
    ... 20 more 

的persistence.xml部分

<persistence-unit name="fastoryDatastore_pu"> 
    <provider>com.impetus.kundera.KunderaPersistence</provider> 
    <properties> 
     <property name="kundera.nodes" value="130.230.141.228" /> 
     <property name="kundera.port" value="9160" /> 
     <property name="kundera.keyspace" value="FastoryDatastore" /> 
     <property name="kundera.dialect" value="cassandra" /> 
     <property name="kundera.client.lookup.class" 
      value="com.impetus.client.cassandra.thrift.ThriftClientFactory" /> 
     <property name="kundera.cache.provider.class" 
      value="com.impetus.kundera.cache.ehcache.EhCacheProvider" /> 
     <property name="kundera.ddl.auto.prepare" value="update" /> 
    </properties> 
</persistence-unit> 

的ApplicationContext一部分

<bean id="transactionManagerContextDatabase" class="org.springframework.orm.jpa.JpaTransactionManager"> 
    <property name="entityManagerFactory" ref="emfContext" /> 
</bean> 
<bean id="entityManagerFactory" 
    class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> 
    <property name="persistenceUnitName" value="fastoryDatastore_pu" /> 
    <property name="loadTimeWeaver"> 
     <bean 
      class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver" /> 
    </property> 
</bean> 

感謝您的幫助!

回答

0

rg.springframework.beans.factory.BeanCreationException:在ServletContext資源[/WEB-INF/applicationContext.xml]中定義的名爲'entityManagerFactory'的bean創建時出錯:init方法的調用失敗;嵌套異常是java.lang.IllegalArgumentException異常:kundera.client屬性缺少持久性單元:fastoryDatastore_pu 相關原因:org.springframework.beans.factory.CannotLoadBeanClassException:錯誤加載類[tut.fi.dpe.fast.datastore.configuration。 EsperConfig],用於在ServletContext資源中定義名稱爲'EsperConfig'的bean [/WEB-INF/applicationContext.xml]:類文件或相關類的問題;嵌套的例外是java.lang.NoClassDefFoundError:組織/ springframework的/上下文/了ApplicationContextAware

看起來像彈簧芯罐子從classpath中缺少什麼?

-Vivek