This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Business logic is best placed in Session EJB. Any helper classes associated with business logic should be instantiated in the Session EJB.
Message-driven EJB should handle processing messages and fowarding whatever data there is to a Session EJB for executing business logic.
Joined: Oct 05, 2006
Ok, but still, how can I load a properties file? The helper classes need access to the properties.
Or, is there a better way to do this? I only have limited experience with j2ee and ejbs....
Joined: Apr 16, 2008
The first thing you should do is write a simple, standalone Java program that loads file-based properties with the java.util.ResourceBundle class.
Once you have this working correctly, then you should incorprate this code in your business object(s) (Session EJB).
Then you must make sure that you are placing the properties file in a location where it (a) can be read by the Session EJB and (b) is loaded into the EJB module (JAR) or EAR file.
If you deploy the application or module without the properties file, it will not be read.
If you deploy the application or module and have the properties file not in the correct location, it will not be read.
So, you first have to ensure that you have written the code correctly. Then once you are sure, then you can work on finding the right location to place the properties file and then deploy the application or module. [ December 08, 2008: Message edited by: James Clark ]