Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » java.lang.NoSuchFieldError: _persistence_listener
java.lang.NoSuchFieldError: _persistence_listener [message #664341] Fri, 08 April 2011 12:41 Go to next message
Marek Pribyl is currently offline Marek PribylFriend
Messages: 4
Registered: April 2011
Junior Member
Hi all,
I have problem with my spring/jpa/eclipselink webapp. it works pefectly on my local machine, but when deployed to the server it ends up with error:

java.lang.NoSuchFieldError: _persistence_listener


both machines are 64bit gentoo linux with sun jdk 1.6.24, Tomcat 7.0_12 & mysql 5.1.

I use spring 3.0.5, jpa 2, eclipselink-2.2.0

jpa annotations are placed to the getters and spring's application context contains:

 <bean id="entityManagerFactory"  class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
                <property name="persistenceUnitName" value="Test"/>
                <property name="dataSource" ref="dataSource" />
                <property name="jpaVendorAdapter" ref="jpaVendorAdapter"/>
                <property name="jpaDialect">
            <bean class="org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect" />
        </property>
        <property name="persistenceProvider">
            <bean class="org.eclipse.persistence.jpa.PersistenceProvider" />
        </property>
        <property name="jpaProperties">
                <props>
                        <prop key="eclipselink.weaving.internal">false</prop>
                        <prop key="eclipselink.ddl-generation">drop-and-create-tables</prop>
                        <prop key="eclipselink.ddl-generation.output-mode">database</prop>
                </props>
        </property>
        </bean>




thanks in advance for any hint
marek
Re: java.lang.NoSuchFieldError: _persistence_listener [message #664684 is a reply to message #664341] Mon, 11 April 2011 15:18 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1039
Registered: July 2009
Senior Member
Hello,

The problem seems to be that EclipseLink assumes the code has been weaved, but an agent is not being used. I am not sure why <prop key="eclipselink.weaving.internal">false</prop>
is being used, as this only affects weaving in optimizations. To tell EclipseLink that weaving has not been done, you would need to use:
<prop key="eclipselink.weaving">false</prop>

An alternative is to statically weave your classes before deployment so that lazy relationships can be used. See
http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_(ELUG)#How_to_Configure_Static_Weaving_for_JPA_Entities

Best Regards,
Chris
Re: java.lang.NoSuchFieldError: _persistence_listener [message #665068 is a reply to message #664684] Wed, 13 April 2011 07:44 Go to previous message
Marek Pribyl is currently offline Marek PribylFriend
Messages: 4
Registered: April 2011
Junior Member
Hi Chris,
thanks for your help, I already used the <prop key="eclipselink.weaving">false</prop> which solved the problem. But I'm still curious why the problem occurs on the server deployment only.

I'm new to the EclipseLink so the <prop key="eclipselink.weaving.internal">false</prop> was just a desperate attempt to solve the problem I found somewhere;-)

I'll definitely take a look on the static weaving as well.

Thanks again,
Marek
Previous Topic:EntityManager can't find entities with URLClassLoader
Next Topic:Create more than one EntityManagerFactory for the same PersistenceUnit
Goto Forum:
  


Current Time: Fri Nov 28 19:43:27 GMT 2014

Powered by FUDForum. Page generated in 0.01789 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software