Invocation API or Java Client Libraries

Hi All,
I want to invoke my short/long lived processes through my java code.
Now, There are two ways to achieve this as i know .
1. Invocation API (which I am using currently now)
2. java client libraries
Now my question is whether one can use java client libraries to invoke workbench processes through java code?
If yes, is it better than Invocation API ?
Thanks
Abhiram

Abhiram,
You can invoke any service defined to LC (there are several exceptions for good reasons) whether they are out-of-the-box services or applications you have built yourself.
In my opinion, your preference for invocation should be based upon the best fit for your existing Java classes. That's the beauty of the LC APIs. They give you some flexibility. The invocation APIs are nice for dealing with documents (PDF and native file formats). However, if your Java class(es) use Web Services then use the SOAP endpoint to call the LC process, for example. If performance is an issue and the Java class(es) run on the same host as LC, then use EJB.
Steve

Similar Messages

  • Error in oim Role creation using Role Manager Service API from Standalone Java client

    Hi,
      Facing the following error when trying to create Role using Role Manager Service API from a standalone java client .
    Tried with the solution of changing ,
    Login into the Web Logic Admin Console --> Servers --> OIM Server --> Protocols --> Modify the Maximum Message from 100000000 to 1000000000, but still the problem persists.
    Exception in thread "main" org.omg.CORBA.BAD_PARAM:   vmcid: 0x0  minor code: 0  completed: No
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase.getSystemException(Unknown Source)
    at com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage_1_2.getSystemException(Unknown Source)
    at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.getSystemExceptionReply(Unknown Source)
    at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(Unknown Source)
    at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(Unknown Source)
    at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.invoke(Unknown Source)
    at org.omg.CORBA.portable.ObjectImpl._invoke(Unknown Source)
    at com.sun.org.omg.SendingContext._CodeBaseStub.meta(Unknown Source)
    at com.sun.corba.se.impl.encoding.CachedCodeBase.meta(Unknown Source)
    at com.sun.corba.se.impl.io.IIOPInputStream.getOrderedDescriptions(Unknown Source)
    at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectUsingFVD(Unknown Source)
    at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(Unknown Source)
    at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(Unknown Source)
    at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(Unknown Source)
    at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(Unknown Source)
    at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(Unknown Source)
    at oracle.iam.identity.rolemgmt.api._RoleManager_ogut7n_RoleManagerRemoteRIntf_Stub.createx(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:85)
    at $Proxy2.createx(Unknown Source)
    at oracle.iam.identity.rolemgmt.api.RoleManagerDelegate.create(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at Thor.API.Base.SecurityInvocationHandler$1.run(SecurityInvocationHandler.java:68)
    at weblogic.security.subject.SubjectProxy.doAs(SubjectProxy.java:64)
    at weblogic.security.subject.SubjectManager.runAs(SubjectManager.java:262)
    at weblogic.security.Security.runAs(Security.java:48)
    at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(weblogicLoginSession.java:52)
    at Thor.API.Base.SecurityInvocationHandler.invoke(SecurityInvocationHandler.java:79)
    at $Proxy3.create(Unknown Source)
    at com.idm.role.CreateRole.createRole(CreateRole.java:113)
    at com.idm.role.CreateRole.main(CreateRole.java:167)
    Thanks In Advance

    Hi , I have used OIM 11g  R2.
    Please find below the code we have used,
    package com.idm.role;
    import java.util.HashMap;
    import java.util.HashSet;
    import java.util.Hashtable;
    import java.util.Iterator;
    import java.util.Set;
    import java.util.logging.Logger;
    import javax.security.auth.login.LoginException;
    import oracle.iam.identity.exception.NoSuchRoleException;
    import oracle.iam.identity.exception.RoleAlreadyExistsException;
    import oracle.iam.identity.exception.RoleCreateException;
    import oracle.iam.identity.exception.RoleLookupException;
    import oracle.iam.identity.exception.RoleModifyException;
    import oracle.iam.identity.exception.SearchKeyNotUniqueException;
    import oracle.iam.identity.exception.ValidationFailedException;
    import oracle.iam.identity.rolemgmt.api.RoleManager;
    import oracle.iam.identity.rolemgmt.api.RoleManagerConstants;
    import oracle.iam.identity.rolemgmt.vo.Role;
    import oracle.iam.platform.OIMClient;
    import oracle.iam.platform.authz.exception.AccessDeniedException;
    public class CreateRole {
    private final static Logger LOGGER = Logger.getLogger(CreateRole.class .getName());
    OIMClient oimClient = null;
    public OIMClient connectToOIM() {
      LOGGER.info("In connectToOIM ");
      Hashtable env = new Hashtable();
      env.put(OIMClient.JAVA_NAMING_FACTORY_INITIAL,
        "weblogic.jndi.WLInitialContextFactory");
      env.put(OIMClient.JAVA_NAMING_PROVIDER_URL,
        "t3://V-hydidm1.itig.co.in:14000");
      System.setProperty("java.security.auth.login.config",
        "F:\\Projects\\IDM\\Team\\Env_setup\\OIM_Setup\\designconsole\\config\\authwl.conf");
      System.setProperty("java.security.policy",
        "F:\\Projects\\IDM\\Team\\Env_setup\\OIM_Setup\\designconsole\\config\\xl.policy");
      System.setProperty("OIM.AppServerType", "wls");
      System.setProperty("APPSERVER_TYPE", "wls");
      System.setProperty("weblogic.Name", "oim_server1");
      oimClient = new OIMClient(env);
      try {
       oimClient.login("xelsysadm", "Passw0rd".toCharArray());
      } catch (LoginException e) {
       e.printStackTrace();
      System.out.println("Connected");
      return oimClient;
    public void readRoleMetadata() {
      LOGGER.info("in readRoleMetadata ");
      RoleManager roleManagerService = oimClient
        .getService(RoleManager.class);
      try {
       Role roleVo = roleManagerService.getDetails(
         RoleManagerConstants.ROLE_DISPLAY_NAME, "API Role1", null);
       Set attributeNameSet = roleVo.getAttributeNames();
       Iterator it = attributeNameSet.iterator();
       while (it.hasNext()) {
        System.out.println("Attribute Name :: " + it.next());
       // roleVo.setAttribute("ADentitlements", "Security Admin access");
       String adEntitlements = "" + roleVo.getAttribute("ADentitlements");
       System.out.println("AD Entitlements :: " + adEntitlements);
       System.out.println("DB Entitlements :: " + ""
         + roleVo.getAttribute("DBEntitlements"));
       System.out.println("Unix Entitlements :: " + ""
         + roleVo.getAttribute("UnixWindows"));
       System.out.println("VPN :: " + "" + roleVo.getAttribute("VPN"));
      } catch (SearchKeyNotUniqueException e) {
       e.printStackTrace();
      } catch (NoSuchRoleException e) {
       e.printStackTrace();
      } catch (RoleLookupException e) {
       e.printStackTrace();
      } catch (AccessDeniedException e) {
       e.printStackTrace();
    public void createRole() {
      LOGGER.info(" in Create role ");
      RoleManager roleManagerService = oimClient
        .getService(RoleManager.class);
      HashMap<String, Object> roleCreationAttrMap = new HashMap<String, Object>();
      roleCreationAttrMap.put(RoleManagerConstants.ROLE_NAME, "API Role1");
      roleCreationAttrMap.put(RoleManagerConstants.ROLE_DESCRIPTION,
        "This Role is created using API Role1");
      roleCreationAttrMap.put(RoleManagerConstants.ROLE_DISPLAY_NAME,
        "API Role1");
      roleCreationAttrMap.put("ADentitlements", "API Role1 AD Entitlements");
      roleCreationAttrMap.put("DBEntitlements", "API Role1 DB Entitlements");
      roleCreationAttrMap.put("VPN", "No");
      roleCreationAttrMap.put("UnixWindows", "API Role1 Unix Entitlements");
      Role roleVo = new Role(roleCreationAttrMap);
      try {
       System.out.println(" Before Create role *********************************************");
       roleManagerService.create(roleVo);
       System.out.println("Role Created .. ");
      } catch (ValidationFailedException e) {
       e.printStackTrace();
      } catch (RoleAlreadyExistsException e) {
       e.printStackTrace();
      } catch (RoleCreateException e) {
       e.printStackTrace();
      } catch (AccessDeniedException e) {
       e.printStackTrace();
    public void modifyRole() {
      LOGGER.info(" in modifyRole ");
      RoleManager roleManagerService = oimClient
        .getService(RoleManager.class);
      Role roleVo;
      try {
       roleVo = roleManagerService.getDetails(
         RoleManagerConstants.ROLE_DISPLAY_NAME, "API Role1", null);
       String roleKey = roleVo.getEntityId();
       HashMap<String, Object> roleCreationAttrMap = new HashMap<String, Object>();
       roleCreationAttrMap.put("ADentitlements",
         "Updated API Role1 AD Entitlements");
       Set roleKeySet = new HashSet<String>();
       roleKeySet.add(roleKey);
       Role roleVoNew = new Role(roleCreationAttrMap);
       roleManagerService.modify(roleKeySet, roleVoNew);
       System.out.println("Role Modified ..");
      } catch (SearchKeyNotUniqueException e) {
       e.printStackTrace();
      } catch (NoSuchRoleException e) {
       e.printStackTrace();
      } catch (RoleLookupException e) {
       e.printStackTrace();
      } catch (AccessDeniedException e) {
       e.printStackTrace();
      } catch (ValidationFailedException e) {
       e.printStackTrace();
      } catch (RoleModifyException e) {
       e.printStackTrace();
    public static void main(String args[]) {
      CreateRole miscObj = new CreateRole();
      miscObj.connectToOIM();
      miscObj.createRole();
      //miscObj.readRoleMetadata();
    Thanks In Advance .

  • [METASOLV XML AP]devolop JAVA client using XML API for metasolv application

    Hi All,
    I am new in this group, and I need to help me to develop a java client to communicate with metasolv application using XML API.
    I read "XML API Developer’s Reference" document, but I still not understand how can I setup the cllient.
    I still need:
    1- What API needed(jar files) I must use to build the client
    2- A sample of source code using java.
    3- detailed guide to communicate with metasolv application using XML API.
    Thanks&Best Regards
    RADOUANE Mohamed

    any help please!!!!

  • Oracle BPEL Java Client API: Reading Configurations dynamically

    We have a requirement to use Oracle BPEL Java client API to control the BPEL instances at the runtime, from an ADF BC Application. is there any possibility to read the configurations/properties that are required to look up (using 'oracle.soa.management.facade.Locator' ) the BPEL Process Manager/Server from connections.xml/adf-config.xml ?
    In other terms, as we need the details like the bpel server URL, security credentials..etc to lookup the BPEL server and instances using the BPEL java client API, how can we read these details from the ADF standard config files like Connections.xml/adf-config.xml instead of hard coding them in the Java program.
    Edited by: 899479 on Feb 4, 2013 6:02 AM

    The api's for BPEL / Workslow canbe found here:
    http://orasoa.blogspot.com/2007/05/newbie-getting-started-with-oracle-soa.html
    Marc

  • VC8 clients and native invocation API

    Hi,
    Could someone from Sun tell me whether JNI invocation API for the 1.5.0_07 Windows JVM supports .NET clients compiled with Visual C++ 8?
    I have an ASP.NET application that calls into the JVM through the JNI invocation API. I know that there were problems with VC7 clients calling into the 1.3 and 1.4 JVM's (they only surfaced under high concurrency), but I was told that the 1.5 JVM would better support .NET clients.
    Thanks...

    See
    http://www.simtel.net/product.php[id]95126[SiteID]simtel.net

  • Problem getting calendar event with recurring using EWS Java client API 1.2

    I am using EWS 1.2 Java client API for getting calendar events. I am able to get Recurring information of the event which is created through API's 
    appointment.save(), but not able to get recurring information of the event created in OWA interface, I get following error during the bind:
    ===================================
    Exception: Connection not established
    microsoft.exchange.webservices.data.EWSHttpException: Connection not established
    at microsoft.exchange.webservices.data.HttpClientWebRequest.throwIfConnIsNull(HttpClientWebRequest.java:394)
    at microsoft.exchange.webservices.data.HttpClientWebRequest.getResponseHeaders(HttpClientWebRequest.java:280)
    at microsoft.exchange.webservices.data.ExchangeServiceBase.processHttpResponseHeaders(ExchangeServiceBase.java:1045)
    at microsoft.exchange.webservices.data.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:58)
    at microsoft.exchange.webservices.data.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:144)
    at microsoft.exchange.webservices.data.ExchangeService.internalBindToItems(ExchangeService.java:1364)
    at microsoft.exchange.webservices.data.ExchangeService.bindToItem(ExchangeService.java:1407)
    at microsoft.exchange.webservices.data.ExchangeService.bindToItem(ExchangeService.java:1430)
    at microsoft.exchange.webservices.data.Appointment.bind(Appointment.java:70)
    at microsoft.exchange.webservices.data.Appointment.bindToRecurringMaster(Appointment.java:176)
    at microsoft.exchange.webservices.data.Appointment.bindToRecurringMaster(Appointment.java:152)
    ============================
    This happens if I use: Appointment.bindToRecurringMaster or Item.bind(service, id, appointmentProps) or findAppointments(). 
    Works fine for events which doesn't have recurring. Only issue with events containing recurrence created through OWA. These are the propertySet:
    new PropertySet(BasePropertySet.IdOnly,
                                    ItemSchema.Subject,
                                    AppointmentSchema.AppointmentType,
                                    AppointmentSchema.DeletedOccurrences,
                                    AppointmentSchema.FirstOccurrence,
                                    AppointmentSchema.LastOccurrence,
                                    AppointmentSchema.IsRecurring,
                                    AppointmentSchema.Location,
                                    AppointmentSchema.ModifiedOccurrences,
                                    AppointmentSchema.OriginalStart,
                                    AppointmentSchema.Recurrence,
                                    AppointmentSchema.Start,
                                    AppointmentSchema.End);
    If I remove Recurrence it gives the response. 
    Thanks.

    I am using EWS 1.2 Java client API for getting calendar events. I am able to get Recurring information of the event which is created through API's 
    appointment.save(), but not able to get recurring information of the event created in OWA interface, I get following error during the bind:
    ===================================
    Exception: Connection not established
    microsoft.exchange.webservices.data.EWSHttpException: Connection not established
    at microsoft.exchange.webservices.data.HttpClientWebRequest.throwIfConnIsNull(HttpClientWebRequest.java:394)
    at microsoft.exchange.webservices.data.HttpClientWebRequest.getResponseHeaders(HttpClientWebRequest.java:280)
    at microsoft.exchange.webservices.data.ExchangeServiceBase.processHttpResponseHeaders(ExchangeServiceBase.java:1045)
    at microsoft.exchange.webservices.data.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:58)
    at microsoft.exchange.webservices.data.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:144)
    at microsoft.exchange.webservices.data.ExchangeService.internalBindToItems(ExchangeService.java:1364)
    at microsoft.exchange.webservices.data.ExchangeService.bindToItem(ExchangeService.java:1407)
    at microsoft.exchange.webservices.data.ExchangeService.bindToItem(ExchangeService.java:1430)
    at microsoft.exchange.webservices.data.Appointment.bind(Appointment.java:70)
    at microsoft.exchange.webservices.data.Appointment.bindToRecurringMaster(Appointment.java:176)
    at microsoft.exchange.webservices.data.Appointment.bindToRecurringMaster(Appointment.java:152)
    ============================
    This happens if I use: Appointment.bindToRecurringMaster or Item.bind(service, id, appointmentProps) or findAppointments(). 
    Works fine for events which doesn't have recurring. Only issue with events containing recurrence created through OWA. These are the propertySet:
    new PropertySet(BasePropertySet.IdOnly,
                                    ItemSchema.Subject,
                                    AppointmentSchema.AppointmentType,
                                    AppointmentSchema.DeletedOccurrences,
                                    AppointmentSchema.FirstOccurrence,
                                    AppointmentSchema.LastOccurrence,
                                    AppointmentSchema.IsRecurring,
                                    AppointmentSchema.Location,
                                    AppointmentSchema.ModifiedOccurrences,
                                    AppointmentSchema.OriginalStart,
                                    AppointmentSchema.Recurrence,
                                    AppointmentSchema.Start,
                                    AppointmentSchema.End);
    If I remove Recurrence it gives the response. 
    Thanks.
    I am also facing the same problem.. If anyone can help, it would be helpful. I can see the response xml has the data, but while parsing the xml the error is generated in getResponseCode() in HttpClientWebRequest

  • Java Client Program to explore CVS Repository

    Hi Friends :
    My module, use CVS as repository to which bunch of XMLs files gets committed by a particular process. Later these XMLs are collected and send to another location by an EOD process.
    I need to write a java client, to explore CVS file folder structure to see what is in the CVS before EOD process starts. I do got one reference from NetBeans Stack - org-netbeans-lib-cvsclient.jar - but faces limitations on them.
    Has any one here, has got any suggestion / alternate approach to make.
    Regards
    Abhilash

    Imagine some friend replied to me - "Oh yes - I have applied this - XYZ jar in my project for same ops.. ' - this would have been booster for any one experimenting with ...That is what expected rather than de-route to Google Path .. My point is, that a Google search will probably lead you to articles, blogs, and posts, on this forum or on others, from people that are applying succesfully XYZ.jar for a similar purpose. This forum, with all due respect to its venerable members, and despite my obvious bias and sympathy for some of them, are no more authoritative than a few other technical places on the Internet.
    And if no such existing resource andwser your needs, you'll be more welcome if you state that "you have read XYZ's doc, read this post (link), and this one (other link), and evaluated this other lib, and none of them seems to fulfills my requirements X, Y, and Z"
    I have noticed your similar reply for the same query in another postAh, you mean in this topic which you resurrected (wink to the moderators :o): {message:id=9817389}?
    Well note that it was not me who pushed this other poor soul to a search engine, so this is not just me getting old, wrinkled and bitter, merely a general consensus here that questions such as "Looking for a way to..." should demonstrate some effort on the part of the questioner before asking others. In the case of such an request where obviously several APIs are easily found, you could read the introduction chapter of the respective docs, to get an idea of the strength and weaknesses, or do a few more searches to find posts related to these APIs on programming forums.
    but I feel - any query can give different dimensions of issuesI don't understand :o(
    Idea of using CVS in my java module for storing files for processing came to my attention (...) remotely related to my requirement (...) It triggered me using CVS (...) would give me added advantagesIn other words, using CVS is not a requirement, it's a technical decision, after analyzing the requirements and the other factors that can drive the choice (licence cost, knowledge within the team, maintenability,...)?
    Unless history, branching, and diffing, are requirements of your application, I seriously question using CVS as only a shared repository of data, but let's assume you have done this analysis and indeed come to the right conclusion.
    So am patient enough to get an valuable guidance / lead on same subject - else I will continue with POC !!
    Good Luck Oh you mean, with my age, wrinkles, and bitterness? Thanks ;)
    I didn't mean to offend you, and wish you good luck getting help, I just pointed out that you will have more chance of getting help if you:
    1) give more details about which "limitations" are hampering your work:
    2) demonstrate more effort of evaluating alternative solutions
    For example it is not clear to me if you're looking for a workaround with your current library, or if you 're looking for alternative libraries.
    J.
    Edited by: jduprez on Aug 24, 2011 10:18 PM

  • Invocation API

    I am working with the invocation api from the tutorial. I do not want to set the path to the jvm.dll before running the exe. How can I dynamically load the dll. When I start the exe, immediately it popsup a message box saying that jvm.dll not found. Can anyone please help me out as to how to load the dll dynamically. All help is appreciated.
    Razi

    Try this:
    // runjava.cpp
    #include <windows.h>
    #include <jni.h>
    #define DOTRELEASE  "1.4" /* Same for 1.3.1, 1.3.2 etc. */
    #define JRE_KEY         "Software\\JavaSoft\\Java Runtime Environment"
    // typedefs for calls to jvm.dll
    typedef jint (JNICALL *CreateJavaVM_t)(JavaVM **pvm, void **env, void *args);
    typedef jint (JNICALL *GetDefaultJavaVMInitArgs_t)(void *args);
    // globals
    JavaVMInitArgs vmArgs;
    JavaVM* jvm;
    JNIEnv* env;
    bool running=false;
    void LogError(const char * format,...)
        char    message[256];
        va_list args;
        va_start(args, format);
        vsprintf(message, format, args);
        va_end(args);
         printf("%s\n",message);          
    void LogWin32Error(const char * pTitle)
        PCHAR pBuffer;
        LONG  lError = GetLastError ( );
        FormatMessage ( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
                        NULL,
                        lError,
                        MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
                        (char *)&pBuffer,
                        0,
                        NULL );
         LogError ("Win32 error: %s %s\n",pBuffer,pTitle);
        LocalFree ( pBuffer );
    bool GetStringFromRegistry(HKEY key, const char *name, unsigned char *buf, int bufsize)
        DWORD type, size;
        if (RegQueryValueEx(key, name, 0, &type, 0, &size) == 0
         && type == REG_SZ
         && (size < (unsigned int)bufsize))
              if (RegQueryValueEx(key, name, 0, 0, buf, &size) == 0)
                   return true;
        return false;
    bool GetPublicJREHome(char *buf, int bufsize)
        HKEY key, subkey;
        char version[MAX_PATH];
        /* Find the current version of the JRE */
        if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, JRE_KEY,0,KEY_READ,&key)!=0)
              LogError("Error opening registry key '" JRE_KEY "'\n");
              return false;
        if(!GetStringFromRegistry(key,"CurrentVersion",(unsigned char *)version, sizeof(version)))
              LogError("Failed reading value of registry key:\n\t"JRE_KEY "\\CurrentVersion\n");
              RegCloseKey(key);
              return false;
        if(strcmp(version, DOTRELEASE)!= 0)
              LogError("Registry key '" JRE_KEY "\\CurrentVersion'\nhas value '%s', but '" DOTRELEASE "' is required.\n", version);
              RegCloseKey(key);
              return false;
        /* Find directory where the current version is installed. */
        if(RegOpenKeyEx(key,version,0,KEY_READ, &subkey)!= 0)
              LogError("Error opening registry key '"JRE_KEY "\\%s'\n", version);
              RegCloseKey(key);
              return false;
        if(!GetStringFromRegistry(subkey, "JavaHome", (unsigned char *)buf, bufsize))
              LogError("Failed reading value of registry key:\n\t"JRE_KEY "\\%s\\JavaHome\n", version);
              RegCloseKey(key);
              RegCloseKey(subkey);
              return false;
        RegCloseKey(key);
        RegCloseKey(subkey);
        return true;
    jint JNICALL _vfprintf_(FILE *fp, const char *format, va_list args)
         LogError(format,args);
         return 0;
    void JNICALL _exit_(jint code)
         LogError("VM exited");
         exit(code);
    void JNICALL _abort_(void)
         LogError("VM aborted");
         abort();
    void LoadJVM(char * dir)
         HINSTANCE handle;
         JavaVMOption options[5];
         char JREHome[MAX_PATH];
         char JVMPath[MAX_PATH];                                        
         char classpathOption[MAX_PATH];
         char librarypathOption[MAX_PATH];
         if(!GetPublicJREHome(JREHome, MAX_PATH))
              LogError("Could not locate JRE");
              abort();
         strcpy(JVMPath,JREHome);
         strcat(JVMPath,"\\bin\\client\\jvm.dll");
        if ((handle=LoadLibrary(JVMPath))==0)
              LogError("Error loading: %s", JVMPath);
              abort();
        CreateJavaVM_t pfnCreateJavaVM=(CreateJavaVM_t)GetProcAddress(handle,"JNI_CreateJavaVM");
        if (pfnCreateJavaVM==0)
              LogError("Error: can't find JNI interfaces in: %s",JVMPath);
              abort();
         strcpy(classpathOption,"-Djava.class.path=");
         strcat(classpathOption,dir);
         strcat(classpathOption,";");
         strcat(classpathOption,JREHome);
         strcat(classpathOption,"\\lib");
         strcat(classpathOption,";");
         strcat(classpathOption,JREHome);
         strcat(classpathOption,"\\lib\\comm.jar");
         strcpy(librarypathOption,"-Djava.library.path=");
         strcat(librarypathOption,JREHome);
         strcat(librarypathOption,"\\lib");
         OutputDebugString("classpath option=");
         OutputDebugString(classpathOption);
         OutputDebugString("\n");
         OutputDebugString("librarypath option=");
         OutputDebugString(librarypathOption);
         OutputDebugString("\n");
         options[0].optionString=classpathOption;     
         options[1].optionString=librarypathOption;     
         options[2].optionString="vfprintf";
         options[2].extraInfo=_vfprintf_;
         options[3].optionString="exit";
         options[3].extraInfo=_exit_;
         options[4].optionString="abort";
         options[4].extraInfo=_abort_;
        vmArgs.version  = JNI_VERSION_1_2;
        vmArgs.nOptions = 5;
        vmArgs.options  = options;
        vmArgs.ignoreUnrecognized = false;
         //if(JNI_CreateJavaVM(&jvm, (void**)&env, &vmArgs)<0)
        if(pfnCreateJavaVM(&jvm,(void**)&env, &vmArgs)!=0)
              LogError("Could not create VM");
              abort();
    void main(int argc, char *argv[])
        char path[MAX_PATH];
        char drive[MAX_PATH];
        char file[MAX_PATH];
        char dir[MAX_PATH];
        char ext[MAX_PATH];
         jclass  cls;
         jmethodID mid;
         jobjectArray args;
         if(argc>=2)
              _splitpath(path,drive,dir,file,ext);
              LoadJVM(dir);
              if(env==NULL)
                   LogError("Could not load VM");
                   abort();
              if(GetModuleFileName(NULL,path,MAX_PATH)==0)
                   LogWin32Error("Getting module filename");
                   abort();
              cls=env->FindClass(argv[1]);
              if(cls==NULL)
                   LogError("Could not find class %s (or its superclass)",argv[1]);
                   exit(-1);
              mid=env->GetStaticMethodID(cls,"main","([Ljava/lang/String;)V");
              if(mid==NULL)
                   LogError("Could not find method 'main'");
                   exit(-1);
              args=env->NewObjectArray(argc-2,env->FindClass("java/lang/String"),NULL);
              if(args==NULL)
                   LogError("Could not create args array");
              for(int arg=0;arg<argc-2;arg++)
                   env->SetObjectArrayElement(args,arg,env->NewStringUTF(argv[arg+2]));
              env->CallStaticVoidMethod(cls,mid,args);
              jvm->DestroyJavaVM();
         else
              printf("Usage: runjava classname\n");
              exit(-1);
    //*****************************************************************************

  • Java client application + SAP Logon Tickets (SSO)

    Java client application + SAP Logon Tickets (SSO)
    Hello
    I have the following question, it is about connection between SAP Enterprise Portal and Java Application.
    After registration in Enterprise Portal (with Internet Explorer Browser) request is passed on to SAP backend system - cFolders (SSO methode)
    With internet browser functioned everything.
    How can one get, however, this Logon tickets with Java application and then be of use later for SOAP connection
    (everything with client java application)
    Thanks for quick help
    Edo

    Hi Edo,
    look at this https://media.sdn.sap.com/javadocs/NW04/SPS15/um/com/sap/security/api/ticket/TicketVerifier.html
    Best Regards
    Oliver

  • Design Problem : How to design/code a java client which is deployed to all the machines in a cluster and make sure that only one of the java client is active

              hi ,
              I have to design a java client (which is basically a JMS message listener)which
              is deplloyed to all the servers in the cluster. But as these are message listeners,
              i want only one of the instance to be active at a time.
              If the server on which the client is active goes down , I want the second server
              to start listening to messages.
              How do i design this ? Also is there a public api for multicasting that we can
              use ?
              Anybody has an idea on how to go about this..
              Thanks
              nisha
              

    Hi Nisha,
              Failover message listeners? Sounds like you want MDBs, which are deployed on all nodes in a
              cluster. If your JMS destination is a queue, then only one MDB will pick up the message. And just
              like any other ejb service, MDBs failover.
              Gene
              "Nisha" <[email protected]> wrote in message news:[email protected]..
              hi ,
              I have to design a java client (which is basically a JMS message listener)which
              is deplloyed to all the servers in the cluster. But as these are message listeners,
              i want only one of the instance to be active at a time.
              If the server on which the client is active goes down , I want the second server
              to start listening to messages.
              How do i design this ? Also is there a public api for multicasting that we can
              use ?
              Anybody has an idea on how to go about this..
              Thanks
              nisha
              

  • How can i execute Spaces API in java main class?

    Hi
    I am able to execute Spaces API through portal application. However if i try to execute it in java main class, its throwing an exception
    "SEVERE: java.io.FileNotFoundException: .\config\jps-config.xml (The system cannot find the path specified)"
    oracle.wsm.common.sdk.WSMException: WSM-00145 : Keystore location or path can not be null or empty; it must be configured through JPS configuration or policy configuration override.
    How can i set this path, so that i can execute Spaces API from java main class.
    Need this main class to configure in cron job, to schedule a task.
    Regards
    Raj

    Hi Daniel
    Currently i have implemented create functionality in my portal application using Spaces API, which is working fine. Now the requirement is, i need to implement a "Cron Job" to schedule a task, which will execute to create space(for example once in a week). Cron job will execute only the main method. So I have created java main class, in which I have used Spaces API to perform create space operation. Then it was giving exception.
    Later I understood the reason, as I am executing the Space API with a simple JSE client, its failing since a simple java program has no idea of default-keystore.jks, jps-config.xml, Security Policy. Hence i have included those details in main class. Now I am getting new error,
    SEVERE: WSM-06303 The method "registerListener" was not called with required permission "oracle.wsm.policyaccess"
    For your reference i have attached the code below, please help. How can i use Spaces API in java main method(i mean public static void main(String[] args) by giving all required information.
        public static void main(String[] args) throws InstantiationException,
                                                      GroupSpaceWSException,
                                                      SpacesException {
            Class2 class2 = new Class2();
            GroupSpaceWSContext context = new GroupSpaceWSContext();
            FactoryFinder.init(null);
            context.setEndPoint("http://10.161.226.30/webcenter/SpacesWebService");
            context.setSamlIssuerName("www.oracle.com");
            context.setRecipientKeyAlias("orakey");
            Properties systemProps = System.getProperties();
            systemProps.put("java.security.policy","oracle/wss11_saml_or_username_token_with_message_protection_client_policy");
            systemProps.put("javax.net.ssl.trustStore","C:\\Oracle\\Middleware11.1.7\\wlserver_10.3\\server\\lib\\cacerts.jks");
    systemProps.put("oracle.security.jps.config","C:\\Oracle\\Middleware11.1.7\\user_projects\\domains\\workspace\\system11.1.1.7.40.64.93\\DefaultDomain\\config\\fmwconfig\\jps-config.xml");
            systemProps.put("javax.net.ssl.keyStore",C:\\Oracle\\Middleware11.1.7\\user_projects\\domains\\workspace\\system11.1.1.7.40.64.93\\DefaultDomain\\config\\fmwconfig\\consumer.jks");
            systemProps.put("javax.net.ssl.keyStorePassword", "Test12");
            System.setProperties(systemProps);
            GroupSpaceWSClient groupSpaceWSClient;
            try {
                groupSpaceWSClient = new GroupSpaceWSClient(context);
                System.out.println("URL: " +
                                   groupSpaceWSClient.getWebCenterSpacesURL());
                //delete the Space
                List<String> groupSpaces = groupSpaceWSClient.getGroupSpaces(null);
                System.out.println("GroupSpaces:: " + groupSpaces.size());
            } catch (Exception e) {
    Regards
    Raj

  • Creating multiple stateful session beans from a java client. (EJB 3.0)

    I'm having difficulties with the following:
    To access the ShoppingCartBean, I have to put the following annotation in my standalone java client:
    @EJB
    private static ShoppingCartRemote shoppingCartBean;
    The static must be there, thus only one ShoppingCartBean will exist within my java client. But as the ShoppingCartBean is a stateful session bean, I want to be able to get different beans of the same type.
    What is the correct way to do this in EJB 3.0?

    Great question. Because Home interfaces have been removed for the EJB 3.0 simplified
    API, stateful session bean creation happens as a side-effect of injection. However, the
    same is true of EJB 3.0 business interface lookups. The easiest way to create additional
    stateful session beans is to lookup the same dependency that was declared via your
    @EJB annotation.
    E.g.,
    // Assuming the declaring class is pkg1.ShoppingCartClient.java
    InitialContext ic = new InitialContext();
    ShoppingCartRemote scr1 = (ShoppingCartRemote)
    ic.lookup("java:comp/env/pkg1.ShoppingCartClient/shoppingCartBean");
    Note that the name relative to java:comp/env is the default associated with your
    @EJB annotation since the name() attribute wasn't used. Alternatively, you
    could have used :
    @EJB(name="scb") private static ShoppingCartRemote shoppingCartBean;
    InitialContext ic = new InitialContext();
    ShoppingCartRemote scr1 = (ShoppingCartRemote) ic.lookup("java:comp/env/scb");
    Yet another alternative is to declare the @EJB at the class-level. This just defines
    the dependency without any injection, which is fine if you want to create a bunch of
    them via lookup anyway.
    @EJB(name="scb", beanInterface=ShoppingCartRemote.class)
    public class .... {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Invoking a secure web service from a standalone java client

    I am using stand alone java client to invoke a web service. This web service in turn invokes a jcs which is protected ( role based access ).
    I am using a proxy at the client side for web service invocation
    FileSubmission_Impl filesubmission_impl = new FileSubmission_Impl();
    FileSubmissionSoap filesubmissionsoap = filesubmission_impl.getFileSubmissionSoap();
    filesubmissionsoap.processFiles(...)
    This works if there are no security constraints on any of the resources (@common:security).
    I need to pass the username and password from the java client that will be authenticated and allowed to access the protected resources.
    Please let me know as to how this can be achieved ( passing username and password from client )

    Paula,
    I suppose you're using CFINVOKE (http://www.activsoftware.com/code_samples/code.cfm/CodeID/44/ColdFusion/Invoking_SOAP_Web_Services_with_ColdFusion_MX_CFINVOKE_Tag) or are you using a third party tool like CFX_SOAP (http://www.activsoftware.com/products/productdetail.cfm/id/1015)?
    Are you working with WebAS 6.4 or 6.2?
    It works with web services created with WebAS 6.4, but you should generate proxy classes. Check Thomas' weblog (second part of it)->https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1012. [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    The WSDL generated by this method is more standard than the one generated when you just Remote enable an FM and look at the webservice browser.
    Th core of CF MX is Java and that engine is rather strict in standards.
    Eddy

  • How to deal with credentials for external applications using a Java Client/

    Hi Guys,
    This is the case. I am integrating an external application with an ADF Application. I have implemented some programmatic ViewObjects that are being filled up by a REST Java Client Wrapper. Everything is working fine but the issue is that the credentials the wrapper is using are hard coded inside the java class. I am thinking to ask for the credentials at the beginning of my taskflow and then store them somewhere and use them then to create my client wrapper (passing them in the constructor).
    However, I don't know if my approach is good and I would like you to share your experiences or how to deal with this.
    Regards

    You can use Credential Store Framework to store the credentials securely in the weblogic server instead of hardcoding in the java class.
    The Credential Store Framework:
    - enables you to manage credentials securely
    - provides an API for storage, retrieval, and maintenance of credentials in different back-end repositories
    Check the documentation on CSF API -
    http://docs.oracle.com/cd/E29505_01/core.1111/e10043/devcsf.htm
    Major Steps -
    1. Create a credential map and key in em console to store the password (http://docs.oracle.com/cd/E25054_01/core.1111/e10043/csfadmin.htm)
    2. Use CSF API to retrieve the stored password
    3. In jazn-data.xml give permissions to access CSF key and map

  • Custom OIM java client not working

    Hi all,
    I am trying to execute a custom OIM java client in my server. The java file just has the code to connect to the OIM server and it is failing at the line
    ConfigurationClient.ComplexSetting config = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
    The basic content of the java file OIMTry.java is given below:
    env.put("java.security.auth.login.config", "/u01/apps/resetpwd/config/auth.conf");
    env.put("java.security.policy", "/u01/apps/resetpwd/config/xl.policy");
    env.put("XL.HomeDir", "/u01/apps/resetpwd");
    ConfigurationClient.ComplexSetting config = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
    env = config.getAllSettings();
    I have set the OIM related jar files in classpath in .bash_profile and able to echo the classpath as well.
    However, the file is executing perfectly in Eclipse tool but not from command prompt.The file is getting compiled properly at command prompt.
    I have tried various options of executing the java file as shown below.
    java -Djava.security.manager -DXL.HomeDir=/u01/apps/oim_server/xellerate -Djava.security.policy=/u01/apps/oim_server/xellerate/config/xl.policy -Djava.security.auth.login.config=/u01/apps/oim_server/xellerate/config/auth.conf -Djava.naming.provider.url=jnp://oim_server_host:12401/ OIMTry
    java -Dclasspath=/u01/apps/resetpwd/lib/xlUtils.jar:/u01/apps/resetpwd/lib/xlAPI.jar:/u01/apps/resetpwd/lib/xlCrypto.jar OIMTry
    The error we are getting is given below:
    Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: com.thortech.xl.util.config.ConfigurationClient
    at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.5.0.0)
    at JvResolvePoolEntry(java.lang.Class, int) (/usr/lib/libgcj.so.5.0.0)
    at OIMTry.main(java.lang.String[]) (Unknown Source)
    Caused by: java.lang.ClassNotFoundException: javax.crypto.Cipher not found in [file:/u01/apps/resetpwd/lib/activation.jar, file:/u01/apps/resetpwd/lib/ojdbc14.jar, file:/u01/apps/resetpwd/lib/XLCustomClient.ear, file:/u01/apps/resetpwd/lib/commons-beanutils.jar, file:/u01/apps/resetpwd/lib/oscache.jar, file:/u01/apps/resetpwd/lib/xlDataObjectBeans.jar, file:/u01/apps/resetpwd/lib/commons-collections.jar, file:/u01/apps/resetpwd/lib/sax.jar, file:/u01/apps/resetpwd/lib/xlDataObjects.jar, file:/u01/apps/resetpwd/lib/commons-dbcp-1.2.1.jar, file:/u01/apps/resetpwd/lib/wlXLSecurityProviders.jar, file:/u01/apps/resetpwd/lib/xlDDM.jar, file:/u01/apps/resetpwd/lib/commons-digester.jar, file:/u01/apps/resetpwd/lib/xalan.jar, file:/u01/apps/resetpwd/lib/xlGenConnector.jar, file:/u01/apps/resetpwd/lib/commons-logging.jar, file:/u01/apps/resetpwd/lib/XellerateClient.jar, file:/u01/apps/resetpwd/lib/xlGenericUtils.jar, file:/u01/apps/resetpwd/lib/commons-pool-1.2.jar, file:/u01/apps/resetpwd/lib/xercesImpl.jar, file:/u01/apps/resetpwd/lib/xliGCProviders.jar, file:/u01/apps/resetpwd/lib/commons-validator.jar, file:/u01/apps/resetpwd/lib/xerces.jar, file:/u01/apps/resetpwd/lib/xlInputPreprocessor.jar, file:/u01/apps/resetpwd/lib/crimson.jar, file:/u01/apps/resetpwd/lib/XIMDD.jar, file:/u01/apps/resetpwd/lib/xlInstaller.jar, file:/u01/apps/resetpwd/lib/csv.jar, file:/u01/apps/resetpwd/lib/XL10SecurityProviders.jar, file:/u01/apps/resetpwd/lib/xlLogger.jar, file:/u01/apps/resetpwd/lib/dom.jar, file:/u01/apps/resetpwd/lib/xlAdapterUtilities.jar, file:/u01/apps/resetpwd/lib/xlRemoteManager.jar, file:/u01/apps/resetpwd/lib/ejb.jar, file:/u01/apps/resetpwd/lib/xlAPI.jar, file:/u01/apps/resetpwd/lib/xlRequestPreview.jar, file:/u01/apps/resetpwd/lib/jakarta-oro-2.0.8.jar, file:/u01/apps/resetpwd/lib/xlAttestation.jar, file:/u01/apps/resetpwd/lib/xlSampleApp.jar, file:/u01/apps/resetpwd/lib/javagroups-all.jar, file:/u01/apps/resetpwd/lib/xlAuditor.jar, file:/u01/apps/resetpwd/lib/xlScheduler.jar, file:/u01/apps/resetpwd/lib/jaxp-api.jar, file:/u01/apps/resetpwd/lib/xlAuthentication.jar, file:/u01/apps/resetpwd/lib/xlUtils.jar, file:/u01/apps/resetpwd/lib/jhall.jar, file:/u01/apps/resetpwd/lib/xlBackOfficeBeans.jar, file:/u01/apps/resetpwd/lib/xlVO.jar, file:/u01/apps/resetpwd/lib/log4j-1.2.8.jar, file:/u01/apps/resetpwd/lib/xlBackofficeClient.jar, file:/u01/apps/resetpwd/lib/xlWebClient.jar, file:/u01/apps/resetpwd/lib/mail.jar, file:/u01/apps/resetpwd/lib/xlCache.jar, file:/u01/apps/resetpwd/lib/xlWSCustomClient.jar, file:/u01/apps/resetpwd/lib/oc4jclient.jar, file:/u01/apps/resetpwd/lib/xlCrypto.jar, file:/u01/apps/resetpwd/lib/xml-apis.jar, file:/usr/share/java/libgcj-3.4.6.jar, file:./, core:/]
    at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
    at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.5.0.0)
    at JvFindClass(_Jv_Utf8Const, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
    at JvBytecodeVerifier.type.compatible(_Jv_BytecodeVerifier.type&, JvBytecodeVerifier) (/usr/lib/libgcj.so.5.0.0)
    at JvBytecodeVerifier.verify_instructions_0() (/usr/lib/libgcj.so.5.0.0)
    at JvVerifyMethod(_Jv_InterpMethod) (/usr/lib/libgcj.so.5.0.0)
    at JvPrepareClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
    at JvWaitForState(java.lang.Class, int) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.VMClassLoader.linkClass0(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
    ...3 more
    Please let me know if I have to set something else in the environment to get rid of this error.
    Thanks,
    Mahendra.

    Hi,
    We were unable to create tcUtilityFactory instance when the env variables are set using the hashmap.
    Instead it is working when we set using System.setProperty() as shown below:
    System.setProperty("XL.HomeDir", "/u01/apps/OIMPwdReset");
    System.setProperty("java.security.policy", "/u01/apps/OIMPwdReset/config/xl.policy");//server or client
    System.setProperty("java.security.auth.login.config", "/u01/apps/OIMPwdReset/config/auth.conf");//server or client
    Hope this helps other guys..
    -Mahendra.

Maybe you are looking for

  • Creative Inspire P7800

    Hello, I have a Creative Labs Inspire P7800 7.1 audio system. It is virtually new (used it twice). Somewhere over the years I lost the power adaptor for the subwoofer. Google doesn't return many results with the info I have. I am looking for a replac

  • Illustrator CS6 drop shadow looks worst

    Anyone there know is it a bug of Illustrator CS6, I try the same size and same setup in Illustrator CS5 have no problem.

  • When I use my EE4G in the States, exactly how do I dial a local U.S. number?

    When I use my EE4G in the States, exactly how do I dial a U.S. number? I will be arriving in Philadelphia and changing planes to go to New York. I want to be able to phone my host in NY when I arrive in Philly, to let them know I've arrived all right

  • Timed array issue

    Hi all, I am trying to incorporate a timed array into my website. I want it to pull the timedCount function every 10 seconds. Any help would be greatly appreciated! Here's what i have so far.... Thanks! Kal function timedCount() var whichQuote=get_ra

  • Tracing enabled = variable updated to next iteration value before end of current iteration

    Hello, I am facing a weird behaviour with variables and loops. (running Teststand 2010 SP1) I am iterating over a variable, when tracing is enabled that variable seem to take the value it should take at the next iteration too early. What I am doing i