Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Where should I put common classes that are used by more than one EJB?

classes common EJB Used
0
Posted

Where should I put common classes that are used by more than one EJB?

0

1) If two EJBs use the same classes, include theses classes in one of the EJBs. Place both EJBs in the same JAR file. After deployment, both EJBs will be able to use the common classes. 2) Place the commonly used class files in a JAR file, which you place in the $J2EE_HOME/lib directory for 9.0.3 and lower and $J2EE_HOME/applib for 9.0.4. Then all applications deployed in OC4J can use these supporting classes. 3) Because “child applications can access classes that exist within a “parent” application, place the commonly used classes in a parent application. All EJBs that use these classes should define the application that contains the common classes as its parent by adding the parent attribute to its element in the server.xml file as follows: The parent attribute defines an optional parent application, where the default is the global application. The child

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123