p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Java > Java Open Source > Hibernate
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read

Welcome to the p2p.wrox.com Forums.

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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 15th, 2009, 11:31 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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 ?

Thanks in advance,
Regards.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old October 16th, 2009, 08:58 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb Answer

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
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
By the way even that you are disconnected, you can still validate your xml file because it always looks for the jar file. (hibernate-mapping2.0 dtd)

If you encounter some problems again,
I advice you to check your configuration, environment and classpath completely.

Have a nice day and nice shares to all the people.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automated tool to convert XML from DTD to DTD lsantos2000 XSLT 2 October 17th, 2007 09:21 AM
how to parse the XML file and DTD through Xerces tufailfifa C++ Programming 0 June 25th, 2007 08:03 AM
how to parse the XML file and DTD tufailfifa XML 0 June 25th, 2007 08:02 AM
XML converter by using own DTD? DorisTan XML 0 January 18th, 2005 09:57 AM
Defining a DTD for an XMl Document boemane C# 0 August 24th, 2004 09:17 AM



All times are GMT -4. The time now is 08:01 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc