You are currently viewing the Hibernate section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
How to Validate XML From Classpath (Hibernate-Mapping2.0 DTD)
Hello I am a newbie for the topic I opened.
I use hibernate 2.0 and web logic as app.server with eclipse as ide.
The entity file starts with:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://x.com.tr/service/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
....
The problem is I do not want to validate dtd information from internet but to load it from classpath in a jar.(hibernate2.jar)
(Because I don't konow how to use hibernate2.jar.Inside there is the hibernate-mapping-2.0.dtd file )
To solve the problem locally without connecting internet may be a proper solution;
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"file:///C:/DTD/hibernate-mapping-2.0.dtd">
but this is not the demanded solution, we persist to solve via classpath solution.
So, I think I could tell about my question easily.
I wait your guides,recommendations about this easy question.
I want to show the path of related dtd information from classpath and how to do that ?
My solution is very easy that the the order of the jars in classpath has affected the working of the server's condition.
I have changed the weblogic.jar to the end of the jars which take place in my classpath.
Especially,remind the people to write code carefully and ask the people who implemented the same situation before.
Try to go through internet and share your ideas and information.
It is time to share more information about what we know and what we did.
Edit your hbm.xml file dtd validation part like that