Now i m doing work with hiberate !
But when i tun a test case then exception occur hibernate factory not bound .
Exception message :
Caused by: java.lang.RuntimeException: javax.naming.NameNotFoundException: HibernateFactory not bound
at com_daffodil_blossoms.modules.ServiceLocator.lookUpPersistenceManagerFactory(ServiceLocator.java:60)
at com_daffodil_blossoms.modules.ServiceLocator.getPersistenceManagerFactory(ServiceLocator.java:79)
... 93 more
Caused by: javax.naming.NameNotFoundException: HibernateFactory not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com_daffodil_blossoms.modules.ServiceLocator.lookUpPersistenceManagerFactory(ServiceLocator.java:57)
... 94 more
My hibernate service.xml file is shown as :
<server>
<mbean code="org.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateFactory,name=HibernateFactory">
<depends>jboss.jca:service=RARDeployer</depends>
<!-- Make it deploy ONLY after D.hbm.xml,
mappings/SubAccount.hbm.xml,
mappings/Password.hbm.xml</attribute>-->
<attribute name="JndiName">jdbc/sqlserver</attribute>
<attribute name="Datasource">java:/jdbc/sqlserver</attribute>
<attribute name="Dialect">org.hibernate.dialect.SQLServerDialect</attribute>
<attribute name="TransactionStrategy">org.hibernate.transaction.JTATransactionFactory</attribute>
<attribute name="TransactionManagerLookupStrategy">org.hibernate.transaction.JBossTransactionManagerLookup</attribute>
<attribute name="UseOuterJoin">false</attribute>
<attribute name="ShowSql">false</attribute>
</mbean>
</server>
Im using jboss 4.0.4rc1
Pls solve this problem & give sufficient solution .
|