title: Access class in EJB project from War project in EAR project?
body: <p>I am creating a project based on MDB's and classes supporting those MDB's. I also need to use a ServletContextListener to interact with the MDB universe (details below), meaning I need a WAR project.</p>
  
  <p>Question: How can the ServletContextListener access a class in the EJB project? </p>
  
  <p>Project organization (standard Eclipse EAR project):</p>
  
  <p>EAR Project
    has some jars in it
  EJB Project
    has some MDB's and lots of other classes used by MDB's
  WAR Project
    has ServletContextListener. </p>
  
  <p>Why am I doing this? I need to start a thread when the project starts. This thread needs access to a bunch of the classes also used by the MDB's.</p>
  
  <p>NOTE: I understand that I could put these common classes into a jar in the EAR project. If there is a way to do this such that a single eclipse "Debug As"->"On Server" then that would constitute a good solution. Whatever solution is provided needs to support that debug on server, with step debugging into all classes.</p>
  
  <p>NOTE 2: I can tell Eclipse that the WAR project is dependent on the EJB project, which removes the Eclipse error flags, but eclipse shows a warning that this dependency will not exist in the deployed project, meaning my classes accessed from the WAR will fail to instantiate at runtime.</p>