cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
78
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

Created by: null on 15-08-2005 04:39:30 PM
We have a configuraion framework that that reads all the configuration files in xml format. This is used in some of our non-audium projects on websphere

All these xml file use a dtd which is included in the jar file.

When I use the same jar file in an audium applications to read config files, Audium is unable to find the dtd included in the jar in the classpath

I have added this jar file to application's java\application\lib folder

I tried keeping it under common\lib folder, but it did not work.

I cannot keep it under app server lib folder because application limitations.

I am wondering, whether auduim class loading is different than other appservers.

I appreciate your help in advance.

Thanks

Subject: RE: classpath issuse
Replied by: Vance Vagell on 15-08-2005 06:48:47 PM
Hi Chandra,

In order to assist you with this issue, we need some additional information:

  • How are you attempting to access the DTD? Is it being referenced in a DOCTYPE statement? Is it being loaded explicitly through custom code? etc. Additionally, any code snippet you could provide that shows how you are accessing the DTD would be helpful.

  • What XML parser are you using?

  • You mentioned that you cannot place the JAR file in your application server's lib folder. Was the DTD accessible (i.e did it work) when you placed it there?

  • Could you explain the general setup of what you are trying to accomplish? For example, where is the XML stored? At what point is the XML parsed (e.g. in an element, on call start)? How does this system normally work, outside of Audium? etc.

Regards,
Vance

Subject: RE: classpath issuse
Replied by: null on 15-08-2005 09:02:38 PM
Vance,
Thank you for your response.

Yes, we use DOCTYPE to access DTD
<!DOCTYPE configuration SYSTEM "http://abc..com/dtd/configuration.dtd">

We use xerces parser

When I keep the Jar file in appserver/lib folder , it is finding the dtd from jar files, but we cannot keep Jar files there.Because it needs to read the application specific config files

Config files are stored under a particular folder in the classpath and this configuartion framework looks for this folder in the classapth and finds it and try to read the config files from there.

we store environment specific configurations in the xml files

In the application startup, the root folder is found and based on the requirement, other data is read from the xml files.

For example if root is our root folder
root


 
---->abc

 
|--> xml files like abc_test.xml and abc_prod.xml


Configuration.Root()
will find the root folder

Configuration.Root().node("abc")
will find the abc folder under root

Configuration.systemRoot().node("abc").get("xyz")

will get us the values stored in config files for xyz as key in abc_test.xml file in abc folder.

Hope this gives you an idea.

Thanks,

Subject: RE: classpath issuse
Replied by: Vance Vagell on 15-08-2005 09:38:22 PM
Hi Chandra,

If an XML file references a DTD through a DOCTYPE, and the DTD is moved, the DTD will not be found when the XML is parsed since the link in the DOCTYPE will be invalid. Based on your reply, it seems that your DOCTYPE was set to point to the DTD on your application server, and when the DTD was moved to a local folder, the DOCTYPE became invalid. Here are some possible solutions:

  • Change the DOCTYPE to reflect the new location of the DTD.

  • Remove the DOCTYPE from the XML files, and instead initiate the validatation against the DTD manually and specify the location of the DTD in your custom code.

  • Leave the JAR file containing the DTD and configuration loader on your application server, but modify the loader to accept a path to the configuration file. Then, have each Audium application pass the path when the loader is called.

The last solution may be preferable, since it involves only a single copy of your configuration loader (i.e. it will be easier to update the configuration loader application, easier to track errors with the loader, takes up less disk space, etc.).

Hope this helps,
Vance
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links