Results 1 to 3 of 3

Thread: Hibernate in Tomcat 5.5

  1. #1
    Join Date
    Apr 2005
    Posts
    29

    Default Hibernate in Tomcat 5.5

    I am migrating from JBoss 4.01.sp1 to Tomcat 5.5. In JBoss, the following Hibernate mapping works fine:

    <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSess ionFactoryBean" singleton="true">

    <property name="dataSource"><ref bean="dataSource"/></property>

    <property name="mappingResources">
    <list>
    <value>WEB-INF/classes/sainc/dao/hbm/JbpUsers.hbm.xml</value>
    <value>WEB-INF/classes/sainc/dao/hbm/StarAttachment.hbm.xml</value>
    <value>WEB-INF/classes/sainc/dao/hbm/StarProject.hbm.xml</value>
    <value>WEB-INF/classes/sainc/dao/hbm/StarProjectType.hbm.xml</value>
    <value>WEB-INF/classes/sainc/dao/hbm/StarProjectPhase.hbm.xml</value>
    <value>WEB-INF/classes/sainc/dao/hbm/StarElement.hbm.xml</value>
    <value>WEB-INF/classes/sainc/dao/hbm/StarElementType.hbm.xml</value>
    <value>WEB-INF/classes/sainc/dao/hbm/StarMimeType.hbm.xml</value>
    <value>WEB-INF/classes/sainc/dao/hbm/StarAttribute.hbm.xml</value>
    <value>WEB-INF/classes/sainc/dao/hbm/StarAttributeSet.hbm.xml</value>
    <value>WEB-INF/classes/sainc/dao/hbm/StarAttributeValueSet.hbm.xml</value>
    <value>WEB-INF/classes/sainc/dao/hbm/StarAttributeValue.hbm.xml</value>
    <value>WEB-INF/classes/sainc/dao/hbm/StarAttributeDataType.hbm.xml</value>
    </list>
    </property>

    When using Tomcat 5.5, however, I'm receviing the following error:

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/star-data.xml]: Initialization of bean failed; nested exception is java.io.FileNotFoundException: class path resource [WEB-INF/classes/sainc/dao/hbm/JbpUsers.hbm.xml] cannot be opened because it does not exist
    java.io.FileNotFoundException: class path resource [WEB-INF/classes/sainc/dao/hbm/JbpUsers.hbm.xml] cannot be opened because it does not exist

    Does anybody have any ideas as to why this would be happening? Is there a workaround?

    Thanks!

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,104

    Default

    Does anybody have any ideas as to why this would be happening?
    Is your WAR expanded - this will occur if it's not.

    Is there a workaround?
    Try
    Code:
    <property name="mappingLocations">
      <value>classpath*&#58;/sainc/dao/hbm/*.hbm.xml</value>
    </property>

  3. #3
    Join Date
    Apr 2005
    Posts
    29

    Default Got it!

    Well, I got it to work starting at com/.../...htm.xml under the "WEB-INF/classes" directory. Now that I think about it, I wonder how it worked the other way. ???

    Cheers...


    <property name="mappingResources">
    <list>
    <value>/com/sainc/dao/hbm/JbpUsers.hbm.xml</value>
    <value>/com/sainc/dao/hbm/StarAttachment.hbm.xml</value>
    <value>/com/sainc/dao/hbm/StarProject.hbm.xml</value>
    <value>/com/sainc/dao/hbm/StarProjectType.hbm.xml</value>
    <value>/com/sainc/dao/hbm/StarProjectPhase.hbm.xml</value>
    <value>/com/sainc/dao/hbm/StarElement.hbm.xml</value>
    <value>/com/sainc/dao/hbm/StarElementType.hbm.xml</value>
    <value>/com/sainc/dao/hbm/StarMimeType.hbm.xml</value>
    <value>/com/sainc/dao/hbm/StarAttribute.hbm.xml</value>
    <value>/com/sainc/dao/hbm/StarAttributeSet.hbm.xml</value>
    <value>/com/sainc/dao/hbm/StarAttributeValueSet.hbm.xml</value>
    <value>/com/sainc/dao/hbm/StarAttributeValue.hbm.xml</value>
    <value>/com/sainc/dao/hbm/StarAttributeDataType.hbm.xml</value>
    </list>
    </property>

Similar Threads

  1. TreeCache + Hibernate + Spring + Tomcat
    By newreaders in forum Data
    Replies: 5
    Last Post: Jun 7th, 2007, 02:38 AM
  2. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  3. Replies: 3
    Last Post: Nov 19th, 2004, 07:16 PM
  4. Replies: 5
    Last Post: Aug 27th, 2004, 07:13 PM
  5. Replies: 7
    Last Post: Aug 21st, 2004, 03:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •