Announcement Announcement Module
No announcement yet.
spring-agent context level loading throws Unknown entity exception Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring-agent context level loading throws Unknown entity exception

    My spring/jpa web application which run in side tomcat server.
    It was run perfectly when we did loadtime weaving in tomcat file as global level.

    configurations as follows:


    <bean id="entityManagerFactory"
    class="org.springframework.orm.jpa.LocalContainerE ntityManagerFactoryBean">
    <property name="persistenceUnitName"
    value="abpersists" />
    <property name="dataSource" ref="dataSource" />
    <property name="jpaVendorAdapter">
    class="org.springframework.orm.jpa.vendor.TopLinkJ paVendorAdapter">
    <property name="showSql" value="true" />
    <property name="generateDdl" value="true" />
    <property name="databasePlatform"
    value="oracle.toplink.essentials.platform.database .MySQL4Platform" />
    <property name="loadTimeWeaver">
    class="org.springframework.instrument.classloading .InstrumentationLoadTimeWeaver" />

    persistence.xml file :

    <persistence xmlns=""
    xsi:schemaLocation="" version="1.0">

    <persistence-unit name="abpersists" transaction-type="RESOURCE_LOCAL">
    <provider>oracle.toplink.essentials.ejb.cmp3.Entit yManagerFactoryProvider</provider>



    Later i change the JAVA_OPT to application context level, so for it i did the following changes: JAVA_OPT for spring-agent.jar was removed. and bring it to context level

    2.<Context path="/abc-service" docBase="C:\apache-tomcat-6.0.20\abc\abc-service.war"
    debug="0" privileged="true">
    <Loader loaderClass="org.springframework.instrument.classl oading.tomcat.TomcatInstrumentableClassLoader"/>

    3.spring config file loadtime weaver changed to following:
    <property name="loadTimeWeaver">
    <bean class="org.springframework.instrument.classloading .ReflectiveLoadTimeWeaver"/>

    All beans marked with @Entity annotation.

    @Table (name = "USER")
    public class User implements Serializable {



    data base is mysql,it uses mysql-connector-java-5.1.13-bin.jar and uses spring 2 version.
    persistence.xml is inside META-INF of the jar which contains entity beans.
    after the change when application connect to db successfully and try to execute loading entities it throws the following error

    java.lang.IllegalArgumentException: Unknown entity bean class: class, please verify that this class has been marked with the @Entity annotation.

    Thanks in advance, any help highly appreciated.