Hi there,

I had deployed HAR using JBoss MBean approach and it works properly. The problem now is when I uses WEB-IND\applicationContext.xml to point the JNDI registered, then error bounced.

Here is the applicationContext.xml snipplet:

Code:
<!-- JCA connector configuration -->
<bean id="sessionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="java:/hibernate/SessionFactory"/>
        <!--<property name="lookupOnStartup" value="false"/>
        <property name="cache" value="true"/>
        <property name="proxyInterface" value="javax.sql.DataSource"/>-->
</bean>
This is the stack trade that shows JNDI being registered and being destroyed once Spring lookup thru web container:

Code:
2006-05-04 16:54:03,109 INFO  [org.jboss.hibernate.jmx.Hibernate] SessionFactory successfully built and bound into JNDI [java:/hibernate/SessionFactory]
2006-05-04 16:54:03,109 DEBUG [org.jboss.hibernate.jmx.Hibernate] Started jboss.har:service=Hibernate
...
2006-05-04 16:54:07,234 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Eagerly caching bean with name 'sessionFactory' to allow for resolving potential circular references
2006-05-04 16:54:07,234 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Not autowiring property 'jndiEnvironment' of bean 'sessionFactory' by name: no matching bean found
2006-05-04 16:54:07,234 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Not autowiring property 'jndiTemplate' of bean 'sessionFactory' by name: no matching bean found
2006-05-04 16:54:07,234 DEBUG [org.springframework.beans.BeanWrapperImpl] About to invoke write method [public void org.springframework.jndi.JndiObjectLocator.setJndiName(java.lang.String)] on object of class [org.springframework.jndi.JndiObjectFactoryBean]
2006-05-04 16:54:07,234 DEBUG [org.springframework.beans.BeanWrapperImpl] Invoked write method [public void org.springframework.jndi.JndiObjectLocator.setJndiName(java.lang.String)] with value of type [java.lang.String]
2006-05-04 16:54:07,234 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Invoking BeanPostProcessors before initialization of bean 'sessionFactory'
2006-05-04 16:54:07,234 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Invoking afterPropertiesSet() on bean with name 'sessionFactory'
2006-05-04 16:54:07,234 DEBUG [org.springframework.jndi.JndiTemplate] Looking up JNDI object with name [java:/hibernate/SessionFactory]
2006-05-04 16:54:07,265 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] initializing class SessionFactoryObjectFactory
2006-05-04 16:54:07,265 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] JNDI lookup: hibernate/SessionFactory
2006-05-04 16:54:07,265 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] lookup: uid=8a82813c0afe9a2a010afe9a90550000
2006-05-04 16:54:07,265 WARN  [org.hibernate.impl.SessionFactoryObjectFactory] Not found: 8a82813c0afe9a2a010afe9a90550000
2006-05-04 16:54:07,265 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] {}
2006-05-04 16:54:07,265 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Retrieving dependent beans for bean 'sessionFactory'
2006-05-04 16:54:07,265 INFO  [org.springframework.beans.factory.support.DefaultListableBeanFactory] Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [sessionFactory,gov.mohr.ems.core.entity.logic.DefaultQueryMethod,gov.mohr.ems.core.entity.logic.ORMEngine]; root of BeanFactory hierarchy}
2006-05-04 16:54:07,281 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationcontext.xml]: Initialization of bean failed; nested exception is javax.naming.NamingException: JNDI object with [java:/hibernate/SessionFactory] not found: JNDI implementation returned null
javax.naming.NamingException: JNDI object with [java:/hibernate/SessionFactory] not found: JNDI implementation returned null
	at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:125)
	at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)
	at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:121)
	at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:146)
Please help, me now is near due date.