Classpath

J

John Smith

I have some XML schemas which I pass to Xerces XML parser. I have stored
those XML schemas in d:\myworkplace\myproject\schemas\client\ folder. There
are 4 schemas. One main schema include other 3 schemas. It all works fine
when I run my code from my Eclise 3.1.2/JDK50/WinXP, but it doesn't work at
my coworker which have the same configuration. The same code expects those 3
imported schemas to be in project root folder (d:\myworkplace\myproject\).
In my code, I'm referencing those imported schemas only by its file name on
the disk (e.g. schema1.xsd), without path (e.g.
d:\myworkplace\myproject\schemas\client\schema1.xsd) and on my PC there are
no problems. I think that this problem is not related to Xerces XML parser,
because there are similar problems with some other configuration files which
are referenced only by its file name, without path. What should I do?
 
J

jmcgill

John said:
What should I do?

Put them in a jar, and ensure that jar is on the classpath, and then
load them as a resource instead of going straight loading via file io.

Look into "getResource()" and "getResourceAsStream()"
 
J

John Smith

Thank you for your response.
Put them in a jar, and ensure that jar is on the classpath, and then load
them as a resource instead of going straight loading via file io.

Look into "getResource()" and "getResourceAsStream()"

No, I can't use this. I'm passing only path/filename (of the main schema) to
the Xerces and other projects.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top