Property file in EJB


EJB programming & troubleshooting: Property file in EJB

  1. Property file in EJB (2 messages)

    Hi, i have a DB helper class which all the EJBs are using. Now for initializing the DB Helper class, i am using a prperty file (for example to read the Data source JNDI name). Can someone tell me where should i put the .propeteis file so that it would be visible to the DB Helper class? DB helper class is packaged in the ejb jar along with other EJB classes. the property file is also required for Log4J initialization.

    Thanks in advance


    Threaded Messages (2)

  2. Property file in EJB[ Go to top ]

    One of the options is to pass the path of properties file to JVM ,
    thus you can construct the file path at run time.
  3. Property file in EJB[ Go to top ]

    Use resource bundles to look up the property file for yourself. If you are writing EJB code then you should be using the Deployment descriptor to provide this information to the bean. Please look at the resource mappings in the deployment descriptors.

    Hope this helps.