uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ahmed Abdeen Hamed" <ahmed.elma...@gmail.com>
Subject Re: Making JAR files reading from within
Date Mon, 11 Aug 2008 12:54:19 GMT
Hi Hannes,Thank you for your response.
I have configuration files, UIMA descriptors, models and dictionaries in my
JAR. After I deployed, the JAR is not able to see those files inside itself
and I get FIleNotFoundException when I run the JAR file the command line.
This problem disappears entirely if I extract the JAR and the files are
copied into the file system. My question is, how do I tell the JAR that
those files are already inside it instead of extracting it? The suggestion
you have given me is very handy in the case of reading a simple file
contents. But if the JAR can't see the applications' descriptors then
getting the contents as streams becomes very messy because those descriptors
have references to other descriptors. So, I am not still sure how to tell
the JAR to access all the descriptors as one problem I have with the JAR.
Any other suggestions?
Thanks again!
Ahmed

On Mon, Aug 11, 2008 at 5:37 AM, Hannes Carl Meyer <
hannescarl@googlemail.com> wrote:

> Hi Ahmed,
> yes it is possible to access files from inside the jar, but in which
> context? In plain Java you can do something like this:
>
> YourClass.class.getClassLoader().getResourceAsStream("yourpackage/resource");
> Regards
> Hannes
>
> 2008/8/8 Ahmed Abdeen Hamed <ahmed.elmasri@gmail.com>
>
> > Hello,Is there a way to tell a jar file to access its contents (txt and
> > config) files instead of looking for such files on the filesystem? I
> > created
> > a UIMA-based application and it is successfully working from my machine
> > using the command-line. However, if I put the jar on another machine it
> > doesn't look inside itself to access model files for examples. I have
> been
> > looking into options and I found out that there is a way to access the
> > jars's internals one file at a time, and read it contents online at at
> > time.
> > However, that makes me reinvent my application again to get it to
> > manipulate
> > the files from the jars even though my program has already done that. Is
> > there a flag that you can turn on to tell the the jar to access its
> > contents
> > vs redoing this again programatically?
> > Thank you for you help!
> > -Ahmed
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message