I am trying to obtain URL from the hibernate configuration file(connectMapping.xml) on web logic 8.1 , it is there in the .war file and it keep throwing me excpetion below,but when i debugged the code i can see the mapping file and the path though, how come it's not able to find it.Is it finding it difficult to point to right path since it is in .war file?. i have no idea what's going on with it.Please help
Thanks in advance
Code
URL url = getClass().getClassLoader().getResource(getMappingFile());
try {
this.cfg.addFile(url.getFile());
}
catch (Exception e) {
log.error("Error adding hibernate file with url"
+ url.toString(), e);
throw e;
}
Error
org.dom4j.DocumentException: C:\bea\user_projects\myserver\.wlnotdelete\extract\myserver_TEST_Portal_test-portal\test-portal.war!\WEB-INF\classes\connectMapping.xml (The system cannot find the path specified) Nested exception:
Error adding hibernate file with urlzip:C:/bea/user_projects/myserver/.wlnotdelete/extract/myserver_TEST_Portal_test-portal/test-portal.war!/WEB-INF/classes/connectMapping.xml
org.hibernate.MappingException: Could not configure datastore from file: C:/bea/user_projects/myserver/.wlnotdelete/extract/myserver_TEST_Portal_test-portal/test-portal.war!/WEB-INF/classes/connectMapping.xml
|