Results 1 to 2 of 2

Thread: hibernate mappings in with weblogic

Hybrid View

  1. #1
    Join Date
    Aug 2004
    Location
    Dallas, TX
    Posts
    26

    Default hibernate mappings in with weblogic

    Weblogic is unable to find Hibernate mappings in classpath if .war is not unpacked. My bean context mapping:

    Code:
    <bean id="mySessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
          <property name="mappingDirectoryLocations">
            <list>
             <value>classpath&#58;/com/foo/contract/domain/common</value>
             <value>classpath&#58;/com/foo/contract/domain/proposal</value>
             <value>classpath&#58;/com/foo/contract/domain/rfp</value>
             <value>classpath&#58;/com/foo/contract/domain/template</value>
            </list>
          ...more...
    </bean>
    Does anyone know of alternative configuration that I can use that does not force me to unpack war file. Thanks in advance.


    P.S. Spring rocks.

  2. #2
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

    WebLogic does not normally extract most of the contents of WAR files out to the filessytem, as it internally uses a Zip file url handler to get at stuff in the archives.

    Just use the mappingLocations property instead of the mappingDirectoryLocations you are trying to use, and point to the mapping files directly on your classpath (which means they should be on the classpath somewhere of course :-).

    Be careful as this param is a Resource, and the default ResourceEditor PropertyEditor which will convert for you from a String path name in the appcontext definition to the actual Resource will get you different results for unqualified names here depending on whether it is a web ApplicationContext variant, or just a simple AppContext variant like ClasspathXmlApplicationContext. In the former, simple path names are treated as file paths relative to the web app context root, while in the latter they considered to be classpath resources. If you always want the path treated as a classpath, just use a
    classpath:
    prefix.

Similar Threads

  1. Replies: 1
    Last Post: Sep 17th, 2005, 02:19 AM
  2. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  3. Hibernate and JTA on WebLogic - doesn't work ?
    By slawek_zachcial@yahoo.com in forum Data
    Replies: 1
    Last Post: May 2nd, 2005, 09:11 AM
  4. Replies: 1
    Last Post: Jan 19th, 2005, 11:22 PM
  5. Replies: 3
    Last Post: Nov 19th, 2004, 07:16 PM

Posting Permissions

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