Announcement Announcement Module
Collapse
No announcement yet.
atEntity tag missing while it is there?? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • atEntity tag missing while it is there??

    Hello,

    I made a webapplication with Spring + JPA + Toplink Essentials + ADF FACES.
    In that application everything runs all fine, but now I had to take some code out of it and drop it into a brand new standalone application.

    The standalone application also uses Spring + JPA + toplink Essentials. The coding program I'm using for this project is JDeveloper 10.1.3.2.0.4066.
    So I took out the major function of the webapplication (read/write function in database) and didn't change anything anymore to it.

    Now when I try to run the JAR file (deployed from the project), I keep on getting this error message:
    PHP Code:
    java.lang.IllegalArgumentExceptionUnknown entity bean class: class be.roularta.scenario.domain.Definitionplease verify that this class has been marked with the atEntity annotation
    Can anybody help me with this problem?

    SPRING.XML:
    PHP Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans ...>
                
        <!-- BEGIN JPA Configuration -->
            <import resource="environment.xml"/>
            
        <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
            <property name="persistenceUnitName" value="fullaccess"/>
            <property name="loadTimeWeaver" ref="weaver"/>
            <property name="jpaVendorAdapter" ref="vendorAdapter"/>
        </bean>
        <bean id="vendorAdapter" class="org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter">
            <property name="databasePlatform" value="ORACLE"/>
            <property name="showSql" value="true"/>
            <property name="generateDdl" value="false"/>
        </bean>
        <bean id="weaver" class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/>
        <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
            <property name="entityManagerFactory" ref="entityManagerFactory"/>
        </bean>
        <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
        <tx:annotation-driven/>
        <!-- END JPA Configuration -->
            
        <!-- BEGIN DAO Configuration -->  
            <bean id="articleDAO" class="be.roularta.scenario.dao.jpa.JPAArticleDAO"/>
            <bean id="definitionDAO" class="be.roularta.scenario.dao.jpa.JPADefinitionDAO"/>
            <bean id="editionDAO" class="be.roularta.scenario.dao.jpa.JPAEditionDAO"/>
            <bean id="editionExportDAO" class="be.roularta.scenario.dao.jpa.JPAEditionExportDAO"/>
            <bean id="exportDAO" class="be.roularta.scenario.dao.jpa.JPAExportDAO"/>
            <bean id="groupDAO" class="be.roularta.scenario.dao.jpa.JPAGroupDAO"/>
            <bean id="groupPubEdDAO" class="be.roularta.scenario.dao.jpa.JPAGroupPubEdDAO"/>
            <bean id="issueDAO" class="be.roularta.scenario.dao.jpa.JPAIssueDAO"/>
            <bean id="issueExportDAO" class="be.roularta.scenario.dao.jpa.JPAIssueExportDAO"/>
            <bean id="periodicityDAO" class="be.roularta.scenario.dao.jpa.JPAPeriodicityDAO"/>
            <bean id="publicationDAO" class="be.roularta.scenario.dao.jpa.JPAPublicationDAO"/>
            <bean id="scenarioDAO" class="be.roularta.scenario.dao.jpa.JPAScenarioDAO"/>
            <bean id="scenarioHistoryDAO" class="be.roularta.scenario.dao.jpa.JPAScenarioHistoryDAO"/>
            <bean id="scenarioItemStatusDAO" class="be.roularta.scenario.dao.jpa.JPAScenarioItemStatusDAO"/>
            <bean id="scenarioStatusDAO" class="be.roularta.scenario.dao.jpa.JPAScenarioStatusDAO"/>
            <bean id="statusDAO" class="be.roularta.scenario.dao.jpa.JPAStatusDAO"/>
            <bean id="pdfDAO" class="be.roularta.scenario.dao.file.FilePDFDAO">
                <property name="environmentConfig" ref="environmentConfiguration"/>
            </bean>
            <bean id="excelDAO" class="be.roularta.scenario.dao.file.FileEXCELDAO">
                <property name="environmentConfig" ref="environmentConfiguration"/>
            </bean>
        <!-- END DAO Configuration -->
            
            <!-- BEGIN SERVICE Configuration -->
            <bean id="dataService" class="be.roularta.scenario.service.impl.DataServiceImpl">
                <constructor-arg ref="editionDAO"/>
                <constructor-arg ref="scenarioDAO"/>
                <constructor-arg ref="scenarioHistoryDAO"/>
                <constructor-arg ref="scenarioItemStatusDAO"/>
                <constructor-arg ref="scenarioStatusDAO"/>
                <constructor-arg ref="groupDAO"/>
            </bean>
            <bean id="scenarioService" class="be.roularta.scenario.service.impl.ScenarioServiceImpl">
                <constructor-arg ref="definitionDAO"/>
                <constructor-arg ref="editionDAO"/>
                <constructor-arg ref="issueDAO"/>
                <constructor-arg ref="pdfDAO"/>
                <constructor-arg ref="scenarioDAO"/>
                <constructor-arg ref="scenarioHistoryDAO"/>
                <constructor-arg ref="scenarioItemStatusDAO"/>
                <constructor-arg ref="scenarioStatusDAO"/>
                <constructor-arg ref="environmentConfiguration"/>
            </bean>
            <!-- END SERVICE Configuration -->
    </beans>
    PERSISTENCE.XML (in META-INF folder)
    PHP Code:
    <?xml version="1.0" encoding="UTF-8" ?>
    <persistence    version="1.0" ...>
        <persistence-unit name="fullaccess" transaction-type="RESOURCE_LOCAL">
            <properties>
                <property name="toplink.jdbc.user" value="webe"/>
                <property name="toplink.jdbc.password" value="webe"/>
                <property name="toplink.jdbc.url"
                          value="jdbc:oracle:thin:atONTW:1521:DBV1"/>
                <property name="toplink.jdbc.driver"
                          value="oracle.jdbc.OracleDriver"/>
            </properties>
        </persistence-unit>
    </persistence>
    DEFINITION.JAVA
    PHP Code:
    package be.roularta.scenario.domain;

    import java.io.Serializable;
    import java.util.List;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.Id;
    import javax.persistence.NamedQueries;
    import javax.persistence.NamedQuery;
    import javax.persistence.OneToMany;
    import javax.persistence.SequenceGenerator;
    import javax.persistence.Table;

    atEntity
    atNamedQueries
    ({
        
    atNamedQuery(name "Definition.getDefinitions"
                    
    query "select o from Definition o"),
        
    atNamedQuery(name "Definition.getDefinitionByCode"
                    
    query "select o from Definition o where o.definitionCode = :code")
    })
    atTable(name "WEBE_MAKR_DEFINITIE")
    public class 
    Definition implements Serializable {

        
    atId
        atGeneratedValue
    (generator "DefinitionSeqGenerator")
        
    atSequenceGenerator(name "DefinitionSeqGenerator"sequenceName "s_webe_makr_definitie"allocationSize 1)
        
    atColumn(name="DEFINITIE_ID"nullable false)
        private 
    Long definitionID;
        
        
    atColumn(name="DEFINITIE_CODE")
        private 
    String definitionCode;
        
    atColumn(name="OMSCHRIJVING")
        private 
    String description;
        
        
    atOneToMany(mappedBy "definition")
        private List<
    EditionDefinitioneditionDefinitionList;
        
    atOneToMany(mappedBy "definition")
        private List<
    ScenarioStatusscenarioStatusList;

        
    // CONSTRUCTOR
        
        
    public Definition(){}
        
        public 
    Definition(String definitionCodeString description) {
            
    this.definitionID null;
            
    this.definitionCode definitionCode;
            
    this.description description;
            
    this.editionDefinitionList null;
            
    this.scenarioStatusList null;
        }

        
    // GETTERS

        
    public Long getDefinitionID() {
            return 
    definitionID;
        }
        
        public 
    String getDefinitionCode() {
            return 
    definitionCode;
        }

        public 
    String getDescription() {
            return 
    description;
        }

        public List<
    EditionDefinitiongetEditionDefinitionList() {
            return 
    editionDefinitionList;
        }

        public List<
    ScenarioStatusgetScenarioStatusList() {
            return 
    scenarioStatusList;
        }

        
    // SETTERS
        
        
    public void setDefinitionID(Long definitionID) {
            
    this.definitionID definitionID;
        }
        
        public 
    void setDefinitionCode(String definitionCode) {
            
    this.definitionCode definitionCode;
        }

        public 
    void setDescription(String description) {
            
    this.description description;
        }

        public 
    void setEditionDefinitionList(List<EditionDefinitioneditionDefinitionList) {
            
    this.editionDefinitionList editionDefinitionList;
        }

        public 
    void setScenarioStatusList(List<ScenarioStatusscenarioStatusList) {
            
    this.scenarioStatusList scenarioStatusList;
        }

        
    // EXTRA METHODS

        
    public EditionDefinition addEditionDefinition(EditionDefinition editionDefinition) {
            
    getEditionDefinitionList().add(editionDefinition);
            
    editionDefinition.setDefinition(this);
            return 
    editionDefinition;
        }

        public 
    EditionDefinition removeEditionDefinition(EditionDefinition editionDefinition) {
            
    getEditionDefinitionList().remove(editionDefinition);
            
    editionDefinition.setDefinition(null);
            return 
    editionDefinition;
        }

        public 
    ScenarioStatus addScenarioStatus(ScenarioStatus scenarioStatus) {
            
    getScenarioStatusList().add(scenarioStatus);
            
    scenarioStatus.setDefinition(this);
            return 
    scenarioStatus;
        }

        public 
    ScenarioStatus removeScenarioStatus(ScenarioStatus scenarioStatus) {
            
    getScenarioStatusList().remove(scenarioStatus);
            
    scenarioStatus.setDefinition(null);
            return 
    scenarioStatus;
        }

    I'm using the Spring-Agent.jar to start Spring inside the project.

    Thanks in advance
Working...
X