Code using advisor session bean..returning of a list

Hi,
I am using Advisor Session Bean for classifying users instead of using pz:div
tags. The steps are given in documentation. I wanted to know what advice.getResult()
returns? It has been given in the API as an Object. Even in pz:div java file they
have used this code to check if the getresult returns something ...
Object nestedResult = advice.getResult();
if((nestedResult instanceof List) && ((List)nestedResult).size() > 0)
{  //belongs to segment
My code works perfectly but I am curious to know about this code. Can anyone please
tell me about the above given code?
Thanx

Assuming you are using v7.0
This might help
http://edocs.bea.com/wlp/docs70/dev/p13n.htm#1000231
i dont know if this has changed in v8.1
hth
deepak
"Madhu" <[email protected]> wrote:
>
Hi,
I want to use the Advisor session bean directly in place of the tags
to return
content based on a static query and match the content to users based
on rules
that execute a content query. Where can I find more information on this?
Thanx.
Madhu

Similar Messages

  • May i use the session bean in the jsp

    <%@ page import="sms.EJB.*,sms.UserDetailEJB.*" %>
    <%
    if (request.getParameter("userid")!=null && request.getParameter("password") !=null && request.getParameter("userLevel")!=null)
    UserHome userHome look up...
    UserLocal userLocal;
    userLocal = userHome.create(userid,password,userlevel);
    %>
    <html>
         <head>
              <title>Insert One Page</title>
         </head>
         <body>
         <form action="/testing/insertOne.jsp">
              <h1 align="center">Insert into User Database !</h1>
              <table align="center">
                   <tr>
                        <td bgcolor ="#FFFCCC">User Name :</td>
                        <td bgcolor ="#FFFCCC"><input type="text" name="userName" size="12" maxlength="12"></td>
                   </tr>
                   <tr>
                        <td bgcolor ="#FFFCCC">Password :</td>
                        <td bgcolor ="#FFFCCC"><input type="password" name="password" size="12" maxlength="12"></td>
                   </tr>
                   <tr>
                        <td bgcolor ="#FFFCCC">User Level :</td>
                        <td bgcolor ="#FFFCCC"><input type="text" name="userLevel" size="12" maxlength="12"></td>
                   </tr>
              </table>
              <p align="center"><input type="submit" name="submit" value="add it"</p>
         </form>
         </body>
    </html>
    May i use the session bean like this, if i dont want to use the data access object
    may i use this...

    Hey it apperars to me like heero82 is using session facade and all he has to do is use session bean to make one business call on session bean. Now if u say it is not correct then i would like to know the better way to doing so.
    I can imagine one ways is use business delegate. Just make new of java class in jsp and let that java class do lookup and delegate the call to session facade.
    Let me know inpout on this
    pranav

  • Create a entity using a session bean in web dynpro

    Hi.
    I want to create an entity bean object trough an EJB session bean in web dynpro, e.g using a form in a WD application filled in by a user.
    I understand how to display a list of entity beans through a session bean and a table, but I don't understand how to create (or edit or remove) such information.
    My session beans look like this:
    @Stateless
    public class MyObjectBean implements MyObjectLocal {
         @PersistenceContext(name = "MyObject", unitName="ProjectPU")
         public EntityManager em;
         public void create(MyObject myObject) {
              em.persist(myObject);
         public void edit(MyObject myObject) {
              em.merge(myObject);
         public void remove(MyObject myObject) {
              em.remove(em.merge(myObject));
         public MyObject find(Integer id) {
              return em.find(MyObject.class, id);
         @SuppressWarnings("unchecked")
         public List<MyObject> findAll() {
              return em.createNamedQuery("MyObject.findAll").getResultList();
    So the model class would be called Request_MyObjectLocal_create.
    I attempted to use [this|http://help.sap.com/saphelp_nwce10/helpdata/en/45/dd45e4bc295595e10000000a1553f7/frameset.htm] help file but I find the answer (step 17) quite unclear.
    Help is greatly appreciated!
    Vincent.

    I've just found the solution from Steve Muench weblog, always useful by the way!
    You can find the solution at this link http://radio.weblogs.com/0118231/stories/2004/05/07/handcodingDynamicDiscoveryOfEjbdeployedAppmodule.html
    In summary, we need to use the class com.evermind.server.rmi.RMIInitialContextFactory, which supports dynamic lookup, and implement the lookup ourselves.
    The code I've written to lookup the service is listed below:
    public static ApplicationModule getAppModuleManutencao() {
    try {
    Context ctx = getContext();
    ManutencaoFacadeHome home = (ManutencaoFacadeHome) ctx.lookup(EJB_MANUTENCAO_BEAN_NAME);
    ApplicationModule am = ApplicationModuleProxy.create(home, null);
    return am;
    } catch (NamingException nex) {     
    nex.printStackTrace();
    return null;
    private static InitialContext getContext() {   
    try {     
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "welcome");
    env.put(Context.PROVIDER_URL, "opmn:ormi://dsv008:OC4J_dvt20/mct");
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    return new InitialContext(env);
    }catch (NamingException e) {     
    e.printStackTrace();
    return null;
    I hope this helps someone!!!
    Cheers!

  • Using BC4J Session Bean in OC4J 10.1.3 with dynamic ports

    Hi Folks!
    I've benn having trouble connecting my BC4J Session Bean to an Oracle 10gAS R3 server instance tha uses dynamic ports.
    After migrating a BC4J/Struts/JSP application from 9iAS to 10gAS R3, I'm trying to connect from a client application to my instace in the server. The problem is that the instance uses dynamic ports, and whenever I deploy my application to the server, I've got to update the port number in the bc4j.xcfg file in the client application, wich has became impossible to maintain.
    When I connect to an EJB in the same server, I use the instance name instead of the port number. However, when I do the same with BC4J, I get the following exception:
    javax.naming.NamingException [Root exception is java.lang.NumberFormatException: For input string: "OC4J_dvt20"]
         at oracle.jbo.client.remote.ejb.ias.AmHomeImpl.remoteLookup(AmHomeImpl.java:131)
         at oracle.jbo.client.remote.ejb.ias.AmHomeImpl.getRemoteApplicationModuleHome(AmHomeImpl.java:42)
         at oracle.jbo.client.remote.ejb.AbstractApplicationModuleHomeImpl.lookupUsingPlatformContext(AbstractApplicationModuleHomeImpl.java:82)
         at oracle.jbo.client.ejb.ApplicationModuleHomeImpl.<init>(ApplicationModuleHomeImpl.java:52)
         at oracle.jbo.client.remote.ejb.AbstractApplicationModuleHomeImpl.<init>(AbstractApplicationModuleHomeImpl.java:35)
         at oracle.jbo.client.remote.ejb.ias.AmHomeImpl.<init>(AmHomeImpl.java:35)
         at oracle.jbo.client.remote.ejb.ias.InitialContextImpl.createJboHome(InitialContextImpl.java:28)
         at oracle.jbo.common.JboInitialContext.lookup(JboInitialContext.java:77)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at oracle.jbo.common.ampool.DefaultConnectionStrategy.createApplicationModule(DefaultConnectionStrategy.java:136)
         at oracle.jbo.common.ampool.DefaultConnectionStrategy.createApplicationModule(DefaultConnectionStrategy.java:80)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.instantiateResource(ApplicationPoolImpl.java:2468)
         at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:536)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2094)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:1961)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:2793)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:453)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:424)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:419)
         at oracle.jbo.client.Configuration.getApplicationModule(Configuration.java:1546)
         at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1504)
         at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1476)
         at pkg.TesteEjbMCT.findTLS(TesteEjbMCT.java:98)
         at pkg.TesteEjbMCT.main(TesteEjbMCT.java:51)
    My question is: is there a way to configure my bc4j.xcfg, or another way to connect, in order to skip the use of the port number? Or a way to get the port number from the server before I connect?
    Thanks in advance!!!

    I've just found the solution from Steve Muench weblog, always useful by the way!
    You can find the solution at this link http://radio.weblogs.com/0118231/stories/2004/05/07/handcodingDynamicDiscoveryOfEjbdeployedAppmodule.html
    In summary, we need to use the class com.evermind.server.rmi.RMIInitialContextFactory, which supports dynamic lookup, and implement the lookup ourselves.
    The code I've written to lookup the service is listed below:
    public static ApplicationModule getAppModuleManutencao() {
    try {
    Context ctx = getContext();
    ManutencaoFacadeHome home = (ManutencaoFacadeHome) ctx.lookup(EJB_MANUTENCAO_BEAN_NAME);
    ApplicationModule am = ApplicationModuleProxy.create(home, null);
    return am;
    } catch (NamingException nex) {     
    nex.printStackTrace();
    return null;
    private static InitialContext getContext() {   
    try {     
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "welcome");
    env.put(Context.PROVIDER_URL, "opmn:ormi://dsv008:OC4J_dvt20/mct");
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    return new InitialContext(env);
    }catch (NamingException e) {     
    e.printStackTrace();
    return null;
    I hope this helps someone!!!
    Cheers!

  • Using local session bean interface from web container using EJB 3.0

    Hi,
    How can you use a local session bean interface from Java (rather than data controls) in a web container using EJB 3.0?
    I can use a remote interface by looking up InitialContext, but I can't find a local interface this way (even from another session EJB). I can use a local interface from an EJB using annotation "EJB", but as I understand, this is not available in the web container.
    If I try to add an ejb-jar.xml file, these seems to mess up by project...
    Hope you can help.
    Roger

    The portable way to retrieve an EJB reference in Java EE is to either inject it or look it up via the
    component's private naming environment. The simplest way is :
    @EJB
    private DocumentManager dm;
    The global JNDI name is only used as an implementation specific way to uniquely assign an
    identifier to a specific Remote EJB. It's best for this not to appear directly in the source code.
    There's more on global JNDI names in our EJB FAQ :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
    The alternative to annotations is to use an ejb-ref to declare the ejb dependency. The ejb-ref
    is declared in the standard deployment descriptor corresponding to the component doing the
    lookup. Each ejb-ref has an ejb-ref-name, e.g. <ejb-ref-name>DM_ref</ejb-ref-name>
    The code looks up the ejb-ref-name relative to the java:comp/env namespace to retrieve the
    EJB reference.
    DocumentManager dm = (DocumentManager)
    new InitialContext().lookup("java:comp/env/DM_ref");

  • Transaction using stateful session bean.

    All,
    I was implementing "Transaction" part using statefull session(trying to understand how transaction work).
    I created a Statefull session bean, here in one method create 2 sql queries
    query1:update Employees set LastName='newname' where EmployeeID = 9
    query2:update Customers set CompanyName = 'newname Inc.' ContactName = 'Maria Anders'
    "query1" works fine, but "query2" is not correct(syntax error) hence will not be executed. This will throw a SQLException.
    According to EJBspec, rollback will happen if there is a system exception. And I guess SQLException is systemexception.
    But when I query "Employees" table, I get the data updated through the "query1".
    What I was excepting was the first query which was executed should have rolled back because the second query has thrown a SQLException.
    I tried using ContainerManaged transaction and BeanManaged transaction.
    But in both cases transaction is not getting rolled back.
    I have tried with REQUIRED and REQUIRESNEW attributes for container managed transactions with Isolation level as Read Commited.
    Is my understanding correct?
    TIA,
    Vijay

    Tried using Bean managed transactions but with the same result. Given below is the sample code.
    UserTransaction uts = null;
    try {
    uts = (UserTransaction)(ctx.getUserTransaction());
    uts.begin();
    Connection con = null;
    con = getCountConnection();
    PreparedStatement ps = con.prepareStatement(sqlselectUserId);
    ps.executeUpdate();
    PreparedStatement ps1 = con.prepareStatement(sqlselectUserDetails);
    ps1.executeUpdate();
    uts.commit();
    catch(SQLException e) {
         uts.rollback();

  • Refresh code servlet and session bean don't work more.

    Hi all,
    I'm not sure if it's a problem with oc4j, but maybe someone can
    help me.
    I'm working with Jdev 10.1.3.0.4(SU4) on Fedora Core 5 and XP.
    I create an application with a servlet, ran the servlet and
    all things work. Change the code in servlet, recompile and refresh
    the browser and all work fine.
    But, when I create a CMP Entity Beans from Tables with EJB 3.0 on
    a simple table and change the code in servlet, recompile and refresh
    the browser the code of servlet stay old. Just restart oc4j make the changes
    work. Changes on entity bean ou session beans or junit class take
    the same problem, just after the restart oc4j do the job.
    Is it a bug? Is thera a workaround?
    Thanks for all,
    Luciano

    Oh and before you tell me to just use XSLT on the output to get it how I want it, or use XMLType views where the XML is generated on the database server, I can assure you I know both of those options, but they both cut into the profitability of running a high-volume service.
    The XSU (XML SQL Utility for those keyword searching) is great in that I can host it on middle tier servers in any servlet container and take the burden of XML generation and parsing off the $40K/processor server. If I can further take the burden of XSLT transformations off the middle tier, so much the better... The XSU allows me to run the same throughput on probably something like half the hardware and a tenth the licensing fees.
    So here's a huge vote in favor of continued development of the XSU...I would also like it to handle XML attributes on inserts/updates rather than having to use the "canonical" element form.
    If anyone knows an even better approach, please speak up!

  • How to realize timeout while invoking a method in remote sesssion bean using my session bean running on wls5.1

    I am using WL5.1 SP11 on a project. I have a stateless session bean inside which
    I will invoke a method defined in another stateless session bean in a remote weblogic
    server 5.1. The performance of the remote server is very low and sometimes when
    I invoke the method through RMI, I got to wait for a long time. So I want to set
    a timeout for my session bean while doing RMI call. The only parameter I could
    find in weblogic-ejb-jar.xml is the "transaction-timeout", but even if I set transaction
    attribute for my session bean, it always block there to wait for the response
    from the remote session bean. The configuation did not work.
    Is there any other solutions to my problem? Please give me some advice if anyone
    has experience on it, Thank you very much.

    I am using WL5.1 SP11 on a project. I have a stateless session bean inside which
    I will invoke a method defined in another stateless session bean in a remote weblogic
    server 5.1. The performance of the remote server is very low and sometimes when
    I invoke the method through RMI, I got to wait for a long time. So I want to set
    a timeout for my session bean while doing RMI call. The only parameter I could
    find in weblogic-ejb-jar.xml is the "transaction-timeout", but even if I set transaction
    attribute for my session bean, it always block there to wait for the response
    from the remote session bean. The configuation did not work.
    Is there any other solutions to my problem? Please give me some advice if anyone
    has experience on it, Thank you very much.

  • Deploy Error when using Stateful Session Bean inside Webdynpro

    Hi,
    I'm trying to create a webdynpro project that uses a stateful session bean
    I have created DC's for a EJB Module project, Enterprise Application and Webdynpro component. Created the bean, built it, added it's package to the public part, added the EJB Module to the EAR project. Built the EAR project. Added the EJB Module project and Enterprise Application project as a used DC in the Webdynpro DC.
    In the Webdynpro DC I added com.sap.archive-packaging.default.update-descriptors=true in the build.properties file of the cfg directory. (using the navigator view) That resolved an error while building it.
    Deployed the Enterprise Application DC without problems.
    Tried to deploy the Webdynpro DC but I get the following error:
    Jun 16, 2008 9:40:46 AM /userOut/deploy (com.sap.ide.eclipse.sdm.threading.DeployThreadManager) [Thread[Deploy Thread,5,main]] WARNING:
    [012]Deployment finished with warning
    Settings
    SDM host : 10.64.36.74
    SDM port : 50018
    URL to deploy : file:/C:/DOCUME~1/JESCHA~1/LOCALS~1/Temp/temp59822company.nl~projempactcmp.ear
    Result
    => deployed with warning : file:/C:/DOCUME~1/JESCHA~1/LOCALS~1/Temp/temp59822company.nl~projempactcmp.ear
    Finished with warnings: development component 'projempactcmp'/'company.nl'/'local'/'20080616094022':Caught exception during application startup from SAP J2EE Engine's deploy service:java.rmi.RemoteException: Error occurred while starting application company.nl/projempactcmp and wait. Reason: Clusterwide execption: server ID 6060950:<--Localization failed: ResourceBundle='com.sap.engine.services.deploy.DeployResourceBundle', ID='com.sap.engine.services.deploy.container.DeploymentException: <--Localization failed: ResourceBundle='com.sap.engine.services.deploy.DeployResourceBundle', ID='Failed implicit start for company.nl/projempejb : Unknown state(5)', Arguments: []--> : Can't find resource for bundle java.util.PropertyResourceBundle, key Failed implicit start for company.nl/projempejb : Unknown state(5)', Arguments: []--> : Can't find resource for bundle java.util.PropertyResourceBundle, key com.sap.engine.services.deploy.container.DeploymentException: <--Localization failed: ResourceBundle='com.sap.engine.services.deploy.DeployResourceBundle', ID='Failed implicit start for company.nl/projempejb : Unknown state(5)', Arguments: []--> : Can't find resource for bundle java.util.PropertyResourceBundle, key Failed implicit start for company.nl/projempejb : Unknown state(5) (message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).REMEXC)
    Deployment exception : Got problems during deployment
    Does anyone know what this error means and how to resolve it. I searched the forum but only found errors that look like this relating to XI not to Webdynpro.......
    Thansk,
    Jeschael
    Edited by: J.V. Lebbink on Jun 17, 2008 6:52 AM

    Default is 30mts.
    This is done as a parameter in orion-ejb-jar.xml. Please look at the EJB Guide at http://otn.oracle.com/docs/products/ias/doc_library/903doc_otn/generic.903/a97677/dtdxml.htm#634197 for details
    regards
    Debu

  • Stateful session bean returns null

    Hi,
    I call a stateful session bean which should return a Long object. Everything works fine while the bean executes and the Long object is returned by the bean.
    But in the EJB-Client I get a null object.
    The EJB-Client is a OC4J 10g standalone server and the EJB-Server is a OC4J 9.03 server, both running on the same machine.
    Here are the JNDI properties:
    java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory
    java.naming.provider.url=ormi://localhost:23791/ws
    java.naming.security.principal=admin
    java.naming.security.credentials=slash
    dedicated.rmicontext=true
    dedicated.connection=true
    Thanks for your help,
    A.

    Hi,
    Store HomeObject or EJB Object in the Session in the WebTier.
    Anil

  • Test web service proxy using EJB session bean client...

    Hello!
    I am following this blog /people/abdelmorhit.elrhazi/blog/2009/10/30/how-to-consume-an-inbound-backend-web-service-in-nwdsjboss-environment to create a EJB session bean client to access the web service proxy...
    The blog is not very clear. Where should I be deploying the web service proxy and the EJB session bean (web service client) ? on the PI 7.1 ?
    How to find out the URL for the wsdl ?
    Thanks

    > The blog is not very clear. Where should I be deploying the web service proxy and the EJB session bean (web service client) ? on the PI 7.1 ?
    "To deploy your web service proxy and session bean, right click on your JBoss server in the Servers view, and click on Add Remove Projects, add you ear file and click finish."
    You need a JBoss server.

  • How to use a session bean in another session bean (or an EJB in a session)

    JDev 11.1.1.4, WLS 10.3.4, Windows 7 x64
    I have a login controller with a session-scoped bean that manages logins.
    I have another session-scoped bean that manages menu security.
    both modules compile and work fine now I need to share the data from one to another.
    I need to reference the login controller in the menu security bean. How do I reference (include) the login bean in the security bean?
    I tried an EJB - what a farce - these are supposed to be universal and easy ( basis of the oop in Java).
    the bean is defined:
    @Stateless(name = "SecurityEJB", mappedName = "ZITASApplication-ZITASModel-SecurityEJB")
    I have tried :
    ic = new InitialContext();
    session = (SecurityEJBLocal)ic.lookup("ZITASApplication-ZITASModel-SecurityEJB#model.security.logic.SecurityEJB");
    session = (SecurityEJBLocal)ic.lookup("ZITASApplication-ZITASModel-SecurityEJB#model.security.logic.SecurityEJBLocal");
    session = (SecurityEJBLocal)ic.lookup("java:ejb/model.security.logic.SecurityEJB");
    session = (SecurityEJBLocal)ic.lookup("java:ejb/SecurityEJB");
    session = (SecurityEJBLocal)ic.lookup("java:app/SecurityEJB");
    session = (SecurityEJBLocal)ic.lookup("java:module/SecurityEJB");
    All return null pointers and claim the name cannot be resolved.
    As you can see - I have found various claims to how to do this.
    One way says create a sevlet, generate a listener and use the sevlet. Basically one for every EJB - a lot of work to use the EJBs
    I would assume that this would be one of the easiest parts of java - as it is the foundation of re-usability and oop.
    I can do either in the application - the added complexity of the EJB is less desirable - but better programming?

    Hi,
    ic.lookup("ZITASApplication-ZITASModel-SecurityEJB#model.security.logic.SecurityEJB");This should work with remote interface. If you want to lookup local interface, you need to register it in web.xml. Quote:
    To access the business local interface you need to define ejb local references for your component environment (i.e. from your servlet environment). You can do this by defining references in your web.xml. For example:
    <ejb-local-ref>
    <ejb-ref-name>ejb/BusinessLogicBean</ejb-ref-name>
    <local>packagename.BusinessLogicBean</local>
    </ejb-local-ref>
    To lookup your local reference from your servlet you need to use the following JNDI reference:
    java:comp/env/ejb/BusinessLogicBean Another one
    First, declare a local ejb reference in your web.xml file (This will add it to JNDI):
    <ejb-local-ref>
    <ejb-ref-name>ejb/Foo</ejb-ref-name>
    <local>simple.ejb.FooLocal</local>
    </ejb-local-ref>
    Then it can be looked up from JNDI:
    InitialContext ctx = new InitialContext();
    FooLocal foo = ctx.lookup("java:comp/env/ejb/Foo");Hope this helps.
    Pedja
    Helpful links (judging from your first post, you are probably sick of these :) )
    How to lookup local EJB in Oracle Weblogic 10.3
    http://m-button.blogspot.com/2008/07/reminder-on-how-to-use-ejb3-with.html
    http://www.coderanch.com/t/451012/EJB-JEE/java/EJB-Local-Lookup-not-working

  • Process Integrator Problem (use of session bean variable between tasks)

    Hello,
    I'm having a problem using the Process Integrator. I made a
    really simple workflow (Start, Task1, Task2, Done) which uses
    the bean given whith the order processing example. Task1 creates
    the bean and executes a business operation (check inventory).
    Task2 executes another business operation (calculate total
    price). The problem is when I try to execute this second b.o I
    get an exception saying
    Nested exception is: Workflow error:
    com.bea.wlpi.common.WorkflowException: Empty instance object for
    business operation "Calculate Total Price" in
    template "Template3".
    Someone could help me and tell me what I am doing wrong.
    Thanks in advance,
    Albert

    If I understand you correctly, you have 3 business operations, one is "Create a EJB",
    one is call "Check Inventory", the other is "Caculate Total Price". I assume you
    save the EJB handle to a workflow variable with a type Bean. My speculation is when
    you define business operation for "Calculate Total Price", you did not associate
    it with the workflow variable that you saved the EJB handle. Just a wild guess.
    Jim Zhou.
    "Albert Lanchas" <[email protected]> wrote:
    >
    Hello,
    I'm having a problem using the Process Integrator. I made a
    really simple workflow (Start, Task1, Task2, Done) which uses
    the bean given whith the order processing example. Task1 creates
    the bean and executes a business operation (check inventory).
    Task2 executes another business operation (calculate total
    price). The problem is when I try to execute this second b.o I
    get an exception saying
    Nested exception is: Workflow error:
    com.bea.wlpi.common.WorkflowException: Empty instance object for
    business operation "Calculate Total Price" in
    template "Template3".
    Someone could help me and tell me what I am doing wrong.
    Thanks in advance,
    Albert

  • Example of using session bean with webservices

    Hello,
    I am working with netbeans 5.5 (with JAX-WS 2.0 library) and using Tomcat.
    I have created webservices and everything is working well so far. However, each webservice is making a connection to my database.
    I would like to use a session bean so that I make the connection only once (at the begining of the client session for example) and store it into my session bean.
    I am a newbie in those things, I search on the Web and on this forum some code examples. The only thing I have found is this article http://weblogs.java.net/blog/ramapulavarthi/archive/2006/06/maintaining_ses.html
    When I tried this, the session doesn't seem to work at all : I get the same result (counter=1) twice.
    Does anybody have a complete example of how to use a session with webservices please?
    Thanks a lot!

    Sorry, I was not very clear in my last message.
    I need all my webservices to share the same bean during one user session.
    Then, if a page calls 2 different web services, only 1 database connection is made instead of 2. And if the user opens other pages which call other webservices, they will use the connection kept into the session bean.
    Anyway, I tried to do like it is said in your website but I can not build my project. I have an error : java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/C:/.../build/web/WEB-INF/lib/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. I do not understand because I have downloaded the jax-ws 2.1.1 api and no other libraries are imported in my project. :-(
    I wonder if it is not related to netbeans...

  • Update object returned by a business method in stateful session bean

    I have a business method in stateful session Bean returning an Object "myObject getObject()". This object can be modified by the client.
    Is it necessary at the end to notify the bean about the changes with some kind of business method "setObject(Object myObject)"? or
    the client and the bean have the same reference to the object and it isn't necessary?
    Thanks

    When an EJB returns a value, it is serialised across the wire and is effectively lost to the EJB. Any changes to the returned object by the client, will have to be notified by a call on the EJB, as in your post.
    Dave

Maybe you are looking for