title: jpa eclipse juni ClassNotFoundException org.hibernate.collection.internal.PersistentBag
body: <p>I'm have the following scenario:</p>
  
  <p><strong>Classes</strong></p>
  
  <pre><code>@javax.persistence.Entity(name = "attribute_values")
  public class AttributeValue {
      @javax.persistence.Id
      private long id;
  
      @javax.persistence.Column
      private String name;
  
      @javax.persistence.Column
      private String value;
  
      //.... Getters and Setters methods
  
  }
  
  @javax.persistence.Entity(name = "attributes")
  public class Attribute {
      @javax.persistence.Id
      private long id;
  
      @javax.persistence.Column
      private String name;
  
      @OneToMany
      @JoinColumn(name = "product_attribute_id", referencedColumnName = "id")
      private java.util.List&lt;AttributeValue&gt; values = new java.util.ArrayList&lt;AttributeValue&gt;();
  
      //.... Getters and Setters methods
  
  }
  
  @javax.persistence.Entity(name = "products")
  public class Product {
      @javax.persistence.Id
      private long id;
  
      @javax.persistence.Column
      private String name;
  
      @OneToMany
      @JoinTable(name = "attributes_by_product",
                              joinColumns ={ @JoinColumn(name = "product_id") },
                              inverseJoinColumns = { @JoinColumn(name = "attribute_id") })
      private java.util.List&lt;Attribute&gt; attributes = new java.util.ArrayList&lt;Attribute&gt;();
  
  
      //.... Getters and Setters methods
  }
  
  @javax.ejb.Remote
  public interfaces ProductServices {
      public Product getProduct(long id);
  }
  
  @javax.ejb.Stateless
  public class ProductServicesImpl implements ProductServices {
  
      @javax.persistence.PersistenceContext(unitName = "myPU")
      private javax.persistence.EntityManager entityManager;
  
      @Override
      public Product getProduct(long id) {
          return this.entityManager.find(Product.class, id);
      }
  }
  </code></pre>
  
  <p>I have deployed the EJB component in an Jboss AS7 and I'm making a remote invocation using a Junit test case in Eclipse Kepler, but I'm getting this exception:</p>
  
  <pre><code>Caused by: java.lang.ClassNotFoundException: org.hibernate.collection.internal.PersistentBag
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:249)
      at org.jboss.marshalling.AbstractClassResolver.loadClass(AbstractClassResolver.java:135)
      at org.jboss.marshalling.AbstractClassResolver.resolveClass(AbstractClassResolver.java:116)
      at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:892)
      at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1204)
      at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272)
      at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
      at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1677)
      at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1593)
      at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1235)
      at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272)
      at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
      at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37)
      at org.jboss.ejb.client.remoting.MethodInvocationResponseHandler$MethodInvocationResultProducer.getResult(MethodInvocationResponseHandler.java:107)
      at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:270)
      at org.jboss.ejb.client.TransactionInterceptor.handleInvocationResult(TransactionInterceptor.java:47)
      at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:272)
      at org.jboss.ejb.client.ReceiverInterceptor.handleInvocationResult(ReceiverInterceptor.java:132)
      at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:260)
      at org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:399)
      at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:140)
      at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)
      at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)
      ... 27 more
  </code></pre>
  
  <p>Somebody knows what is wrong there?</p>
  
  <p>Thanks a lot guys !</p>