These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Can't get the SessionFactory using JNDI
PostPosted: Sun Nov 13, 2005 8:09 am 
Newbie

Joined: Sun Nov 13, 2005 7:40 am
Posts: 1
Hello,
I am using JBoss 4.0.3SP, EJB3.0 Hibernate3.1
and I am trying to create a Hibernate Archive (har). My problem is that the SessionFactory that I am trying to retrieve is not bound. I have searched the forums for a solution, but didn't find anything.

I am confused in some issues.
1) Should my mbean that I am trying to create should be called jboss-service.xml or hibernate-service.xml

2) Do I need to modify anything in the persistence.properties file located in
jboss-4.0.3SP1\server\all\deploy\ejb3.deployer\META-INF

3) Even though I have more than one hbm.xml file in the .har only the first one is being displayed in the console as found

4) When Jboss starts I always get the following error, which I don't know if iit is signifcant to my problem

13:25:40,640 INFO [HANamingService] Started ha-jndi bootstrap jnpPort=1100, backlog=50, bindAddress=/0.0.0.0
13:25:40,640 WARN [HANamingService] Failed to start AutomaticDiscovery
java.net.SocketException: error setting options
at java.net.PlainDatagramSocketImpl.join(.........

.........
13:25:42,203 WARN [TreeCache] No transaction manager lookup class has been defined. Transactions cannot be used........

I have put the ........... so I won't cluter the screen.



Your help is greatly appreciated.
Zoe Tsekas

jboss-service.xml file contents

<server>
<mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Hibernate">
<attribute name="DatasourceName">java:/MySqlDS</attribute>
<attribute name="Dialect">org.hibernate.dialect.MySQLInnoDBDialect</attribute>
<attribute name="SessionFactoryName">java:/hibernate/MesitisSessionFactory</attribute>
<attribute name="CacheProviderClass">net.sf.hibernate.cache.HashtableCacheProvider</attribute>
<attribute name="Hbm2ddlAuto">create-drop</attribute>
<attribute name="ShowSqlEnabled">true</attribute>
</server>

persistence.properties file contents

hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup
hibernate.connection.release_mode=after_statement
hibernate.transaction.flush_before_completion=false
hibernate.transaction.auto_close_session=false
hibernate.query.factory_class=org.hibernate.hql.ast.ASTQueryTranslatorFactory
hibernate.hbm2ddl.auto=create-drop
#hibernate.hbm2ddl.auto=create
hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
# Clustered cache with TreeCache
#hibernate.cache.provider_class=org.jboss.ejb3.entity.TreeCacheProviderHook
#hibernate.treecache.mbean.object_name=jboss.cache:service=EJB3EntityTreeCache
hibernate.connection.datasource=java:/DefaultDS
hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.jndi.java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
hibernate.jndi.java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 9:22 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Since you are using EJB3, why don't you use .par instead of .har?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.