- This topic has 4 replies, 2 voices, and was last updated 19 years, 9 months ago by tarantula.
-
AuthorPosts
-
tarantulaParticipantHi,
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
Riyad KallaMembertarantula,
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?
tarantulaParticipantHi 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
Riyad KallaMemberDo 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.
tarantulaParticipantHi,
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 -
AuthorPosts