Strange Session/Entity Bean Cross-Instance Calls in Cluster

In one of our enviroments, we are seeing session entity bean cross-instance
          calls that are hard to explain. The following is our configuration:
          The cluster contains 4 instances on 2 machines (2 on each machine). The same
          beans are deployed to each instance. "jndi.properties" is on the classpath
          for the each instance with jndi provider url = mach1inst1-ip, mach1inst2-ip,
          mach2inst1-ip, mach2inst2-ip:70001. Same servlets are also deployed to each
          instances.
          Requests from the web are load balanced through weblogic's proxy plugin for
          IPlanet and are forwarded to the 4 weblogic cluster instances. The servlet
          processing the requests calls a stateless session bean which uses an entity
          bean. The entity bean is configured with "home-is-clusterable" set to
          "false".
          What we have observed is that when all 4 instances are up, sometimes (even
          when the load is not high) the session bean is accessing entity bean from an
          instance on one machine to an instnace on another machine, while if only one
          machine (with 2 instances) is up, we don't see such calls.
          My theory is that because the jndi provider url is the same for all
          instances, the jndi lookup from each instance goes to the instance bound to
          the first IP specified in the provider url: machine 1 istance 1. If the
          request is from machine 2, because of co-location optimization, even though
          the home stub is from machine 1 instance 1, the session bean returned from
          the home stub actually is from machine 2. However, when the session bean
          does jndi lookup to get an entity bean home, the home stub is from machine 1
          and instance 1. And unfortunately, because the entity bean home is not
          clusterable, the stub can only point back to machine 1, co-location can not
          work. Thus entity bean from machine 1 is referenced by the session bean
          located on machine 2. I do not have a chance to verify this. But it seems to
          make sense to me.
          Unfortunately, I don't feel that I have a theory to explain why we don't see
          cross instance session entity bean calls when only 1 machine is up (with 2
          instances).
          Any ideas or hints would be greatly appreciated.
          Thanks,
          David Chen
          

rs = stmt.executeQuery() , insert statement is not a query. So use executeUpdate.

Similar Messages

  • Timeout of session / entity bean

    Hi all
    We are facing "RollbackException: The transaction has been marked for rollback (timed out)" excpetion. please help us in resolving this.
    Here is problem description.
    Code Description:
    Step1: Action class calls Session bean
    Step2:Session Bean does three things
    A. Reads various value from database and write it to fileOutputStream
    B. Generate a Sequence number using Sequence
    C. Call create method of Entity Bean by local reference to insert the created file (in step 2A) in database as blob
    As per our observation session bean takes around 20-30 sec in processing 2A and 2B.
    But at 2-C, code raises following error
    TariffDocumentBlob is the Entity Bean
    TariffSessionEJB is the Session Bean
    javax.ejb.CreateException: Error creating EntityBean: RollbackException: The transaction has been marked for rollback (timed out)
    05/10/24 16:04:01      at TariffDocumentBlobLocalHome_EntityHomeWrapper397.create(TariffDocumentBlobLocalHome_EntityHomeWrapper397.java:1135)
    05/10/24 16:04:01      at com.derc.rims.businessservice.businessinterface.TariffSessionEJBBean.createTariffBlobMasterRecord(TariffSessionEJBBean.java:102)
    05/10/24 16:04:01      at com.derc.rims.businessservice.businessinterface.TariffSessionEJBBean.uploadTariff(TariffSessionEJBBean.java:76)
    05/10/24 16:04:01      at TariffSessionEJBLocal_StatelessSessionBeanWrapper96.uploadTariff(TariffSessionEJBLocal_StatelessSessionBeanWrapper96.java:80)
    05/10/24 16:04:01      at com.derc.rims.businessservice.businessinterface.BISessionFacadeEJBBean.delegate(BISessionFacadeEJBBean.java:534)
    05/10/24 16:04:01      at BISessionFacadeEJB_StatelessSessionBeanWrapper4.delegate(BISessionFacadeEJB_StatelessSessionBeanWrapper4.java:101)
    05/10/24 16:04:01      at com.derc.rims.action.tariff.CalculateTariffAction.execute(CalculateTariffAction.java:75)
    05/10/24 16:04:01      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    05/10/24 16:04:01      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    05/10/24 16:04:01      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1485)05/10/24 16:04:01      at
    org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:527)05/10/24 16:04:01      at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:760)05/10/24 16:04:01      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)05/10/24 16:04:01      
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)05/10/24 16:04:01      at
    oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)05/10/24 16:04:01      at
    com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:649)05/10/24 16:04:01      at
    com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)05/10/24 16:04:01 TRANSACTION OVER05/10/24
    16:04:01      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
    05/10/24 16:04:01      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
    05/10/24 16:04:01      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
    05/10/24 16:04:01      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    05/10/24 16:04:01      at java.lang.Thread.run(Thread.java:534)
    com.evermind.server.rmi.OrionRemoteException: Transaction was rolled back: timed out     at
    BISessionFacadeEJB_StatelessSessionBeanWrapper4.delegate(BISessionFacadeEJB_StatelessSessionBeanWrapper4.java:159)
    at com.derc.rims.action.tariff.CalculateTariffAction.execute(CalculateTariffAction.java:75)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1485)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:527)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    at oracle.security.jazn.oc4j.JAZNFilter.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.HttpRequestHandler.run(HttpRequestHandler.java:270)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    at java.lang.Thread.run(Thread.java:534)
         Nested exception is:java.rmi.RemoteException: No Exception - originate from:java.lang.Exception: No Exception - originate from:; nested exception is:
         java.lang.Exception: No Exception - originate from:     at com.evermind.server.ejb.EJBUtils.makeException(EJBUtils.java:931)
         at BISessionFacadeEJB_StatelessSessionBeanWrapper4.delegate(BISessionFacadeEJB_StatelessSessionBeanWrapper4.java:159)     
         at com.derc.rims.action.tariff.CalculateTariffAction.execute(CalculateTariffAction.java:75)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1485)     
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:527)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.security.jazn.oc4j.JAZNFilter.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.HttpRequestHandler.run(HttpRequestHandler.java:270)     
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)     
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)     
         at java.lang.Thread.run(Thread.java:534)
         Caused by: java.lang.Exception: No Exception - originate from:     at com.evermind.server.ejb.EJBUtils.makeException(EJBUtils.java:930)
         ... 17 more
    We have tried out .....
    - Making new Enity Bean
    - changing timeout of session bean by changing it in properties
    <session-deployment name="TariffSessionEJB" timeout="300" >
    We are using Oracle 10g application Sever and Oracle 10.1 database.

    Assuming you are using either 9.0.4 or 10.1.2, please note that default transaction time out is 30s and you can change that <transaction-config> element in server.xml. This is specified in millliseconds
    -Debu

  • Creating a Session & Entity bean in Weblogic

    Hii javaities
    I am new 2 EJB , and i want 2 create a apllication using EJB.
    I want 2 create a session , and entity bean in WEblogic.
    Can anybody help me i this
    Or if u have some good links , plz pass it 2 me.
    Thanking in anticipation

    http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html
    http://www.oracle.com/technology/sample_code/tech/java/j2ee/designpattern/businesstier/sessionfacade/readme.html
    google search for more.

  • Strange behavior with entity beans and servlets in a cluster

    We have 2 WebLogic 4.5.1 servers in a cluster with none of the Service
              Packs installed. When a client uses the deployed entity beans or
              servlets they work every other time. The times they do not work nothing
              happens. No exceptions, no responses to the client ( i.e. HTTP 404s ),
              nothing. I suspect something in the cluster setup since we do not have
              these same problems on non-clustered entity beans or servlets. We have
              made sure all the entity beans have the Shared Database flag set on and
              added the delayUpdatesUntilEndOfTx false to the enviroment of the DD.
              That didn't fix the problem. Any ideas?
              Thanks in advance,
              Dallas Dempsey
              DEM - Houston, TX
              

    Do you have log files?
              - Prasad
              Chris Dempsey wrote:
              > We have 2 WebLogic 4.5.1 servers in a cluster with none of the Service
              > Packs installed. When a client uses the deployed entity beans or
              > servlets they work every other time. The times they do not work nothing
              > happens. No exceptions, no responses to the client ( i.e. HTTP 404s ),
              > nothing. I suspect something in the cluster setup since we do not have
              > these same problems on non-clustered entity beans or servlets. We have
              > made sure all the entity beans have the Shared Database flag set on and
              > added the delayUpdatesUntilEndOfTx false to the enviroment of the DD.
              > That didn't fix the problem. Any ideas?
              >
              > Thanks in advance,
              > Dallas Dempsey
              > DEM - Houston, TX
              

  • EJB/JPA Session/Entity Bean: Back Reference Id not set

    Hello All,
    I m using JPA as a persist tool. I have an entity Account and in Account there is a collection of entity AccountDetail. In Account entity relation for AccountDetail is One-To-Many and in AccountDetail the relation for Account is Many-To-One. When i save the Account, object of Account and AccountDetail are saved correctly. But the problem is that in AccountDetail the Id of Account is not saved in Database table. I have AccountId in AccountDetail table. plz help me??
    Second thing is that how to generate automatically primary keys when entity saved in database ???

    define the column you want to auto increment as an Integer with Identity attribute set to True (using the sql server management tool for example) and then put
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    in front of the ID declaration in the mapping file, it should generate the IDs automatically.

  • How to achieve Entity Bean methods ONLY by calling them from a Session Bean

    Hi,
    I used a session bean as a business facade to a entity bean.
    In the session bean I achieve the entity bean with a jndiContext.lookup("java:comp/env/ejbEntityBean").
    Now I am looking for a solution that it is only possible to call the entity bean methods or the whole entity bean from the corresponding session bean.
    In other words: "How can I forbid the access to the entity bean, if the calling object is not the corresponding session bean?"
    --->
    I only found a way the regulate the access to the entity bean methods by declaring a security-role.
    But the existence of the security-role at runtime depends on the calling user-authorizations!
    Is there a way to set the entity-security-role within the session bean context?
    Best Regards
    Steffen

    Hi Srikanth Reddy.T,
    sorry, I am not looking for a special tag  <entity-security-role>.
    I am looking for a way to specifiy that my session bean "has" the special security-role (in my case "WebZaehlerEjbRole") of my entity bean "in my case "WebZaehlerEjbRole") that is necessary to call the methods (findAlleEntries, findByWindowId,...) of my entity-bean.
    Here is the relevant part of my ejb-jar.ml:
         <assembly-descriptor>
              <security-role>
                   <role-name>WebZaehlerEjbRole</role-name>
              </security-role>
              <method-permission>
                   <description>method-permission</description>
                   <role-name>WebZaehlerEjbRole</role-name>
                   <method>
                        <ejb-name>WebZaehlerBean</ejb-name>
                        <method-name>findAllEntries</method-name>
                        <method-params/>
                   </method>
                   <method>
                        <ejb-name>WebZaehlerBean</ejb-name>
                        <method-name>findByWindowId</method-name>
                        <method-params>
                             <method-param>java.lang.Long</method-param>
                        </method-params>
                   </method>
    Regards,
    Steffen

  • Wrong version of an entity bean object being updated

    We are having a problem with an entity bean that uses bean managed persistence. The "order" entity bean has
    been used as part of our Order Routing System for the last 2 years with no problems. The entity bean is
    accessed via calls from a "Order Manager" session bean. No change has been done to the entity bean but the
    frequency of calls from the session bean to update the entity bean have increased significantly.
    The "order" entity bean wraps an Order object that contains order properties (i.e. id, quantity, price,
    version, etc). The entity bean has a "void setOrder(Order param)" function that writes the Order to a database
    and a "Order getOrder()" function that clones and returns the internal Order object. The "ejbLoad()" function
    reads the Order object from the database and the "ejbStore()" function is not implemented.
    The "OrderEntityPK ejbFindByPrimaryKey()" function checks if the order entity primary key (an "int") exists
    on the database.
    We are using the SilverStream 3.5 application server as our EJB container. According to the SilverStream manual
    it does not maintain a pool of idle/unused entity beans, instead it instantiates beans as requested.
    Our problem is:
    1) The wrong version of the entity object is sometimes being updated (i.e. an old instance of the order entity is being
    picked up and updated on the database).
    2) We sometimes get a TransactionRequired exception thrown when we have concurrent updates to two different
    objects of the entity bean.
    Any idea as to what our problem could be?
    Thanks in advance for your help,
    The following are the main code snippets:
    Original Code
    Session Bean A
    Method 1 --- gets entity Bean B and calls a method on a different object passing this entity bean
              in as a parameter to enable a method on this bean to be called.
    EntityBean lOrderEntity = findOrderEntity(callerUnixLogin, currOrderId);
                   currOrder = lOrderEntity.getOrder();
                   //Logic to update the currOrder object via a method call.
                   persistManager.persistOrder(lOrderEntity, callerUnixLogin, currOrder, psTransactionType);
         persistManager.persistOrder Method:
                   lOrderEntity.setOrder(callerUnixLogin, order);
         findOrderEntity method:
    OrderEntity lOrderEntity = null;
              OrderEntityBeanPK orderPK = new OrderEntityBeanPK(orderId);
              try
                   if (orderEntityHome == null)
                        connectToOrderEntityBean(callerUnixLogin);
                   lOrderEntity = orderEntityHome.findByPrimaryKey(orderPK);
              ... etc
    Current Code
    Session Bean C
    Method 2 ---- calls method 1 in Session Bean A
    Calls to method 2 above happens in quick succession.
    OrderEntityBean class
    ... important methods ...
         private Order order = null;
         public OrderEntityBeanPK ejbFindByPrimaryKey(OrderEntityBeanPK primaryKey)
              throws FinderException, RemoteException, DBOException
              try
                   orderObjectManager.orderIdExists(primaryKey.orderId);
              catch (OMOrderValidationException exc)
                   throw new FinderException(exc.getMessage());
              return primaryKey;
         public void setOrder(String userUnixLogin, Order newOrder)
              throws EJBException, RemoteException, DBOException, OMFormattingException, OMOrderValidationException
              callerUnixLogin = userUnixLogin;
              int version = newOrder.getOrderVersion().intValue();
              if (order.getOrderVersion().intValue() == version)
                   order = null;
                   order = newOrder;
                   Integer newVersion = new Integer(version + 1);
                   order.setOrderVersion(newVersion);
                   newVersion = null;
                   order.setSysUser(callerUnixLogin);
                   orderObjectManager.updateOrder(callerUnixLogin, order);
              else
                   Debug.Print(userUnixLogin, "OrderEntityBean.setOrder: wrong version number for order " + newOrder.getOrdId() +
                        ": expected " + order.getOrderVersion() + " and got " + newOrder.getOrderVersion(), 0);
                   throw new OMOrderValidationException("wrongVersion", order, order.getOrdId(), IName.Order.VERSION, newOrder.getOrderVersion());
         public Order getOrder()
              throws EJBException, RemoteException
    return ((Order)order.clone());
    The following transactions exists for the entity bean ...
    Required:
         create and setOrder methods
    Not Supported
         findByPrimary and getOrder methods

    "The entity bean has a "void setOrder(Order param)" function that writes the Order to a database"
    This functionality should be performed in the ejbStore method().
    "a "Order getOrder()" function that clones and returns the internal Order object."
    Sounds reasonable, except for the cloning part.
    "The "ejbLoad()" function reads the Order object from the database"
    Cool.
    ""ejbStore()" function is not implemented."
    Whoops. Looks like your setOrder method is doing too much. It should do the inverse of getOrder (namely, setting the interal Order object), nothing more. Defer the persistence code to the ejbStore method.
    "According to the SilverStream manual it does not maintain a pool of idle/unused entity beans, instead it instantiates beans as requested."
    Manual? What's that? Assuming that is correct, better hope you don't ever get a high load. You might wanna look into JBoss.
    "2) We sometimes get a TransactionRequired exception thrown when we have concurrent updates to two different objects of the entity bean."
    How can you have concurrent access to two different objects?? Concurrency is inherently applicable to only one object.
    In summary:
    Write your beans properly, ejbLoad populates the bean with data, ejbStore persists the bean's data.
    Get a better (and possibly free) appserver.

  • 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

  • Value string (primary key) could not pass to entity bean

    database server 3.23.57
    application server Jboss 3.07
    ide jbuilder8
    i am using session bean to wrap entity bean where it calls for entity bean to lookup the databse.
    value entered in client application could not be passed from session bean to entity bean.
    it is a jtextfield thta capture string as input which is the customer id. it is also the primary key. session bean managed to get the value but it was then became null when i pass to entity bean.
    may i know wat could be the problem that is causing this?
    application server not suporting this feature???? or it is th elogic problem .. or i have miss ot some code somewhere.?

    Sounds like a code problem.

  • Composite Primary Key in M:N CMP Entity Bean Relationship

    Dear Sir/Madam,
         We are creating an Enterprise Application for our institute using EJB 2.0 specifiactions. In the course of developement, we are facing a problem in writing the CMP Entity Beans with EJB Relationships.
         We are having many to many relationship between two beans such that the primary key of one Entity Bean (let's call it A), serves as the foreign key of another Entity Bean (let's call it B). Further, this primary key of A as foreign key in B, participates in the composite key of B.
         The EJB Specifications require that the primary key field(s) of any bean (B, in our case) declared in the Primary Key class should be the subset of the 'cmp-field' declared in the deployment descriptor for that bean. As I said earlier, we have many to many relationship at play. Hence, we require to keep the foerign key in the 'cmr-field' in lieu of 'cmp-field'. In short, the component of primary key is in 'cmr-field' while, it is needed in both 'cmp-field' and 'cmr-field'. That's perfect from Database point of view but illogical from CMP Entity Bean's view.
         How can we write the deployment descriptor for such a CMP (BMP is working fine for above scenario) Entity Bean? Also, how can we write the Primary Key class? The problem is not just to find the solution, but find under the hood of EJB 2.0 specifications.
         Please help.

    I think you should realise that it would not be convenient to use CMP for everything. It is difficult to define complex relations using CMP. Mostly BMP os preferd since it gives the flexibility for the bean developer.
    Regards
    xH4x0r

  • How to manage a XMLType in a CMP Entity Bean

    Hi everyone.
    Have any of you dealt with a XMLType in a CMP Entity Bean, for instance, the oracle CLOB datatype or directly with XMLType? any of you have tried with a successful result?
    What I have to do for creating a CMP if the destination table is going to have a XMLType column. Because I need to Store a very large XML Document.
    I will really appreciate.
    Thank you
    Francisco.

    Francisco,
    In case you haven't already seen it, perhaps this blog from Debu Panda will help:
    http://radio.weblogs.com/0135826/2004/08/11.html#a60
    Good Luck,
    Avi.

  • SVS on model attribute bound to webservice from entity bean

    Hi,
    i want to use an SVS on a model attribute. The model comes from a session bean, that talks to an entity bean.
    The problem is, that the model attribute has a type of longObject and i think that's the cause why SVS cant be used.
    The entity bean belongs to an db table where i use a ddic simple type with enumeration. I think the pure j2ee part between the WebDynpro and the ddic is the problem, why  the ddic information cant be transported to the WebDynpro, is it?
    So how do i use SVS for a model attribute that is bound to a webservice, that comes from a session/entity bean?
    Thanks in advance!
    Oliver

    hii Sudheer,
    The web service creation is getting fine for local project, but wat i want to do is to create a webservice for a session bean in EJB DC ....
    So how can i change workspace of DC?? Its stuff goes into DTR rite?
    how do u change the workspace of DC project??
    regards,
    Amey

  • 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

  • Session Bean calling entity bean

    Hi
    How does session bean calls entity bean in weblogic6.1
    Thanks

    have a look in the examples that come with weblogic
    "Anand" <[email protected]> wrote in message
    news:[email protected]..
    >
    >
    Hi
    How does session bean calls entity bean in weblogic6.1
    Thanks

  • Problem calling entity bean from session bean using sun one app server

    Hi,
    I am getting the following exception while calling entity bean(bmp) from stateless session(cmp)bean.
    SEVERE: IOP5012: Some runtime exception ocurred in IIOP: [javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: Unable to create reference org.omg.CORBA.OBJ_ADAPTER: vmcid: SUN minor code: 1015 completed: No]
    SEVERE: IOP5013: Unable to create reference: [org.omg.CORBA.OBJ_ADAPTER: vmcid: SUN minor code: 1015 completed: No]
    SEVERE: EJB5029: Exception getting ejb context : [CustomerEJB]
    SEVERE:
    WARNING: CORE3283: stderr: javax.transaction.TransactionRolledbackException: CORBA TRANSACTION_ROLLEDBACK 9998 Maybe; nested exception is:
    WARNING: CORE3283: stderr: org.omg.CORBA.TRANSACTION_ROLLEDBACK: vmcid: 0x2000 minor code: 1806 completed: Maybe
    WARNING: CORE3283: stderr: at com.sun.corba.ee.internal.iiop.ShutdownUtilDelegate.mapSystemException(ShutdownUtilDelegate.java:114)
    WARNING: CORE3283: stderr: at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.wrapException(Util.java:358)
    WARNING: CORE3283: stderr: at javax.rmi.CORBA.Util.wrapException(Util.java:277)
    WARNING: CORE3283: stderr:
    My primary key implementation is
    public class CustomerEJBKey implements java.io.Serializable {
    static final long serialVersionUID = 3206093459760846163L;
    public String customerId;
    public DBConfigBean dbConfigBean;
    * Creates an empty key for Entity Bean: CustomerEJB
    /*public CustomerEJBKey() {
    public CustomerEJBKey(String customerId,DBConfigBean dbConfigBean){
    this.customerId = customerId;
    this.dbConfigBean = dbConfigBean;
    public String getCustomer(){
    return customerId;
    public DBConfigBean getDBConfigBean(){
    return dbConfigBean;
    * Returns true if both keys are equal.
    public boolean equals(Object key) {
    if(key instanceof CustomerEJBKey)
    return this.customerId.equals(((CustomerEJBKey)key).customerId) &&
    this.dbConfigBean.equals(((CustomerEJBKey)key).dbConfigBean);
    else
    return false;
    * Returns the hash code for the key.
    public int hashCode() {
    return customerId.hashCode() + dbConfigBean.hashCode();
    and entity bean method invocation is,
    homeFactory = EJBHomeFactory.getInstance();
    home = (CustomerEJBHome) homeFactory.lookup(CustomerEJBHome.class);
    remote = (CustomerEJB) PortableRemoteObject.narrow( home.findByPrimaryKey(new CustomerEJBKey(customerId,dbBean)), CustomerEJB.class);
    This works fine in Websphere and JBoss. Do you have any idea why I am getting this exception?
    Appreciate your response.
    Regards,
    Sankar.

    My suggestion is to put some System.out.println() statements and see if the output helps in any way in debugging. I can't think of anything on the top of my head although I have been working lightly on SunONE.
    By the way, you referred the stateless bean as CMP. Just wanted to tell you that you are wrong. The terms CMP and BMP refer to persistence, which is applied to Database tables and not to stateless/stateful session beans which are written for some specific purpose independent of underlying database.

Maybe you are looking for

  • Issues with opening epub in Safari after ios 6.1 (10B141) update

    After upgrading to ios 6.1 on both iPad 2 and new iPad (4) epubs don't open correctly in Safari. Regularly downloading epubs from www.jw.org. When trying to click on epub, a new tab opens, it appears to be downloading but once appear to be fully down

  • Loader Component Trouble

    Hey guys... I'm back. I am still working on this site, and have worked through numerous challanges and gotten through, but I have now hit a roadblock that I cant seem to conquer... Here is the situation....I have a "main" file.... I am using the tech

  • Networking ... cant find PCs on network - Already read other posts, no clue

    Hi everyone! I am having a problem with networking and my MacBook. I have created a location for my home, where i share a network with two laptops and two desktops, all of them with vista home premium except for one with ultimate. I have set them all

  • Process chains are not running in a given time.

    Hi BI Experts, Good afternoon.   Daily we are running the process chains in the night time. And the  first process chain starts at 22:30(master data loading).   But from 5 days onwards, our process chains are running in the morning time around 10AM.

  • Super class code error..

    This is almost giving me an headache LOLOL gosh.. //Super class public class X {      private String pp = "xpto";      public Y refy;      public X(){}      public X(String pp){           this.pp = pp;           refy = new Y();      public String get