Hi,
Just another way:
For my classes in the jar-files I put my *.properties into the jboss\conf
directory and load the file through the getResource mechanism
public class Hot {
static private Properties defaults = new Properties();
static private String hotPropertiesFile = "hot.properties";
static private Properties hotProperties = new Properties(defaults);
static private void initDefaults() {
//logical server name
defaults.put("xxx", "yyy");
defaults.put("...", "...");
...
}
static{ //load hot properties on Hot class loading
initDefaults();
try {
// in jboss the conf-directory is automatically added to the CLASSPATH
// => load file through getResource mechanism
InputStream propInput =
Hot.class.getClassLoader().getResourceAsStream(hotPropertiesFile);
hotProperties.load(propInput);
}
catch (Exception e){
System.out.println("Hot: Could not open Hot properties file: " +
hotPropertiesFile );
}
...
}
> ----------
> Von: Lionel Siau[SMTP:[EMAIL PROTECTED]]
> Antwort an: [EMAIL PROTECTED]
> Gesendet: Mittwoch, 6. Juni 2001 01:48
> An: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Betreff: Re: [JBoss-user] is that a taboo?
>
> Hi Mikhail,
>
> I have a similar problem with my WAR and properties file for Jive. This is
> so irritating.(see my post)
>
> Lionel
> ----- Original Message -----
> From: "Mikhail Akopov" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, June 05, 2001 4:44 PM
> Subject: [JBoss-user] is that a taboo?
>
>
> > Sorry for bothering all the community by the stupid question, but I
> still
> > need an answer...
> > It is rather simple thing: how to make EJBs and servlets localization?
> >
> > Localization means I need to put one or several *.properties files into
> > classpath.
> > When I deploy a standalone war file into Tomcat, I put these files
> inside
> > war into the
> > same directory where the class files are situated. And this works fine.
> >
> > But when I put the same war file inside the ear file and deploy this ear
> > file into jboss - I loose all those *.properties. The only way I got
> them
> > working is to put all of them into $JBOSS_HOME/lib/ext - obviously bad
> > solution.
> >
> > What's wrong? Help me please. I tried all the variants including
> Class-Path
> > in manifest.
> > I browsed all the jboss-user archive and found only the same question by
> > other guys but no response.
> >
> > Is that a taboo? :-)
> >
> >
> >
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/jboss-user
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user