Discussions
EJB programming & troubleshooting: how can I load a properties file drom a sessin EJB ,in JBoss?
-
how can I load a properties file drom a sessin EJB ,in JBoss? (5 messages)
- Posted by: mircea markus
- Posted on: September 17 2002 05:03 EDT
My problem is that I MUST load a .properties file from a session bean and I cant make that from the .jar.A solution is to put it in the JNDI server ,but..Threaded Messages (5)
- how can I load a properties file drom a sessin EJB ,in JBoss? by Lasse Koskela on September 17 2002 13:22 EDT
- how can I load a properties file drom a sessin EJB ,in JBoss? by hoi tsang on September 17 2002 14:47 EDT
- how can I load a properties file drom a sessin EJB ,in JBoss? by Sven van t Veer on September 17 2002 17:23 EDT
- how can I load a properties file drom a sessin EJB ,in JBoss? by Ravi Shankar on September 18 2002 05:52 EDT
- how can I load a properties file drom a sessin EJB ,in JBoss? by John Pletka on September 18 2002 11:21 EDT
-
how can I load a properties file drom a sessin EJB ,in JBoss?[ Go to top ]
- Posted by: Lasse Koskela
- Posted on: September 17 2002 13:22 EDT
- in response to mircea markus
Are you able to place a helper class outside the EJB.jar? If you can, then that should help. The helper class could read the properties file for your EJB. -
how can I load a properties file drom a sessin EJB ,in JBoss?[ Go to top ]
- Posted by: hoi tsang
- Posted on: September 17 2002 14:47 EDT
- in response to mircea markus
helo, i suggest you *bind* the directory path of the properties file into to an JNDI variable, and use an external class (e.g. Command type class) to lookup the path of the file from the JNDI directory and load the properties for you... -
how can I load a properties file drom a sessin EJB ,in JBoss?[ Go to top ]
- Posted by: Sven van t Veer
- Posted on: September 17 2002 17:23 EDT
- in response to mircea markus
<quote>
My problem is that I MUST load a .properties file from a session bean and I cant make that from the .jar.A solution is to put it in the JNDI server ,but..
</quote>
Thou shall not use io in EJB (see the specs). It´s not threadsafe, not clusterable etc etc. Use JNDI & the ejb environment. -
how can I load a properties file drom a sessin EJB ,in JBoss?[ Go to top ]
- Posted by: Ravi Shankar
- Posted on: September 18 2002 05:52 EDT
- in response to Sven van t Veer
Sven said:
> Thou shall not use io in EJB (see the specs). It´s not
> threadsafe, not clusterable etc etc. Use JNDI & the ejb
> environment.
But I thought you were allowed to use any class from java.util.* (including java.util.Properties)?
- Ravi
-
how can I load a properties file drom a sessin EJB ,in JBoss?[ Go to top ]
- Posted by: John Pletka
- Posted on: September 18 2002 11:21 EDT
- in response to mircea markus
You are not allowed to use the io package from within EJB, however you are allowed to use the ClassLoader. What you do is put the properties file in your classpath the call this.getClass().getResourceAsStream("/my.properties"), then populate the Property object with the input stream.