English 中文(简体)
休眠/JBoss - “服务jboss-as有循环依赖性”
原标题:Hibernate / JBoss - "Service jboss-as has a circular dependency" on new Configuration()

当试图启动休眠会话时, 代码中启动新休眠配置的部分会断开“ service jboss-as 有循环依赖性”例外 。

从控制台应用程序调用相同代码的工作正确 。

尝试了与JBoss 7.1一起包装的4.1.3和4.0.1的休眠状态,但误差相同。

如果有谁能把我推向正确的方向 我会很感激的

Configuration configuration = new Configuration();

JBoss 输出 :

...
11:30:00,482 INFO  [org.jboss.as] (MSC service thread 1-4) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 3324ms - Started 173 of 250 services (76 services are passive or on-demand)
11:30:00,571 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "JBCXFRS.war"
11:30:10,903 INFO  [org.jboss.resteasy.spi.ResteasyDeployment] (http-localhost-127.0.0.1-8080-2) Deploying javax.ws.rs.core.Application: class hr.spi.rs.MyApplication
11:30:24,081 INFO  [org.hibernate.annotations.common.Version] (http-localhost-127.0.0.1-8080-3) HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
11:30:24,144 INFO  [org.hibernate.Version] (http-localhost-127.0.0.1-8080-3) HHH000412: Hibernate Core {4.1.3.Final}
11:30:24,213 INFO  [org.hibernate.cfg.Environment] (http-localhost-127.0.0.1-8080-3) HHH000206: hibernate.properties not found
11:30:24,233 INFO  [org.hibernate.cfg.Environment] (http-localhost-127.0.0.1-8080-3) HHH000021: Bytecode provider name : javassist
11:30:24,432 INFO  [org.hibernate.cfg.Configuration] (http-localhost-127.0.0.1-8080-3) HHH000043: Configuring from resource: /hibernate.cfg.xml
11:30:24,437 INFO  [org.hibernate.cfg.Configuration] (http-localhost-127.0.0.1-8080-3) HHH000040: Configuration resource: /hibernate.cfg.xml
11:30:24,825 INFO  [org.hibernate.cfg.Configuration] (http-localhost-127.0.0.1-8080-3) HHH000041: Configured SessionFactory: 
11:30:25,466 INFO  [org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl] (http-localhost-127.0.0.1-8080-3) HHH000402: Using Hibernate built-in connection pool (not for production use!)
11:30:25,473 INFO  [org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl] (http-localhost-127.0.0.1-8080-3) HHH000115: Hibernate connection pool size: 1
11:30:25,479 INFO  [org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl] (http-localhost-127.0.0.1-8080-3) HHH000006: Autocommit mode: false
11:30:25,488 INFO  [org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl] (http-localhost-127.0.0.1-8080-3) HHH000401: using driver [com.microsoft.sqlserver.jdbc.SQLServerDriver] at URL [jdbc:sqlserver://MyDbServer;databaseName=MyDatabase]
11:30:25,496 INFO  [org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl] (http-localhost-127.0.0.1-8080-3) HHH000046: Connection properties: {user=sa, password=****}
11:30:38,571 INFO  [org.hibernate.dialect.Dialect] (http-localhost-127.0.0.1-8080-3) HHH000400: Using dialect: org.hibernate.dialect.SQLServerDialect
11:30:38,837 INFO  [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (http-localhost-127.0.0.1-8080-3) HHH000399: Using default transaction strategy (direct JDBC transactions)
11:30:38,897 INFO  [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (http-localhost-127.0.0.1-8080-3) HHH000397: Using ASTQueryTranslatorFactory
11:30:39,868 INFO  [org.hibernate.validator.util.Version] (http-localhost-127.0.0.1-8080-3) Hibernate Validator 4.2.0.Final
11:30:40,289 INFO  [org.jboss.as.controller] (MSC service thread 1-2) JBAS014774: Service status report
JBAS014775:    New missing/unsatisfied dependencies:
      service jboss.naming (missing) dependents: [service jboss.data-source.java:jboss/datasources/ExampleDS, service jbosgi.xservice."javax.naming.InitialContext", service jbosgi.xservice."javax.naming.spi.InitialContextFactoryBuilder", service jboss.deployment.unit."JBCXFRS.war".CLEANUP] 
      service jboss.naming.context.java (missing) dependents: [service jboss.naming.context.java.TransactionManager] 

11:30:40,303 ERROR [stderr] (http-localhost-127.0.0.1-8080-3) Initial SessionFactory creation failed.org.jboss.msc.service.CircularDependencyException: Service jboss-as has a circular dependency
最佳回答

删除冬眠. cfg. xml 的会话- 物理部分的名称参数后, 一切开始运转, 没有“ 循环依赖性” 错误 。

我不知道为什么它有 任何问题运行这个, 或如何有人应该 推断出, 从隐秘的JBOS例外。

把它当作答案 希望它能拯救一个人 一天拉头发。

<hibernate-configuration>
    <session-factory name="">
        ...

更改为 :

<hibernate-configuration>
    <session-factory>
        ...
问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签