facebook

Hibernate Web Project deployment problem [Closed]

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #226365 Reply

    tarantula
    Participant

    Hi,

    I’m using MyEclipse 3.8.4 with Eclipse 3.0.1 on Linux and I’m having problems deploying a Web project using the MyEclipse deployment tool. The problem is that the resulting hibernate.cfg.xml file is missing my mapping file declarations as follows:

    
            <!-- mapping files -->
            <!-- The following mapping element was auto-generated in -->
            <!-- order for this file to conform to the Hibernate DTD -->
            <mapping resource="Add valid path"/>
    

    I checked my WEB-INF/classes directory before deploying and the file was fine (i.e. it had the correct mapping declarations) but the file in the deployed exploded directory is missing this information, causing ServletExceptions at runtime.

    Can you please help?

    tarantula

    #226370 Reply

    Riyad Kalla
    Member

    tarantula,
    In your project where does the cfg.xml file live? If you use an exploded deployment, is it there? Have you tried removing the deployment, then manually checking the destination directory with Windows explorer to make sure it is actually gone and that stray files haven’t been left behind?

    #226371 Reply

    tarantula
    Participant

    Hi Riyad,

    The hibernate.cfg.xml file is in my /src directory. The output location for this directory is /WEB-INF/classes. I tried removing the deployment and all the files were successfully removed from the destination directory. I also tried adding a file called test.txt to the /src directory and redeploying and it was copied to the destination directory.

    tarantula

    #226373 Reply

    Riyad Kalla
    Member

    Do me a favor, switch to the Navigator view and navigate into your WEB-INF/classes dir, and open the copy of hibernate.cfg.xml there, does it match the one in your /src folder?

    Also you didn’t mention if exploded deployment gives a different result than packaged deploynment.

    #227192 Reply

    tarantula
    Participant

    Hi,

    I have an update on this problem. I did not attempt to deploy the project as a war but I believe I know what was causing the above behaviour. I was redeploying a Web project that had references to another J2EE project with Hibernate caps installed using the Smart Deployment feature. When I deployed my first project, the contents of the referenced project were being merged into the classes directory. I checked the referenced project and it had a blank hibernate.cfg.xml file which was apparently overwriting the first one, causing the exception. My solution was to remove the second hibernate.cfg.xml file. We should close this support request.

    Thanks for your help,
    tarantula

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Hibernate Web Project deployment problem [Closed]

You must be logged in to post in the forum log in