"is not a known entity" error from EclipseLink
===

I'm seeing a strange behavior in **Weblogic** (10.3.3) when using **EclipseLink** (2.0.2).

Here is what I do. I use Maven to compile a project in which I use **JPA** (1.0.2). In this project, **module "A"** depends on **module "B"**. "B" contains a bunch of Entities ( *javax.persistence.Entity* ). But "**persistence.xml**" is in "A" in which all entities of "B" are registered. "B" is deployed as an **Optional Package** and "A" refers to it via its MANIFEST.

Deployment is successful but when I run the application and try to persist an entity I get the above error in "A".

One of the following actions will solve it:

- Restart the weblogic server
- Update module A's POM file and explicitly add a dependency to module B. Originally this dependency is not there because classes in module A accept "Object" and pass that through to EntityManager (not explicitly the entity class type). Adding this dependency doesn't change the JAR file's manifest in anyway. It only update the "maven" directory in JAR file's META-INF folder. I don't think weblogic even care about this folder.

I downloaded EclipseLinks' source and debugged the application. It seems that the problem occurs because "***descriptors***" collection field in "***org.eclipse.persistence.internal.sessions.AbstractSession***" class doesn't have the entity's descriptor and thus it doesn't recognize it as an Entity. 

I reckon restarting the server updates that cache. But what about the second solution? Why is that working? Is "maven" directory in JAR file's META-INF directory known to weblogic?