0 Replies Latest reply on Nov 2, 2011 4:50 AM by selvam as

    WARN SessionFactoryObjectFactory:98 - Could not bind factory to JNDI

    selvam as Newbie

      Hi


      i created one sample application while  start the tomcat server  it shows warn message every time ..  can anybody help me please


      My  Server Log file:


      56,609  WARN SessionFactoryObjectFactory:98 - Could not bind factory to JNDI
      naming.NamingException: Context is read only
        at org.apache.naming.NamingContext.checkWritable(NamingContext.java:903)
        at org.apache.naming.NamingContext.bind(NamingContext.java:831)
        at org.apache.naming.NamingContext.rebind(NamingContext.java:208)
        at org.hibernate.util.NamingHelper.bind(NamingHelper.java:74)
        at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90)
        at org.hibernate.impl.SessionFactoryImpl (SessionFactoryImpl.java:306)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
        at org.jboss.seam.persistence.HibernateSessionFactory.createSessionFactory(HibernateSessionFactory.java:165)
        at org.jboss.seam.persistence.HibernateSessionFactory.startup(HibernateSessionFactory.java:79)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
        at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
        at org.jboss.seam.Component.callComponentMethod(Component.java:2211)
        at org.jboss.seam.Component.callCreateMethod(Component.java:2134)
        at org.jboss.seam.Component.newInstance(Component.java:2094)
        at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
        at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
        at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:112)
        at org.jboss.seam.init.Initialization.init(Initialization.java:735)
        at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:35)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)



      My Hibernate.cfg.xml


      *
      <hibernate-configuration>
          <session-factory name="java:/mtcSession">
              <property name="show_sql">true</property>
              <property name="connection.datasource">java:comp/env/jdbc/mtcDatasource</property>
              <property name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
              <property name="transaction.flush_before_completion">true</property>
                <property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
                <property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
      </session-factory>
      </hibernate-configuration>*



      My components.xml

      <components xmlns="http://jboss.com/products/seam/components"
                  xmlns:core="http://jboss.com/products/seam/core"
                  xmlns:persistence="http://jboss.com/products/seam/persistence"
                  xmlns:security="http://jboss.com/products/seam/security"
                  xmlns:transaction="http://jboss.com/products/seam/transaction"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      xmlns:web="http://jboss.com/products/seam/web"
                  xsi:schemaLocation=
                      "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
                       http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
                       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                       http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.1.xsd
                           http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">

          <core:manager conversation-timeout="120000"
                        concurrent-request-timeout="500"
                        conversation-id-parameter="cid"/>
                       
          <persistence:hibernate-session-factory name="hibernateSessionFactory"/>
          <core:init transaction-management-enabled="true"/>
         
          <persistence:managed-hibernate-session name="mtcSession"
                                                      session-factory="#{hibernateSessionFactory}"
                                          auto-create="true"/>
         
          <security:identity authenticate-method="#{authenticator.authenticate}"/>
         
          <transaction:hibernate-transaction session="#{mtcSession}"/>

          <web:context-filter url-pattern="/*" />
         
      </components>


      .. Thanks in advance


      Selvam.