tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <david.blev...@visi.com>
Subject Re: javax.naming.OperationNotSupportedException with Hibernate 3 and Openejb 3.0
Date Mon, 16 Jun 2008 20:59:00 GMT
Hmm, it seems that Hibernate is trying to bind something into JNDI  
which isn't allowed.  JNDI is read-only in Java EE land.  I looked  
through the code to see if there were any hints and it seems like the  
binding of things into JNDI is optional and can be shut off.

Looks as though if you delete this line of your hibernate config:
   <session-factory name="shoppingmodule/hibernate/HibernateFactory">

that it will not try and bind the name into JNDI.  It's clearly  
caching the SessionFactory in a couple different static hashmaps so  
I'm guessing the JNDI thing isn't used internally.

Let us know if that works.

-David


On Jun 13, 2008, at 12:02 AM, ManojS wrote:

>
> Hello,
> Does anyone had the following problem while working with openejb and
> hibernate ?
>
> When I run my hibernate application in openejb (openejb 3.0 war  
> deployed in
> tomcat 5.5, java 1.5, hibernate 3) it is showing an error while  
> loading the
> hibernate configuration with following lines of code.
>
>
>
>> new Configuration().setInterceptor( new MyHibernateInterceptor()
>> ).configure( "shoppingmodule- 
>> hibernate.cfg.xml" ).buildSessionFactory();
>>
>
> The error log is as follows:
>
>
>
>> INFO - Factory name: shoppingmodule/hibernate/HibernateFactory
>> INFO - JNDI InitialContext properties:{}
>> INFO - Creating subcontext: shoppingmodule
>> INFO - Creating subcontext: hibernate
>> WARN - Could not bind factory to JNDI
>> javax.naming.OperationNotSupportedException
>> 	at
>> org 
>> .apache.openejb.core.ivm.naming.IvmContext.rebind(IvmContext.java: 
>> 283)
>> 	at
>> org 
>> .apache.openejb.core.ivm.naming.IvmContext.rebind(IvmContext.java: 
>> 287)
>> 	at org.hibernate.util.NamingHelper.bind(NamingHelper.java:74)
>> 	at
>> org 
>> .hibernate 
>> .impl 
>> .SessionFactoryObjectFactory 
>> .addInstance(SessionFactoryObjectFactory.java:90)
>> 	at
>> org 
>> .hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java: 
>> 290)
>> 	at
>> org 
>> .hibernate.cfg.Configuration.buildSessionFactory(Configuration.java: 
>> 1154)
>>
>
> My "shoppingmodule-hibernate.cfg.xml" file looklike as follows:
>
>
>
>> <?xml version="1.0" encoding="utf-8"?>
>> <!DOCTYPE hibernate-configuration PUBLIC
>> "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
>> "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
>> <hibernate-configuration>
>>  <session-factory name="shoppingmodule/hibernate/HibernateFactory">
>>  <property name="show_sql">true</property>
>>  <property name="connection.datasource">java:comp/env/MySqlDS</ 
>> property>
>>  <property
>> name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
>>  <property
>> name 
>> = 
>> "transaction 
>> .factory_class">org.hibernate.transaction.CMTTransactionFactory</ 
>> property>
>>  <property
>> name 
>> = 
>> "transaction 
>> .manager_lookup_class 
>> ">org.apache.openejb.hibernate.TransactionManagerLookup</property>
>>  <property name="connection.release_mode">auto</property>
>>  <property name="transaction.flush_before_completion">true</property>
>>  <property name="transaction.auto_close_session">true</property>
>>        <mapping resource="..." />
>>        ... All my resource mappigs are coming here ...]
>>  </session-factory>
>> </hibernate-configuration>
>>
>
> Thanks in advance for any help/solutions.
> -Manoj.
>
> -- 
> View this message in context: http://www.nabble.com/javax.naming.OperationNotSupportedException-with-Hibernate-3-and-Openejb-3.0-tp17816372p17816372.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>


Mime
View raw message