Can't deploy BMP Entity bean (iAS903)

When I create findAll() method in Local interface and try to deploy apllication with BMP, server return "Deployment failed: Nested exception Root Cause: Syntax error in source. Syntax error in source".
If remove findAll(), all OK.
If use Remote interface - also all OK.
How does BMP with fildAll() in Local interface deploy in iAS903?
thanks
Alexey.

Alexey -- A fix will be coming out in the next release but before then you can ask your support representative for a patch for bug#2587584. This should solve the problem.
Thanks -- Jeff

Similar Messages

  • Deploying BMP Entity Bean with primary key calss

    Hi,
    I am using EJB 2.0 with and websphere studio 5.0 and database is sql server 2000.
    My BMP Entity bean has a primary key class.From my client I am invoking the Entity Bean by calling it's findbyprimarykey method.
    The home interface of my findbyprimarykey method returns a class of type Remote.But in the Entity Bean class,the return type is the primarykey class type.
    My problem is invoking this findbyprimarykey from the client to get the remote interface so that the other business methods of the entity bean can be called.
    The control goes into the ejbFindbyPrimaryKey but when it is returing from the Entity Bean class,it gives a remote exception (as the return type in Entity Bean class and Home interface are different for the findbyprimarykey method).
    I think that somewhere in the deployment decriptor in my websphere,i have to specify the primarykey class type,which i am missing out and hence getting the error.
    Please help me out with your advice and solution.
    Thanks
    Rahul Priyadarshi

    Hi,
    Sorry to disturb you again.
    Even my code is also almost the same....i am pasting the code below...Please go through it and let me know if I have made any mistake..
    EditVendorEntityBean.....(Bean Class)
    package code.beans.EditVendor;
    import code.beans.dataAccess.*;
    import javax.ejb.CreateException;
    import javax.ejb.RemoveException;
    import javax.ejb.EntityBean;
    import javax.ejb.EntityContext;
    import javax.ejb.EJBException;
    import javax.ejb.FinderException;
    import javax.ejb.ObjectNotFoundException;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import java.sql.*;
    import javax.sql.*;
    import java.util.*;
    * Bean implementation class for Enterprise Bean: EditVendorEntity
    public class EditVendorEntityBean implements javax.ejb.EntityBean {
         private static Hashtable dataSources = new Hashtable();
         private String username;
    private int Vendor_ID;
    private int Category_Id;
    private String Category_Name;
    private String Vendor_Name;
    private String Vendor_Address1;
    private String Vendor_Address2;
    private String Contact_Name;
    private String Home_Phone;
    private String Work_Phone;
    private String email;
    private String faxno;
    private String userloginname;
    private boolean dirtyFlag = false;
    private EntityContext context;
    private static final String DS_NAME = "jdbc/spiPOPS";
    Connection con = null;
    Statement stmt = null;
    PreparedStatement st = null;
    ResultSet res = null;
         //***********************Business Methods*********************
    // Begin of Busines Methods
    public void setData (String[] catname, String vendorname,String vendadd1,String vendadd2,String vendcontact,String venoff,String venres,String mailid,String venfax) {
              System.out.println("in setData where Vendor Id= "+ Vendor_ID);
                   boolean status=false;
                   boolean existing=false;
                   ArrayList cat=new ArrayList();
                   try
                        cat=getcategorylist(this.Vendor_ID);
                   catch(SQLException e)
                        System.out.println("Could not get category list");
                   System.out.println("Size of cat array -->" + cat.size() + " and string array size -->" + catname.length);
                   if(catname.length>0)
                        //Removing unwanted vendor categories for a particular vendor id
                        for(int i=0;i<cat.size();i++)
                                  existing=false;
                                  String tempdata=(String)cat.get(i);
                                  for(int j=0;j<catname.length;j++)
                                       if(tempdata.equals(catname[j]))
                                            existing=true;
                                  if(!existing)
                                       try
                                            delvencat(this.Vendor_ID,tempdata.trim());
                                       catch(SQLException e)
                                            System.out.println("Could not delete record in POPS_VENDOR_CATEGORY for -->" + tempdata);
                   //Adding new vendor categories for a particular vendor
                        try
                                  for(int i=0;i<catname.length;i++)
                                       status=false;
                                       String strcat=catname;
                                       status=checkcat(this.Vendor_ID,strcat.trim());
                                       if(!status)
                                            insertvencat(this.Vendor_ID,strcat.trim());
                        catch(SQLException e)
                                  System.out.println("Could not insert or select from POPS_VENDOR_CATEGORY table");
                   this.Vendor_Name          =vendorname;
              this.Vendor_Address1     =vendadd1;
              this.Vendor_Address2     =vendadd2;
              this.Contact_Name          =vendcontact;
              this.Work_Phone               =venoff;
              this.Home_Phone               =venres;
              this.email                    =mailid;
              this.faxno                    =venfax;
                   dirtyFlag = true;
                   System.out.println("Leaving set data method");
    public Vector getData() {
         Vector vctRec=new Vector();
         ArrayList arrdatas = new ArrayList();
         arrdatas.add(""+this.Vendor_ID);
         arrdatas.add(this.Vendor_Name);
         arrdatas.add(this.Vendor_Address1);
         arrdatas.add(this.Vendor_Address2);
         arrdatas.add(this.Contact_Name);
         arrdatas.add(this.Work_Phone);
         arrdatas.add(this.Home_Phone);
         arrdatas.add(this.email);
         arrdatas.add(this.faxno);
         vctRec.addElement(arrdatas);
         ArrayList cat=new ArrayList();
              try
              System.out.println("Calling getcategorylist from getdata with vendorid-->" + this.Vendor_ID);
              cat          = getcategorylist(this.Vendor_ID);
         catch(SQLException e)
                   System.out.println("Could not get datas for category list");
         vctRec.addElement(cat);
         ArrayList allcats=new ArrayList();
         try
                        allcats          = getallcategorylist();
              catch(SQLException e)
                        System.out.println("Could not get datas for category list");
         vctRec.addElement(allcats);
              dirtyFlag = false;
         System.out.println("Before return statement in getdata with vector size -->" + vctRec.size());
              return vctRec;
    // End of Business Methods
    //**************************Entity Bean Methods*******************************
         * ejbActivate
         public void ejbActivate() {
              Vendor_ID = Integer.parseInt((String)context.getPrimaryKey());
         System.out.println("Inside ejbActivate Vendor_ID-->"+ Vendor_ID);
         * ejbLoad
         public void ejbLoad() {
              System.out.println("Inside ejbLoad ********" );
    try {
    loadRow();
    }catch (Exception ex) {
              System.out.println("Failed in loadRow()");
    throw new EJBException("ejbLoad: " +
    ex.getMessage());
         * ejbPassivate
         public void ejbPassivate() {
         System.out.println("Inside ejbPassivate " );
    Vendor_ID = 0;
         * ejbRemove
         public void ejbRemove() throws javax.ejb.RemoveException {
              //Empty Method
         * ejbStore
         public void ejbStore() {
    System.out.println("Inside ejbStore " );
    try {
    storeRow();
    }catch (Exception ex) {
              System.out.println("Exception thrown in storeRow" + ex.getMessage());
    throw new EJBException("ejbLoad: " +
    ex.getMessage());
         * getEntityContext
         public javax.ejb.EntityContext getEntityContext() {
              return context;
         * setEntityContext
         public void setEntityContext(javax.ejb.EntityContext ctx) {
              System.out.println("Inside setEntityContext " );
    try{
         con = getConnection(DS_NAME);
         System.out.println("DB Connection Created!!");
    catch(Exception e){
    this.context = ctx;
         * unsetEntityContext
         public void unsetEntityContext() {
    System.out.println("Inside unsetEntityContext " );
    closeDbConnection(con, res, st);
    this.context = null;
         * ejbCreate
         //code.beans.EditVendor.EditVendorEntityKey
         public code.beans.EditVendor.EditVendorEntityKey ejbCreate(String vendorid)
              throws javax.ejb.CreateException {          
              return new EditVendorEntityKey(vendorid);
              //return null;
         * ejbPostCreate
         public void ejbPostCreate(String vendorid) throws javax.ejb.CreateException {
              //Empty
         * ejbFindByPrimaryKey
         //code.beans.EditVendor.EditVendorEntityKey
         public code.beans.EditVendor.EditVendorEntityKey ejbFindByPrimaryKey(
              code.beans.EditVendor.EditVendorEntityKey primaryKey)
              throws javax.ejb.FinderException {
    try {
    if(selectByPrimaryKey(Integer.parseInt(primaryKey.getVendorId()))) {
              System.out.println("Leaving the findbyprimarykey method from the entity bean");
         return primaryKey;
         //return null;
    }else {
         throw new ObjectNotFoundException
         ("Row for id " + primaryKey + " not found.");
    }catch (Exception ex) {
    throw new EJBException("EXCEPTION IN ejbFindByPrimaryKey :- " + ex.getMessage());
         /*********************** Database Utility Routines *************************/
    private boolean selectByPrimaryKey(int priKey)
    throws SQLException {
         System.out.println("inside selectByPrimaryKey for primary key " + priKey);
    String queryStr ="SELECT VENDOR_ID FROM POPS_VENDOR WHERE VENDOR_ID = " + priKey;
    System.out.println("in selectByPrimaryKey where queryString is: "+ queryStr);
              stmt = con.createStatement();
    ResultSet result = stmt.executeQuery(queryStr);
    if(!result.next()) {
    stmt.close();
         System.out.println("Did not find "+priKey);
    return false;
    else { //Found the primaryKey
    Vendor_ID = result.getInt("VENDOR_ID");
    stmt.close();
    return true;
    private void loadRow() throws SQLException {
              System.out.println("inside loadRow ...");
              stmt = con.createStatement();
              String queryStr = "SELECT VENDOR_NAME,VENDOR_ADDRESS1,VENDOR_ADDRESS2,CONTACT_NAME,HOME_PHONE,WORK_PHONE,EMAIL_ID,FAX_NO " +
                                  "FROM POPS_VENDOR WHERE VENDOR_ID=" + Vendor_ID;
              System.out.println("Inside loadRow()***********"+queryStr);
              ResultSet result = stmt.executeQuery(queryStr);
              ArrayList catadatas=new ArrayList();
         if(!result.next())
         throw new SQLException("No record for primary key" + Vendor_ID);
              this.Vendor_ID               =Vendor_ID;
                        this.Vendor_Name          =result.getString("VENDOR_NAME");
                        this.Vendor_Address1     =result.getString("VENDOR_ADDRESS1");
                        this.Vendor_Address2     =result.getString("VENDOR_ADDRESS2");
                        this.Contact_Name          =result.getString("CONTACT_NAME");
                        this.Home_Phone               =result.getString("HOME_PHONE");
                        this.Work_Phone               =result.getString("WORK_PHONE");
                        this.email                    =result.getString("EMAIL_ID");
                        this.faxno                    =result.getString("FAX_NO");
                             System.out.println("Leaving loadrow method with loaded datas for vendor -->" + Vendor_ID);
                             stmt.close();
    private ArrayList getcategorylist(int vendor) throws SQLException{
              String queryStr ="SELECT DISTINCT(VENDOR_CAT) FROM POPS_VENDOR_CATEGORY WHERE VENDOR_ID=" + vendor;
              System.out.println("Query for the cat list --> " + queryStr);
              stmt = con.createStatement();
              ResultSet result = stmt.executeQuery(queryStr);
              ArrayList catdatas=new ArrayList();
    try{
                   while(result.next())
                        catdatas.add(result.getString("VENDOR_CAT"));
              catch (SQLException e){
                   stmt.close();
                   System.out.println("Could not retrieve datas for Category list");
              stmt.close();
              System.out.println("size off array for cat -->" + catdatas.size() + " and datas ->" + catdatas);
              return catdatas;
         private ArrayList getallcategorylist() throws SQLException{
                   //String queryStr ="SELECT DISTINCT(VENDOR_CAT) FROM POPS_VENDOR_CATEGORY";
                   StringBuffer strquery=new StringBuffer(20);
                   strquery.append("SELECT DISTINCT(CATEGORY_NAME) FROM POPS_CATEGORY");
                   stmt = con.createStatement();
                   //ResultSet result = stmt.executeQuery(queryStr);
                   ResultSet result = stmt.executeQuery(strquery.toString());
                   ArrayList catdatas=new ArrayList();
                   try{
                        while(result.next())
                                  //catdatas.add(result.getString("VENDOR_CAT"));
                                  catdatas.add(result.getString("CATEGORY_NAME"));
                   catch (SQLException e){
                             stmt.close();
                             System.out.println("Could not retrieve datas for All Category list");
                   stmt.close();
                   return catdatas;
         private void delvencat(int vendor,String vencat) throws SQLException {
              int update=-1;
              stmt = con.createStatement();
              String queryStr ="DELETE FROM POPS_VENDOR_CATEGORY WHERE VENDOR_ID = " + vendor + " AND VENDOR_CAT = '" + vencat.toUpperCase() + "'";
              System.out.println("Delete query --> " + queryStr);
              update= stmt.executeUpdate(queryStr);
              if(update!=1)
                   System.out.println("Did not find data to delete");
              stmt.close();
         private void insertvencat(int vendor,String vencat) throws SQLException {
              int update=-1;
              String queryStr ="INSERT INTO POPS_VENDOR_CATEGORY(VENDOR_ID,VENDOR_CAT)" +
                                  " VALUES(" + vendor +",'" + vencat + "')";
              System.out.println("Insert query --> " + queryStr);
              stmt = con.createStatement();
              update=stmt.executeUpdate(queryStr);
              if(update!=1)
                   System.out.println("Could not insert records in the database");
              stmt.close();
         private boolean checkcat(int vendor,String catven) throws SQLException {
              boolean datastatus=false;
              String queryStr ="SELECT VENDOR_ID FROM POPS_VENDOR_CATEGORY WHERE VENDOR_ID = " + vendor + " AND VENDOR_CAT = '" + catven.toUpperCase() + "'";
              stmt = con.createStatement();
              ResultSet result = stmt.executeQuery(queryStr);
              datastatus=result.next();
              stmt.close();
              return datastatus;
    private void storeRow() throws SQLException {
                   System.out.println("Inside ejb store");
         if (!dirtyFlag) {
         System.out.println("Skipping the UPDATE because object is not dirty");
         return;
         CallableStatement cs=null;
    try{
                        cs = con.prepareCall("EXEC POPS_VENDOR_UPDATE " + this.Vendor_ID + ",'" + this.Vendor_Name + "','" + this.Vendor_Address1 + "','" + this.Vendor_Address2 + "','" + this.Contact_Name + "','" + this.Work_Phone + "','" + this.Home_Phone + "','" + this.email + "','" + this.faxno +"'");
                        System.out.println("\n\n SQL Statement : \n " + "EXEC POPS_VENDOR_UPDATE " + this.Vendor_ID + ",'" + this.Vendor_Name + "','" + this.Vendor_Address1 + "','" + this.Vendor_Address2 + "','" + this.Contact_Name + "','" + this.Work_Phone + "','" + this.Home_Phone + "','" + this.email + "','" + this.faxno +"'");
                        cs.executeUpdate();
              catch (SQLException e){
                        cs.close();
                        System.out.     println("\n\n Error in calling stored procedure POPS_INSERT_NEW_REQUEST \n\n"+ e.getMessage() + "\n\n");
              cs.close();
              dirtyFlag = false;
         private Connection getConnection(String dbName) throws SQLException
              String configuredDataSourceName = null;
              if (dbName == null) {
                   System.out.println("Attemp to get connection failed. The requested database name is null");
              DataSource dbSource = getDataSource(dbName);
              return dbSource.getConnection();
         private DataSource getDataSource(String dbName)
              // looking from cache;
              DataSource dbSource = (DataSource) dataSources.get(dbName);
              if (dbSource == null) { //we need to find it from JNDI
                   try {
                        Context ic = new InitialContext();
                        dbSource = (DataSource) ic.lookup(dbName);
                        dataSources.put(dbName, dbSource);
                   }catch (NamingException e){
              return dbSource;
         * User calls this function to safely close an connection
         * @param connt The connection a datasource
         * @param rs The resulSet inside this connection
         * @param statement The statement associate with this connection
         private void closeDbConnection(Connection cont,ResultSet rs,Statement statement)
              if (rs != null)
              try {
                        rs.close();
                   } catch (SQLException ignored) {
                        ignored.printStackTrace();
              if (statement != null)
                   try {
                        statement.close();
                   } catch (SQLException ignored) {
                        ignored.printStackTrace();
              if (cont != null)
                   try {
                        cont.close();
                   } catch (SQLException ignored) {
                        ignored.printStackTrace();
         } //closeDbConnection
    EditVendorEntity (Remote Interface)
    package code.beans.EditVendor;
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    import java.util.*;
    * Remote interface for Enterprise Bean: EditVendorEntity
    public interface EditVendorEntity extends javax.ejb.EJBObject {
         public void setData (String[] catname, String vendorname,String vendadd1,String vendadd2,String vendcontact,String venoff,String venres,String mailid,String venfax)
                   throws RemoteException;
    public Vector getData() throws RemoteException;
    EditVendorEntityHome (Home Interface)
    package code.beans.EditVendor;
    import java.rmi.RemoteException;
    import javax.ejb.CreateException;
    import javax.ejb.FinderException;
    import javax.ejb.DuplicateKeyException;
    import javax.ejb.EJBHome;
    import java.util.*;
    * Home interface for Enterprise Bean: EditVendorEntity
    public interface EditVendorEntityHome extends javax.ejb.EJBHome {
         * Creates an instance from a key for Entity Bean: EditVendorEntity
         public code.beans.EditVendor.EditVendorEntity create(String vendorid)
              throws javax.ejb.CreateException, java.rmi.RemoteException;
         * Finds an instance using a key for Entity Bean: EditVendorEntity
         public code.beans.EditVendor.EditVendorEntity findByPrimaryKey(
              code.beans.EditVendor.EditVendorEntityKey Vendor_ID)
              throws javax.ejb.FinderException, java.rmi.RemoteException;
    EditVendorEntityKey (Primary Key Class)
    package code.beans.EditVendor;
    * Key class for Entity Bean: EditVendorEntity
    public class EditVendorEntityKey implements java.io.Serializable {
         static final long serialVersionUID = 3206093459760846163L;
         public String primkey;
         * Creates an empty key for Entity Bean: EditVendorEntity
         public EditVendorEntityKey() {  }
         public EditVendorEntityKey(String primarykey) {     
              this.primkey=primarykey;
         public String getVendorId() {
    return primkey;
         * Returns true if both keys are equal.
         public boolean equals(java.lang.Object otherKey) {
              if (otherKey instanceof code.beans.EditVendor.EditVendorEntityKey) {
                   code.beans.EditVendor.EditVendorEntityKey o =
                        (code.beans.EditVendor.EditVendorEntityKey) otherKey;
                   return (primkey.equals(otherKey));
              return false;
         * Returns the hash code for the key.
         public int hashCode() {
              return (primkey.hashCode());
    Please go through and give me your comments and solution...
    Thanks in advance
    Rahul

  • Can't get BMP Entity Bean Instance!!

    Hello
    I have created a BMP Entity bean, and put on the findPrimaryKey method this code:
    try {
    context = new InitialContext();
    DataSource ds = (DataSource) context.lookup(nombreConexion);
    conn = ds.getConnection();
    stmt = conn.createStatement();
    rs = stmt.executeQuery("select count(upc) from musiccdejb where upc='"+ primaryKey +"'");
    if (rs!=null && rs.next()) {    
    countNumber = rs.getInt(1);
    if (countNumber!=1) {
    throw new Exception();
    catch (SQLException e) {
    System.out.println("Error ejbFindPrimaryKey"+e);
    catch (Exception e1) {
    System.out.println("Otro error ejbFindPrimaryKey"+e1);
    Everything there seem to be ok, because the select return 1, so the primary key exist, but after that the container doesn't get the information for this entity bean, everything is null when I tried to acces the information.
    Context ctx = new InitialContext();
    MusicCDBMPHome musicCDHome = (MusicCDBMPHome)ctx.lookup("java:comp/env/ejb/MusicCDBMP");
    boolean found = false;
    try {
    musicCDObj = musicCDHome.findByPrimaryKey("1");
    found = true;
    } catch (Exception e) {
    found = false;
    if (found) {
    out.println(musicCDObj.getUpc());
    out.println(musicCDObj.getTitle());
    Please help me, I am working with JDeveloper 9i Release 2 and OC4J Standalone version 9.0.2.
    Ana Maria

    Yes, I alredy did that, and this is te content of my ejbLoad:
    String upc = (String)entityContext.getPrimaryKey();
    ResultSet rs = null;
    try {
    context = new InitialContext();
    DataSource ds = (DataSource) context.lookup(nombreConexion);
    conn = ds.getConnection();
    stmt = conn.createStatement();
    rs = stmt.executeQuery("select count(upc) from musiccdejb where upc='"+ upc +"'");
    if (rs!=null && rs.next()) {
    if (rs.getInt(1)!=1) {
    throw new Exception();
    catch (SQLException e) {
    System.out.println("Error ejbLoad"+e);
    catch (Exception e1) {
    System.out.println("Otro error ejbLoad"+e1);
    Another suggestion??
    Thanks
    Ana Maria

  • Can I deploy the entity bean in different jar files?

    I have an application EAR, which contains several JARs. I have an entity bean A that has relationships with 2 other different entity beans B and C in the same DB. Now, I have to deploy this entity A together with B in AB.jar, and A with C in AC.jar. Both AB.jar and AC.jar are modules of the same application EAR file. They all use the same data sources to the same database, and named by different <ejb-name>.
    I have no problem with deploying the app to WebLogic 8.1. But the JSP page accessing entity A got errors. Sometime, it got error complaining that the container-generated ejbFindAccount mehtod is abstract.
    My questions are,
    Can an entity bean be defined twice in 2 different jars?
    When container load AB.jar and AC.jar, does it generate the finder methods twice?
    I guess there are some name conflicts going on here. What should I do to avoid it?
    Any comments are very much appreciated.

    Thanks for your answer, but how can I use it in connection with relationships?
    <!-- ********************************************************************** -->
    <!-- Relationship: View to FrameworkUser                                             -->
    <!-- ********************************************************************** -->
    <ejb-relation id="View-FrameworkUser">
         <description></description>
         <ejb-relation-name>View-FrameworkUser</ejb-relation-name>
         <ejb-relationship-role>
              <ejb-relationship-role-name>Views-have-FrameworkUser</ejb-relationship-role-name>
              <multiplicity>Many</multiplicity>
              <relationship-role-source>
                   <ejb-name>View</ejb-name>
              </relationship-role-source>
              <cmr-field>
                   <cmr-field-name>frameworkUser</cmr-field-name><!-#- getter/setter -#->
                   <cmr-field-type>java.util.Collection</cmr-field-type>
              </cmr-field>
         </ejb-relationship-role>
         <!-#- *************** -#->
         <ejb-relationship-role>
              <ejb-relationship-role-name>FrameworkUser-has-Views</ejb-relationship-role-name>
              <multiplicity>One</multiplicity>
              <relationship-role-source>
                   <!-#- *******REFERENCE******** -#->
                   <ejb-name>ejb_foo_jar2_ejb.jar#FrameworkUser</ejb-name>
                   <!-#- *******REFERENCE******** -#->
              </relationship-role-source>
         </ejb-relationship-role>
    </ejb-relation>
    ...this obviously doesn't work...
    Do I have to write a new <entity> where I define the referenced entity?

  • Problem in deploying CMP entity bean 2.0 in J2EE 1.4

    i am trying to deploy a cmp entity bean 2.0 using j2ee1.4 deployment tool. the bean uses sql server as the database. i have successfully created a coonection pool for sql server using j2ee admin console. the entity bean class files are successfully compiled. but while deploying the entity bean i am not able to set the database settings and jndi name for the bean. can one please guide me in the deployment steps in j2ee1.4.
    mohit

    Mohit,
    We are discussing this topic in the fourm below. I'm having the same problem so feel free to join our conversation.
    ~Howard
    http://forum.java.sun.com/thread.jsp?forum=13&thread=478054

  • Using JDO under BMP entity beans

    I have an entity bean that is a BMP which uses JDO under the hood. The Oc4J document says that "Bean-managed persistence entity beans manage the resource locking within the bean implementation themselves" in the advanced subject chapter. Ok can someone in oracle add an extra line eloborating on that statement ?
    I am stuck in trying to pass a test that can do concurrent modify of an entity bean. I had 2 or more threads trying to modify one single BMP entity bean object concurrently. The database vendor recognizes one bean had the lock and deny locks to any other beans. Who should block the call to the database until one thread releases the lock on the object ? The developer ? J2EE container ? Database ?
    J2EE tenet "Developers are shielded from concurrency and threading issues while implementing business logic" Does that still hold ??
    An object Person's salary value and his benefit information are tried to be modified at the same time by different external system(salary administrator, benefit's administrator). But I dont want the user to see the lock on the object error, but instead I require a pessimistic lock on the BMP. Why does Oc4J not support pessimistic concurrency option for BMP ?

    Kurien,
    If you wish to bring something to the attention of the "Oracle dev team", I suggest you try Oracle's "MetaLink" Web site:
    http://metalink.oracle.com
    It is the official Oracle support Web site.
    These forums are for the Oracle community. Oracle Corporation employees are not obliged to even visit these forums.
    By the way, I am not an Oracle employee.
    Good Luck,
    Avi.
    P.S. For your information, you may find Debu Panda's blogs of help:
    http://radio.weblogs.com/0135826/

  • Help! My database connection from BMP Entity bean dies after a while!!!

    Hi all!
    I posted a related post about this lately How do I use connection pooling from BMP Entity Beans in OC4J 10.1.2? but it didn't solve my problems.
    I have some entity beans coded with BMP, so I handle all database stuff myself. I have set up datasources.xml like this:
        <data-source
            class="com.evermind.sql.DriverManagerDataSource"
            name="OracleDS"
            location="jdbc/OracleCoreDS"
            xa-location="jdbc/xa/OracleXADS"
            ejb-location="jdbc/OracleDS"
            connection-driver="oracle.jdbc.driver.OracleDriver"
            username="scott"
            password="tiger"
            url="jdbc:oracle:thin:@//URL TO DB:SID"
            inactivity-timeout="30"
            min-connections="10"
            max-connections="50"
        />All JNDI connection lookup is done through the ejb-location as I should. I have been through all my try {} catch {} finally {} blocks, so ensure that I close all objects after use.
    After a few hours of inactivity, my program dies. I have inserted a lot of debug statements (System.out.println()), and it seems like the program hangs when it's trying to execute a PreparedStatement.
    I.e. it dies when I do ps.ExecuteQuery in the code below (NOTE: to make things easier to read, I have stripped out all error handling here):
        Context ic = new InitialContext();
        DataSource ds = (DataSource)ic.lookup("jdbc/OracleDS");
        c = ds.getConnection();
        System.out.println("DEBUG: Got database connection.");
        PreparedStatement ps = c.prepareStatement("SELECT foobar FROM footable WHERE foo=?");
        System.out.println("DEBUG: Prepared SQL statement.");
        ps.setString(1,"foo");
        ResultSet rs = ps.executeQuery();
        // Close all objects (rs, ps, c) here.My database is on another physical server, so I wonder if this is caused by an unstable network, or?
    Please help!
    ~Morten

    Hi again!
    Sorry for the delay, but I have been busy lately.
    Anyway: Our application server is 10.1.2, so I don't think patch 4307303 is relevant here. Database server is Oracle 9.2.0.6. Everything runs on Linux (of course) ;-).
    Here's a thread dump:
    Full thread dump Java HotSpot(TM) Server VM (1.4.2_04-b05 mixed mode):
    "ApplicationServerThread-8" prio=1 tid=0x089a9448 nid=0x5902 in Object.wait() [885e6000..885e687c]
         at java.lang.Object.wait(Native Method)
         at EDU.oswego.cs.dl.util.concurrent.SynchronousChannel.poll(SynchronousChannel.java:353)
         - locked <0x91a31e60> (a EDU.oswego.cs.dl.util.concurrent.LinkedNode)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor.getTask(PooledExecutor.java:767)
         at com.evermind.util.ReleasableResourcePooledExecutor.myGetTask(ReleasableResourcePooledExecutor.java:151)
         at com.evermind.util.ReleasableResourcePooledExecutor.access$000(ReleasableResourcePooledExecutor.java:33)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:190)
         at java.lang.Thread.run(Thread.java:534)
    "AJPRequestHandler-ApplicationServerThread-7" prio=1 tid=0x08d78a58 nid=0x5902 runnable [8b2f4000..8b2f587c]
         at java.net.SocketInputStream.socketRead0(Native Method)
         at java.net.SocketInputStream.read(SocketInputStream.java:129)
         at oracle.net.ns.Packet.receive(Unknown Source)
         at oracle.net.ns.DataPacket.receive(Unknown Source)
         at oracle.net.ns.NetInputStream.getNextPacket(Unknown Source)
         at oracle.net.ns.NetInputStream.read(Unknown Source)
         at oracle.net.ns.NetInputStream.read(Unknown Source)
         at oracle.net.ns.NetInputStream.read(Unknown Source)
         at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:978)
         at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:950)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:434)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:661)
         at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:959)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:693)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1065)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2901)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:2942)
         - locked <0x914cad08> (a oracle.jdbc.driver.T4CPreparedStatement)
         - locked <0x920256c0> (a oracle.jdbc.driver.T4CConnection)
         at com.evermind.sql.FilterPreparedStatement.executeQuery(FilterPreparedStatement.java:270)
         at com.evermind.sql.FilterPreparedStatement.executeQuery(FilterPreparedStatement.java:270)
         at com.evermind.sql.PreparedStatementBCELProxy.executeQuery(PreparedStatementBCELProxy.java:31)
         at com.brunata.servicerapport.ejb.CustomerBean.ejbCreate(Unknown Source)
         at CustomerLocalHome_EntityHomeWrapper2.create(CustomerLocalHome_EntityHomeWrapper2.java:420)
         at com.brunata.servicerapport.BeanFactory.getCustomerBean(Unknown Source)
         at com.brunata.servicerapport.CustomerOpenAction.execute(Unknown Source)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at com.brunata.servicerapport.CustomerAuthorizationFilter.doFilter(Unknown Source)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:649)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    "Thread-23" daemon prio=1 tid=0x092ebb18 nid=0x5902 in Object.wait() [88565000..8856587c]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x920000f0> (a java.util.TaskQueue)
         at java.util.TimerThread.mainLoop(Timer.java:429)
         - locked <0x920000f0> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:382)
    "Thread-22" daemon prio=1 tid=0x092eb988 nid=0x5902 in Object.wait() [8dfa0000..8dfa087c]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x92000188> (a java.util.TaskQueue)
         at java.util.TimerThread.mainLoop(Timer.java:429)
         - locked <0x92000188> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:382)
    "AJPRequestHandler-ApplicationServerThread-6" prio=1 tid=0x08c03240 nid=0x5902 runnable [8b0f1000..8b0f187c]
         at java.net.SocketInputStream.socketRead0(Native Method)
         at java.net.SocketInputStream.read(SocketInputStream.java:129)
         at com.evermind.io.SingleReadBufferInputStream.readChunk(SingleReadBufferInputStream.java:116)
         at com.evermind.io.SingleReadBufferInputStream.read(SingleReadBufferInputStream.java:35)
         at com.evermind.server.http.AJPRequestHandler.readAJPPackets(AJPRequestHandler.java:462)
         at com.evermind.server.http.AJPRequestHandler.initRequest(AJPRequestHandler.java:396)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:185)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    "DestroyJavaVM" prio=1 tid=0x08053278 nid=0x5902 waiting on condition [0..bfffcac4]
    "OC4JMonitorThread" daemon prio=1 tid=0x08d7a5a0 nid=0x5902 in Object.wait() [88667000..8866787c]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x92aed1f8> (a java.lang.Object)
         at oracle.ons.NotificationQueue.internalDequeue(NotificationQueue.java:253)
         - locked <0x92aed1f8> (a java.lang.Object)
         at oracle.ons.NotificationQueue.dequeue(NotificationQueue.java:226)
         at oracle.ons.Subscriber.receive(Subscriber.java:136)
         at com.evermind.server.OC4JMonitorThread.run(OC4JMonitorThread.java:315)
         at java.lang.Thread.run(Thread.java:534)
    "Thread-6" daemon prio=1 tid=0x087f9f98 nid=0x5902 in Object.wait() [886e8000..886e887c]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x92aed368> (a java.lang.Object)
         at java.lang.Object.wait(Object.java:429)
         at oracle.ons.NotificationQueue.internalDequeue(NotificationQueue.java:255)
         - locked <0x92aed368> (a java.lang.Object)
         at oracle.ons.NotificationQueue.dequeue(NotificationQueue.java:215)
         at oracle.ons.SenderThread.run(SenderThread.java:81)
    "Thread-5" daemon prio=1 tid=0x087f9d10 nid=0x5902 runnable [88769000..8876987c]
         at java.net.SocketInputStream.socketRead0(Native Method)
         at java.net.SocketInputStream.read(SocketInputStream.java:129)
         at oracle.ons.InputBuffer.readMoreData(InputBuffer.java:267)
         at oracle.ons.InputBuffer.getNextString(InputBuffer.java:222)
         at oracle.ons.ReceiverThread.run(ReceiverThread.java:228)
    "TaskManager" prio=1 tid=0x087f9b30 nid=0x5902 waiting on condition [887ea000..887ea87c]
         at java.lang.Thread.sleep(Native Method)
         at com.evermind.util.TaskManager.run(TaskManager.java:247)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    "Thread-4" prio=1 tid=0x08ca2fb8 nid=0x5902 in Object.wait() [891e2000..891e287c]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x92aee258> (a java.util.TaskQueue)
         at java.util.TimerThread.mainLoop(Timer.java:429)
         - locked <0x92aee258> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:382)
    "AJPConnectionListener [0.0.0.0/0.0.0.0:3302]" prio=1 tid=0x086f1668 nid=0x5902 runnable [8a7ca000..8a7ca87c]
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
         - locked <0x927a0390> (a java.net.PlainSocketImpl)
         at java.net.ServerSocket.implAccept(ServerSocket.java:448)
         at java.net.ServerSocket.accept(ServerSocket.java:419)
         at com.evermind.server.http.AJPConnectionListener.run(AJPConnectionListener.java:60)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    "RMIServer [0.0.0.0:3202] count:2" prio=1 tid=0x086cbff0 nid=0x5902 runnable [8b172000..8b17287c]
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
         - locked <0x927a0850> (a java.net.PlainSocketImpl)
         at java.net.ServerSocket.implAccept(ServerSocket.java:448)
         at java.net.ServerSocket.accept(ServerSocket.java:419)
         at com.evermind.server.rmi.RMIServer.run(RMIServer.java:464)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    "JMSServer[webprod:3702]" prio=1 tid=0x0879aff0 nid=0x5902 runnable [8b1f3000..8b1f387c]
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
         - locked <0x92746aa0> (a java.net.PlainSocketImpl)
         at java.net.ServerSocket.implAccept(ServerSocket.java:448)
         at java.net.ServerSocket.accept(ServerSocket.java:419)
         at com.evermind.server.jms.JMSServer.run(JMSServer.java:516)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    "LogFlusher" daemon prio=1 tid=0x081b91a0 nid=0x5902 waiting on condition [8b274000..8b27487c]
         at java.lang.Thread.sleep(Native Method)
         at oracle.core.ojdl.BufferedLogWriter$Flusher.run(BufferedLogWriter.java:354)
    "Signal Dispatcher" daemon prio=1 tid=0x080ba9e0 nid=0x5902 waiting on condition [0..0]
    "Finalizer" daemon prio=1 tid=0x080b61a8 nid=0x5902 in Object.wait() [8e9a7000..8e9a787c]
         at java.lang.Object.wait(Native Method)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
         - locked <0x925b0378> (a java.lang.ref.ReferenceQueue$Lock)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
         at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
    "Reference Handler" daemon prio=1 tid=0x080b5dc8 nid=0x5902 in Object.wait() [8ea28000..8ea2887c]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:429)
         at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)
         - locked <0x925b02a0> (a java.lang.ref.Reference$Lock)
    "VM Thread" prio=1 tid=0x080b52e0 nid=0x5902 runnable
    "VM Periodic Task Thread" prio=1 tid=0x080bee08 nid=0x5902 waiting on condition
    "Suspend Checker Thread" prio=1 tid=0x080b9fc8 nid=0x5902 runnable As far as I can see, my PreparedStatement (or connection) is locked.... Any ideas?
    ~Morten ;-)

  • Deploying CMP Entity Beans in Weblogic

    How to generate/convert the Orion xml file to Weblogic_RDBMS ?
    Thx

    petstore 1.3 will be available for the upcoming beta of weblogic 7.0...
    Andrew Sliwkowski(BEA)
    [email protected]
    "Nitin Sawant" <[email protected]> wrote in message
    news:3c04f6cd$[email protected]..
    >
    Appreciate if you can share your plans on releasing a petstore 1.3 patchfor weblogic.
    >
    >
    i am having problems deploying CMP Entity Beans in petstore 1.3 where theprimary
    key class is defined as java.lang.Object in the ejb-jar.xml descriptor(<prim-key-class>java.lang.Object</prim-key-class>).
    Does weblogic 6.1 with 1.3 features enabled support the above feature.
    Thanks,

  • Error while deploying an entity bean

    Hi,
    I am trying to deploy an entity bean in weblogic 7.0 .
    My weblogic-ejb-jar.xml has the entry as :
    <weblogic-enterprise-bean>
    <ejb-name>enroleejb.ManagedObjectImplHome</ejb-name>
    <stateless-session-descriptor>
    <pool>
    <max-beans-in-free-pool>100</max-beans-in-free-pool>
    <initial-beans-in-free-pool>0</initial-beans-in-free-pool>
    </pool>
    <stateless-clustering>
    <stateless-bean-is-clusterable>True</stateless-bean-is-clusterable>
    <stateless-bean-methods-are-idempotent>False</stateless-bean-methods-are-ide
    mpotent>
    </stateless-clustering>
    </stateless-session-descriptor>
    <transaction-descriptor>
    <trans-timeout-seconds>60</trans-timeout-seconds>
    </transaction-descriptor>
    <enable-call-by-reference>True</enable-call-by-reference>
    <jndi-name>enroleejb.ManagedObjectImplHome</jndi-name>
    </weblogic-enterprise-bean>
    When I run ejbc it gives the following error.
    [java] The file /meta-inf/weblogic-cmp-rdbms-jar.xml, specified in a
    type-storage element
    of your weblogic-ejb-jar.xml descriptor, does not exist in the jar
    file.
    [java] at
    weblogic.ejb20.persistence.PersistenceType.setTypeSpecificFile(PersistenceTy
    pe.java:475)
    [java] at
    weblogic.ejb20.persistence.PersistenceType.setupDeployer(PersistenceType.jav
    a:407)
    [java] at
    weblogic.ejb20.deployer.CMPInfoImpl.setup(CMPInfoImpl.java:114)
    [java] at
    weblogic.ejb20.ejbc.EJB20CMPCompiler.generatePersistenceSources(EJB20CMPComp
    iler.java:64)
    [java] at
    weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:223)
    [java] at
    weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:344)
    [java] at weblogic.ejbc20.runBody(ejbc20.java:470)
    [java] at weblogic.utils.compiler.Tool.run(Tool.java:126)
    [java] at weblogic.ejbc.main(ejbc.java:29)
    In the generated jar file I have meta-inf\weblogic-cmp-rdbms.jar file.
    Still it gives the error.
    What could be the problem?
    Any help would be appreciated.
    Thanks,
    Namrata

    Ejb jar file should have META-INF/weblogic-cmp-rdbms-jar.xml
    "Sarita Satoor" <[email protected]> wrote:
    Hi,
    I am trying to deploy an entity bean in weblogic 7.0 .
    My weblogic-ejb-jar.xml has the entry as :
    <weblogic-enterprise-bean>
    <ejb-name>enroleejb.ManagedObjectImplHome</ejb-name>
    <stateless-session-descriptor>
    <pool>
    <max-beans-in-free-pool>100</max-beans-in-free-pool>
    <initial-beans-in-free-pool>0</initial-beans-in-free-pool>
    </pool>
    <stateless-clustering>
    <stateless-bean-is-clusterable>True</stateless-bean-is-clusterable>
    <stateless-bean-methods-are-idempotent>False</stateless-bean-methods-are-ide
    mpotent>
    </stateless-clustering>
    </stateless-session-descriptor>
    <transaction-descriptor>
    <trans-timeout-seconds>60</trans-timeout-seconds>
    </transaction-descriptor>
    <enable-call-by-reference>True</enable-call-by-reference>
    <jndi-name>enroleejb.ManagedObjectImplHome</jndi-name>
    </weblogic-enterprise-bean>
    When I run ejbc it gives the following error.
    [java] The file /meta-inf/weblogic-cmp-rdbms-jar.xml, specified
    in a
    type-storage element
    of your weblogic-ejb-jar.xml descriptor, does not exist in the jar
    file.
    [java] at
    weblogic.ejb20.persistence.PersistenceType.setTypeSpecificFile(PersistenceTy
    pe.java:475)
    [java] at
    weblogic.ejb20.persistence.PersistenceType.setupDeployer(PersistenceType.jav
    a:407)
    [java] at
    weblogic.ejb20.deployer.CMPInfoImpl.setup(CMPInfoImpl.java:114)
    [java] at
    weblogic.ejb20.ejbc.EJB20CMPCompiler.generatePersistenceSources(EJB20CMPComp
    iler.java:64)
    [java] at
    weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:223)
    [java] at
    weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:344)
    [java] at weblogic.ejbc20.runBody(ejbc20.java:470)
    [java] at weblogic.utils.compiler.Tool.run(Tool.java:126)
    [java] at weblogic.ejbc.main(ejbc.java:29)
    In the generated jar file I have meta-inf\weblogic-cmp-rdbms.jar file.
    Still it gives the error.
    What could be the problem?
    Any help would be appreciated.
    Thanks,
    Namrata

  • I am facing a problem while deploying an Entity bean in iPlanet(sp3).I have attached the exception thrown.Why has this exception occured?

    [04/Dec/2001 10:54:00:2] error: EBFP-marshal_internal: internal exception caught in kcp skeleton, ex
    ception = java.lang.NullPointerException
    [04/Dec/2001 10:54:00:2] error: Exception Stack Trace:
    java.lang.NullPointerException
    at java.util.Hashtable.get(Hashtable.java:321)
    at com.netscape.server.ejb.SQLPersistenceManager.<init>(Unknown Source)
    at com.netscape.server.ejb.SQLPersistenceManagerFactory.newInstance(Unknown Source)
    at com.netscape.server.ejb.EntityDelegateManagerImpl.getPersistenceManager(Unknown Source)
    at com.netscape.server.ejb.EntityDelegateManagerImpl.doPersistentFind(Unknown Source)
    at com.netscape.server.ejb.EntityDelegateManagerImpl.find(Unknown Source)
    at com.kivasoft.eb.EBHomeBase.findSingleByParms(Unknown Source)
    at samples.test.ejb.Entity.ejb_home_samples_test_ejb_Entity_TestEntityBean.findByPrimaryKey(
    ejb_home_samples_test_ejb_Entity_TestEntityBean.java:126)
    at samples.test.ejb.Entity.ejb_kcp_skel_TestEntityHome.findByPrimaryKey__samples_test_ejb_En
    tity_TestEntity__int(ejb_kcp_skel_TestEntityHome.java:266)
    at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
    at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
    at samples.test.ejb.Entity.ejb_kcp_stub_TestEntityHome.findByPrimaryKey(ejb_kcp_stub_TestEnt
    ityHome.java:338)
    at samples.test.ejb.Entity.ejb_stub_TestEntityHome.findByPrimaryKey(ejb_stub_TestEntityHome.
    java:85)
    at samples.test.ejb.TestEJB.getGreeting(TestEJB.java:51)

    Hi,
    I think you are trying to test the Hello world EJB example shipped with the product. As a first
    step I would recomend you to go through every line of the document on deploying this application,
    since, I too have experienced many errors while trying to deploy the sample applications, but on
    following the documentation, I subsequently overcame all the errors and have been working with the
    applications. So please follow the steps in documentation and let me know, if you still encounter any
    issues.
    Regards
    Raj
    Sandhya S wrote:
    I am facing a problem while deploying an Entity bean in iPlanet(sp3).I
    have attached the exception thrown.Why has this exception occured?
    [04/Dec/2001 10:54:00:2] error: EBFP-marshal_internal: internal
    exception caught in kcp skeleton, ex
    ception = java.lang.NullPointerException
    [04/Dec/2001 10:54:00:2] error: Exception Stack Trace:
    java.lang.NullPointerException
    at java.util.Hashtable.get(Hashtable.java:321)
    at
    com.netscape.server.ejb.SQLPersistenceManager.<init>(Unknown Source)
    at
    com.netscape.server.ejb.SQLPersistenceManagerFactory.newInstance(Unknown
    Source)
    at
    com.netscape.server.ejb.EntityDelegateManagerImpl.getPersistenceManager(Unknown
    Source)
    at
    com.netscape.server.ejb.EntityDelegateManagerImpl.doPersistentFind(Unknown
    Source)
    at
    com.netscape.server.ejb.EntityDelegateManagerImpl.find(Unknown Source)
    at com.kivasoft.eb.EBHomeBase.findSingleByParms(Unknown
    Source)
    at
    samples.test.ejb.Entity.ejb_home_samples_test_ejb_Entity_TestEntityBean.findByPrimaryKey(
    ejb_home_samples_test_ejb_Entity_TestEntityBean.java:126)
    at
    samples.test.ejb.Entity.ejb_kcp_skel_TestEntityHome.findByPrimaryKey__samples_test_ejb_En
    tity_TestEntity__int(ejb_kcp_skel_TestEntityHome.java:266)
    at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
    at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
    at
    samples.test.ejb.Entity.ejb_kcp_stub_TestEntityHome.findByPrimaryKey(ejb_kcp_stub_TestEnt
    ityHome.java:338)
    at
    samples.test.ejb.Entity.ejb_stub_TestEntityHome.findByPrimaryKey(ejb_stub_TestEntityHome.
    java:85)
    at samples.test.ejb.TestEJB.getGreeting(TestEJB.java:51)
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • I can not fine the Entity Bean's advantage than Java Bean?

    I can not fine the Entity Bean's advantage than Java Bean,
    can you tell me, thanks a lot?

    I can not fine the Entity Bean's advantage than Java
    Bean,
    can you tell me, thanks a lot?I think you should read more of the EJB Spec. You'll find your answer there. But mainly with entities you can have the container manage all the lifecyle of the Bean (transactions, caching, creation, etc...). But entities are not only to map columns in the database, they are supposed to have business code. See more by reading the spec.
    MSB

  • [persistence] all work, but can't persist new entity bean

    Hi,
    I have a FacadeBean which is working fine ... I can contact the BD oracle for retrieving my entity beans, update an entity bean etc...
    BUT... I can't create an entity bean :( I don't understand why!!!
    With the same code, I can create, list, etc... on OC4J and JBoss but the create method won't work with WebLogic :|
    Here is the error present in console:
    <09-mars-2007 15 h 03 min 47 s CET> <Error> <EJB> <BEA-010026> <Exception occurr
    ed during commit of transaction Name=[EJB be.starapic.test.ejb.MyEntityFacadeBea
    n.create(be.starapic.test.ejb.MyEntity)],Xid=BEA1-007A82AF3A953057A4BD(30283302)
    ,Status=Rolled back. [Reason=weblogic.transaction.internal.AppSetRollbackOnlyExc
    eption],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=1,seconds
    left=30,XAServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(ServerRes
    ourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(state=rolledback,assigned=Ad
    minServer),xar=weblogic.jdbc.wrapper.JTSXAResourceImpl@110563c,re-Registered = f
    alse),SCInfo[base_domain+AdminServer]=(state=rolledback),properties=({weblogic.t
    ransaction.name=[EJB be.starapic.test.ejb.MyEntityFacadeBean.create(be.starapic.
    test.ejb.MyEntity)], weblogic.jdbc=t3://192.168.100.188:7001}),OwnerTransactionM
    anager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=AdminServer+192.168.
    100.188:7001+base_domain+t3+, XAResources={weblogic.jdbc.wrapper.JTSXAResourceIm
    pl},NonXAResources={})],CoordinatorURL=AdminServer+192.168.100.188:7001+base_dom
    ain+t3+): weblogic.transaction.RollbackException: Unknown reason
    at weblogic.transaction.internal.TransactionImpl.throwRollbackException(
    TransactionImpl.java:1808)
    at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(Se
    rverTransactionImpl.java:333)
    at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTran
    sactionImpl.java:227)
    at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemo
    teObject.java:606)
    at weblogic.ejb.container.internal.BaseRemoteObject.postInvokeTxRetry(Ba
    seRemoteObject.java:426)
    at weblogic.ejb.container.internal.StatefulRemoteObject.postInvokeTxRetr
    y(StatefulRemoteObject.java:100)
    at be.starapic.test.ejb.myentityfacade_opn58i_MyEntityFacadeRemoteImpl.c
    reate(myentityfacade_opn58i_MyEntityFacadeRemoteImpl.java:158)
    at be.starapic.test.ejb.myentityfacade_opn58i_MyEntityFacadeRemoteImpl_C
    BV.create(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(Remote
    BusinessIntfProxy.java:42)
    at $Proxy152.create(Unknown Source)
    at be.starapic.test.web.HelloServlet.doGet(HelloServlet.java:88)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
    (StubSecurityHelper.java:226)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
    tyHelper.java:124)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:283)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:175)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:3334)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
    ervletContext.java:2081)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
    ontext.java:1987)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
    ava:1359)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
    .>
    <09-mars-2007 15 h 03 min 47 s CET> <Error> <HTTP> <BEA-101020> <[weblogic.servl
    et.internal.WebAppServletContext@144a314 - appName: 'testDeploy', name: '/testDe
    ploy', context-path: '/testDeploy'] Servlet failed with Exception
    javax.ejb.EJBException: nested exception is: weblogic.transaction.internal.AppSe
    tRollbackOnlyException
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(Remote
    BusinessIntfProxy.java:57)
    at $Proxy152.create(Unknown Source)
    at be.starapic.test.web.HelloServlet.doGet(HelloServlet.java:88)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    Truncated. see log file for complete stacktrace
    That say nothing good...
    at $Proxy152.create(Unknown Source) is the problem I think but why ...?
    Here is the entity bean:
    @Entity
    @Table(name="table_myentity")
    public class MyEntity implements Serializable
    private static final long serialVersionUID = -5806278646729410835L;
    private int id;
    private String name;
    private int number;
    public void setName(String name) {
    this.name = name;
    public String getName() {
    return name;
    public void setNumber(int number) {
    this.number = number;
    @Column(name="mynumber")
    public int getNumber() {
    return number;
    public void setId(int id) {
    this.id = id;
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    public int getId() {
    return id;
    May be a problem of auto-generate for the ID...
    Here is the facade bean:
    @Stateful(name="myentityfacade", mappedName="myentityfacade")
    @Remote(MyEntityFacadeRemote.class)
    @Local(MyEntityFacadeLocal.class)
    public class MyEntityFacadeBean implements MyEntityFacadeRemote, MyEntityFacadeLocal {
    @PersistenceContext
    private EntityManager em;
    public MyEntity create(MyEntity meb) {
    em.persist(meb);
    return meb;
    public void update(MyEntity meb) throws IllegalAccessException {
    if (null == em.find(MyEntity.class, meb.getId())) {
    throw new IllegalAccessException("Attempt to update a non existing entity");
    em.merge(meb);
    public void delete(int id) {
    MyEntity meb = em.find(MyEntity.class, id);
    em.remove(meb);
    public void delete(MyEntity meb) {
    meb = em.merge(meb);
    em.remove(meb);
    public MyEntity findById(int id) {
    return em.find(MyEntity.class, id);
    public List<MyEntity> listAll() {
    return em.createQuery("SELECT o FROM MyEntity AS o").getResultList(); //TOPLINK, HIBERNATE
    public List<MyEntity> listFiltered(String filter) {
    return em.createQuery("SELECT o FROM MyEntity AS o "+filter).getResultList(); //TOPLINK, HIBERNATE
    public int getNbMyEntityBean() {
    return this.listAll().size();
    Sorry for the long post... And finnaly here is the code present in the servlet:
    // CREATE
    MyEntity meb1 = new MyEntity();
    meb1.setName("bbb");
    meb1.setNumber(2);
    meb1 = remoteMyEntityFacade.create(meb1);
    Note that the remoteMyEntityFacade is working, because I can call any other buisness method without crashing the application.. Just the create can't work and so, persistence can't be used :(
    Any suggestions ?

    There is a problem with generated key
    that code won't work:
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    public int getId() {
    return id;
    But, if I remove line "GeneratedValue", it can insert into the BD, once only :s
    The ID is set to 0 by default, so I can't add more than one entity :s

  • Can i create an entity bean to part of a table

    Hi there,
    I am using EJB 2.0.
    Can i create an entity bean to part of a table.
    Thanks
    Edited by: vamseebobby on Nov 5, 2007 11:11 AM

    of course,provided the other parts left out have not constraints.
    sumelong

  • Can anyone describe using entity beans for persitance in Software Architect

    Can anyone describe using entity beans for persitance in Software Architecture you built for a product?

    Although this forum is supposed to help you gain knowledge on entity beans, its not a free rider that's supposed regurgitate everyone's knowledge to you.
    Read something first and then clarify your thoughts with this forum.

  • Can CMT Session Bean call BMP Entity Bean in WebLogic 6.0?

              Hi
              Does anybody successfully use CMT Session Bean calling BMP +CMT Entity bean in
              WebLogic6.0? I have the following problem.
              Any idea will be appreciated.
              --Winston
              Let's say we have a Session bean SB, it uses container to manage the transaction.
              A method of SB will call an Entity Bean EB which adopts bean-managed persistence.
              Both SB and EB use CMT and all of their methods use "required" in the descriptor
              file.
              1. If the connection con.getAutoCommit() is true in the EB, then the transaction
              within SB cannot be rolled back as the ejbCreate() has already commit into the
              database.
              2. On the other hand if Connecton of EB con.getAutoCommit() is false, then container
              cannot successfully commit the transaction from SB's method, as EjbCreate and
              EjbStore() in EB are likely using the different database connections, which causes
              EbjStore() fail and the following error message will be sent to the Console:
              ============================================================
              "<Jul 9, 2001 4:16:48 PM PDT> <Error> <EJB> <Exception during commit of transacti
              on transaction=(IdHash=7738920,Name = [EJB TraderBeanImpl.buy()],Xid=105:5e6719a
              ded42e332,Status=Rolled back. [Reason = weblogic.utils.NestedRuntimeException:
              E
              rror writing from beforeCompletion - with nested exception:
              [java.rmi.NoSuchObjectException: Exception from ejbStore:javax.ejb.NoSuchEntityE
              xception: ejbStore: AccountBean (4003) not updated]],numRepliesOwedMe=0,numRepli
              esOwedOthers=0,seconds since begin=0,seconds left=30,SCInfo[examplesServer]=(sta
              te=rolledback),properties=({weblogic.transaction.name=[EJB TraderBeanImpl.buy()]
              })): java.rmi.NoSuchObjectException: Exception from ejbStore:javax.ejb.NoSuchEnt
              ityException: ejbStore: AccountBean (4003) not updated
              at weblogic.ejb20.internal.EJBRuntimeUtils.throwRemoteException(EJBRunti
              meUtils.java:57)
              at weblogic.ejb20.manager.DBManager.beforeCompletion(DBManager.java:364)
              at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManag
              er.java:211)
              at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(Serv
              erSCInfo.java:511)
              at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(Se
              rverSCInfo.java:78)
              at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAn
              dChain(ServerTransactionImpl.java:893)
              at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(
              ServerTransactionImpl.java:1229)
              at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTran
              sactionImpl.java:168)
              at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:2
              01)
              at examples.ejb.basic.statefulSession.TraderBeanEOImpl.buy(TraderBeanEOI
              mpl.java:37)
              at examples.ejb.basic.statefulSession.TraderBeanEOImpl_WLSkel.invoke(Tra
              derBeanEOImpl_WLSkel.java:76)
              at weblogic.rmi.internal.BasicServerAdapter.invoke(BasicServerAdapter.ja
              va:373)
              at weblogic.rmi.internal.BasicServerAdapter.invoke(BasicServerAdapter.ja
              va:237)
              at weblogic.rmi.internal.BasicRequestHandler.handleRequest(BasicRequestH
              andler.java:118)
              at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
              .java:17)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              --------------- nested within: ------------------
              weblogic.utils.NestedRuntimeException: Error writing from beforeCompletion - wit
              h nested exception:
              [java.rmi.NoSuchObjectException: Exception from ejbStore:javax.ejb.NoSuchEntityE
              xception: ejbStore: AccountBean (4003) not updated]
              at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManag
              er.java:220)
              at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(Serv
              erSCInfo.java:511)
              at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(Se
              rverSCInfo.java:78)
              at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAn
              dChain(ServerTransactionImpl.java:893)
              at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(
              ServerTransactionImpl.java:1229)
              at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTran
              sactionImpl.java:168)
              at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:2
              01)
              at examples.ejb.basic.statefulSession.TraderBeanEOImpl.buy(TraderBeanEOI
              mpl.java:37)
              at examples.ejb.basic.statefulSession.TraderBeanEOImpl_WLSkel.invoke(Tra
              derBeanEOImpl_WLSkel.java:76)
              at weblogic.rmi.internal.BasicServerAdapter.invoke(BasicServerAdapter.ja
              va:373)
              at weblogic.rmi.internal.BasicServerAdapter.invoke(BasicServerAdapter.ja
              va:237)
              at weblogic.rmi.internal.BasicRequestHandler.handleRequest(BasicRequestH
              andler.java:118)
              at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
              .java:17)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              --------------- nested within: ------------------
              weblogic.transaction.RollbackException: Unexpected exception in beforeCompletion
              : sync = weblogic.ejb20.internal.TxManager$TxListener@356eb0
              Error writing from beforeCompletion - with nested exception:
              [weblogic.utils.NestedRuntimeException: Error writing from beforeCompletion -
              wi
              th nested exception:
              [java.rmi.NoSuchObjectException: Exception from ejbStore:javax.ejb.NoSuchEntityE
              xception: ejbStore: AccountBean (4003) not updated]]
              at weblogic.transaction.internal.TransactionImpl.throwRollbackException(
              TransactionImpl.java:1261)
              at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTran
              sactionImpl.java:218)
              at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:2
              01)
              at examples.ejb.basic.statefulSession.TraderBeanEOImpl.buy(TraderBeanEOI
              mpl.java:37)
              at examples.ejb.basic.statefulSession.TraderBeanEOImpl_WLSkel.invoke(Tra
              derBeanEOImpl_WLSkel.java:76)
              at weblogic.rmi.internal.BasicServerAdapter.invoke(BasicServerAdapter.ja
              va:373)
              at weblogic.rmi.internal.BasicServerAdapter.invoke(BasicServerAdapter.ja
              va:237)
              at weblogic.rmi.internal.BasicRequestHandler.handleRequest(BasicRequestH
              andler.java:118)
              at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
              .java:17)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >"
              

    We did receive a 4.5.1 / 5.1 interoperability patch - but it wasn't quite 'seamless'.
    We never tried to use it.
    SOAP? Isn't that around 50 times slower than RMI?
    Mike
    "Gary Mui" <[email protected]> wrote:
    We ran into this issue last fall and got some feedback from weblogic
    support. They originally said that it could be done (as well as different
    versions talking to one another via JMS) but it turned out that they
    were
    incorrect and ended up saying that it is not possible. Before 6.0 went
    GA,
    BEA said that there would be a interoperability patch to do this, but
    I've
    never seen nor heard of anything regarding it. As a workaround, we
    implemented 4.5.1 / 6.0 communication via SOAP.
    Mike Reiche wrote in message <3b1bcaec$[email protected]>...
    I have the same question - and more. Last year we were told that wecould
    not use
    RMI (and ejbs) between 4.5.1 and 5.1. Which seems kinda weird becauseI've
    heard
    of people using WL ejbs from Tomcat. This issue has caused us to avoidusing
    WL ejbs in any future development which has any chance of ever beingused
    by any
    app server (WL included) that is not under the direct control of thedata
    center.
    I've been trying to convince the Architecture team here that we canuse WL
    EJBs
    and we can call them from other app servers - but can't seem to getany
    supporting
    statement from BEA (maybe I haven't tried hard enough).
    Anyway, a response from BEA would be appreciated.
    - Mike
    "Madhu K" <[email protected]> wrote:
    Is it possible to call a (stateless session) bean deployed in weblogic
    6.0
    from a bean in weblogic 5.1? I have two versions of weblogic running
    on two
    different hosts and I have to call a bean that is running in 6.0 from
    5.1.
    Are there any limitations?
    Appreciate any feedback/suggestions.
    Thanks,
    Madhu

Maybe you are looking for

  • Problem with PDF files opening up in code on IMac OS 10.6.6

    Just bought a new IMac three weeks ago (my first Apple Computer after years of using a PC). I've been using their TextEdit program to create simple documents, and routinely save the documents as PDF's to make it easier to share with clients. Everythi

  • Macbook slows down at the same time every day.

    I know this makes me sound crazy, but my Macbook (running Mac OS X) starts to get inexplicably sluggish at the same time every day – roughly between 4:30 and 5 p.m. Applications start temporarily freezing up and I get that beachball-looking thing, an

  • Ethernet/Displays/Thunderbolt/Ports

    I want to use my imac as a second screen for my macbook pro but my minidisplay port on the macbook pro is being used up by the thunderboltd external harddrive, so even if i bought a minidisplay--> minidisplay cable i wouldn't be able to use it.......

  • Need Info about SAP functional training in Bangalore

    Hi All, Can any of you suggest where i can get training for the following functional areas in Bangalore? MM, SD and PP I will be grateful to you if you can also tell me the cost for each of this functional training. Thanks and Regards, Santhu.

  • How to rename oracle9i database in windows 2000

    Hi All, I am trying to rename an oracle database on windows 2000. I am having some issues...can anyone help me how to fix it. Trace file is created from existing database (ORCLDB) using alter database backup controlfile to trace and the following ste