Bean-Managed Persistent Entity Bean - SDA

Hello,
I wrote a BMP Entity Bean and it should use a data dictionary that i already have defined, but i do not know what should i write in the ejb-jar.xml file in order to get it works. Could you please tell me what should i write?
<resource-ref>
  <res-ref-name>???</res-ref-name>
  <res-type>????<res-type>
</resource-ref>
Thanks for your help,
SAPLernen

Hello,
I wrote a BMP Entity Bean and it should use a data dictionary that i already have defined, but i do not know what should i write in the ejb-jar.xml file in order to get it works. Could you please tell me what should i write?
<resource-ref>
  <res-ref-name>???</res-ref-name>
  <res-type>????<res-type>
</resource-ref>
Thanks for your help,
SAPLernen

Similar Messages

  • Container Managed Persistence entity bean relationship fields

    I want to ask something that until now still confuse. Did Relationship fields in Container Managed Persistence entity beans declare , inside Database table or only Persistence fields .
    If Relationship fields not declare inside database table ,how if SQL calls the relationship fields between related entity bean.
    did container handle this task.
    example: I have 2 entity bean with CMP(Container Managed Persistence)version 2.0
    call Player and Team. every entity bean have own relationship fields and persistence fields.
    player has playerId(primary key),name,position,age persistence fields and teams is relationship fields.
    team has teamId(primary key),name,city and players is relationship fields.
    I know that all persistence fields is declare in own database table but how about relationship fields.
    can you tellme, How SQL calls can access relationship fields if relatiosnship fields is not declare in database table.
    I use J2EE RI SDK version 1.3
    and deploytool .
    thank's .

    thank's for your reply .Now I have another problem
    I use J2EE RI from java.sun .I try to follow example in j2eetutorial about CMP Example call RosterApp.ear .
    I dont'change anything code inside RosterApp.ear but when I deploy and runclient command thereis syntax error :
    java.rmi.ServerException: Remote exception occured in server thread :nested exception is java.rmi.ServerException :exception thrown from bean :nested exception is : java.ejb.EJBException :nested exception is :java.sql.SQLException :syntax error or access violation ,message from server: "you have an error in SQL syntax near "
    "leagueBeanTable" WHERE "leagueId" = 'L1' at line 1
    in example ,RosterApp.ear use Cloudscape database ,but I try to use Mysql database for RosterApp.ear ,is there any different syntax SQL from Cloudscape to Mysql .
    if like that ,so I must edit first SQL calls from Cloudscape to MYSQL . I think because relationship fields is for entity beans only ,so how if mysql database want to access foreign key another table because foreign key isn't declare in databse table.
    example : I have 3 entity bean call player, team, league .
    1. PlayerEJB have persistence fields name, position, playerId(primary key), cmr fields is teams
    2. TeamEJB have persistence fields name, city, teamId (primary key) , cmr fields is players and leagues .
    3. LeagueEJB have persistence fields name ,sport, leagueId(primary key), cmr fields is teams
    so table is
    PlayerEJB <--->TeamEJB<--->LeagueEJB
    Player have some finder method call findBySport(String Sport) .
    because Sport is persistence fields for LeagueEJB
    so PlayerEJB must traverse TeamEJB first before LeagueEJB
    EJB QL : SELECT distinct object(p) FROM Player (p) IN (p.teams) AS t
    WHERE t.league.sport = ?1
    I know that Container will translates EJB QL to SQL calls ,but default is only for cloudscape database and I use for MYsql .
    so can you helpme how to query method findBySport(String sport) to Mysql calls .
    thereis no foreign key between table in database table there is only Relationship fields in entity bean.

  • Persist Entity Bean in flat file?

    Is it possible to persist entity bean in a flat file? I need to persist a single value (sequence number) and I can not use database to do so.
    I would need to run this in a clustered environment and need to recover the value if something goes wrong. The statefull bean would almost do except when one server fails before it replicates value onto another box.
    thx.

    Steve Edens wrote:
    I'm also trying to get a grip on the best way to handle some static application properties in a clustered environment. My need mostly relates to
    a need to read in some flat file type properties and then store them someplace
    where business logic can call them as needed.. Like a static hashmap or
    something. But someone mentioned Entity beans, BMP, etc..
    Now.. here's the strange part of the message.
    Back in 1999 I traveled over to our west coast office in San Francisco. I was meeting and greeting the staff there and along the way I had a short
    meeting with someone named Bisera Ferrero. I mention this event because I
    was really impressed with the beauty and charm of Bisera. Therefore, I guess
    I'm a fan. I rememered the name.. a little. Really, I had sort of forgotten
    about it until reading this forum this morning. So.. who knows. I guess
    there could be a lot of Bisera Ferrero names on our planet.
    Good luck in your quests..

  • Container-managed persistence Entity bean

    WE use a container-managed persistence Entity bean. To handle the state synchronization between the object & the database, what must WE do?
    Thanks in Advance

    That's the container's job. You can use the commit option A/B/C to control how the DB and objects are synchronized.
    -Scott
    http://www.swiftradius.com

  • Deploying Entity Bean Managed Persistant Example.

    Here is my error after running the client:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.RemoteException: Transaction aborted; nested exception is: javax.transaction.RollbackException; nested exception is:
    javax.transaction.RollbackException
    at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:170)
    at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
    at Test1HomeStub.create(Unknown Source)
    at Test1Client.main(Unknown Source)
    Here is the J2EE Verification error (allthough it deploys sucessfully I get this error for all the
    tuitorial examples)
    Error: [ ejb/SimpleTest1 ] class [ Test1Home ] cannot be found within this jar [ app-client-ic.jar ].
    For [ app-client-ic.jar ]
    Error: [ ejb/SimpleTest1 ] class [ Test1 ] cannot be found within this jar [ app-client-ic.jar ].
    I have edited the SavingsAccount example so it has only got one table, two fields and a couple of methods. Here is the code:
    create.sql
    drop table test1;
    create table test1
    (id varchar(3) constraint pk_test1 primary key,
    firstname varchar(24) );
    exit;
    Test!Bean.java
    import java.sql.*;
    import javax.sql.*;
    import java.util.*;
    import javax.ejb.*;
    import javax.naming.*;
    public class Test1Bean implements EntityBean {
    private final static String dbName = "java:comp/env/jdbc/Test1DB";
    private String id;
    private String firstName;
    private EntityContext context;
    private Connection con;
    public String getFirstName() {
    return firstName;
    public String ejbCreate(String id, String firstName) throws CreateException {
    try {
    insertRow(id, firstName);
    } catch (Exception ex) {
    throw new EJBException("ejbCreate: " + ex.getMessage());
    this.id = id;
    this.firstName = firstName;
    return id;
    public String ejbFindByPrimaryKey(String primaryKey)
    throws FinderException {
    boolean result;
    try {
    result = selectByPrimaryKey(primaryKey);
    } catch (Exception ex) {
    throw new EJBException("ejbFindByPrimaryKey: " + ex.getMessage());
    if (result) {
    return primaryKey;
    } else {
    throw new ObjectNotFoundException("Row for id " + primaryKey +
    " not found.");
    public void ejbRemove() {
    try {
    deleteRow(id);
    } catch (Exception ex) {
    throw new EJBException("ejbRemove: " + ex.getMessage());
    public void setEntityContext(EntityContext context) {
    this.context = context;
    public void unsetEntityContext() {
    public void ejbActivate() {
    id = (String) context.getPrimaryKey();
    public void ejbPassivate() {
    id = null;
    public void ejbLoad() {
    try {
    loadRow();
    } catch (Exception ex) {
    throw new EJBException("ejbLoad: " + ex.getMessage());
    public void ejbStore() {
    try {
    storeRow();
    } catch (Exception ex) {
    throw new EJBException("ejbStore: " + ex.getMessage());
    public void ejbPostCreate(String id, String firstName) {
    /*********************** Database Routines *************************/
    private void makeConnection() {
    try {
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup(dbName);
    con = ds.getConnection();
    } catch (Exception ex) {
    throw new EJBException("Unable to connect to database. " +
    ex.getMessage());
    private void releaseConnection() {
    try {
    con.close();
    } catch (SQLException ex) {
    throw new EJBException("releaseConnection: " + ex.getMessage());
    private void insertRow(String id, String firstName) throws SQLException {
    makeConnection();
    String insertStatement =
    "insert into test1 values ( ? , ? )";
    PreparedStatement prepStmt = con.prepareStatement(insertStatement);
    prepStmt.setString(1, id);
    prepStmt.setString(2, firstName);
    prepStmt.executeUpdate();
    prepStmt.close();
    releaseConnection();
    private void deleteRow(String id) throws SQLException {
    makeConnection();
    String deleteStatement = "delete from test1 where id = ? ";
    PreparedStatement prepStmt = con.prepareStatement(deleteStatement);
    prepStmt.setString(1, id);
    prepStmt.executeUpdate();
    prepStmt.close();
    releaseConnection();
    private boolean selectByPrimaryKey(String primaryKey)
    throws SQLException {
    makeConnection();
    String selectStatement =
    "select id " + "from test1 where id = ? ";
    PreparedStatement prepStmt = con.prepareStatement(selectStatement);
    prepStmt.setString(1, primaryKey);
    ResultSet rs = prepStmt.executeQuery();
    boolean result = rs.next();
    prepStmt.close();
    releaseConnection();
    return result;
    private void loadRow() throws SQLException {
    makeConnection();
    String selectStatement =
    "select firstname from test1 where id = ? ";
    PreparedStatement prepStmt = con.prepareStatement(selectStatement);
    prepStmt.setString(1, this.id);
    ResultSet rs = prepStmt.executeQuery();
    if (rs.next()) {
    this.firstName = rs.getString(1);
    prepStmt.close();
    } else {
    prepStmt.close();
    throw new NoSuchEntityException("Row for id " + id +
    " not found in database.");
    releaseConnection();
    private void storeRow() throws SQLException {
    makeConnection();
    String updateStatement =
    "update test1 set firstname = ? where id = ?";
    PreparedStatement prepStmt = con.prepareStatement(updateStatement);
    prepStmt.setString(1, firstName);
    prepStmt.setString(4, id);
    int rowCount = prepStmt.executeUpdate();
    prepStmt.close();
    if (rowCount == 0) {
    throw new EJBException("Storing row for id " + id + " failed.");
    releaseConnection();
    // Test1Bean
    Test1Client
    import java.util.*;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    public class Test1Client {
    public static void main(String[] args) {
    try {
    Context initial = new InitialContext();
    Object objref =
    initial.lookup("java:comp/env/ejb/SimpleTest1");
    Test1Home home =
    (Test1Home) PortableRemoteObject.narrow(objref,
    Test1Home.class);
    Test1 duke =
    home.create("123", "Duke");
    duke = home.findByPrimaryKey("123");
    System.out.println(duke.getFirstName());
    System.exit(0);
    catch (Exception ex)
    System.err.println("Caught an exception.");
    ex.printStackTrace();
    Test1Home.jav
    import java.rmi.RemoteException;
    import javax.ejb.*;
    public interface Test1Home extends EJBHome {
    public Test1 create(String id, String firstName) throws RemoteException, CreateException;
    public Test1 findByPrimaryKey(String id)
    throws FinderException, RemoteException;
    Test1.java
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    public interface Test1 extends EJBObject {
    public String getFirstName() throws RemoteException;
    application.xml (Test1App.ear)
    <?xml version="1.0" encoding="UTF-8"?>
    <application xmlns="http://java.sun.com/xml/ns/j2ee" version="1.4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
    <description>Application description</description>
    <display-name>Test1App</display-name>
    <module>
    <java>app-client-ic.jar</java>
    </module>
    <module>
    <ejb>ejb-jar-ic.jar</ejb>
    </module>
    </application>
    sun-application.xml (Test1App.ear)
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-application PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.0 J2EE Application 1.4//EN" "http://www.sun.com/software/appserver/dtds/sun-application_1_4-0.dtd">
    <sun-application>
    <pass-by-reference>false</pass-by-reference>
    </sun-application>
    ejb-jar.xml (in ejb-jar-ic.jar)
    <?xml version="1.0" encoding="UTF-8"?>
    <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" version="2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
    <display-name>Test1JAR</display-name>
    <enterprise-beans>
    <entity>
    <ejb-name>Test1Bean</ejb-name>
    <home>Test1Home</home>
    <remote>Test1</remote>
    <ejb-class>Test1Bean</ejb-class>
    <persistence-type>Bean</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>true</reentrant>
    <resource-ref>
    <res-ref-name>jdbc/Test1DB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    <security-identity>
    <use-caller-identity/>
    </security-identity>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <method-permission>
    <unchecked/>
    <method>
    <ejb-name>Test1Bean</ejb-name>
    <method-intf>Home</method-intf>
    <method-name>remove</method-name>
    <method-params>
    <method-param>java.lang.Object</method-param>
    </method-params>
    </method>
    <method>
    <ejb-name>Test1Bean</ejb-name>
    <method-intf>Home</method-intf>
    <method-name>getHomeHandle</method-name>
    </method>
    <method>
    <ejb-name>Test1Bean</ejb-name>
    <method-intf>Remote</method-intf>
    <method-name>isIdentical</method-name>
    <method-params>
    <method-param>javax.ejb.EJBObject</method-param>
    </method-params>
    </method>
    <method>
    <ejb-name>Test1Bean</ejb-name>
    <method-intf>Remote</method-intf>
    <method-name>getFirstName</method-name>
    </method>
    <method>
    <ejb-name>Test1Bean</ejb-name>
    <method-intf>Home</method-intf>
    <method-name>findByPrimaryKey</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </method>
    <method>
    <ejb-name>Test1Bean</ejb-name>
    <method-intf>Home</method-intf>
    <method-name>remove</method-name>
    <method-params>
    <method-param>javax.ejb.Handle</method-param>
    </method-params>
    </method>
    <method>
    <ejb-name>Test1Bean</ejb-name>
    <method-intf>Remote</method-intf>
    <method-name>getHandle</method-name>
    </method>
    <method>
    <ejb-name>Test1Bean</ejb-name>
    <method-intf>Home</method-intf>
    <method-name>create</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    <method-param>java.lang.String</method-param>
    </method-params>
    </method>
    <method>
    <ejb-name>Test1Bean</ejb-name>
    <method-intf>Home</method-intf>
    <method-name>getEJBMetaData</method-name>
    </method>
    <method>
    <ejb-name>Test1Bean</ejb-name>
    <method-intf>Remote</method-intf>
    <method-name>getPrimaryKey</method-name>
    </method>
    <method>
    <ejb-name>Test1Bean</ejb-name>
    <method-intf>Remote</method-intf>
    <method-name>remove</method-name>
    </method>
    <method>
    <ejb-name>Test1Bean</ejb-name>
    <method-intf>Remote</method-intf>
    <method-name>getEJBHome</method-name>
    </method>
    </method-permission>
    <container-transaction>
    <method>
    <ejb-name>Test1Bean</ejb-name>
    <method-intf>Remote</method-intf>
    <method-name>remove</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
    <method>
    <ejb-name>Test1Bean</ejb-name>
    <method-intf>Remote</method-intf>
    <method-name>getFirstName</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    sun-ejb-jar.xml (in ejb-jar-ic.jar )
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.0 EJB 2.1//EN" "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_2_1-0.dtd">
    <sun-ejb-jar>
    <enterprise-beans>
    <name>Test1JAR</name>
    <ejb>
    <ejb-name>Test1Bean</ejb-name>
    <jndi-name>Test1Bean</jndi-name>
    <resource-ref>
    <res-ref-name>jdbc/Test1DB</res-ref-name>
    <jndi-name>jdbc/ejbTutorialDB</jndi-name>
    </resource-ref>
    </ejb>
    </enterprise-beans>
    </sun-ejb-jar>
    application-client.xml ( in app-client-ic.jar)
    <?xml version="1.0" encoding="UTF-8"?>
    <application-client xmlns="http://java.sun.com/xml/ns/j2ee" version="1.4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd"><display-name>Test1Client</display-name>
    <ejb-ref>
    <ejb-ref-name>ejb/SimpleTest1</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>Test1Home</home>
    <remote>Test1</remote>
    </ejb-ref>
    </application-client>
    sun-application-client.xml ( in app-client-ic.jar)
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-application-client PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.0 Application Client 1.4//EN" "http://www.sun.com/software/appserver/dtds/sun-application-client_1_4-0.dtd">
    <sun-application-client>
    <ejb-ref>
    <ejb-ref-name>ejb/SimpleTest1</ejb-ref-name>
    <jndi-name>Test1Bean</jndi-name>
    </ejb-ref>
    </sun-application-client>
    This is adapted from the Savings Account example. I couldn't get it to work either
    from the source provided though it did work with the provided ear. I have been
    comparing the difference in setting but can see anything.
    I have been able to build and deploy all the other examples in the tutorial but I am somehow
    stuck on ejbs.
    Help would be much appreciated.
    cheers,
    paul

    Just had a look at the client jar. The one generated by the Savings Account provided ear has got a shorter ejb-jar.xml. It doesn't have the functions specified like the one in its ear file.
    Another difference thet the Manifest.mf files for my client jar do not have as many paths specified
    as my test client jar. Don't know why. I am suspecting that maybe there is a slight configuration problem in my j2ee setup. Though I am not sure waht or what to look for. I hope this little bit of
    extra info helps.
    cheers,
    paul.

  • Are Bean Managed Persistance EJBs a better choice for an application with a lot of Oracle 9i JDBC activity?

     

    You don't really give enough information to answer the question. Probably the most important questions are the coarseness of the database activity, the need for remoteability, and the need for a component and security model.
    The short, rule of thumb, answer is that Entity Beans (regardless of BMP vs. CMP) almost always have a significant performance penalty. You should choose Entity Beans because you need/want the features of Entity Beans, not because of performance.
    David

  • ManyToMany persist entity problem

    Hi, I'm beginning with EJB 3.0 and I've wrote this code to persist data from two tables, whitch have ManyToMany relationship.
    When I want to persist objects I gives me a error... How to reduce this problem?
    Thanks!!!
    Entity #1:
    @Entity
    @Table(name = "kategorie")
    @NamedQueries({@NamedQuery(name = "Kategorie.findById", query = "SELECT k FROM Kategorie k WHERE k.id = :id"), @NamedQuery(name = "Kategorie.findByNazev", query = "SELECT k FROM Kategorie k WHERE k.nazev = :nazev")})
    public class Kategorie implements Serializable {
        private static final long serialVersionUID = 1L;
        @Id
        @GeneratedValue
        @Column(name = "id", nullable = false)
        private Integer id;
        @Column(name = "nazev")
        private String nazev;
        @JoinTable(name = "kategorieprodukty",
                   joinColumns = {@JoinColumn(name = "kategorie", referencedColumnName = "id")},
                   inverseJoinColumns = {@JoinColumn(name = "produkt", referencedColumnName = "id")})
        @ManyToMany
        private Collection<Produkty> produktCollection;
        public Kategorie() {
        public Kategorie(Integer id) {
            this.id = id;
        public Integer getId() {
            return id;
        public void setId(Integer id) {
            this.id = id;
        public String getNazev() {
            return nazev;
        public void setNazev(String nazev) {
            this.nazev = nazev;
        public Collection<Produkty> getProduktCollection() {
            return produktCollection;
        public void setProduktCollection(Collection<Produkty> produktCollection) {
            this.produktCollection = produktCollection;
        public void addProdukt(Produkty produkt) {
            this.getProduktCollection().add(produkt);
        }Entity #2:
    @Entity
    @Table(name = "produkty")
    @NamedQueries({@NamedQuery(name = "Produkty.findById", query = "SELECT p FROM Produkty p WHERE p.id = :id"), @NamedQuery(name = "Produkty.findByNazev", query = "SELECT p FROM Produkty p WHERE p.nazev = :nazev")})
    public class Produkty implements Serializable {
        private static final long serialVersionUID = 1L;
        @Id
        @Column(name = "id", nullable = false)
        private Integer id;
        @Column(name = "nazev")
        private String nazev;
        @Lob
        @Column(name = "popis")
        private String popis;
        @ManyToMany(mappedBy = "produktCollection")
        private Collection<Kategorie> kategorieCollection;
        public Produkty() {
        public Produkty(Integer id) {
            this.id = id;
        public Integer getId() {
            return id;
        public void setId(Integer id) {
            this.id = id;
        public String getNazev() {
            return nazev;
        public void setNazev(String nazev) {
            this.nazev = nazev;
        public String getPopis() {
            return popis;
        public void setPopis(String popis) {
            this.popis = popis;
        public Collection<Kategorie> getKategorieCollection() {
            return kategorieCollection;
        public void setKategorieCollection(Collection<Kategorie> kategorieCollection) {
            this.kategorieCollection = kategorieCollection;
        }Session Bean:
    @Stateless
    public class ProduktyFacade implements ProduktyFacadeRemote {
        @PersistenceContext
        private EntityManager em;
        public void create(Produkty produkt, Collection<Kategorie> kategorie)
            em.persist(produkt);
            em.refresh(produkt);
            for (Kategorie kat : kategorie) {
                kat.addProdukt(produkt);
        public void edit(Produkty produkty) {
            em.merge(produkty);
        public void remove(Produkty produkty) {
            em.remove(em.merge(produkty));
        public Produkty find(Object id) {
            return em.find(domain.Produkty.class, id);
        public List<Produkty> findAll() {
            return em.createQuery("select object(o) from Produkty as o").getResultList();
    }When I call:
    @EJB
        private ProduktyFacadeRemote produktyFacade;
    produkt = new Produkty();
    Collection<Kategorie> kategorie = new ArrayList<Kategorie>();
    kategorie.add(...
    produktyFacade.create(produkt, kategorie);
    ...It gives me this error (I'm using Netbeans 6.0.1 with GlassFish V2):
    "IOP00810257: (MARSHAL) Could not load class domain.Kategorie"
    org.omg.CORBA.MARSHAL:   vmcid: SUN  minor code: 257 completed: Maybe
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:9684)
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:9699)
            at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1042)
            at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:896)
            at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:890)
            at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:880)
            at com.sun.corba.ee.impl.encoding.CDRInputStream.read_abstract_interface(CDRInputStream.java:511)
            at com.sun.corba.ee.impl.io.IIOPInputStream.readObjectDelegate(IIOPInputStream.java:386)
            at com.sun.corba.ee.impl.io.IIOPInputStream.readObjectOverride(IIOPInputStream.java:547)
            at java.io.ObjectInputStream.readObject(ObjectInputStream.java:345)
            at java.util.ArrayList.readObject(ArrayList.java:593)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at com.sun.corba.ee.impl.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1679)
            at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1202)
            at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:422)
            at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:362)
            at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:328)
            at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:966)
            at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1052)
            at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:475)
            at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$14.read(DynamicMethodMarshallerImpl.java:368)
            at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.readArguments(DynamicMethodMarshallerImpl.java:435)
            at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:152)
            at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:687)
            at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:227)
            at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1846)
            at com.sun.corba.ee.impl.protocol.SharedCDRClientRequestDispatcherImpl.marshalingComplete(SharedCDRClientRequestDispatcherImpl.java:183)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:219)
            at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:192)
            at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
            at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225)
            at session.__ProduktyFacadeRemote_Remote_DynamicStub.create(session/__ProduktyFacadeRemote_Remote_DynamicStub.java)
            at session._ProduktyFacadeRemote_Wrapper.create(session/_ProduktyFacadeRemote_Wrapper.java)
            at jsf.ProduktyController.create(ProduktyController.java:62)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at com.sun.el.parser.AstValue.invoke(AstValue.java:187)
            at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
            at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
            at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
            at javax.faces.component.UICommand.broadcast(UICommand.java:383)
            at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
            at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
            at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
            at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
            at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
            at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
            at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
            at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
            at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
            at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
            at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
            at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
    nested exception is: java.rmi.MarshalException: CORBA MARSHAL 1398079745 Maybe; nested exception is: org.omg.CORBA.MARSHAL: ----------BEGIN server-side stack trace---------- org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:9684) at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:9699) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1042) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:896) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:890) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:880) at com.sun.corba.ee.impl.encoding.CDRInputStream.read_abstract_interface(CDRInputStream.java:511) at com.sun.corba.ee.impl.io.IIOPInputStream.readObjectDelegate(IIOPInputStream.java:386) at com.sun.corba.ee.impl.io.IIOPInputStream.readObjectOverride(IIOPInputStream.java:547) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:345) at java.util.ArrayList.readObject(ArrayList.java:593) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.corba.ee.impl.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1679) at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1202) at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:422) at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:362) at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:328) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:966) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1052) at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:475) at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$14.read(DynamicMethodMarshallerImpl.java:368) at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.readArguments(DynamicMethodMarshallerImpl.java:435) at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:152) at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:687) at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:227) at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1846) at com.sun.corba.ee.impl.protocol.SharedCDRClientRequestDispatcherImpl.marshalingComplete(SharedCDRClientRequestDispatcherImpl.java:183) at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:219) at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:192) at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152) at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225) at session.__ProduktyFacadeRemote_Remote_DynamicStub.create(session/__ProduktyFacadeRemote_Remote_DynamicStub.java) at session._ProduktyFacadeRemote_Wrapper.create(session/_ProduktyFacadeRemote_Wrapper.java) at jsf.ProduktyController.create(ProduktyController.java:62) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.el.parser.AstValue.invoke(AstValue.java:187) at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297) at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77) at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91) at javax.faces.component.UICommand.broadcast(UICommand.java:383) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752) at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244) at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198) at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214) at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265) at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106) ----------END server-side stack trace---------- vmcid: SUN minor code: 257 completed: Maybe

    Steve Edens wrote:
    I'm also trying to get a grip on the best way to handle some static application properties in a clustered environment. My need mostly relates to
    a need to read in some flat file type properties and then store them someplace
    where business logic can call them as needed.. Like a static hashmap or
    something. But someone mentioned Entity beans, BMP, etc..
    Now.. here's the strange part of the message.
    Back in 1999 I traveled over to our west coast office in San Francisco. I was meeting and greeting the staff there and along the way I had a short
    meeting with someone named Bisera Ferrero. I mention this event because I
    was really impressed with the beauty and charm of Bisera. Therefore, I guess
    I'm a fan. I rememered the name.. a little. Really, I had sort of forgotten
    about it until reading this forum this morning. So.. who knows. I guess
    there could be a lot of Bisera Ferrero names on our planet.
    Good luck in your quests..

  • How to run jdbc:odbc driver for MS Access in Beam Managed Persisten Entity

    Hi friends,
    I like to know how to access an MS Access Database using a BMP Entity Bean. I like to know how the connection is established. Can we use the Class.forName(). I'd like to recieve the 3 to 4 line code. :)
    Please Help
    Thank YOu!!

    rampalli_aravind wrote:
    Hi friends,
    I like to know how to access an MS Access Database Google "Sun JDBC tutorial".
    using a BMP Entity Bean. Really? How quaint!
    I like to know how the connection is established.
    Connection c = DriverManager.createConnection(url, user, pass);
    Can we use the Class.forName(). Yes.
    I'd like to recieve the 3 to 4 line code. :)I've got you halfway there. The rest is left for you.
    Please HelpI think I did.
    Thank YOu!!No, thank YOU! Where would this forum be without stoopid questions like yours?
    %

  • Persist entity in ApplicationLifecycleListener

    hi,
    i would like to persist some entities at deployment time in a postStart method of a class which extends ApplicationLifecycleListener.
    the problem is that the entites are not in the db although i dont get any exceptions and the entities even get their id after persist.
    it looks like the transaction is not committed. i tried to commit manually but i got an exception that i cannot do this with a JTA entity manager.
    is there a way to 'force' the commit?
    or how could i use application managed entity manager? i tried to jndi lookup, but did not succeed:( i found only my datasource which is an instance of RmiDataSource.
    thanks a lot for the help,
    cheers,
    gg

    Database access inside events is allowed, whether JPA events or descriptor events, but you need to be careful. Basically you need to understand what you are doing and its affects and are on your own if you screw something up. You must keep in mind that the persistence context is in the process of a commit. So calling persist() or changing objects can have issues, the objects may not get inserted or changes applied depending on the event. Performing direct database access such as native SQL queries is probably safer, but you need to be careful of locks and violating database constraints. You can use insertObject within a UnitOfWork during write events, but you need to be careful.
    Normally you would use the same transaction, if you created a new transaction/EntityManager/UnitOfWork, then you need to be careful or performance, and of deadlocking with yourself.

  • Managing large entity dimension in Hyperion Planning

    Hi experts,
    Here is my situation :
    - Planning version : 9.3.1.3
    - OS : Windows 2003 Server 32-bits
    - Repository : SQL Server 2005
    - Application with 3 plans, 12 dimensions. Larger dimension is "Entity" with 40,000 members.
    - No workflow is used
    Here is my problem :
    - I can add without any problem members in my entity dimension but, when I want to cut/paste or delete any member, Planning process uses a lot of memory on the server and when the limit is reached (parameter in the registry database can't be higher : 1622M), process freeze with an out of memory error. So, I restart service and delete or cut/paste is not done.
    - Cut/paste and delete on others dimensions work fine.
    So, could anyone give me advices about my situation ?
    Thanks
    Julien

    Hi,
    Patch was a good idea, but we was already in 9.3.1.14.
    We finally found the solution :
    Entity is really "linked" to scenario and version by the workflow functionnality.
    As we don't use it, we disabled for process management each scenario and version.
    MIRACLE : Thanks to this action, when we delete an entity, memory consumption is low and process quick.
    Conclusion : Delete process of entity dimension controls a lot of things in the repository, using a lot of memory. So, if a scenario or a version is not used in a workflow process, it is very important to discard it from process management.
    Cheers
    Julien

  • Container managed persistance: many-many relationship

    Here's the scenario:
    table STUDENTS has columns ID, NAME
    table CLASSES has columns ID, TITLE
    table STUDENT_CLASSES is an intersection table with columns STUDENT, CLASS which are foreign keys to the ID columns in the STUDENTS and CLASSES tables
    How do I specify to OC4J that it should use the STUDENT_CLASSES table to facilitate the container managed many-many relationship?

    Voytek -- I would use the ormap demo (projects to emps relationship) as an example and see what exists from deploying that. I've included the original ejb-jar.xml entry as well as a trimmed down version of the orion-ejb-jar.xml entry. In this case it is the default mapping but what you would need to do is include an orion-ejb-jar.xml with just the parts you want to control.
    <ejb-relation>
    <ejb-relation-name>Emps-Projects</ejb-relation-name>
    <ejb-relationship-role>
    <ejb-relationship-role-name>Projects-have-Emps</ejb-relationship-role-name>
    <multiplicity>Many</multiplicity>
    <relationship-role-source>
    <ejb-name>ProjectBean</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>employees</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    <ejb-relationship-role>
    <ejb-relationship-role-name>Emps-have-Projects</ejb-relationship-role-name>
    <multiplicity>Many</multiplicity>
    <relationship-role-source>
    <ejb-name>EmpBean</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>projects</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    </ejb-relation>
    <entity-deployment name="ProjectBean" location="ProjectBean" table="ProjectBean" >
    <primkey-mapping>
    <cmp-field-mapping name="projectNo" persistence-name="projectNo" />
    </primkey-mapping>
    <cmp-field-mapping name="projectName" persistence-name="projectName" />
    <cmp-field-mapping name="employees">
    <collection-mapping table="EmpBean_projects_Proje__296v53">
    <primkey-mapping>
    <cmp-field-mapping name="ProjectBean_projectNo">
    <entity-ref home="ProjectBean">
    <cmp-field-mapping name="ProjectBean_projectNo" persistence-name="ProjectBean_projectNo" />
    </entity-ref>
    </cmp-field-mapping>
    </primkey-mapping>
    <value-mapping type="hr.EmpLocal">
    <cmp-field-mapping name="EmpBean_empNo">
    <entity-ref home="EmpBean">
    <cmp-field-mapping name="EmpBean_empNo" persistence-name="EmpBean_empNo" />
    </entity-ref>
    </cmp-field-mapping>
    </value-mapping>
    </collection-mapping>
    </cmp-field-mapping>
    ... finder methods removed ...
    </entity-deployment>
    I hope this helps -- Jeff

  • Confused with Entity Beans

    Hello:
    I ve been trying to learn EJBs using Wrox's Professional EJB.
    At page number 145 sequence diagram, it shows that ( for a bean
    managed persistance Entity bean ) every find<METHOD>(args) invoked on
    an EJBHome object will be delegated to a corresponding
    ejbFind<METHOD>(args) method on the bean implementation object. I m a
    bit confused here.
    1. Since from the OO point of view, "find" is about finding, shouldn t
    this have been a method on some kind of broker object, that should
    have created/found the corresponding implementation objects and
    returned the corresponding handles ( object references ). In the case
    of findInRange() that returns multiple objects this becomes more
    apparent, wherein one need to have an ejb implementation object to
    start with in order to get the collection of objects he has been
    looking for. Where did I 'didn t get it'
    2. One of my friends says Container managed persistence ( CMP ) is not
    at all popular due to the inefficiency compared to BMP, and that only
    very few projects will be actually using it. Is there any truth in
    this.
    3. Is there a vendor neutral newsgroup ( and more specific that
    comp.java.lang.help ) for posting ejb related discussions.
    Thanks
    --sony

    Hi Sony,
    "Sony Antony" <[email protected]> wrote in message
    news:[email protected]..
    Hello:
    I ve been trying to learn EJBs using Wrox's Professional EJB.
    At page number 145 sequence diagram, it shows that ( for a bean
    managed persistance Entity bean ) every find<METHOD>(args) invoked on
    an EJBHome object will be delegated to a corresponding
    ejbFind<METHOD>(args) method on the bean implementation object. I m a
    bit confused here.
    1. Since from the OO point of view, "find" is about finding, shouldn t
    this have been a method on some kind of broker object, that should
    have created/found the corresponding implementation objects and
    returned the corresponding handles ( object references ). In the case
    of findInRange() that returns multiple objects this becomes more
    apparent, wherein one need to have an ejb implementation object to
    start with in order to get the collection of objects he has been
    looking for. Where did I 'didn t get it'In fact, a bean serves as the "broker" object, though I don't like
    the name that much. Finally, this is the Spec, and you have to
    live with it.
    2. One of my friends says Container managed persistence ( CMP ) is not
    at all popular due to the inefficiency compared to BMP, and that only
    very few projects will be actually using it. Is there any truth in
    this.It depends on application requirements. CMP are perfect for writing
    simple persistance objects with "one object per one DB table" pattern.
    From efficiency point of view weblogic does it's best to optimize
    bean's behaiviour. You shouldn't be concerned about it.
    BMPs are good when you need to deal with coarse-grained persistance.
    I'd recomend you to get hands on experience with CMPs and
    BMPs. Practice is invaluable source of knowlege.
    3. Is there a vendor neutral newsgroup ( and more specific that
    comp.java.lang.help ) for posting ejb related discussions.weblogic.developer.interest.ejb is a perfect place for this type of
    discussions.
    Regards,
    Slava Imeshev

  • NotSerializableException on Entity Bean Client

    hi
    Am new to entity beans, specifically Bean-Managed Persistent Entity Beans. I am trying to return a DTO back from the business method of entity bean. In short the code in bean is this
    public EmployeeDetailsDTO getEmployeeDetails(int empNo){
         // Code to fetch emp details
         // Set values in DTO
        return empDetails;
    }On the client side its
    AccountPK pk = new AccountPK("4");
    account = home.findByPrimaryKey(pk);
    EmployeeDetailsDTO empDetails = account.getEmployeeDetails(4);However, i get this excpetion on the cleint.
    java.rmi.MarshalException: error marshalling return; nested exception is: java.io.NotSerializableException:com.tpt.practice.entityBeans.bmp.EmployeeDetailsDTO
    Note: The EmployeeDetailsDTO does implement the Serializable interface. Any other reason why i should get this error?

    Is it possible that a field on the DTO is throwing the Serializable Exception? ..is serialVersionUID manually declared? Perhaps that would help?

  • How to access the ejb using WSIF

    I have deployed my Bean Managed Persistance Entity Bean in Weblogic 8.1 App Server. Trying to access the ejb from Synchronous BPEL process using WSIF. I am getting following error
    - WSIF0011I: Preferred port 'EJBPort' was not available
    org.apache.wsif.WSIFException: Unable to find an available port
         at org.apache.wsif.base.WSIFServiceImpl.getPort(Unknown Source)
         at org.apache.wsif.base.WSIFServiceImpl.getPort(Unknown Source)
         at com.test.wsif.RunInventory.main(RunInventory.java:55)
    How to resolve the above said problem??
    Here is my Inventory.wsdl file
    <?xml version="1.0" ?>
    <definitions targetNamespace="http://wsifservice.Inventory/"
    xmlns:tns="http://wsifservice.Inventory/"
    xmlns:typens="http://wsiftypes.addressbook.service.ejb/"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:format="http://schemas.xmlsoap.org/wsdl/formatbinding/"
    xmlns:ejb="http://schemas.xmlsoap.org/wsdl/ejb/"
    xmlns="http://schemas.xmlsoap.org/wsdl/">
    <!-- type defs -->
    <types>
    <xsd:schema
    targetNamespace="http://wsiftypes.addressbook.service.ejb/"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema">
    <xsd:complexType name="vecdetails">
    <xsd:sequence>
    <xsd:element name="make" type="xsd:string"/>
    <xsd:element name="bodystyle" type="xsd:string"/>
    <xsd:element name="model" type="xsd:string"/>
    <xsd:element name="quantity" type="xsd:int"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    </types>
    <!-- message declns -->
    <message name="getInventoryRequestMessage">
    <part name="vecdetails" type="typens:request"/>
    </message>
    <message name="getInventoryResponseMessage">
    <part name="response" type="typens:response"/>
    </message>
    <!-- port type declns -->
    <portType name="Inventory">
    <operation name="getInventory">
    <input name="getInventoryRequest" message="tns:getInventoryRequestMessage"/>
    <output name="getInventoryResponse" message="tns:getInventoryResponseMessage"/>
    </operation>
    </portType>
    <!-- binding declns -->
    <binding name="EJBBinding" type="tns:Inventory">
    <ejb:binding/>
    <format:typeMapping encoding="Java" style="Java">
    <format:typeMap typeName="xsd:string" formatType="java.lang.String" />
    </format:typeMapping>
    <operation name="getInventory">
    <ejb:operation
    methodName="getInventory"
    parameterOrder="make bodystyle model quantity"
    interface="remote" returnPart="response" />
    <input name="getInventoryRequest"/>
    <output name="getInventoryResponse"/>
    </operation>
    </binding>
    <!-- service decln -->
    <service name="InventoryService">
    <port name="EJBPort" binding="tns:EJBBinding">
    <!-- Put vendor-specific deployment information here -->
         <ejb:address className="com.poc.inventoryejb.InventoryHome"
              jndiName="Inventory"
    initialContextFactory="weblogic.jndi.WLInitialContextFactory"
         jndiProviderURL="t3://localhost:7001"/>
    </port>
    </service>
    </definitions>

    Try to restart BPEL Server. When I tested WSIF Bindings I had to restart server after every changes in WSIF WSDL.
    Alexey.

  • Javax.naming.NameNotFoundException: name not bound

    Hi,
    Here is the Servlet code
    Context context = null;
              try {
                   context = new InitialContext();
              } catch (NamingException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              ProcessPaymentLocal local = null;
              try {
                   local = (ProcessPaymentLocal)context.lookup("processPayment");
              } catch (NamingException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              PrintWriter writer = response.getWriter();
              writer .println("<html>");
              writer.println("<body>");
              writer.println("Done!!!!"+" "+local.byCash(100));
              writer.println("</body>");
              writer.println("</html>");
              writer.close();
    lookUp is giving the exception
    Here is the EJB:
    @Stateless(name="processPayment")
    public class ProcessPayment implements ProcessPaymentLocal {
         @PersistenceContext(unitName="JPA")
         EntityManager manager;
         @Override
         public boolean byCash(double amount) {
              // TODO Auto-generated method stub
              return processPayment(amount,"cash");
         @Override
         public boolean byCheck(double amount) {
              // TODO Auto-generated method stub
              return processPayment(amount,"check");
         @Override
         public boolean byCredit(double amount) {
              // TODO Auto-generated method stub
              return processPayment(amount,"credit");
         public boolean processPayment(double amount, String paymentMode){
              PaymentEntity entity = new PaymentEntity();
              entity.setAmount(amount);
              entity.setPaymentMode(paymentMode);
              manager.persist(entity);
              return true;
    Any help? Anything wrong with the initial context... I'm using a local interface

    1. To use local interfaces in Glassfish your client & bean must be in same EAR or EJB module.
    2. @Sateless(name=) it's only the name of bean and in fact the bean interface is stored under different name then processPayment, it can be something like
    packege.className.
    3. I assume that you can't use EJB annotation is servlet.
    4. If indeed you need to use lookup, you need perform following steps (only in Glassfish context).
    a) if you are in same EAR as servlet use in web.xml resource ref like in following eg.
        <ejb-local-ref>
            <ejb-ref-name>Custom name, this name you will use in WAR</ejb-ref-name> <!---->
            <ejb-ref-type>Session</ejb-ref-type>
            <local-home/> <!-- Beans are homeles ->
            <local>eu.softper.aleksandra.ewidencje.book.BookLocal</local> <!-- Your's bean local interface -->
            <ejb-link>Your bean name - here</ejb-link>
        </ejb-local-ref>b)if outside EAR you need to use server specific deployment, if server allows to pass local ref outside application. Glassfish does not.

Maybe you are looking for