title: What are reasons for eclipselink failing to autodetect entity classes?
body: <p>I'm running eclipselink in an OSGi container and my entity classes are in their own bundle.</p>
  
  <p>I have repeatedly run into the problem that Eclipselink fails to autodetect the entity classes, resulting in "Xyz is not a known entity type" messages. This is painful to debug and my somewhat helpless approach is to more or less randomly tweak configuration files until it works.</p>
  
  <p>I wish I knew a more systematic approach, but I don't seem to know enough about possible reasons for the problem. What could they be? Is there an overview of what happens in autodetection and what is required for it to work?</p>
  
  <p>So if you ran into the problem yourself and were able to determine one specific reason, post it here, or vote it up when you already see it. That way we could produce a list of typical issues sorted by frequency. I'll add the ones I actually solved.</p>
  
  <p>Facts I know:</p>
  
  <ul>
  <li>eclipselink uses the OSGi extender pattern to listen for bundles registering and then sets them up</li>
  <li>it supposedly uses the class loader for the bundle that defines the persistence unit, if you're using a <code>persistence.xml</code> for configuration, this is the bundle where that file should be located.</li>
  </ul>