Creating Webservice with entity bean

I am trying to create a webservice(using entity bean). Using ANT i am building
up the .ear file. My source files are placed in a directory (c:\test) . I have
set the path and invoked ANT .In the build.xml file , when it is trying to compile
the ejb classes , it gives me the following error:
ERROR: Error from ejbc: Could not locate bean with ejb-name 'EBankEJBean'
in weblogic-ejb-jar.xml
Can anybody pls help me out !
thanx
arthi

WLS 7.0 only supports stateless session bean or a plain java
class as web service.
From your post it seems you have trouble doing ejbc.
You will get better answer if you post this in the ejb
newsgroup.
regards,
-manoj
"arthi" <[email protected]> wrote in message
news:[email protected]..
I am trying to create a webservice(using entity bean). Using ANT i am building
up the .ear file. My source files are placed in a directory (c:\test) . I have
set the path and invoked ANT .In the build.xml file , when it is trying to
compile
the ejb classes , it gives me the following error:
ERROR: Error from ejbc: Could not locate bean with ejb-name 'EBankEJBean'
in weblogic-ejb-jar.xml
Can anybody pls help me out !
thanx
arthi
[att1.html]

Similar Messages

  • RE: Consuming and Creating a CMP Entity Bean

    Hi There,
    I have been trying to find an answer for 1 day. I don't know ehre to look next.
    I am creating a CMP entity bean. I have created all the set and get mehtods as abstract functions. I have added a ejbCreate and a matching ejbPostCreate. The class code looks like this.
    public abstract class COrderBean implements EntityBean {
         protected EntityContext entctx;
         //abstract declarations of property accessors
         public abstract int getId();
         public abstract void setId(int intid);
         public abstract String getCustomerID();
         public abstract void setCustomerID(String strcustomerid);
         public abstract Date getDate();
         public abstract void setDate(Date datorder);
         public abstract String getNotes();
         public abstract void setNotes(String strnotes);
         public void ejbActivate() {}
         public void ejbPassivate() {}
         public void ejbRemove() {}
         public void ejbLoad() {}
         public void ejbStore() {}
         public void setEntityContext(EntityContext context)
              entctx = context;
         public void unsetEntityContext()
              entctx = null;
         public COrderPK ejbCreate()
              return null;
         public COrderPK ejbCreate(int new_id, String new_customerid, Date new_order_date, String new_notes) throws CreateException
              setId(new_id);
              setCustomerID(new_customerid);
              setDate(new_order_date);
              setNotes(new_notes);
              return new COrderPK(getId());
         public void ejbPostCreate(int id, String customerid, Date order_date, String notes) {}
    My client code works with both BMP entity beans and session beans. It is shown below. I am working with Sun's Application Server 8.0 and I created the database schema with the capture-schema.exe command.
    Properties prps = new Properties();
              props.put("javax.rmi.CORBA.UtilClass","com.sun.corba.ee.impl.javax.rmi.CORBA.Util");
              props.put("org.omg.CORBA.ORBClass","com.sun.corba.ee.impl.orb.ORBImpl");
              props.put("org.omg.CORBA.ORBSingletonClass","com.sun.corba.ee.impl.orb.ORBSingleton");
              Context context = new InitialContext(props);
              Object obj = context.lookup("corbaname:iiop:localhost:3700#COrderBean");
              //Object obj = context.lookup("entitybean.OrderItem");
                   IOrderHome home = (IOrderHome)PortableRemoteObject.narrow(obj,Class.forName("ctaejb.entitybean.order.IOrderHome"));
                   //use create
                   IOrderRemote remote = home.findByPrimaryKey(new COrderPK(1));
                   System.out.println(remote.getDate().toString());
    I am getting the follwing error. Can someone please help. Thanks in advance.
    WARNING: "IOP00810257: (MARSHAL) Could not find class"
    org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:7987)
         at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1013)
         at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:259)
         at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1989)
         at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2213)
         at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1221)
         at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:400)
         at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:330)
         at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:296)
         at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
         at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:879)
         at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:255)
         at com.sun.corba.ee.spi.servicecontext.UEInfoServiceContext.<init>(UEInfoServiceContext.java:30)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at com.sun.corba.ee.spi.servicecontext.ServiceContextData.makeServiceContext(ServiceContextData.java:114)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.unmarshal(ServiceContexts.java:195)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:365)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:353)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:470)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:327)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:158)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:129)
         at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
         at ctaejb.entitybean.order._IOrderHome_DynamicStub.findByPrimaryKey(_IOrderHome_DynamicStub.java)
         at mainapp.CTestApplication.main(CTestApplication.java:32)
    Caused by: java.lang.ClassNotFoundException
         ... 27 more
    org.omg.CORBA.UNKNOWN: vmcid: 0x0 minor code: 0 completed: Maybe
         at com.sun.corba.ee.spi.servicecontext.UEInfoServiceContext.<init>(UEInfoServiceContext.java:34)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at com.sun.corba.ee.spi.servicecontext.ServiceContextData.makeServiceContext(ServiceContextData.java:114)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.unmarshal(ServiceContexts.java:195)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:365)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:353)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:470)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:327)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:158)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:129)
         at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
         at ctaejb.entitybean.order._IOrderHome_DynamicStub.findByPrimaryKey(_IOrderHome_DynamicStub.java)
         at mainapp.CTestApplication.main(CTestApplication.java:32)

    Forget it. All the code works. I didn't know that the Sun App Server required a Persistence Manager to work with CMP entity beans. Once I added the persistence manager, all was OK. Have a good day.

  • Caching data with Entity Bean

    Hello,
    I am performing some tests concerning the benefit of caching data with Entity Bean.
    Here is the case :
    I have an Entity Bean with a business method getName() to retrieve a name field in the EJB.
    I understand that in order to cach data, I have to set the NOT_SUPPORTED transaction attr for this method. In this way, when this method is called, the ejbReload() is not called and the data is retreived from the EJB ready instance (and not from the database).
    Is it true and is it the good way to use the cach mechanism ?
    Now if we consider that this instance is the only one in the ready stage, and it is never pooled (it seems so !), what about a modification of the database from a tier (or from an other EB instance)? The Entity Bean is not able to see this modification seence it does not call the ejbLoad method.
    Is there a way to force an Entity Bean to be periodically polled in order to recover data from the data store when activated ?
    Thanks in advance,
    Thierry

    No, This is wrong way of doing what you want. Most of the application servers provide various configuration settings for this. Eg. caching mechanism, interval on when to call ejbLoad and ejbStore, read only beans. You have to check the documentation for this.
    --Ashwani

  • 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

  • Multiple create methods of entity beans in single transcation

    Hi,
    I have some entity beans with CMR. I am managing these entity beans with a Stateful session bean whose transaction type is Container Managed for all its methods.
    In one particular method of this Session bean I am calling two entity bean's create method. i.e I am creating two entity beans through home.create() methods. There are two home.create() methods one after another inside a try catch block.
    I want that the entire operation be under just one transcation so i have also given the transaction attribute as Required for all methods of Session bean and Entity Beans.
    However if i pass invalid parameters to second create method so that it generates exception then still the first create statement is successful and database is updated.
    what i want is that the first create also should be roll backed.
    How can i acheive this through Container Managed Transaction Session Bean?

    Hi Ashwini,
    "Ashwini" <[email protected]> wrote in message news:400291af$[email protected]..
    I have some entity beans with CMR. I am managing these entity beans with a Stateful session bean whose transactiontype is Container Managed for all its methods.
    >
    In one particular method of this Session bean I am calling two entity bean's create method. i.e I am creatingtwo entity beans through home.create() methods. There are two home.create() methods one after another inside a try catch
    block.
    >
    I want that the entire operation be under just one transcation so i have also given the transaction attribute asRequired for all methods of Session bean and Entity Beans.
    >
    However if i pass invalid parameters to second create method so that it generates exception then still the firstcreate statement is successful and database is updated.
    what i want is that the first create also should be roll backed.
    How can i acheive this through Container Managed Transaction Session Bean?o Do you use TXDatasource with your entity beans?
    o In CMT transactions are automatically rolled back only when RuntimeExceptions
    are thrown. What kind of exception is thrown in your case?
    Regards,
    Slava Imeshev

  • Jprobe Memory Debugger with Entity Bean

    hi,
    I m testing an EJB application(Bean Managed) using Jprobe Memory debugger.
    While testing it gives me that objects referred by entity bean are loitering . for eg if somewhere in my code i created an integer using new Integer and if I m letting it passed to ejbCreate .then that object is pointed as loitering while debugging. further it happens with srtring and data access Objects and otheres as well.
    so is there a memory Leak or The debugger is handling the entity bean in such a way.
    version of jprobe used is 5.2.3 on windows
    Please provide me help regarding the same

    Actually, what one or the developers in my group found out is two things:
    1) The clone is a shallow copy.They copy the references but not objects themselves. This has been causing problems for us.
    2) It seems that you don't work on a copy and you work on the original and they keep a copy. Now, this is fine IF you don't have multiple threads working on the same Entity bean and we moved our application from Weblogic where it throws an exception if that Entity bean is in use to OC4J which is suppose to copy the bean and doesn't so you have multiple threads possibly modifying the same object.

  • Problem woking with entity beans on WL 8.1

    Hi,
    I'm evaluating WL8.1.I'm able to deploy session beans & MDBs & test successfully.Similarly
    , I' m able to deploy entity beans but, not able to test it successfully.It says
    there was a problem in identifying the bean using the specified JNDI name.The
    underlying table name contains '_'(underscorre).Does this create problem.Is there
    any patch for this from bea?
    It 'll be greate if some one respond with the details.
    Thanks
    Raja

    Thanks for ur info.Is this 'CR122524_81sp1.jar' available from bea site?
    Regards
    Raja
    "Deepak Vohra" <[email protected]> wrote:
    >
    >
    CR122524_81sp1.jar
    is required if a table has a underscore(_).
    "raja" <[email protected]> wrote:
    Hi,
    I'm evaluating WL8.1.I'm able to deploy session beans & MDBs & testsuccessfully.Similarly
    , I' m able to deploy entity beans but, not able to test it successfully.It
    says
    there was a problem in identifying the bean using the specified JNDI
    name.The
    underlying table name contains '_'(underscorre).Does this create problem.Is
    there
    any patch for this from bea?
    It 'll be greate if some one respond with the details.
    Thanks
    Raja

  • Confused with Entity Beans

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

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

  • Report with entity beans - BIG performance problem

    I have several EJBs (CMP entity beans).
    I need to build a report using linked EJBs and show this report
    to a user (so, updates are not needed - report is only for web page demonstration).
    the problem is: such report is generated too slow.
    I have ~100 records in table 'TestResult' and ~500 records in table 'TestObject'.
    these tables are linked like this:
    one testobject <--> many testresults
    for each testresult I need to show a line with some info which should be retrieved
    from bound EJBs (e.g. testresult-testobject-assigneduser-prioritylevel)
    how to optimize such report generation?
    I have heard something about session beans with Value Objects.
    do I need to use such session beans here?
    what is a general solution for generating reports using linked EJBs?
    I tried to solve the problem by using DB View, but it didn't help.
    I have used 'TestResultView' - info is retrieved fast enough from this view
    (several msecs), but displaying this info is still very costly.
    please, help!
    Oracle 8.1.7,
    WebLogic 6.1

    Hi,
    because I have checked the time required to
    1) retrieve EJBS (several msec)Let me share some of my views with you.Once you retrieve the EJBS ie ie the collection of remote interface from the finder method the container is firing single "select " query and gets all the primary keys back.
    2) cycle through it - get fields and display them
    (~4000 msec)Now the cycle of getting the value you are getting the bean from the PooledState to ready state which will get the fields by firing the "select" query (ejbload()). Now in the instance you are invoking the multiple methods and at the end it will remain there in ready till you call the remove which u are not doing so the time out will bring it back to the pooledstate.
    And if you are calling the bean very frequently then all the instances will go to the ready state and the activation & passivation will start developing ......
    So at the end when the bean moves back to the pooled state after timeout the ejbStore() fires the "update " query!!!!
    Let us consider the activation/passivation not appearing for simple understanding !!!!!!!!
    So for each iteration you are firing 2 queries to the database.So if you have 500 records then the queries generatted will be 1(select from finder)+2(1 by select(ejbload)+1 by update(ejbStore))*500. So the flow is calling 1001 queries ...Thus quering about 1000 queries will definetly take some time...
    So what is the solution????
    Any way you dont require to fire the update query as you are just viewing the data...So u can stop calling the ejbStore().
    Hence you queries will drop to half.Now how we can do this is by using the BMP.....
    The other solution is using the Sessionbean and store the data all 500 records in the Object which can be called across the n/w. This object should implements the Serializable interface and this tech is the Transfer Object feature.....
    Hope you find this useful..
    regards
    Vicky

  • Deployment problem sdk 1.4 with entity bean

    hallo!
    i have a big problem with the j2ee sdk 1.4. when i want to add an entity bean to my ear-file, everything goes good, but when i put the sql-ql for the finder-method and save the file i got an error like this
    xxxxxxx.ear is corrupt or cannot be read
    when i dont save and will show the descriptor it generates an empty descriptor for this entity bean.
    the problem is, that the deployment tool cannot generate the deployment desciptor for entity beans. with session bean there was no problems.
    hope somebody can help me.
    thanks

    There's bug in non-U.S. locales. The workaround is described in this thread:
    http://forum.java.sun.com/thread.jsp?forum=136&thread=472692&tstart=15&trange=15
    -Ian Evans
    Sun Microsystems
    J2EE Tutorial team

  • 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
              

  • 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.

  • How can I control the EJB's Transaction with entity bean

    If I use entity bean, the Transaction is managed by container.and I want to create JDBC Connection by myselft ,not the Datasource,how is the transaction is controlled by the container,if transaction is not controlled ,how can I control it??

    Hi,
    If you want to control the transaction your self then you need to use javax.transaction.UserTransaction interface and methods defined by it.
    Hope this helps
    Vishal

  • Problem with transaction with Entity Beans in R2

    I had a transaction (initiated by a session bean (requires new)) that takes two entity beans (two bank accounts) and trasfer funds from one to another. It looks like the container is waiting for the transaction, i don't know, here comes the exception I get (this code used to work with a lot of simultaneous clients with R1) :
    com.evermind.server.ejb.TimeoutExpiredException: timeout expired waiting for an instance
    at com.evermind.server.ejb.DBEntityWrapperPool.getWrapperInstance(DBEntityWrapperPool.java:189)
    at com.evermind.server.ejb.DBEntityEJBHome.getWrapperInstance(DBEntityEJBHome.java:135)
    error: Remote: Database error, IO failure: com.evermind.server.rmi.OrionRemoteException: Error enlisting connection resource: javax.transaction.RollbackException: The transaction has been marked for rollback (timed out); nested exception is:
    javax.transaction.RollbackException: The transaction has been marked for rollback (timed out); nested exception is:
    com.evermind.server.rmi.OrionRemoteException: Error enlisting connection resource: javax.transaction.RollbackException: The transaction has been marked for rollback (timed out); nested exception is:
    javax.transaction.RollbackException: The transaction has been marked for rollback (timed out)
    above goes the ejb-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.2//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_2.dtd">
    <ejb-jar>
    <description>
    </description>
    <enterprise-beans>
    <session>
    <description>
    </description>
    <ejb-name>ContaFacadeEJB</ejb-name>
    <home>contacorrente.ContaFacadeHome</home>
    <remote>contacorrente.ContaFacade</remote>
    <ejb-class>contacorrente.ContaFacadeBean</ejb-class>
    <ejb-ref>
    <ejb-ref-name>ContaCorrenteEJB</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>contacorrente.ContaCorrenteHome</home>
    <remote>contacorrente.ContaCorrente</remote>
    </ejb-ref>
    </session>
    <entity>
    <description>
    </description>
    <ejb-name>ContaCorrenteEJB</ejb-name>
    <home>contacorrente.ContaCorrenteHome</home>
    <remote>contacorrente.ContaCorrente</remote>
    <ejb-class>contacorrente.ContaCorrenteBean</ejb-class>
    <primkey-class>java.lang.String</primkey-class>
    <reentrant>True</reentrant>
    <persistence-type>Container</persistence-type>
    <cmp-field><field-name>id_conta</field-name></cmp-field>
    <cmp-field><field-name>saldo</field-name></cmp-field>
    <cmp-field><field-name>senha</field-name></cmp-field>
    <primkey-field>id_conta</primkey-field>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>ContaFacadeEJB</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>RequiresNew</trans-attribute>
    </container-transaction>
    <container-transaction>
    <method>
    <ejb-name>ContaCorrenteEJB</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Mandatory</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    and the code of the beans (just the method used)
    Entity (account)
    public void debita(double valor) throws ContaCorrenteException
    double saldoOld=saldo;
    saldo=saldo-valor;
    if (saldo<0)
    throw new ContaCorrenteException("Saldo insuficiente:"+saldoOld);
    Session :
    public void transfere(String idConta1, String idConta2, double valor, String senha) throws ContaCorrenteException
         try
    Context cx=new InitialContext();
    Object homeObject=cx.lookup("java:comp/env/ContaCorrenteEJB");
    ContaCorrenteHome home=(ContaCorrenteHome) PortableRemoteObject.narrow(homeObject,ContaCorrenteHome.class);
    ContaCorrente c1=null;
    ContaCorrente c2=null;
    try
    c1=home.findByPrimaryKey(idConta1);
    c2=home.findByPrimaryKey(idConta2);
    if (!c1.getSenha().equals(senha)) { throw new ContaCorrenteException("Senha incorreta");}
    catch(FinderException e)
    System.out.println("erro ao localizar conta :"+e.getMessage());
    context.setRollbackOnly();
    throw new ContaCorrenteException("Conta inexistente");
    catch(java.rmi.RemoteException e)
    System.out.println("erro Remote: "+e.getMessage());
    context.setRollbackOnly();
    throw new ContaCorrenteException("Erro ao conectar objeto remoto");
    try
    c1.debita(valor);
    c2.credita(valor);
    catch(ContaCorrenteException e)
    context.setRollbackOnly();
    throw new ContaCorrenteException(e.getMessage());
    catch(java.rmi.RemoteException e)
    throw new ContaCorrenteException("Erro de conexco");
         catch (NamingException e)
    System.out.println("erro de localizagco:"+e.getMessage());
    throw new ContaCorrenteException("Erro de acesso remoto na localizacao da conta");
    please, someone help me...
    Thanks in advance

    I forgot : when i try to shut the server down i get the message :
    Shutting down...
    Error serializing bean: Deadlock detected, timing out call after 15 seconds wait for transaction [Transaction d9:fa:4f:b6:ff:ff:ff:ff:4a:0:0:0:0:0:0:0:0:4b:0:ec:6d:ce:c0:16]
    Error serializing bean: Deadlock detected, timing out call after 15 seconds wait for transaction [Transaction d9:fa:4f:b6:ff:ff:ff:ff:4c:0:0:0:0:0:0:0:0:4d:0:ec:6d:d2:d9:d2]
    Error serializing bean: Deadlock detected, timing out call after 15 seconds wait for transaction [Transaction d9:fa:4f:b6:ff:ff:ff:ff:4e:0:0:0:0:0:0:0:0:4f:0:ec:6d:d4:21:a3]
    and it doesn't shutdown.

  • Problem with entity bean

    Hi friends, i am using cmp entity bean to access my relational data base. In my table i am using a sequence (oracle) to generate a sequentiel number as a unique identifier so in my entity bean i am not inserting a primery key. The problem is that i need to get the primary key of the bean after creating and storing it to use the key for other treatment. Any idea, thank a lot

    Hi,
    It seems you just need to move all "after creation" stuff (including getId()) into ejbPostCreate method.
    If I don't miss anything, think that's all.
    Good luck

Maybe you are looking for

  • Email monitor for permanent connection.

    I am trying to set up my monitor to send an email to alert me when it detects movement. I have filled out the fields. I have a permanent broadband cable connection. Not dial up. When I try to select test email it tries to dial a connection. Doesn't r

  • DELETE THE MATCHED RECORDS IN DB2 TABLE

    DELETE THE MATCHED RECORDS IN DB2 TABLE sql server table sqlserver_emp(c1,c2,c3,4) records:1 2 3 4 DB2 table db2_emp(c1 key,c2,c3,c4) records:1 2 5 6 7 8 Both tables having same structure Matched records : 1 2 1.Delete the matched records in db2 tabl

  • Inbound Shipment and Leg creation

    Hi All, We are manually creating legs (stages) in Inbound shipments in 3 party scenario, its a direct leg from vendor to customer. During leg creation process i am able to give the Vendor (departure details) including points, shipping point and vendo

  • How to install ARD into 10.7.3

    I am trying to install apple remote desktop 3.3.  But I am unable to select HD as the installation drive.  Receive message "Remote Desktop can't be installed on this disk.  This software requires Mac OS X version 10.6"  In fact, I am running 10.7.3.

  • Database for Mac

    I Use FileMaker Pro, but I feel Apple could do better (ease of use) and do it more elegantly. MS Access was the only Microsoft program I missed when I switched to Mac years ago. Do others out there feel similarly?  Plus a version for iOS. Posted here