title: How to performe openJPA enhancement at runtime?
body: <p>I am trying to deploy dynamic web project with openJPA faset to the TomEE Plus server. However, when I launch application on the server it gives me the following error: </p>
  
  <blockquote>
    <p>111  INFO   [main] openjpa.Runtime - OpenJPA dynamically loaded a validation provider.
    131  INFO   [main] openjpa.Runtime - Starting OpenJPA 2.2.0
    202  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.MySQLDictionary".</p>
  </blockquote>
  
  <pre><code>Exception in thread "main" &lt;openjpa-2.2.0-r422266:1244990 nonfatal user error&gt; org.apache.openjpa.persistence.ArgumentException: This configuration disallows runtime optimization, but the following listed types 
  were not enhanced at build time or at class load time with a javaagent: "
      de.webshop.internal.db.Producer
      de.webshop.internal.db.Stock
      de.webshop.internal.db.Product".
  
  at org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:115)
  at org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
  at org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
  at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
  at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
  at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
  at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
  at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
  at de.webshop.inventory.service.business.logic.utils.ProductAvailabilityInStock.isEnoughProductsInStock(ProductAvailabilityInStock.java:43)
  at de.webshop.inventory.service.implementation.InventoryWebService.CheckOrderItemsAvailability(InventoryWebService.java:52)
  at test.de.webshop.TestClass.testWBService(TestClass.java:40)
  at test.de.webshop.TestClass.main(TestClass.java:12)
  </code></pre>
  
  <p>What are your suggestions?</p>