Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Datanucleus warning: Class was specified in persistence-unit but not annotated, so ignoring

When starting up my app I see for every class this warning:

WARN  [DataNucleus.MetaData] - Class com.mycomp.MyClass was specified in persistence-unit myPersistenceUnit but not annotated, so ignoring

The app starts up correctly so there is no direct issue, but I'm wondering where this coming form, and how to avoid id.

My persistence.xml looks like:

<persistence-unit name="myPersistenceUnit">
    <provider>org.datanucleus.api.jpa.PersistenceProviderImpl</provider>
    <properties>
        <property name="datanucleus.ConnectionURL" value="appengine" />
        <property name="datanucleus.NontransactionalRead" value="true" />
        <property name="datanucleus.NontransactionalWrite" value="true" />
        <property name="datanucleus.appengine.datastoreEnableXGTransactions" value="true" />
        <property name="datanucleus.jpa.addClassTransformer" value="false" />
    </properties>
</persistence-unit>

I'm running my app on Google App Engine with Spring.

But I can't find the origin of the warnings. Something seems to be telling my app to do some check for all classes.

PS: I'm defining my entityManagerFactory as follows:

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
    LocalContainerEntityManagerFactoryBean entityManagerFactory = new LocalContainerEntityManagerFactoryBean();
    entityManagerFactory.setPersistenceUnitName("myPersistenceUnit");
    entityManagerFactory.setPersistenceUnitPostProcessors(new ClasspathScanningPersistenceUnitPostProcessor("com.mycomp.domain"));
    return entityManagerFactory;
}

Any help appreciated.

like image 948
Marcel Overdijk Avatar asked Apr 07 '13 18:04

Marcel Overdijk


1 Answers

You aren't including any < jar-file > or < class > tags in your persistence.xml, so my guess is that your application is searching for Entities in all the classes it can reach. Maybe you are mixing Entity with non-Entity classes in the same java package. You don't say much about the pacakges or your classes really.

like image 187
E. Celis Avatar answered Sep 24 '22 05:09

E. Celis