Discussions

EJB programming & troubleshooting: How to add external jar to EJB project

  1. How to add external jar to EJB project (2 messages)

    Hi, Using eclipse Ganymede, What is the "formal" method of adding an external JAR to the EJB project, not to be classloaded by the EAR classloader. That is, I don't want to add the jar to the EAR, but only to the EJB project.. What I did is add the JAR to the build classpath of the EJB project and then I chose it in the project's J2EE module dependencies. Is it OK? In addition, for some reason not clear to me, eclipse insists that I mark this JAR for export in the build path.. Daniel

    Threaded Messages (2)

  2. A second thought...[ Go to top ]

    Maybe, after all, this is platform dependent. For example, I am using weblogic 8.1 which provides only one class loader per EAR, so all ejb.jars inside EAR share the same classloader and the EAR does not have a separate classloader. In this case, there is no meaning in loading this jar in the EJB classloader only. But what about other servers where there are actually separate classloaders for EAR and EJB? (Websphere is like that if I am not mistaken..)
  3. You can create shared libraries[ Go to top ]

    I think you can created shared libraries and when app is deployed associate these shared libs to the project.