Calling BRM from UDF using JNDI lookup with @EJB annotation

Hi Experts
I am trying to implement a UDF to invoke my BRM Rules set via JNDI Lookup instead of a SOAP Channel lookup.
I have had a look at the following links/docs:
Calling BRM from UDF using Public API
http://www.gleanster.com/system/resources/W1siZiIsIjIwMTIvMDgvMDcvMjAvNDcvNTAvNDMvVGhpbmdzX1lvdV9TaG91bGRfS25vd19hYm91dF9TQVBfTmV0V2VhdmVyX0JSTS5wZGYiXV0/Things%20You%20Should%20Know%20about%20SAP%20NetWeaver%20BRM.pdf
For item 1 above, the example looks really good, but it doesnt explain how I get access to the following required imports from my UDF:
import com.sap.brms.qrules.ejb.*;
import com.sap.brms.qrules.engine.AbstractProject;
import com.sap.brms.qrules.engine.RuleEngine;
import com.sap.brms.qrules.engine.RulesetContext;
import javax.ejb.EJB;
The second document is really good as well, but I could not figure out how to get it to work from my UDF.
So, can anyone help me to understand specifically what is required to get this to work?
Is is possible to invoke the rule set from my UDF?
How do I give my UDF access to all the required jars/imports?
I have manage to create a new DC (Development Component) with a public part and this enables me to get my code to compile on my local PC but I am not able to activate it due to the server not having access to the same java packages as my local copy.
Any help would be greatly appreciated.

You resolve the dependency by importing the required jars with using the dependency tab for the mapping program.
As stipulated before, I have managed to resolve the dependency issue but I have now getting the same error as in the forum: Calling BRM from UDF using Public API
The specific error is:
com.sap.engine.services.cross.PortableRemoteObjectContainer.narrow(PortableRemoteObjectContainer.java:238)
Has anyome manage to get invoke a BRM Ruleset using JNDI?

Similar Messages

  • Calling package from java using JNDI properties

    Hi there,
    I have created an interface to transfer data from oracle to JMS XML Queue. It is inside a package and have generated a scenario.
    The scenario works well when executed from the ODI designer. When I execute it from java it throws an error. The error is
    java.sql.SQLException: Cannot load connection class because of underlying exception: 'javax.jms.JMSException: Cannot create the initial JNDI context
    Is there any ways to set the JNDI properties, (any set methods for ODIConnection object)
    Cheers

    Are you serious with that question? Did you try to build the web service client before? Because this is exactly the same. Try to find "building web service clients" instead "Calling BPEL from java". By default (probably) every BPEL process has both WSIF and SOAP end points, just use correct WSDL address.

  • UserTransaction -  Scope using JNDI lookup from jspInit() method

    Howdy,
    I'm using JSP's with JavaBeans accessing a DataSource and some other enviroment variables using JNDI lookups. I've read that JNDI lookups can take a fair amount of time and should be limited whenever possible. My previous configuration had the JNDI lookups inside the constructors of the JavaBeans but I've recently decided to move them to the jspInit() method of the calling JSP. This way the lookup only needs to be performed once and then I pass the values to the JavaBean in a method called setContextVariables. Two of the references to objects that i'm sending are the UserTransaction and DataSource objects. Within the Javabeans I have userTran.begin() and commit() statements. So far it's running great but i'm starting to wonder about the thread safety of this method. My question lies in the actual delagation of the UserTransaction object to the calling client method. It seems that i'm passing the same transaction to every Javabean (or am I?) Is the transaction actually issued when the begin() method is called, or at the time of the JNDI lookup? To test everything out, I opened two sessions and put a breakpoint inside one of the transactions. When I stopped at the breakpoint I ran another thread (also using a transaction retrieved from the same JSP). Then I went back and resumed the first thread and everything seemed to work ok. So... this seems completely fantabulastic so far (definitely noticable response time increases) but I'm still a little skeptical. If anyone is using a process similar to this I would appreciate some feedback. Thanks.

    Hi,
    The EJB bean will use the client transaction when the following attributes are specified in descriptor.
    1) Required
    2) Mandatory
    3) Supports
    In Required case, if the client is associated with Transaction, then the EJB bean will use the same transaction. This is achieved by Transaction context. The EJB bean will use the same transaction context set by client. if the client doesn't have any transaction, then the container will create new transaction context for EJB bean and completes the transaction.
    In Mandatory case, the client must be associated with Transaction so that EJB bean will use the same transaction. If the client doesn't associate with transaction, then container will throw TransactionRequiredException for EJB bean.
    In Supports case, it works similar to Required case except that if the client doesn't associate with transaction, then there won't be any transaction in EJB bean.
    hope this helps.

  • Full page prints from iPhone but not from iPad using photo app with AirPrint ?

    Full page prints from iPhone but not from iPad using photo app with AirPrint ? iPad only prints 4x6 on full size paper. It's an HP 8600.

    I also have this problem printing photos from an iPad to an Epson WF-2540 printer. It prints only 4x6 and without border (so print starts at extreme top left corner of paper). Borderless printing is not selected on printer. Printing a square photo just crops to 4x6 size.

  • How to use JNDI lookup

    Hi ,
    I am creating a POC for my project.Its using ATG and spring frameworks using RAD 6.first I have created ATG sample project in that same EAR file i created sample Spring project.Both are running in the same EAR.
    I want to use spring classes from ATG components to use those methods.that is i should pass parameters to spring project methods and i should get the return value after executing those methods.
    I heard that using JNDI look up I can get spring project class objects using that I can invoke spring project methods.
    My requirement is two projects will be running in the same EAR.But one project will not be having information about other projects.both are independent from other.Using JNDI look up i need to invoke Spring project methods.
    Please anyone help me how to do this.
    I used java:comp/env/com/dao/EmpDAO to get instance of my class EmpDAO.But i am getting naming exception.Can anyone help me how to do this
    Thanks in advance.

    If Tomcat is your servlet/JSP engine, they have a nice bit about how to do it:
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
    MOD

  • Anyone knows how to do JNDI lookup with OracleAQ?

    Hi all;
    Can anybody point me some guide/idea on how to implement JNDI lookup with OracleAQ?
    (Creating connectionFacotry , parameters for "java.naming.factory.initial", java.naming.provider.url etc..)
    Thanks
    -Ratha
    Edited by: Ratha on Sep 27, 2011 3:50 AM

    import javax.naming.*;
    import javax.naming.directory.*;
    import java.util.Properties;
    Properties env = new Properties();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, PROVIDER_URL);
    env.put(Context.SECURITY_PRINCIPAL, JNDI_USER);
    env.put(Context.SECURITY_CREDENTIALS, JNDI_PWD);
    InitialContext = new InitialDirContext(env);
    where JNDI_USER is the userid If ACL is configured at the JNDI server
    where JNDI_PWD is the password If ACL is configured at the JNDI server
    Context.INITIAL_CONTEXT_FACTORY is the initial Context factory and depends on ur JNDI service provider.
    PROVIDER_URL is the url of the JNDI server containing protocol/ip/port
    Hope it helps
    -aseem

  • I am from India using my iphone4 with Vodafone and  firmware version 5.0.1(9A405). I am unable to access 3G from my device as the CELLULAR DATA NETWORK option in the settings is missing. Any methods or options for fixing the same????

    I am from India using my iphone4 with Vodafone and  firmware version 5.0.1(9A405). I am unable to access 3G from my device as the CELLULAR DATA NETWORK option in the settings is missing. Any methods or options for fixing the same????

    I am from India using my iphone4 with Vodafone and  firmware version 5.0.1(9A405). I am unable to access 3G from my device as the CELLULAR DATA NETWORK option in the settings is missing. Any methods or options for fixing the same????

  • Need help in retrieving attributes from LDAP using JNDI

    I am trying to retrieve attributes from LDAP using JNDI, but I'm getting the following error when I try to run my Java program.
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/naming/NamingException
    I have all the jar files in my classpath: j2ee.jar, fscontext.jar and providerutil.jar. The interesting thing is that it gets compiled just fine but gives an error at run-time.
    Could anyone tell me why I'm getting this error? Thanks!
    Here's my code:
    import javax.naming.*;
    import javax.naming.directory.*;
    import java.util.*;
    import java.io.*;
    class Getattr {
    public static void main(String[] args) {     
    // Identify service provider to use     
    Hashtable env = new Hashtable(11);     
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");      
    // user     info
    String userName = "username";     
    String password = "password";          
    // LDAP server specific information     
    String host = "ldaphostname";     
    String port = "portnumber";     
    String basedn = "o=organization,c=country";     
    String userdn = "cn=" + userName + "," + basedn;          
    env.put(Context.PROVIDER_URL, "ldap://" + host + ":" + port + "/" + basedn);     
    env.put(Context.SECURITY_PRINCIPAL, userdn);     
    env.put(Context.SECURITY_CREDENTIALS, password);     
    try {          
    System.setErr(new PrintStream(new FileOutputStream(new File("data.txt"))));     
    // Create the initial directory context     
    DirContext ctx = new InitialDirContext(env);          
    // Ask for all attributes of the object      
    Attributes attrs = ctx.getAttributes("cn=" + userName);          
    NamingEnumeration ne = attrs.getAll();                    
    while(ne.hasMore()){                         
    Attribute attr = (Attribute) ne.next();                                   
    if(attr.size() > 1){               
    for(Enumeration e = attr.getAll(); e.hasMoreElements() ;) {                                       
    System.err.println(attr.getID() + ": " + e.nextElement());                     
    } else {
         System.err.println(attr.getID() + ": " + attr.get());
    // Close the context when we're done     
    ctx.close();     
    } catch(javax.naming.NamingException ne) {
         System.err.println("Naming Exception: " + ne);     
    } catch(IOException ioe) {
         System.err.println("IO Exception: " + ioe);     

    That doesn't work either. It seems its not finding the NamingException class in any of the jar files. I don't know why? Any clues?

  • XI Alerts from UDF using file adapter.

    I need to send alerts from XI message mapping. I have the file ---> file scenario but don't want he stop the process if any failures in the mapping. If I find any failures, I need to catch the those failures and send as alerts/email report. As per the link /people/bhavesh.kantilal/blog/2006/07/25/triggering-xi-alerts-from-a-user-defined-function,  I am not sure whether  I can use LookupService for file adapter or not. Can anyone give me some idea on how to send the alerts from UDF using he file adapter ?

    Try this...
    public String Mail_Test(String input,Container container){
          // Recipient's email ID needs to be mentioned.
          String to = "<Recipient mail ID>";
            // Sender's email ID needs to be mentioned
          String from = "<Sender mail ID>";
           // Assuming you are sending email from localhost
           String host = "<Hostname of the SMTP server>";
           // Get system properties
           Properties properties = System.getProperties();
          // Setup mail server
          properties.setProperty("mail.smtp.host", host);
          // Get the default Session object.
          Session session = Session.getDefaultInstance(properties);
           try{
                 // Create a default MimeMessage object.
                MimeMessage message = new MimeMessage(session);
                 // Set From: header field of the header.
                 message.setFrom(new InternetAddress(from));
                 // Set To: header field of the header.
                 message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));
                 // Set Subject: header field
                 message.setSubject("Check the problem dude...");
                 // Now set the actual message
                 message.setText("You did blunder correct that...");
                 // Send message
                 Transport.send(message);
                 System.out.println("Sent message successfully....");
          catch (MessagingException mex) {
                mex.printStackTrace();
                throw new RuntimeException(mex.getMessage());
          return input;

  • How to use Java WebStart with EJB ?

    hi forum...
    how to use Java WebStart with EJB ? examples ?
    thanks
    mindu

    Greetings,
    hi forum...
    how to use Java WebStart with EJB ? examples ?Well, for starters these are complementing, not 'cooperating', technologies. I presume, since EJB's do not - directly, at least - communicate with a web browser, that you intend for "Java WebStart" to somehow invoke an EJB?? Java WebStart is a technology for running client-side (Java) applications from the web browser - perceptively, the application resides on the server, but technically it, like an applet, is downloaded to the client and run there. Unlike an applet, however, it is not constrained by "sandbox" restrictions and does not have to be re-downloaded each time it is invoked - though the process allows for automagically updating the client-side with new versions of the application. ;) So, with this in mind, to "use Java WebStart with EJB" means little more than deploying an EJB client application with Java WebStart as the distribution channel.
    thanks
    minduRegards,
    Tony "Vee Schade" Cook

  • Calling non ejb from ejb using jndi lookup

    Is it possible to call a non ejb java object from an ejb using a jndi lookup?
    For example, we have a java class where main registers itself with our application server (JBoss 3.0.1). We have a test client that can use jndi to look up the object, but we can't get an ejb inside the application server to use the object.
    Are we trying to do the impossible? If my question is not clear, please let me know so I can try to clarify.
    Thanks

    JNDI uses factories to create objects.
    It's possible that JBoss has a Bean Factory which you can use to create your instance.
    Tomcat has a Bean factory in its JNDI implementation. I use it just as you have indicated.
    The JBoss documenation may help?
    Dave

  • Problem deploying cmp bean invoking another cmp bean using jndi lookup

    I have a cmp BeanA that invokes another cmp BeanB, so I am using a jndi lookup in BeanA to download the localhome object to BeanB using the following:
    Context ctx = new InitialContext();
    home = (LocalAddressHome) ctx.lookup("java:comp/env/ejb/BeanBHomeRef");
    then I specify the ejb/BeanBHomeRef, entity bean, local, BeanB's local home and component interface in EJB ref. when I am packaging BeanA
    I also package BeanB in a separate jar file.
    When I attempt to deploy the application it throws strange exception that says the folowing:
    java.lang.IllegalArgumentException: BeanBEJB says it links to an ejb called BeanBEJB of local home class LocalBeanBHome but no bean with this local home c
    lassname and type can be found in this ejb-jar.
    yet when I un-jar the package, these class files exitsts.
    When I go ahead and delete the reference to BeanB from the BeanA package file, I am able to deploy the application but then correctly fails on jndi lookup.
    I have been able to open the cmpcustomer.ear sample application that comes with RI and execute it without any problem. But when I to package the same beans for example CustomerBean and it won't even allow me to create the customer.jar file. I get a screen full of errors.......
    I am using Sun RI 1.3.01, is there a known bug that I am not aware of? Is there a fix around it?
    Is there any another way to get the home ref. to BeanB so I can invoke create() method?
    Any advice or suggestions?
    thanksl
    -kaisaab

    What app server are you using? may be I can help you
    --Ashish Saraf                                                                                                                                                                                           

  • JNDI lookup with DNS

    Hi all,
    we are using 2 weblogic 5.1 servers (not clustered) for
    our load balancing solution. In our client applications,
    we use a hostname against a DNS for the JNDI lookups for our
    RMI objects deployed on the 2 weblogic servers.
    Ideally, a round-robin load balancing is expected.
    But in reality, all the lookups are sticking to one of our
    servers until we restart our client applications. The
    lookups may switch to another. In our applications,
    we are making many subsequent RMI lookup using JNDI.
    We would like to spread the remote method invocation
    between our 2 servers. How can we integrate with the
    DNS? We have proved that the DNS will return the
    IP addresses of the 2 weblogic in round-robin manner.
    thanks!
    cheers,
    Kenneth
    [email protected]

    Ken,
    What client are you using? We had the same problem when we switched from
    Windows NT to Windows 2000 clients. Round-robin worked fine in NT and by
    default got "stuck" when we tried it from Win 2000 client. There is a
    setting in the network properties on Win 2000 to "unstick" that will fix the
    problem, if this is the setup you have?
    Bart Jenkins, Globeflow SA
    [email protected]
    "Kenneth Yue" <[email protected]> wrote in message
    news:3bb09863$[email protected]..
    >
    >
    Hi all,
    we are using 2 weblogic 5.1 servers (not clustered) for
    our load balancing solution. In our client applications,
    we use a hostname against a DNS for the JNDI lookups for our
    RMI objects deployed on the 2 weblogic servers.
    Ideally, a round-robin load balancing is expected.
    But in reality, all the lookups are sticking to one of our
    servers until we restart our client applications. The
    lookups may switch to another. In our applications,
    we are making many subsequent RMI lookup using JNDI.
    We would like to spread the remote method invocation
    between our 2 servers. How can we integrate with the
    DNS? We have proved that the DNS will return the
    IP addresses of the 2 weblogic in round-robin manner.
    thanks!
    cheers,
    Kenneth
    [email protected]

  • Using jndi.properties with weblogic 6.1

    Apologies if this is a basic question - I am new to Weblogic.
    I have successfully got a test EJB working with Weblogic 6.1 using a properties object to set up my JNDI InitialContext.
    In the weblogic examples I've downloaded it says you can also use a jndi.properties file to do this. I have set up a jndi.properties file, which is in the classpath for my class calling the EJB. But when I do my jndi .lookup("ejbname") I get the error:
    javax.naming.CommunicationException: Can't find SerialContextProvider
    The weblogic documentation at:
    http://e-docs.bea.com/wls/docs61///rmi_iiop/API_rmi_iiop.html
    refers to using jndi.properties and says to look at:
    http://edocs.bea.com/wls/docs61/jndi/jndi.html
    But at this page there is no mention of the jndi.properties method.
    I'd be grateful for any suggestions - in particular whether it is possible to use this method of configuring the JNDI setup.
    I'm running wlserver6.1 on a Windows 2000 PC, using JDK 1.3.1
    My jndi.properties file looks as follows:
    java.naming.property.names=java.naming.factory.initial,java.naming.provider.url
    java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
    java.naming.provider.url=t3://localhost:7001

    It is not WebLogic-specific. See
    http://java.sun.com/j2se/1.3/docs/api/javax/naming/InitialContext.html
    Alison Tunley <[email protected]> wrote:
    Apologies if this is a basic question - I am new to Weblogic.
    I have successfully got a test EJB working with Weblogic 6.1 using a properties object to set up my JNDI InitialContext.
    In the weblogic examples I've downloaded it says you can also use a jndi.properties file to do this. I have set up a jndi.properties file, which is in the classpath for my class calling the EJB. But when I do my jndi .lookup("ejbname") I get the error:
    javax.naming.CommunicationException: Can't find SerialContextProvider
    The weblogic documentation at:
    http://e-docs.bea.com/wls/docs61///rmi_iiop/API_rmi_iiop.html
    refers to using jndi.properties and says to look at:
    http://edocs.bea.com/wls/docs61/jndi/jndi.html
    But at this page there is no mention of the jndi.properties method.
    I'd be grateful for any suggestions - in particular whether it is possible to use this method of configuring the JNDI setup.
    I'm running wlserver6.1 on a Windows 2000 PC, using JDK 1.3.1
    My jndi.properties file looks as follows:
    java.naming.property.names=java.naming.factory.initial,java.naming.provider.url
    java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
    java.naming.provider.url=t3://localhost:7001--
    Dimitri

  • Problem in JNDI lookup with Jdev JDEVADF_MAIN_GENERIC_061111.1900.4245

    I have a JMS topic defined in a standalone oc4j (11g) and I am doing a JNDI lookup on that from an application that runs in embedded oc4j of jdev. Look up fails but if I add the same topic in jms.xml of embedded oc4j, it starts to work fine. My point is topic name shouldn't be needed in jms.xml of embedded oc4j i.e. client side (topic is present in remote oc4j and rightly defined in jms.xml of that oc4j). I verified that by creating a command line java application and that one is able to do lookup on the same topic available in the standalone oc4j.
    I guess this problem is not specific to the label JDEVADF_MAIN_GENERIC_061111.1900.4245, it was there before also.
    Any pointers on what could be wrong when I run in JDev?
    Thanks,
    Vishal

    Please use the internal email distribution list jdev_us for 11 related questions.

Maybe you are looking for

  • Sound on ipad and iphone

    Since updating to os7.1.1 i lost my safari sound on ipad and iphone

  • Getting error while opening Sun access manager console

    We are facing problem while accessing console of Sun Access Manager. We got No Page Found error whenever we try to access the Sun Access Manager console. We have tried restarting the directory server and web server but even that doesn�t help us. Foll

  • Deployment of ESB for 10.1.3.4 (trying to amend Endpoint properties)

    I have downloaded the new deployment code (esbdeploymentautomation) to enable you to deploy an ESB between environments. I am deplying an ESB process from Dev to Systest. I have amended the build_tst.properties file to include all the relevant info a

  • Module Programming  PBO and PAI flow.

    Hi, I am new to module programming, My req are -  I have 4 input fields and button in my first screen(1000) After user enters these values then I have to validate this values in the database and then I need to update 1 field value in the database. Af

  • 13 th question

    mark the correct SAP business work flow a..is a support tool that can be used to optimize the flow of business transactions b..control the info process flow according to a predefined model c.. bring right work in the right order at right time to the