1 Reply Latest reply on Mar 26, 2008 1:48 AM by Saumesh Kumar

    Problem in deplyoing Struts - Hibernate project

    Saumesh Kumar Newbie

      Hello...

      I am working on struts & hibernate 3 & using websphere as IDE. The project is working fine in Websphere & tomcat, but when I deploy it to JBoss 4.0.3 SP1, there are lot of problems.

      When I run sql query through

      session.createSqlQuery()


      it says that
      addScalar() or addEntity() methods
      must be executed before executing query.

      other problem is that when I run HQL through
      session.cerateQuery()
      . It says that
      no persistent classes found for query class: select us.strEmpId, us.strUserName
      and throws following exception -

      [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/DHBVN].[action]] Servlet.service() for servlet action threw exception
      java.lang.NullPointerException


        • 1. Re: Problem in deplyoing Struts - Hibernate project
          Saumesh Kumar Newbie

          Some snapshot of my Server Log is.

          2008-03-26 11:04:29,468 INFO [org.apache.struts.util.PropertyMessageResources] Initializing, config='org.apache.struts.taglib.logic.LocalStrings', returnNull=true
          2008-03-26 11:04:32,718 INFO [STDOUT] strUserName pis
          2008-03-26 11:04:32,718 INFO [STDOUT] strPassword pis
          2008-03-26 11:04:32,828 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] JNDI lookup: hibernate/SessionFactory
          2008-03-26 11:04:32,828 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] lookup: uid=8ae58a8b18e994580118e99459560000
          2008-03-26 11:04:33,078 DEBUG [org.hibernate.jdbc.JDBCContext] no active transaction, could not register Synchronization
          2008-03-26 11:04:33,078 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 4941863619903488
          2008-03-26 11:04:33,078 INFO [STDOUT] Before Sql
          2008-03-26 11:04:33,078 DEBUG [org.hibernate.impl.SessionImpl] find: select us.strEmpId, us.strUserName from appsrv.forms.frmbns.LoginBean us
          2008-03-26 11:04:33,125 DEBUG [org.hibernate.engine.QueryParameters] named parameters: {}
          2008-03-26 11:04:33,125 WARN [org.hibernate.hql.QuerySplitter] no persistent classes found for query class: select us.strEmpId, us.strUserName from appsrv.forms.frmbns.LoginBean us
          2008-03-26 11:04:33,140 DEBUG [org.hibernate.jdbc.JDBCContext] after autocommit
          2008-03-26 11:04:33,140 DEBUG [org.hibernate.impl.SessionImpl] after transaction completion
          2008-03-26 11:04:33,140 INFO [STDOUT] List Size---0
          2008-03-26 11:04:33,140 INFO [STDOUT] After List Add
          2008-03-26 11:04:33,140 DEBUG [org.hibernate.impl.SessionImpl] closing session
          2008-03-26 11:04:33,140 DEBUG [org.hibernate.jdbc.ConnectionManager] connection already null in cleanup : no action


          Plz help me to solve this problem.