Manabu Yoneyama [
http://community.jboss.org/people/amadablam] created the discussion
"What does "Naming context is read-only" mean?"
To view the discussion, visit:
http://community.jboss.org/message/627906#627906
--------------------------------------------------------------
I'd like to run a simple web application with Hibernate4 on a JBoss AS7.
But I have an error below.
java.lang.UnsupportedOperationException: Naming context is read-only
I wrote hibernate.cfg.xml (snippet),
<session-factory name="">
<property
name="connection.datasource">java:jboss/datasources/MySQL</property>
<property
name="dialect">org.hibernate.dialect.MySQLDialect</property>
</sessioin-factory>
and source code:
Configuration config = new Configuration().configure();
SessionFactory sessionFactory = config.buildSessionFactory(); // It might be causes the
error.
I can connect datasouce "java:jboss/datasources/MySQL" use below code.
InitialContext context = new InitialContext();
ds = (DataSource)context.lookup("java:jboss/datasources/MySQL");
conn = ds.getConnection();
Does anyone know the reason for this?
Sorry for my english is poor.
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/627906#627906]
Start a new discussion in JNDI and Naming at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]