Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Hibernate
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Hibernate section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 15th, 2009, 10:31 AM
Registered User
 
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.
 
Old October 16th, 2009, 07:58 AM
Registered User
 
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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Automated tool to convert XML from DTD to DTD lsantos2000 XSLT 2 October 17th, 2007 08:21 AM
how to parse the XML file and DTD through Xerces tufailfifa C++ Programming 0 June 25th, 2007 07:03 AM
how to parse the XML file and DTD tufailfifa XML 0 June 25th, 2007 07: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 08:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.