Trouble validating log4j config with DTD
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 7
- Joined: Tue Oct 26, 2004 12:03 am
- Contact:
Trouble validating log4j config with DTD
I'm having trouble validating log4j files I use with the DTD. The log4j.dtd comes with the distribution in the source tree. I went into the default Oxygen catalog and I added an entry based off of the other entries I saw (catalogs are new to me).
Sample header of a log4j file:
My log4jcatalog file:
I basically just edited a copy of the SVG one to my liking. I put the log4j.dtd file in this same location and I edited the catalog.xml to refer to this file above.
So Oxygen doesn't seem to see this file at all. I try to validate a log4j config file and I get:
Bummer. My platform is Mac OS X. Any ideas?
Sample header of a log4j file:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
"http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<system systemId="log4j.dtd" uri="log4j.dtd"/>
</catalog>
So Oxygen doesn't seem to see this file at all. I try to validate a log4j config file and I get:
Code: Select all
F FileNotFoundException-/Volumes/scratch/SmileyDev/jboss/server/default/conf/log4j.dtd (No such file or directory)
~ David Smiley
Registered Oxygen User
Registered Oxygen User
-
- Posts: 388
- Joined: Thu Jul 01, 2004 12:29 pm
Dear David Smiley,
You don't need a catalog to validate your log4j files. Just make sure you have the log4j.dtd in the same folder as the log4j files or if the log4j.dtd
is in another folder specify the full path to the dtd in the header of your log4j files. In this case the header of the log4j file must look like this :
In your example i think the path is : file:/Volumes/scratch/SmileyDev/jboss/server/default/conf/log4j.dtd
Best Regards,
Octavian
You don't need a catalog to validate your log4j files. Just make sure you have the log4j.dtd in the same folder as the log4j files or if the log4j.dtd
is in another folder specify the full path to the dtd in the header of your log4j files. In this case the header of the log4j file must look like this :
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "the full path to log4j.dtd">
Best Regards,
Octavian
-
- Posts: 7
- Joined: Tue Oct 26, 2004 12:03 am
- Contact:
I appreciate your help but...
1. I don't want to have to put log4j.dtd wherever I may be viewing a log4j configuration file.
2. I don't want to have to modify DOCTYPE declarations in log4j configuration files.
I think my needs are reasonable. The catalog appears to address my needs but I can't get it to work for me.
1. I don't want to have to put log4j.dtd wherever I may be viewing a log4j configuration file.
2. I don't want to have to modify DOCTYPE declarations in log4j configuration files.
I think my needs are reasonable. The catalog appears to address my needs but I can't get it to work for me.
~ David Smiley
Registered Oxygen User
Registered Oxygen User
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
The fact that the field containing the full name of the default catalog is not editable should provide a reasonable hint this is not the way to tell Oxygen about your catalog. You should only enable or disable its use and not modify its contents. Adding your catalog to the list of catalogs displayed below the default catalog field (use the New button in the same Preferences page) provides exactly what you need. Do not forget to restart Oxygen so that changes to the XML catalog settings take effect.
Regards,
Sorin
Regards,
Sorin
-
- Posts: 7
- Joined: Tue Oct 26, 2004 12:03 am
- Contact:
OK. I removed my change the Oxygen's catalog and I added the catalog via the provided mechansim.
I get the same result, which is the file-not-found error as it looks for log4j.dtd within the same file as the log4j.xml I'm looking at.
I thought perhaps it might help if I used an absolute path in my catalog file for the URI attribute so I used:
file:///Volumes/scratch/SmileyDev/Tools/oxygen Folder/frameworks/log4j/dtd/log4j.dtd"
But that had no effect.
I get the same result, which is the file-not-found error as it looks for log4j.dtd within the same file as the log4j.xml I'm looking at.
I thought perhaps it might help if I used an absolute path in my catalog file for the URI attribute so I used:
file:///Volumes/scratch/SmileyDev/Tools/oxygen Folder/frameworks/log4j/dtd/log4j.dtd"
But that had no effect.
~ David Smiley
Registered Oxygen User
Registered Oxygen User
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi David,
The XML Catalog acts as an entity resolver. If you use a relative reference in your document that will be expanded by the parser before calling the entity resolver. Therefore if you have a catalog entry containing only the log4j.dtd that will not match. Another thing that you should take into account is that some characters need to be encoded, for instance space should be replaced with %20. We will make a working sample with log4j and let you know the steps to make that work.
Best Regards,
George
The XML Catalog acts as an entity resolver. If you use a relative reference in your document that will be expanded by the parser before calling the entity resolver. Therefore if you have a catalog entry containing only the log4j.dtd that will not match. Another thing that you should take into account is that some characters need to be encoded, for instance space should be replaced with %20. We will make a working sample with log4j and let you know the steps to make that work.
Best Regards,
George
-
- Posts: 388
- Joined: Thu Jul 01, 2004 12:29 pm
Dear David Smiley,
To make this work follow the next steps:
Octavian
To make this work follow the next steps:
- 1. Create a catalog (log4jcatalog.xml) and specify the systemId as an absolute path, the catalog must look like this :
2. Add the log4j.dtd in the same folder as log4jcatalog.xml or if the log4j.dtd is
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
"http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<system systemId="file:/log4j.dtd" uri="log4j.dtd"/>
</catalog>
in another folder specify the path in the catalog : uri="the path to the dtd".
3. Add the catalog to the oXygen catalogs list from Options->Preferences->XML Catalogs.
4. Restart oXygen
5. Create an xml file like this :6. Try to validate your xml file.Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "file:/log4j.dtd">
<log4j:configuration>
</log4j:configuration>
Octavian
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service