Results 1 to 3 of 3

Thread: resource lookup inside an ear. file

  1. #1
    Join Date
    Dec 2005
    Posts
    269

    Default resource lookup inside an ear. file

    hi all

    I'm having the prob with finding the resources (Hiberbnate mappings for example) in the structure of an .ear. The .ear is deployed within the JBoss4 and has the following content:
    Code:
    app.ear 
      |--conf/appContext.xml (spring)
      |                       |--<bean class="LocalSessionFac"/>
      |--common.jar
      |--app.har  
                      |--com
                            |--example
                                     |--hbm
                                           |--*.hbm.xml <<-- point of interest
    I need to inject the .hbm.xml files into the sessionFactory. What's the simpliest way to do it?

    Thanx in advance

  2. #2
    Join Date
    Dec 2005
    Posts
    269

    Default

    hmmm,

    I tried to replace mappingDirectoryLocations with mappingLocations to point to .hbm.xml files inside the .har, and it works!

    But this solution is far from ideal... As I assume, the problem lies in the lookup machanism of the archive files, and when I point to a directory instead of a file it makes no sence for this mechanism.

    Are there any ways, or work-around to solve the prob?

  3. #3

    Default

    hi;
    i think it all depends on the classloading scheme that jboss uses.
    i dont really know what classloader jboss gives the har file and its hard to understand from your packaging description the full picture.

    what you need to do is look at the flow that triggers the loading of the hbm files and make sure that you have 'classloading access' from the classes that need to load the hbm, to the hbm it self.

    when i say 'classloading access', i mean, for example:
    in a web application every resource packaged in a jar and put in the WEB-INF/lib directory is available for the web application. this is because the spec mandates the availability of these jars to the web application classloader
    __________
    Guy Katz
    www.xwave.co.il

Posting Permissions

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