@persistenceContext를 사용할 때 JBoss 7 Throwing 엔티티가 매핑되지 않습니다.

StackOverflow https://stackoverflow.com/questions/9481122

문제

에서 을 실행하지만 JBoss에서 실패하는 응용 프로그램에서 엔티티가 매핑되지 않음 " 예외가 아닙니다.JBoss가 내 지속성 컨텍스트를 관리하기를 원하지 않으므로 LocalContainEntityManagerFactoryBean을 구성하기 위해 클래스 패스 스캔을 사용하고 있습니다.JBoss Standalone.xml에서 JPA 모듈을 비활성화 하고이 내용을 사용하여 JBoss-Deployment-Structure.xml을 추가했습니다.

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
    <deployment>
        <exclusions>
            <module name="org.hibernate"/>
        </exclusions>
    </deployment>
</jboss-deployment-structure>
.

여전히 작동하지 않습니다.이 예외의 원인은 무엇입니까?JBoss는 여전히 지속성 컨텍스트를 관리하려고합니까?

p.s : 기본적으로 나는 이상한 PU 정의를 얻습니다 (PU 루트 URL은 내 전쟁이 아닙니다!)

(MSC service thread 1-3) insurance-module 17:51:41.456 [MSC service thread 1-3] DEBUG org.hibernate.ejb.Ejb3Configuration - Processing PersistenceUnitInfo [
17:51:41,456 INFO  [stdout] (MSC service thread 1-3)    name: default
17:51:41,456 INFO  [stdout] (MSC service thread 1-3)    persistence provider classname: null
17:51:41,456 INFO  [stdout] (MSC service thread 1-3)    classloader: ModuleClassLoader for Module "deployment.insurance-module-0.1-SNAPSHOT.war:main" from Service Module Loader
17:51:41,457 INFO  [stdout] (MSC service thread 1-3)    Temporary classloader: org.springframework.instrument.classloading.SimpleThrowawayClassLoader@13acaabd
17:51:41,457 INFO  [stdout] (MSC service thread 1-3)    excludeUnlistedClasses: true
17:51:41,457 INFO  [stdout] (MSC service thread 1-3)    JTA datasource: null
17:51:41,457 INFO  [stdout] (MSC service thread 1-3)    Non JTA datasource: com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> z8kfsx8l1ikdpo61c3bmxu|6b5638a, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> z8kfsx8l1ikdpo61c3bmxu|6b5638a, idleConnectionTestPeriod -> 60, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/insurance, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 60, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 5, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 1, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> select 1, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]
17:51:41,457 INFO  [stdout] (MSC service thread 1-3)    Transaction type: RESOURCE_LOCAL
17:51:41,457 INFO  [stdout] (MSC service thread 1-3)    PU root URL: file:/home/mircea/jboss-as-7.0.2.Final/modules/sun/jdk/main/service-loader-resources/
17:51:41,457 INFO  [stdout] (MSC service thread 1-3)    Shared Cache Mode: UNSPECIFIED
17:51:41,457 INFO  [stdout] (MSC service thread 1-3)    Validation Mode: AUTO
17:51:41,457 INFO  [stdout] (MSC service thread 1-3)    Jar files URLs []
17:51:41,457 INFO  [stdout] (MSC service thread 1-3)    Managed classes names []
17:51:41,457 INFO  [stdout] (MSC service thread 1-3)    Mapping files names []
17:51:41,457 INFO  [stdout] (MSC service thread 1-3)    Properties []
17:51:41,459 INFO  [stdout] (MSC service thread 1-3) insurance-module 17:51:41.459 [MSC service thread 1-3] DEBUG org.hibernate.ejb.Ejb3Configuration - Detect class: true; detect hbm: true
17:51:41,462 INFO  [stdout] (MSC service thread 1-3) insurance-module 17:51:41.462 [MSC service thread 1-3] DEBUG o.h.ejb.packaging.AbstractJarVisitor - Searching mapped entities in jar/par: file:/home/mircea/jboss-as-7.0.2.Final/modules/sun/jdk/main/service-loader-resources/
.

도움이 되었습니까?

해결책

PackageStoccan이 올바른 패키지를 가리키지 않으면 Tomcat 7에서 잘 작동하지만 JBoss에 배포 할 때는 질문에 설명 된대로 실패합니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top