3 Replies Latest reply on Feb 23, 2010 4:35 AM by jaikiran pai

    ERROR org.hibernate.impl.SessionFactoryObjectFactory  - Invalid JNDI name

    Siva Prasad Newbie

      I am getting this error in Jboss server When i enter username and password and clicks Login button.Application loading properly,but in jboss server i am gettin this error.What could be the reason?Any one knows Share with me.....Thank you.....

       

       

      11:38:01,109 INFO  [STDOUT] 2010 Feb 23 11:38:01 [http-127.0.0.1-8080-1] ERROR org.hibernate.impl.SessionFactoryObjectFactory  - Invalid JNDI name

      javax.naming.InvalidNameException: An empty name cannot be passed to rebind

              at org.jnp.server.NamingServer.rebind(NamingServer.java:237)

              at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:562)

              at javax.naming.InitialContext.rebind(InitialContext.java:412)

              at org.hibernate.util.NamingHelper.bind(NamingHelper.java:97)

              at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:113)

              at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:348)

              at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)

              at com.compudyne.dao.util.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:65)

              at com.compudyne.dao.services.BaseHibernateDAO.getSession(BaseHibernateDAO.java:22)

              at com.celcom.dao.service.LoginDao.findByExample(LoginDao.java:68)

              at com.celcom.app.bean.LoginBean.systemGatewayLogin(LoginBean.java:69)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

              at java.lang.reflect.Method.invoke(Method.java:597)

              at org.apache.el.parser.AstValue.invoke(AstValue.java:170)

              at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)

              at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)

              at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)

              at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

              at javax.faces.component.UICommand.broadcast(UICommand.java:387)

              at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)

              at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:324)

              at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:299)

              at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:256)

              at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:469)

              at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)

              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)

              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)

              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)

              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)

              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)

              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)

              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

              at java.lang.Thread.run(Thread.java:619)

        • 1. Re: ERROR org.hibernate.impl.SessionFactoryObjectFactory  - Invalid JNDI name
          jaikiran pai Master
          11:38:01,109 INFO  [STDOUT] 2010 Feb 23 11:38:01
          [http-127.0.0.1-8080-1] ERROR
          org.hibernate.impl.SessionFactoryObjectFactory  - Invalid JNDI name
          javax.naming.InvalidNameException: An empty name cannot be passed to rebind
                  at org.jnp.server.NamingServer.rebind(NamingServer.java:237)
                  at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:562)
                  at javax.naming.InitialContext.rebind(InitialContext.java:412)
                  at org.hibernate.util.NamingHelper.bind(NamingHelper.java:97)
                  at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:113)
                  at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:348)
                  at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
                  at com.compudyne.dao.util.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:65)
          

           

          Looks like an empty string is being passed as the jndi name for binding to JNDI. What does your hibernate.cfg.xml look like (specifically the jndi name for the session factory).

          • 2. Re: ERROR org.hibernate.impl.SessionFactoryObjectFactory  - Invalid JNDI name
            Siva Prasad Newbie

            Thanks for your kind reply jaikiran pai....Below is my hibernate file.........

             

            My Hibernate.cfg.xml file,

             

            <?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="">

             

                 <!-- HIBERNATE properties setting [ START ]-->

             

            <property name="hibernate.c3p0.max_size">1000</property>

            <property name="hibernate.c3p0.max_statements">0</property>

            <property name="hibernate.c3p0.min_size">5</property>

            <!-- <property name="hibernate.c3p0.timeout">30</property> -->

            <property name="hibernate.cache.use_minimal_puts">true</property>

            <!-- <property name="hibernate.cache.use_query_cache">true</property> -->

            <!-- <property name="hibernate.cglib.use_reflection_optimizer">true</property> -->

            <property name="hibernate.connection.autocommit">false</property>

            <!-- <property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property> -->

            <property name="hibernate.max_fetch_depth">3</property>

            <property name="hibernate.show_sql">true</property>

                 

                  <!-- Enable Hibernate's automatic session context management -->

                    <property name="current_session_context_class">thread</property>

             

                    <!-- Disable the second-level cache  -->

                    <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

            <!-- HIBERNATE properties setting [ END ]-->

             

            <!-- HIBERNATE database connection setting [ START ] -->

              <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>

              <property name="hibernate.connection.password">pps</property>

              <property name="hibernate.connection.url">jdbc:oracle:thin:@10.1.68.216:1511:cdb</property>

              <property name="hibernate.connection.username">data_pps</property>

              <property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>

            <property name="hibernate.default_schema">data_pps</property>

            <!-- HIBERNATE database connection setting [ END ]-->

             

            <!-- HIBERNATE database MAPPING setting [ START ]-->

             

              <mapping resource="com/compudyne/dao/celcom/pojo/Login.hbm.xml" />

            <mapping resource="com/compudyne/dao/celcom/pojo/LoginActivity.hbm.xml" />

            <mapping resource="com/compudyne/dao/celcom/pojo/Menu.hbm.xml" />

             

            <mapping resource="com/compudyne/dao/celcom/pojo/MenuRoleAccess.hbm.xml" />

            <mapping resource="com/compudyne/dao/celcom/pojo/UserAccessMerchant.hbm.xml" />

            <mapping resource="com/compudyne/dao/celcom/pojo/Merchant.hbm.xml" />

            <mapping resource="com/compudyne/dao/celcom/pojo/UserRole.hbm.xml" />

            <mapping resource="com/compudyne/dao/celcom/pojo/UserProfile.hbm.xml" />

            <mapping resource="com/compudyne/dao/celcom/pojo/MerchantProfile.hbm.xml" />

            <mapping resource="com/compudyne/dao/celcom/pojo/OrganizationProfile.hbm.xml" />

            <mapping resource="com/compudyne/dao/celcom/pojo/OrganizationProfile.hbm.xml" />

            <!--<mapping resource="com/compudyne/dao/celcom/pojo/CreditcardPayment.hbm.xml"/>-->

            <mapping resource="com/compudyne/dao/celcom/pojo/Blacklisted.hbm.xml" />

             

            <!-- HIBERNATE database MAPPING setting [ END ]-->

             

            </session-factory>

            </hibernate-configuration>

            • 3. Re: ERROR org.hibernate.impl.SessionFactoryObjectFactory  - Invalid JNDI name
              jaikiran pai Master

              sivamugu wrote:

               


              <session-factory name="">

               

              You are specifying an empty string for the name. Change it to some sensible name.