Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 142487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:56:40+00:00 2026-05-11T07:56:40+00:00

I tried to use the xslt task in Ant to modify a Hibernate mapping

  • 0

I tried to use the xslt task in Ant to modify a Hibernate mapping file (*.hbm.xml) using XSLT. However I kept on getting an com.sun.org.apache.xml.internal.utils.WrappedRuntimeException.

If I take out the !DOCTYPE declaration in the source xml file, the following target runs without any error. Could someone please tell me what I’m doing wrong? Thanks!

Here’s my Ant target:

<target name='generatePermHbmXml'>   <xslt in='${base.configuration.hibernate.dir}\Test.hbm.xml'          out='${base.configuration.hibernate.dir}\TestPerm.hbm.xml'         style='${base.configuration.hibernate.dir}\perm.xsl'>     <xmlcatalog>       <dtd publicId='-//Hibernate/Hibernate Mapping DTD//EN'            location='http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd'/>     </xmlcatalog>   </xslt>        </target> 

Here’s my log output:

[xslt] : Error! hibernate.sourceforge.net [xslt] : Error! com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: hibernate.sourceforge.net 

[Edit] Here’s the DOCTYPE that I removed to get it working

<!DOCTYPE hibernate-mapping PUBLIC '-//Hibernate/Hibernate Mapping DTD//EN' 'http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd'> 

[Edit2]: I found a fix, but I don’t know whether if it is the ‘right’ way or not. I downloaded the DTD file and placed that in my project dir. I referenced the file (as shown below) instead of the URL, and it seems to be working now.

<xmlcatalog>   <dtd publicId='-//Hibernate/Hibernate Mapping DTD//EN'        location='${base.configuration.hibernate.dir}/hibernate-mapping-3.0.dtd'/> </xmlcatalog>  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T07:56:41+00:00Added an answer on May 11, 2026 at 7:56 am

    Ah, I think I know the problem. In your xslt task, you specified an xmlcatalog:

    <xmlcatalog>   <dtd publicId='-//Hibernate/Hibernate Mapping DTD//EN'        location='http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd'/> </xmlcatalog> 

    The xmlcatalog is used to help the xslt task find DTDs and other items needed for XML parsing and validation. If you go to the URL you specified as location you do get a DTD. (Which Firefox shows an an empty page, but viewing ‘page source’ you see the DTD contents.) Since the DTD is in fact present at that URL, I don’t know exactly why the build had a problem reading that DTD — maybe there’s a difference in encoding or maybe the site didn’t respond properly. If you ran ANT with the -verbose option, you would see more of a stack dump around the failure if you really wanted to debug it. You would see the original Exception that got wrapped in the Exception you saw.

    Anyway, if you download the DTD in question and then point your location in the dtd element at the local file, as you did:

    <xmlcatalog>   <dtd publicId='-//Hibernate/Hibernate Mapping DTD//EN'        location='${base.configuration.hibernate.dir}/hibernate-mapping-3.0.dtd'/> </xmlcatalog> 

    then the parser can find the DTD it needs, guaranteed, and it works fine.

    So yes, your solution is the correct solution. This way, your builds don’t depend on an external website being accessible and having a file available.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to use Ant's XMLValidate task to validate an XML document against
I'm trying to use XSLT text output to generate a file (in a file
On the server I receive xml from a webservice, I use xslt transformation on
I'm trying to use ant to use XSLT to preprocess three specific stylesheets in
I tried to use the read/write file descriptor in bash so that I could
I tried to use DriveInfo.IsReady, but it returns false if an unformatted floppy is
I tried to use this on my class library mylib.core.data.dll and got a successful
I tried to use OPTION (MAXRECURSION 0) in a view to generate a list
I have tried to use ASP.NET MVC for a while, then I face a
Has anybody tried to use JavaFX Script in server side applications? The language itself

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.