-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: WebSphere deployment problem, HQL, Hbm not mapped error
PostPosted: Fri Jul 28, 2006 7:06 pm 
Beginner
Beginner

Joined: Thu Sep 25, 2003 5:22 pm
Posts: 29
Location: NC
I am using WebSphere 5.1 as my application server, on linux, and all coding and testing is done through a development environment on WinXP, RAD (Rational Application Developer) 6.0.

I have no errors when I deploy and test in my development environment , but when I try and deploy the same .ear to the WebSphere server, I get the following problems. We recently upgraded to RAD 6.0 from WebSphere Enterprise Developer 5.1, and it worked fine there, deployed fine from there, so my suspicion is that RAD is the culprit.

I am stumped... tried changing the query to contain the fully qualified com.myclasses.model.download.pojo.MyUpdateHbm, tried the query as "FROM MyUpdateHbm as d WHERE d.serviceId = :sid AND d.clientId = :cid" and its associated changes (setLong by name, etc.). My suspicion is that it is a configuration error since it works one place and not another.

Can anyone help?

Hibernate version:
3.0.5

Name and version of the database you are using:
DB2 version 8


Full stack trace of any exception that occurs:
Code:
[7/28/06 18:39:04:023 EDT] 151a35f0 PARSER        E org.hibernate.hql.PARSER  *** ERROR:  MyUpdateHbm is not mapped.
[7/28/06 18:39:04:346 EDT] 151a35f0 PARSER        E org.hibernate.hql.PARSER  *** ERROR:  Invalid path: 'd.serviceId'
[7/28/06 18:39:04:418 EDT] 151a35f0 PARSER        E org.hibernate.hql.PARSER  *** ERROR: <AST>: unexpected end of subtree
[7/28/06 18:39:04:574 EDT] 151a35f0 PARSER        E org.hibernate.hql.PARSER  *** ERROR:  Invalid path: 'd.clientId'
[7/28/06 18:39:04:585 EDT] 151a35f0 PARSER        E org.hibernate.hql.PARSER  *** ERROR: <AST>: unexpected end of subtree
[7/28/06 18:39:04:739 EDT] 151a35f0 PARSER        E org.hibernate.hql.PARSER  *** ERROR:  Invalid path: 'd.createTs'
[7/28/06 18:39:05:262 EDT] 151a35f0 SystemOut     O 2006-07-28-18.39.05.062 ERROR [Servlet.Engine.Transports : 100] BaseException.logException()[63] ->
****** EXCEPTION ID:[2006.07.28 AD at 06:39:04 PM EDT] ******
MyUpdateHbm is not mapped. [FROM MyUpdateHbm as d WHERE d.serviceId = ? AND d.clientId = ? ORDER BY d.createTs asc ]
com.myclasses.framework.dao.DAOException: MyUpdateHbm is not mapped. [FROM MyUpdateHbm as d WHERE d.serviceId = ? AND d.clientId = ? ORDER BY d.createTs asc ]
   at com.myclasses.model.dao.DownloadFileDAO.getDownloadFileList(DownloadFileDAO.java:133)
   at com.myclasses.facade.DownloadFileFacade.getDownloadFileList(DownloadFileFacade.java:89)
   at com.myclasses.actions.DownloadFileAction.getDownloadFileList(DownloadFileAction.java:284)
   at com.myclasses.actions.DownloadFileAction.performAction(DownloadFileAction.java:56)
   at com.myclasses.actions.BaseAction.execute(BaseAction.java:85)
   at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
   at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
   at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
   at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
   at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))
   at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
   at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code))
   at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
   at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))
   at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))
   at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code))
   at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
   at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
   at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
   at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))
   at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))
   at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))
   at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
   at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))
   at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))
   at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))
   at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled Code))
   at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))



Mapping documents:
Code:
<hibernate-mapping schema="MY_SCHEMA">
   <class
       name="com.myclasses.model.download.pojo.MyUpdateHbm"
       table="TBL_MYCLASSES_UPDATE">
       
       <id
          name="seqNum"
           column="SEQ_NUM"
           type="java.lang.Long"
           length="15">
              <generator class="sequence" >
                 <param name="sequence">MY_SCHEMA.SEQ_MY_UPDATE</param>
              </generator>
       </id>
      
       <property
          name="clientId"
           column="CLIENT_ID"
           type="java.lang.Long"
           length="15">
           <meta attribute="field-description">
              @hibernate.property
               column="CLIENT_ID"
           </meta>
      </property>
      
      <property
          name="serviceId"
           column="SERVICE_ID"
           type="java.lang.Long"
           length="15">
           <meta attribute="field-description">
              @hibernate.property
               column="SERVICE_ID"
           </meta>
      </property>
      
      <property
          name="fileDirectory"
           column="FILE_DIRECTORY"
           type="java.lang.String"
           length="100">
           <meta attribute="field-description">
              @hibernate.property
               column="FILE_DIRECTORY"
           </meta>
      </property>

      <property
          name="fileName"
           column="FILENAME"
           type="java.lang.String"
           length="30">
           <meta attribute="field-description">
              @hibernate.property
               column="FILENAME"
           </meta>
      </property>
      
      <property
          name="downloadTs"
           column="DOWNLOAD_TS"
           type="java.sql.Timestamp">
           <meta attribute="field-description">
              @hibernate.property
               column="DOWNLOAD_TS"
           </meta>
      </property>
      <property
          name="createTs"
           column="CREATE_TS"
           type="java.sql.Timestamp">
           <meta attribute="field-description">
              @hibernate.property
               column="CREATE_TS"
           </meta>
      </property>
      
      <property
          name="versionNum"
           column="VERSION_NUM"
           type="java.lang.String"
           length="50">
           <meta attribute="field-description">
              @hibernate.property
               column="VERSION_NUM"
           </meta>
      </property>
      
      <property
          name="fileBlob"
           column="FILEBLOB"
           type="java.sql.Blob">
           <meta attribute="field-description">
              @hibernate.property
               column="FILEBLOB"
           </meta>
      </property>

      <property
          name="fileDescription"
           column="FILE_DESC"
           type="java.lang.String"
           length="50">
           <meta attribute="field-description">
              @hibernate.property
               column="FILE_DESC"
           </meta>
      </property>
      
      <property
          name="typeIndication"
           column="TYPE_IND"
           type="java.lang.String"
           length="1">
           <meta attribute="field-description">
              @hibernate.property
               column="TYPE_IND"
           </meta>
      </property>
      
      <property
          name="notes"
           column="INSTALL_NOTES"
           type="java.lang.String"
           length="500">
           <meta attribute="field-description">
              @hibernate.property
               column="INSTALL_NOTES"
           </meta>
      </property>
      <property
          name="fileSize"
           column="FILE_SIZE"
           type="java.lang.Long"
           length="15">
           <meta attribute="field-description">
              @hibernate.property
               column="FILE_SIZE"
           </meta>
      </property>

      <many-to-one name="clientUser"
         column="CLIENT_USER_ID" />
      
   </class>
</hibernate-mapping>



Code between sessionFactory.openSession() and session.close():

Code:
   public static final String GET_DOWNLOAD_FILE =
      "FROM MyUpdateHbm as d "
         + "WHERE d.serviceId = ? "
         + "AND d.clientId = ? "
         + "ORDER BY d.createTs asc ";

   List d =
            session
               .createQuery(GET_DOWNLOAD_FILE)
               .setLong(0, serviceId.longValue())
               .setLong(1, clientId.longValue())
               .list();


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 29, 2006 2:18 am 
Expert
Expert

Joined: Tue Dec 07, 2004 6:57 am
Posts: 285
Location: Nürnberg, Germany
Hi,
are you sure that the hbm.xml files are contained in the ear? Please verify that.

_________________
Please don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 29, 2006 6:50 am 
Regular
Regular

Joined: Mon Jun 13, 2005 12:21 pm
Posts: 61
Location: Hannover
Also check the logfile while startup, are you're .hbm file processed when initializing you're SessionFactory?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 31, 2006 10:12 am 
Beginner
Beginner

Joined: Thu Sep 25, 2003 5:22 pm
Posts: 29
Location: NC
We figured it out. The problem was multiple webapps in the same .ear were sharing some configuration parameters. In the development environment, appA loaded before appB so there were no problems. In the deployment, however, appB loaded before appA and overrode the the configuration that appA had loaded, therefore essentially also overriding the mapped hbm files.

It was confusing because the files existed in the .ear. and the logs had shown that the files were mapped... and they *were* mapped, just promptly overriden. :-)

We commented out one of the config file loads and all is now happy and good.

Thanks for the help, though!

-Kat


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.