aspose file tools*
The moose likes Object Relational Mapping and the fly likes Context is read only exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Context is read only exception" Watch "Context is read only exception" New topic
Author

Context is read only exception

Justin Howard
Ranch Hand

Joined: Feb 19, 2009
Posts: 162
Hi All,

I am using Hibernate. It works fine, but I have this exception in my logs. What should I look for ?

Thanks
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Tomcat's JNDI implementation is read only I believe. The error you are seeing is the SessionFactory trying to remove itself from JNDI, so its not that serious, all you are getting is an ungraceful shutdown. How do you configure your SessionFactory to bind it in JNDI in the first place?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Justin Howard
Ranch Hand

Joined: Feb 19, 2009
Posts: 162
Thanks for the reply.



This is in my hibernate.cfg.xml


Thanks
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

None of that will bind the SessionFactory in JNDI - do you have a hibernate.properties file kicking around in your deployment too? Its the hibernate.session_factory_name property that tells Hibernate to bind the SessionFactory in JNDI itself, if you are not using that I'm assuming you are trying to bind it manually?
Justin Howard
Ranch Hand

Joined: Feb 19, 2009
Posts: 162
Thanks for the reply.

No I dont have any hibernate.properties file. Just the cfg.xml file.
When does the binding actually take place.

Thanks
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

The binding takes place (if Hibernate is doing it) when you create your SessionFactory. If you don't specify hibernate.session_factory_name Hibernate does not try to bind anything. Have you ever set it? Could you have an older version of your configuration deployed somehow?

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Context is read only exception
 
Similar Threads
Struts JSP exception
Getting an exception in Hibernate, was fine till yesterday
how to analyse log file in tomcat
problem with getOutputStream() has already been called for this response
org.springframework.beans.factory.NoSuchBeanDefinitionException No bean named