我想安裝Mule來使用Mule JPA模塊(http://mulesoft.github.io/mule-module-jpa/mule/jpa.html),但我遇到依賴問題。如何設置Mule JPA模塊以使用Hibernate JPA實現?
我已經通過Mule Studio添加了JPA模塊,它爲我設置了maven依賴關係。我還將hibernate-entitymanager依賴添加到我的pom中以提供JPA實現。我已經添加了與Mule運行時中包含的hibernate-core版本相同的3.6.0版本。然而,當我嘗試啓動騾子應用程序,我得到以下堆棧跟蹤:
INFO 2013-08-30 09:33:20,428 [main] org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean: Building JPA container EntityManagerFactory for persistence unit 'org.jembi.openhim.jpa'
INFO 2013-08-30 09:33:20,525 [main] org.hibernate.annotations.common.Version: Hibernate Commons Annotations 3.2.0.Final
INFO 2013-08-30 09:33:20,530 [main] org.hibernate.cfg.Environment: Hibernate 3.6.0.Final
INFO 2013-08-30 09:33:20,531 [main] org.hibernate.cfg.Environment: hibernate.properties not found
INFO 2013-08-30 09:33:20,533 [main] org.hibernate.cfg.Environment: Bytecode provider name : javassist
INFO 2013-08-30 09:33:20,536 [main] org.hibernate.cfg.Environment: using JDK 1.4 java.sql.Timestamp handling
INFO 2013-08-30 09:33:20,594 [main] org.hibernate.ejb.Version: Hibernate EntityManager 3.6.0.Final
ERROR 2013-08-30 09:33:20,609 [main] org.mule.module.launcher.application.DefaultMuleApplication: null
java.lang.IllegalAccessError: tried to access method org.hibernate.engine.CascadeStyle.<init>()V from class org.hibernate.engine.EJB3CascadeStyle$1
at org.hibernate.engine.EJB3CascadeStyle$1.<init>(EJB3CascadeStyle.java:44)
at org.hibernate.engine.EJB3CascadeStyle.<clinit>(EJB3CascadeStyle.java:39)
at org.hibernate.ejb.event.EJB3PersistEventListener.<clinit>(EJB3PersistEventListener.java:39)
at org.hibernate.ejb.EventListenerConfigurator.<init>(EventListenerConfigurator.java:101)
at org.hibernate.ejb.Ejb3Configuration.<init>(Ejb3Configuration.java:159)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)
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:1545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1483)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
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.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:89)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:109)
at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:119)
at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:73)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at org.mule.config.builders.AutoConfigurationBuilder.autoConfigure(AutoConfigurationBuilder.java:101)
at org.mule.config.builders.AutoConfigurationBuilder.doConfigure(AutoConfigurationBuilder.java:57)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:84)
at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:207)
at org.mule.module.launcher.application.ApplicationWrapper.init(ApplicationWrapper.java:64)
at org.mule.module.launcher.DefaultMuleDeployer.deploy(DefaultMuleDeployer.java:47)
at org.mule.tooling.server.application.ApplicationDeployer.run(ApplicationDeployer.java:58)
at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:91)
它似乎有一個版本不匹配或東西,是造成這一點,但我想不出爲什麼。我使用與hibernate核心相同的實體管理器版本。任何想法我可以嘗試?