小编use*_*773的帖子

JBoss Hibernate与SessionFactory和JNDI冲突

我正在JBoss AplicationServer上使用ICEFaces和Hibernate启动一个项目,现在我无法让Hibernate工作.

问题是我的DAO类无法获得SassionFacade.我认为Hibernate没有创建一个,因为与JNDI存在相同的冲突

到目前为止我做了什么:

用MySQL设置我的数据库.我使用了这个教程:https://community.jboss.org/wiki/DataSourceConfigurationInAS7
(我安装了JDBC驱动程序作为模型)不确定它是否有效,因为当服务器启动它时看起来他正在加载另一个驱动程序

18:30:26,980 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 26) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
Run Code Online (Sandbox Code Playgroud)

我几乎使用了本教程的第一面:
http://www.packtpub.com/article/developing-applications-with-jboss-and-hibernate-1
,看起来它很有用,我看到我的数据库和表,但标志会话工厂为空,并显示此警告:

2012-01-26 18:36:25,177 WARN Worker-14 org.hibernate.impl.SessionFactoryObjectFactory - Could not bind factory to JNDIjavax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getNameParser(Unknown Source)
at org.hibernate.util.NamingHelper.bind(NamingHelper.java:75)
at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:113) …
Run Code Online (Sandbox Code Playgroud)

jboss hibernate jndi sessionfactory

2
推荐指数
1
解决办法
2万
查看次数

标签 统计

hibernate ×1

jboss ×1

jndi ×1

sessionfactory ×1