Question

In Weblogic 10.3, the JAR containing the EJB below along with the persistence file, is deployed. But Weblogic deploys it as Type "Library" instead of an "EJB", which is not what I want.

package com.sajee;
import javax.persistence.*;

@Entity
@Table(name="REGISTRAR")

public class Registrar implements java.io.Serializable
{
    private int courseId, registered;
    public Registrar ( ) { }

    @Id
    @Column(name="courseId")
    public int getCourseId( ) { return courseId; }
    public void setCourseId(int pk) { courseId = pk; }

    @Column(name="number_students_registered")
    public int getRegistered( ) { return registered; }
    public void setRegistered(int reg) {registered = reg; }

}

<persistence>
<persistence-unit name="SRS" transaction-type="JTA">
    <jta-data-source>myDataSource</jta-data-source> 
    <non-jta-data-source>myDataSource</non-jta-data-source> 
    <properties>
        <property name="openjpa.jdbc.DBDictionary" value="derby" /> 
    </properties>
 </persistence-unit>
</persistence>

Any ideas on what I'm doing wrong? How would I troubleshoot this?

Was it helpful?

Solution

The above class is not really an EJB, no EJB annotation or descriptor. It's different from an Entity Bean in EJB 2.x.

You could have a stateless EJB to manage the JPA entity with the stateless annotation or the XML descriptor.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top