1 2 Previous Next 19 Replies Latest reply on Mar 25, 2009 8:30 PM by 686283

    Call a BPEL process as non oc4jadmin user

    522560
      Hi,

      I need to call a BPEL process from my ADF application which is deployed on separate application server. To call the BPEL process from a java client I have come across many docs on web which make use of IDeliveryService. Based on those I have written following piece of code which is working fine.
      However, this code needs me to use oc4jadmin to make this call. Can I make use of some other non oc4jadmin user to achieve the same thing.

      Code that works using oc4jadmin...
      ------------------------------------------------------------------------
      Locator loc = null;
      jndi = new Hashtable();
      jndi.put(Context.PROVIDER_URL, "ormi://mysoaserver:12401/orabpel");
      jndi.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
      jndi.put(Context.SECURITY_PRINCIPAL, "oc4jadmin");
      jndi.put(Context.SECURITY_CREDENTIALS, "welcome1");
      jndi.put("dedicated.connection", "true");
      loc = new Locator("default", "bpel", jndi);

      IDeliveryService svc = (IDeliveryService)loc.lookupService(IDeliveryService.SERVICE_NAME);
      NormalizedMessage msg = new NormalizedMessage();
      String content = "<MyBPELProcessRequest xmlns=\"http://xmlns.oracle.com/MyBPEL\">\n" +
      " <input>141880</input>\n" +
      "</MyBPELProcessRequest>\n" ;
      msg.addPart(msgPart, content);
      NormalizedMessage resp = svc.request("MyBPEL", "process", msg);
      Map payload = resp.getPayload();
      Element part = (Element)payload.get(msgPart);
      Node outputElement = part.getFirstChild();
      return outputElement.getNodeValue();
      ------------------------------------------------------------------------

      regards - rutwik
        • 1. Re: Call a BPEL process as non oc4jadmin user
          206307
          Yes you can in with Jazn you can. You must make a new user in the AS and give the appropriate role to the user. For example, by default you have also the user 'bpeladmin' that only have control on BPEL not on the other components of the AS.
          • 2. Re: Call a BPEL process as non oc4jadmin user
            522560
            Tried using the bpeladmin username and password as SECURITY_PRINCIPAL and SECURITY_CREDENTIALS in code above and I get following exception:
            -------------------------------------------------------
            java.lang.Exception: Failed to create "ejb/collaxa/system/DeliveryBean" bean; exception reported is: "javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException: Not authorized; nested exception is:
                 javax.naming.AuthenticationException: Not authorized [Root exception is javax.naming.AuthenticationException: Not authorized]
                 at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:63)
                 at javax.naming.InitialContext.lookup(InitialContext.java:351)
                 at com.oracle.bpel.client.util.BeanRegistry.lookupDeliveryBean(BeanRegistry.java:279)
                 at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:250)
                 at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:83)
                 at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:53)
                 at acca.oracle.adf.bpelclient.InvokeBPEL.invokeBpelRemote1(InvokeBPEL.java:92)
                 at acca.oracle.adf.bpelclient.InvokeBPEL.main(InvokeBPEL.java:103)
            Caused by: javax.naming.AuthenticationException: Not authorized
                 at oracle.oc4j.rmi.ClientRmiTransport.connectToServer(ClientRmiTransport.java:99)
                 at oracle.oc4j.rmi.ClientSocketRmiTransport.connectToServer(ClientSocketRmiTransport.java:68)
                 at com.evermind.server.rmi.RMIClientConnection.connect(RMIClientConnection.java:600)
                 at com.evermind.server.rmi.RMIClientConnection.lookup(RMIClientConnection.java:130)
                 at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:249)
                 at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:50)
                 ... 7 more
            --------------------------------------------------------

            And I assign the ascontrol_admin, ascontrol_appadmin roles through EM to bpeladmin, I get following exception
            -------------------------------------------------------------
            java.lang.Exception: Failed to create "ejb/collaxa/system/DeliveryBean" bean; exception reported is: "javax.naming.NamingException: Lookup error: javax.naming.NoPermissionException: Not allowed to look up ejb/collaxa/system/DeliveryBean, check the namespace-access tag setting in orion-application.xml for details; nested exception is:
                 javax.naming.NoPermissionException: Not allowed to look up ejb/collaxa/system/DeliveryBean, check the namespace-access tag setting in orion-application.xml for details [Root exception is javax.naming.NoPermissionException: Not allowed to look up ejb/collaxa/system/DeliveryBean, check the namespace-access tag setting in orion-application.xml for details]
                 at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:63)
                 at javax.naming.InitialContext.lookup(InitialContext.java:351)
                 at com.oracle.bpel.client.util.BeanRegistry.lookupDeliveryBean(BeanRegistry.java:279)
                 at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:250)
                 at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:83)
                 at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:53)
                 at acca.oracle.adf.bpelclient.InvokeBPEL.invokeBpelRemote1(InvokeBPEL.java:92)
                 at acca.oracle.adf.bpelclient.InvokeBPEL.main(InvokeBPEL.java:103)
            Caused by: javax.naming.NoPermissionException: Not allowed to look up ejb/collaxa/system/DeliveryBean, check the namespace-access tag setting in orion-application.xml for details
                 at com.evermind.server.rmi.RMICall.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMICall.java:110)
                 at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:92)
                 at com.evermind.server.rmi.RMIClientConnection.waitForJndiResponse(RMIClientConnection.java:326)
                 at com.evermind.server.rmi.RMIClientConnection.lookup(RMIClientConnection.java:137)
                 at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:249)
                 at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:50)
                 ... 7 more
            -------------------------------------------------------------

            The roles for bpeladmin user as seen from Enterprise Manager is as follows...
            ------------------
            BPMWorkflowSuspend, BPMSystemAdmin, BPMWorkflowReassign, ascontrol_appadmin, ascontrol_monitor, BPMDefaultDomainAdmin, BPMAnalyst, BPMWorkflowViewHistory, rule-administrators, ascontrol_admin, BPMWorkflowAdmin
            ------------------
            • 3. Re: Call a BPEL process as non oc4jadmin user
              522560
              Success... we assigned role of 'oc4j_administrator' to the bpeladmin user and then we are able to call the BPEL process. In our case since we are using Oracle SSO, we did it through OID UI.

              What is still a mystery to me is that why the role 'oc4j_administrator', that doesn't sound related to BPEL, is required to achieve this?
              • 4. Re: Call a BPEL process as non oc4jadmin user
                njain78
                Hi,

                Can anyone plese tell me from where I need to assign this particular role "oc4j_administratot" to bpeladmin user.

                Regards,
                Nikhil
                • 5. Re: Call a BPEL process as non oc4jadmin user
                  lonneke
                  You can assign the bpel_admin user to the group oc4j_administrators:

                  -open the Oracle Enterprise manager, login.
                  -Click on the container that the bpel runtime is deployed to (home or a dedicated one)
                  -click on administration
                  (http://host:port/em/console/ias/oc4j/administration)
                  -click on security providers
                  - click on edit next to orabpel application
                  - click on realms
                  - click on the number that is displayed for jazn.com (assuming that is the realm that your bpeladmin user is defined in)
                  - click on bpeladmin
                  - select oc4jadministrators and click 'move'
                  -click on 'apply'

                  Hope this helps,

                  Lonneke
                  • 6. Re: Call a BPEL process as non oc4jadmin user
                    lonneke
                    The user has to have permission to execute RMI ... this happens to apply to oc4jadministrators.

                    Lonneke
                    • 7. Re: Call a BPEL process as non oc4jadmin user
                      445254
                      Hi,

                      You can also grant "com.evermind.server.rmi.RMIPermission login" to another group using JAAS Admintool.

                      I had similar problems connecting to OC4J with jdeveloper (especially with OID).
                      I made an entry in my blog on this (See. http://blog.jpoot.com ) perhaps there is some information for you in there.

                      Greetings
                      Jaap
                      • 8. Re: Call a BPEL process as non oc4jadmin user
                        597807
                        Hi

                        We have tried all the options ie.. setting all the jar files and oc4jadministrators etc.But still getting the same error

                        Failed to create "ejb/collaxa/system/DeliveryBean" bean; exception reported is: "javax.naming.NameNotFoundException: ejb/collaxa/system/DeliveryBean not found

                        Please help us out in this. We have written a JSP page and calling the BPEL Process from that JSP.We are using JDeveloper and Oracle SOA Suit.

                        Regards,
                        Pavana & Bhargavi
                        • 9. Re: Call a BPEL process as non oc4jadmin user
                          113859
                          Pavana & Bhargavi ,

                          Did you find a solution ? We have the same problem ...

                          David

                          Message was edited by:
                          embreda
                          • 10. Re: Call a BPEL process as non oc4jadmin user
                            rsuchoza
                            Did you ever solve this? I am still receiving the " ejb/collaxa/system/DeliveryBean not found" error while trying to initiate a bpel process from a jsp page. The JSP page is deployed in the same oc4j container but is a seperate app module. Does RMI have anything to do with this?
                            • 11. Re: Call a BPEL process as non oc4jadmin user
                              657320
                              Pavana & Bhargavi,

                              I do have the same problem calling any BPEL process from my JSP pages. Would you please share your solution in case you have found.

                              My email address is: esfand55@gmail.com

                              thanks
                              Esfand
                              • 12. Re: Call a BPEL process as non oc4jadmin user
                                677146
                                hi,
                                This is sridhar here. This problem is due to the order of importing the jar files. We have to import the jar files in proper order. Even i got the same problem after assigning admin also but finally i could solve this by importing the jar files in the following order. Try with this order it may give u a solution.

                                <BPEL_HOME> = D:/OracleAS (in my case...!)

                                <BPEL_HOME>/bpel/lib/bpm-infra.jar
                                <BPEL_HOME>/bpel/lib/orabpel-common.jar
                                <BPEL_HOME>/bpel/lib/orabpel-thirdparty.jar


                                <BPEL_HOME>/j2ee/home/jazncore.jar
                                <BPEL_HOME>/j2ee/home/oc4jclient.jar

                                <BPEL_HOME>/lib/xml.jar
                                <BPEL_HOME>/lib/xmlparserv2.jar

                                <BPEL_HOME>/webservices/lib/orasaaj.jar
                                <BPEL_HOME>/webservices/lib/soap.jar

                                <BPEL_HOME>/bpel/system/services/config [FOLDER]

                                <BPEL_HOME>/bpel/system/services/lib/bpm-services.jar

                                <BPEL_HOME>/bpel/system/services/schema [FOLDER]

                                &

                                <BPEL_HOME>/bpel/lib/olite40.jar

                                <BPEL_HOME>/jdbc/lib/ojdbc14.jar

                                <BPEL_HOME>/bpel/lib/orabpel.jar

                                wsclient_extended.jar (This is Downloaded from Oracle's site..!)
                                • 13. Re: Call a BPEL process as non oc4jadmin user
                                  686283
                                  Where is this file that you would update jar imports be located? I am having the same problem, and would like to fix it asap. Can't seem to find where the imports are being called?


                                  thanks

                                  Brian
                                  • 14. Re: Call a BPEL process as non oc4jadmin user
                                    677146
                                    could not understand ur question clearly? all jars inside your soa installation directory.. send me more details so that i could try to give the solution...

                                    Edited by: user10614915 on Mar 25, 2009 6:38 AM
                                    1 2 Previous Next