1

Bean Spring のように Mule に含まれる Service を使用して POC をテストします。Hibernate と Jpa の依存関係に問題があります。Hibernate と JPA のどのバージョンが Mule 3.4 CE でサポート/使用されているか。

フローを実行したくない場合、多くの例外があります: hibernate 3.6.0.Final:

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)

4.0.1 および uppe の場合:

  java.lang.NoSuchMethodError: org.hibernate.cfg.Environment.verifyProperties(Ljava/util/Map;)V
    at org.hibernate.service.ServiceRegistryBuilder.buildServiceRegistry(ServiceRegistryBuilder.java:244)
    at org.hibernate.ejb.Ejb3Configuration.buildLifecycleControledServiceRegistry(Ejb3Configuration.java:930)
    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:903)
    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889)
    at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
    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)

私の依存ツリー:

[INFO] +- org.mule:mule-core:jar:3.4.0:provided
[INFO] |  +- commons-beanutils:commons-beanutils:jar:1.8.0:provided
[INFO] |  +- org.safehaus.jug:jug:jar:asl:2.0.0:provided
[INFO] |  +- commons-cli:commons-cli:jar:1.2:provided
[INFO] |  +- commons-collections:commons-collections:jar:3.2.1:provided
[INFO] |  +- commons-io:commons-io:jar:1.4:provided
[INFO] |  +- commons-lang:commons-lang:jar:2.4:provided
[INFO] |  +- commons-pool:commons-pool:jar:1.5.3:provided
[INFO] |  +- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:provided
[INFO] |  +- javax.annotation:jsr250-api:jar:1.0:provided
[INFO] |  +- org.slf4j:jcl-over-slf4j:jar:1.6.1:provided
[INFO] |  +- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO] |  +- org.slf4j:slf4j-log4j12:jar:1.6.1:compile
[INFO] |  +- log4j:log4j:jar:1.2.16:compile
[INFO] |  +- asm:asm:jar:3.1:provided
[INFO] |  +- asm:asm-commons:jar:3.1:provided
[INFO] |  |  \- asm:asm-tree:jar:3.1:provided
[INFO] |  +- org.mvel:mvel2:jar:2.1.3.Final:provided
[INFO] |  +- org.jgrapht:jgrapht-jdk1.5:jar:0.7.3:provided
[INFO] |  \- org.mule.common:mule-common:jar:0.11.0:provided
[INFO] +- org.mule.modules:mule-module-spring-config:jar:3.4.0:provided
[INFO] |  +- org.mule.modules:mule-module-annotations:jar:3.4.0:provided
[INFO] |  |  \- cglib:cglib-nodep:jar:2.2:provided
[INFO] |  +- org.springframework:spring-context:jar:3.2.1.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-aop:jar:3.2.1.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-expression:jar:3.2.1.RELEASE:compile
[INFO] |  +- dom4j:dom4j:jar:1.6.1-osgi:provided
[INFO] |  \- jaxen:jaxen:jar:1.1.1:provided
[INFO] |     \- jdom:jdom:jar:1.0:provided
[INFO] +- org.mule.transports:mule-transport-file:jar:3.4.0:provided
[INFO] +- org.mule.modules:mule-module-xml:jar:3.4.0:provided
[INFO] |  +- org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:provided
[INFO] |  +- commons-jxpath:commons-jxpath:jar:1.3-osgi:provided
[INFO] |  +- com.thoughtworks.xstream:xstream:jar:1.4.2:provided
[INFO] |  |  \- xmlpull:xmlpull:jar:1.1.3.1:provided
[INFO] |  +- joda-time:joda-time:jar:1.6:provided
[INFO] |  +- xpp3:xpp3_min:jar:1.1.3.4.O-osgi:provided
[INFO] |  +- org.codehaus.woodstox:woodstox-core-asl:jar:4.0.8:provided
[INFO] |  |  \- org.codehaus.woodstox:stax2-api:jar:3.0.2:provided
[INFO] |  +- net.java.dev.stax-utils:stax-utils:jar:20080702-osgi:provided
[INFO] |  +- net.sf.saxon:saxon:jar:8.9.0.4-osgi:provided
[INFO] |  +- net.sf.saxon:saxon-dom:jar:8.9.0.4-osgi:provided
[INFO] |  +- net.sf.saxon:saxon-xqj:jar:8.9.0.4:provided
[INFO] |  +- javax.xml.bind:jaxb-api:jar:2.1:provided
[INFO] |  \- com.sun.xml.bind:jaxb-impl:jar:2.1.5:provided
[INFO] +- org.mule.tests:mule-tests-functional:jar:3.4.0:test
[INFO] |  +- org.springframework:spring-beans:jar:3.2.1.RELEASE:compile
[INFO] |  +- commons-net:commons-net:jar:2.0:test
[INFO] |  +- org.apache.ftpserver:ftpserver-core:jar:1.0.2:test
[INFO] |  |  \- org.apache.mina:mina-core:jar:2.0.0-M6:test
[INFO] |  +- org.apache.ftpserver:ftplet-api:jar:1.0.2:test
[INFO] |  +- org.apache.sshd:sshd-core:jar:0.6.0:test
[INFO] |  +- bouncycastle:bcprov-jdk14:jar:139:test
[INFO] |  +- org.mule:mule-core:test-jar:tests:3.4.0:test
[INFO] |  |  +- javax.activation:activation:jar:1.1-osgi:provided
[INFO] |  |  \- org.apache.geronimo.specs:geronimo-j2ee-connector_1.5_spec:jar:1.1-osgi:test
[INFO] |  \- org.mockito:mockito-all:jar:1.9.0:test
[INFO] +- mockobjects:mockobjects-core:jar:0.09:test
[INFO] +- junit:junit:jar:4.9:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.1:test
[INFO] +- mysql:mysql-connector-java:jar:5.1.10:compile
[INFO] +- org.mule.transports:mule-transport-email:jar:3.4.0:provided
[INFO] |  \- javax.mail:mail:jar:1.4.3:provided
[INFO] +- org.mule.transports:mule-transport-jdbc:jar:3.4.0:provided
[INFO] |  +- commons-dbutils:commons-dbutils:jar:1.2:provided
[INFO] |  \- com.experlog:xapool:jar:1.5.0-osgi:provided
[INFO] +- org.springframework:spring-orm:jar:3.2.1.RELEASE:compile
[INFO] |  +- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  \- org.springframework:spring-core:jar:3.2.1.RELEASE:compile
[INFO] |     \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:4.0.1.Final:test
[INFO] |  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.0.Final:test
[INFO] |  +- org.hibernate:hibernate-core:jar:4.0.1.Final:test
[INFO] |  |  \- antlr:antlr:jar:2.7.7:test
[INFO] |  +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:test
[INFO] |  +- org.jboss.logging:jboss-logging:jar:3.1.0.CR2:test
[INFO] |  +- org.javassist:javassist:jar:3.15.0-GA:test
[INFO] |  \- org.hibernate.common:hibernate-commons-annotations:jar:4.0.1.Final:test
[INFO] \- fr.myapp:jar:0.0.1-SNAPSHOT:compile
[INFO]    +- org.springframework:spring-jdbc:jar:3.2.4.RELEASE:compile
[INFO]    |  \- org.springframework:spring-tx:jar:3.2.4.RELEASE:compile
[INFO]    \- org.springframework.data:spring-data-jpa:jar:1.4.2.RELEASE:compile
[INFO]       +- org.springframework.data:spring-data-commons:jar:1.6.2.RELEASE:compile
[INFO]       \- org.aspectj:aspectjrt:jar:1.7.2:compile

muleESB を使用せずにテスト コンテキストで実行される私の Spring サービスは問題ありません。

4

3 に答える 3

0

/opt/mule での hibernate-core-3.6.0.Final.jar の抑制は、muleEsb の実行に役立ちます。

于 2013-11-14T09:32:05.813 に答える
0

mmeyer が指摘したように、これは Class Loader の問題です。これは、Mule 3.2 で修正できます。Mule には、きめ細かなクラス読み込みオプションが用意されています。上記の問題を解決するには、src/main/app/mule-deploy.properties で次のプロパティを提供します。これにより、アプリケーション クラス ローダーを使用して org.hibernate.engine.CascadeStyle と org.hibernate.engine.EJB3CascadeStyle の両方がロードされます。

修正: src/main/app/mule-deploy.properties に以下を追加します

loader.override=org.hibernate

注: Mule Studio では引き続きこの問題が発生するため、Hibernate エンティティ マネージャ jar を \MuleStudio\plugins\org.mule.tooling.server.3.4.1.ee_3.4.1.201312062152\mule\opt に追加する必要があります。

Mule CE スタンドアロンを使用した私の観察:

シナリオ 1: (展開の失敗)

My Mule App /lib - hibernate-entitymanager-3.6.0.Final があります。- hibernate-core-3.6.0.Final.jar を含む他のすべての hibernate jar を除外しました

MuleCE3.4.0/lib/opt - hibernate-core-3.6.0.Final.jar およびその他の休止状態の jar があります

アプリのデプロイ時のエラー: 原因: org.mule.api.config.ConfigurationException: クラス パス リソース [persistenceContext.xml] で定義された名前 'entityManagerFactory' の Bean の作成中にエラーが発生しました: init メソッドの呼び出しに失敗しました。ネストされた例外は java.lang.IllegalAccessError: クラス org.hibernate.engine.EJB3CascadeStyle$1 (org.mule.api.lifecycle.InitialisationException) からメソッド org.hibernate.engine.CascadeStyle.()V にアクセスしようとしました

シナリオ 2 (展開の成功)

My Mule App /lib - hibernate-entitymanager-3.6.0.Final があります。- hibernate-core-3.6.0.Final.jar を含む他のすべての hibernate jar を除外しました

MuleCE3.4.0/lib/opt - hibernate-core-3.6.0.Final.jar と他の hibernate jar があります - [シナリオ 1 とは異なります] hibernate-entitymanager-3.6.0.Final を MuleCE/lib/opt にコピーします

于 2014-01-30T20:55:59.007 に答える