Invoking methods in C++ from Java

I'm invoking the Java Virtual Machine from my C++ program like is described here: http://java.sun.com/docs/books/tutorial/native1.1/invoking/invo.html
So, I run my C++ program (let's call it C), C invokes the JVM and starts a Java program (let's call it J). C can now invoke methods in J. Now I want J to invoke a method in C. Is this possible?

Yes it is.
However your C code that you want to invoke from java must be defined as "native" - that is, it is defined as the implementation for java methods that are declared native.
The possibly most confusing part is where to put the C code and how to make the java-C linkage.
o You can put the C code in a DLL, and use a "loadLibrary" call to make it available.
o Alternatively, and perhaps more likely, your original C/C++program can make "registerNative" calls to the JVM to identify to it the native implementations.

Similar Messages

  • Error Invoking a BPEL process from JAVA

    Dear colleagues,
    I'm facing a error at execution time when I'm invoking a BPEL process from java. My BPEL process is in a different server than my application. BPEL is running in SOA SUITE 10.1.3.1 and my JAVA application so far is in the embebed OC4J of my Jdveloper 10.1.3.3. I've seen different post with a similiar problem, but there wasn't never a solution!. Here you have the code following by the error:
    ***************** SOURCE **************************************
    Locator locator = new Locator("default", "bpel");
    IDeliveryService deliveryService =
    (IDeliveryService)locator.lookupService
    (IDeliveryService.SERVICE_NAME );
    System.out.println(deliveryService.SERVICE_NAME);
    System.out.println(deliveryService.LOCAL_SERVICE_NAME);
    NormalizedMessage nm = new NormalizedMessage();
    nm.addPart("payload", xml );
    NormalizedMessage res =
    deliveryService.request("LOAD_DB_5", "process", nm);
    ********************* ERROR ************************************
    08/07/23 17:07:21 java.lang.Exception: Fallo al crear el bean "ejb/collaxa/system/DeliveryBean"; la excepción mostrada es: "javax.naming.NameNotFoundException: ejb/collaxa/system/DeliveryBean not found
         at com.evermind.server.rmi.RMIServerContext.lookup(RMIServerContext.java:207)
         at com.evermind.server.ApplicationContext.unprivileged_lookup(ApplicationContext.java:257)
         at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:197)
         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 amaos.xml.loadData.LoadXml.loadData(LoadXml.java:31)
         at amaos.view.beans.FileProcessor.fileUploaded(FileProcessor.java:159)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
         at oracle.adf.view.faces.component.UIXComponentBase.__broadcast(UIXComponentBase.java:1087)
         at oracle.adf.view.faces.component.UIXEditableValue.broadcast(UIXEditableValue.java:247)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:269)
         at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:363)
         at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:98)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at amaos.view.UploadQuestionary.doFilter(UploadQuestionary.java:24)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at amaos.view.UploadQuestionary.doFilter(UploadQuestionary.java:24)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:228)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:197)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:171)
         at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:103)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    08/07/23 17:07:21      at com.oracle.bpel.client.util.BeanRegistry.lookupDeliveryBean(BeanRegistry.java:293)
    08/07/23 17:07:21      at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:250)
    08/07/23 17:07:21      at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:83)
    08/07/23 17:07:21      at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:53)
    08/07/23 17:07:21      at amaos.xml.loadData.LoadXml.loadData(LoadXml.java:31)
    08/07/23 17:07:21      at amaos.view.beans.FileProcessor.fileUploaded(FileProcessor.java:159)
    08/07/23 17:07:21      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    08/07/23 17:07:21      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    08/07/23 17:07:21      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    08/07/23 17:07:21      at java.lang.reflect.Method.invoke(Method.java:585)
    08/07/23 17:07:21      at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
    08/07/23 17:07:21      at oracle.adf.view.faces.component.UIXComponentBase.__broadcast(UIXComponentBase.java:1087)
    08/07/23 17:07:21      at oracle.adf.view.faces.component.UIXEditableValue.broadcast(UIXEditableValue.java:247)
    08/07/23 17:07:21      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:269)
    08/07/23 17:07:21      at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:363)
    08/07/23 17:07:21      at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:98)
    08/07/23 17:07:21      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
    08/07/23 17:07:21      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
    08/07/23 17:07:21      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
    08/07/23 17:07:21      at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    08/07/23 17:07:21      at amaos.view.UploadQuestionary.doFilter(UploadQuestionary.java:24)
    08/07/23 17:07:21      at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
    08/07/23 17:07:21      at amaos.view.UploadQuestionary.doFilter(UploadQuestionary.java:24)
    08/07/23 17:07:21      at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
    08/07/23 17:07:21      at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)
    08/07/23 17:07:21      at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
    08/07/23 17:07:21      at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:228)
    08/07/23 17:07:21      at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:197)
    08/07/23 17:07:21      at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:171)
    08/07/23 17:07:21      at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:103)
    08/07/23 17:07:21      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
    08/07/23 17:07:21      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
    08/07/23 17:07:21      at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
    08/07/23 17:07:21      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
    08/07/23 17:07:21      at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
    08/07/23 17:07:21      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
    08/07/23 17:07:21      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
    08/07/23 17:07:21      at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    08/07/23 17:07:21      at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
    08/07/23 17:07:21      at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
    08/07/23 17:07:21      at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
    08/07/23 17:07:21      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    08/07/23 17:07:21      at java.lang.Thread.run(Thread.java:595)
    Any help is welcome!
    Thanks

    Hi
    You are trying to create a locator object with default values which does not work at all times.Use Locator("default",prop) where prop is a properties object and set the values according to your environment.
    The following properties values must be set
    Properties props=new Properties();
    props.setProperty("orabpel.platform","ias_10g");
    props.setProperty("java.naming.factory.initial","com.evermind.server.rmi.RMIInitialContextFactory");
    props.setProperty("java.naming.provider.url", "url value");
    props.setProperty("java.naming.security.principal","domain user name");
    props.setProperty("java.naming.security.credentials","password");
    props.setProperty("dedicated.rmicontext", "true");

  • Invoke a bpel process from Java API

    All,
    I got an error when I tried to invoke a bpel process from java api. Can anyone help?
    I got the following errors:
    <2007-08-14 10:10:11,986> <ERROR> <default.collaxa.cube.xml> com.oracle.bpel.client.BPELFault: faultName: {{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure}
    messageType: {null}
    parts: {{summary=oracle.xml.parser.v2.XMLElement@da5c23}}
    <2007-08-14 10:10:12,158> <ERROR> <default.collaxa.cube.xml> <XMLElement__CXPM::save> ORABPEL-09219
    Cannot save element.
    An attempt to save the element "EssayScoringDetailsCollection" has failed. Because this element is not a root element and for some reason the scope has reference to this element, scope should have references ONLY to root elements.
         at com.collaxa.cube.xml.dom.XMLElement__CXPM.save(XMLElement__CXPM.java:82)
         at com.collaxa.cube.engine.core.PersistenceService.save(PersistenceService.java:259)
         at com.collaxa.cube.engine.types.bpel.CXMessageVariable__CXPM.save(CXMessageVariable__CXPM.java:182)
         at com.collaxa.cube.engine.core.PersistenceService.save(PersistenceService.java:259)
         at com.collaxa.cube.engine.persist.BaseScope__CXPM.save(BaseScope__CXPM.java:170)
         at com.collaxa.cube.engine.persist.Scope__CXPM.save(Scope__CXPM.java:97)
         at com.collaxa.cube.engine.core.PersistenceService.save(PersistenceService.java:259)
         at com.collaxa.cube.engine.enc.ScopeContextSerializer.serializeContext(ScopeContextSerializer.java:587)
         at com.collaxa.cube.engine.enc.ScopeContextSerializer.toBin(ScopeContextSerializer.java:99)
         at com.collaxa.cube.engine.adaptors.common.BaseCubeInstancePersistenceAdaptor.store(BaseCubeInstancePersistenceAdaptor.java:543)
         at com.collaxa.cube.engine.adaptors.olite.CubeInstancePersistenceAdaptor.store(CubeInstancePersistenceAdaptor.java:387)
         at com.collaxa.cube.engine.data.CubeInstancePersistenceMgr.store(CubeInstancePersistenceMgr.java:367)
         at com.collaxa.cube.engine.CubeEngine.store(CubeEngine.java:5008)
         at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:5266)
         at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:1083)
         at com.collaxa.cube.engine.ejb.impl.CubeEngineBean.createAndInvoke(CubeEngineBean.java:132)
         at com.collaxa.cube.engine.ejb.impl.CubeEngineBean.syncCreateAndInvoke(CubeEngineBean.java:161)
         at sun.reflect.GeneratedMethodAccessor158.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAs(Subject.java:396)
         at com.evermind.server.ThreadState.runAs(ThreadState.java:622)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxRequiresNewInterceptor.invoke(TxRequiresNewInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at CubeEngineBean_LocalProxy_4bin6i8.syncCreateAndInvoke(Unknown Source)
         at com.collaxa.cube.engine.delivery.DeliveryHandler.initialRequestAnyType(DeliveryHandler.java:499)
         at com.collaxa.cube.engine.delivery.DeliveryHandler.initialRequest(DeliveryHandler.java:451)
         at com.collaxa.cube.engine.delivery.DeliveryHandler.request(DeliveryHandler.java:125)
         at com.collaxa.cube.ejb.impl.DeliveryBean.request(DeliveryBean.java:95)
         at sun.reflect.GeneratedMethodAccessor157.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAs(Subject.java:396)
         at com.evermind.server.ThreadState.runAs(ThreadState.java:622)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at DeliveryBean_RemoteProxy_4bin6i8.request(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    <2007-08-14 10:10:12,158> <ERROR> <default.collaxa.cube> <BaseCubeSessionBean::logError> Error while invoking bean "cube engine": Cannot serialize DOM element.
    Failed to serialize the DOM element "EssayScoringDetailsCollection" to binary format. The exception reported is Cannot save element.
    An attempt to save the element "EssayScoringDetailsCollection" has failed. Because this element is not a root element and for some reason the scope has reference to this element, scope should have references ONLY to root elements.
    ORABPEL-09221
    Cannot serialize DOM element.
    I did the following in my java application:
    //create the BPEL locator object to find the BPEL process
    Locator locator = new Locator("default", "welcome1", jndi);
    //just for fun, display all the available BPEL processes
    /*for(IBPELProcessHandle ibph : locator.listProcesses()) {
    System.out.println(ibph.getProcessModel());
    IDeliveryService deliveryService = (IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME);
    //construct the normalized message
    NormalizedMessage nm = new NormalizedMessage();
    String xml = "<ns1:PromptsCollection xmlns:ns1='http://xmlns.oracle.com/pcbpel/adapter/db/top/DBSelectPrompt'>" +
    "<ns1:Prompts>" +
    "<ns1:promptId>" pr.getPromptId()"</ns1:promptId>" +
    "<ns1:calibrated>"+pr.getCalibrated().toString()+"</ns1:calibrated>" +
    "<ns1:ibn>"+pr.getIbn()+"</ns1:ibn>" +
    "<ns1:promptType>"+pr.getPromptType()+"</ns1:promptType>" +
    "<ns1:promptsetId>"+pr.getPromptset().getPromptsetId()+"</ns1:promptsetId>" +
    "<ns1:vantagePromptId>"+pr.getVantagePromptId()+"</ns1:vantagePromptId>" +
    "<ns1:promptKey>"+pr.getPromptKey()+"</ns1:promptKey>" +
    "<ns1:holdStatusCode>"+pr.getHoldStatus()+"</ns1:holdStatusCode>" +
    "<ns1:holdEssayTotalCount>"+pr.getHoldEssayTotalCount()+"</ns1:holdEssayTotalCount>" +
    "<ns1:holdEssayCurrentCount>"+pr.getHoldEssayCurrentCount()+"</ns1:holdEssayCurrentCount>" +
    "<ns1:approvedStatus>"+pr.getApprovedStatus()+"</ns1:approvedStatus>" +
    "<ns1:rowChangeDate>"+pr.getRowChangeDate()+"</ns1:rowChangeDate>" + "<ns1:programId>1001</ns1:programId>" +
    "<ns1:programId></ns1:programId>" +
    "<ns1:characterCountMin>"+pr.getCharacterCountMin()+"</ns1:characterCountMin>" +
    "<ns1:durationMin>"+pr.getDurationMin()+"</ns1:durationMin>" +
    "<ns1:rangeFindingFlag>"+pr.getRangeFindingFlag()+"</ns1:rangeFindingFlag>" +
    "<ns1:durationFlag></ns1:durationFlag>" +
    "<ns1:characterCountMax>"+pr.getCharacterCountMax().intValue()+"</ns1:characterCountMax>" +
    "<ns1:durationMax>"+pr.getDurationMax().intValue()+"</ns1:durationMax>" +
    "<ns1:rangeCount>"+ rangeCount+"</ns1:rangeCount>" +
    "</ns1:Prompts>" +
    "</ns1:PromptsCollection>" ;
    /*String xml = "<ns1:PromptsCollection xmlns:ns1='http://xmlns.oracle.com/pcbpel/adapter/db/top/DBSelectPrompt'>" +
    "<ns1:Prompts>" +
    "<ns1:promptId>" pr.getPromptId().toString()"</ns1:promptId>" +
    "<ns1:calibrated>"+pr.getCalibrated().toString()+"</ns1:calibrated>" +
    "<ns1:ibn>"+pr.getIbn()+"</ns1:ibn>" +
    "<ns1:promptType>"+pr.getPromptType()+"</ns1:promptType>" +
    "<ns1:promptsetId>"+pr.getPromptset().getPromptsetId().toString()+"</ns1:promptsetId>" +
    "<ns1:vantagePromptId>"+pr.getVantagePromptId()+"</ns1:vantagePromptId>" +
    "<ns1:promptKey>"+pr.getPromptKey()+"</ns1:promptKey>" +
    "<ns1:holdStatusCode>"+pr.getHoldStatus()+"</ns1:holdStatusCode>" +
    "<ns1:holdEssayTotalCount>"+pr.getHoldEssayTotalCount()+"</ns1:holdEssayTotalCount>" +
    "<ns1:holdEssayCurrentCount>"+pr.getHoldEssayCurrentCount()+"</ns1:holdEssayCurrentCount>" +
    "<ns1:approvedStatus>"+pr.getApprovedStatus()+"</ns1:approvedStatus>" +
    "<ns1:rowChangeDate>"+pr.getRowChangeDate()+"</ns1:rowChangeDate>" +
    "<ns1:programId></ns1:programId>" +
    "<ns1:characterCountMin>"+pr.getCharacterCountMin()+"</ns1:characterCountMin>" +
    "<ns1:durationMin>"+pr.getDurationMin()+"</ns1:durationMin>" +
    "<ns1:rangeFindingFlag>"+pr.getRangeFindingFlag()+"</ns1:rangeFindingFlag>" +
    "<ns1:durationFlag></ns1:durationFlag>" +
    "<ns1:characterCountMax>"+pr.getCharacterCountMax()+"</ns1:characterCountMax>" +
    "<ns1:durationMax>"+pr.getDurationMax()+"</ns1:durationMax>" +
    "<ns1:rangeCount>"+pr.getRangeCount()+"</ns1:rangeCount>" +
    "</ns1:Prompts>" +
    "</ns1:PromptsCollection>" ; */
    //add the payload part to the message with the xml variable
    nm.addPart("payload", xml.trim());
    //make the call to the BPEL process
    NormalizedMessage response = deliveryService.request("UpdatePromptStatus", "process",nm);
    Map payload = response.getPayload();

    I'm getting all of the same errors, but in a slightly different situation.
    <2007-08-23 09:11:46,086> <ERROR> <default.collaxa.cube.xml> com.oracle.bpel.client.BPELFault: faultName: {{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure}
    messageType: {null}
    parts: {{summary=oracle.xml.parser.v2.XMLElement@d454cf}}
    <2007-08-23 09:11:46,633> <ERROR> <default.collaxa.cube.xml> <XMLElement__CXPM::save> ORABPEL-09219
    Cannot save element.
    An attempt to save the element "SfCaseCollection" has failed. Because this element is not a root element and for some reason the scope has reference to this element, scope should have references ONLY to root elements.
         at com.collaxa.cube.xml.dom.XMLElement__CXPM.save(XMLElement__CXPM.java:82)
         at com.collaxa.cube.engine.core.PersistenceService.save(PersistenceService.java:259)
         at com.collaxa.cube.engine.types.bpel.CXMessageVariable__CXPM.save(CXMessageVariable__CXPM.java:182)
         at com.collaxa.cube.engine.core.PersistenceService.save(PersistenceService.java:259)
         at com.collaxa.cube.engine.persist.BaseScope__CXPM.save(BaseScope__CXPM.java:170)
         at com.collaxa.cube.engine.persist.Scope__CXPM.save(Scope__CXPM.java:97)
         at com.collaxa.cube.engine.core.PersistenceService.save(PersistenceService.java:259)
         at com.collaxa.cube.engine.enc.ScopeContextSerializer.serializeContext(ScopeContextSerializer.java:587)
         at com.collaxa.cube.engine.enc.ScopeContextSerializer.toBin(ScopeContextSerializer.java:99)
         at com.collaxa.cube.engine.adaptors.common.BaseCubeInstancePersistenceAdaptor.store(BaseCubeInstancePersistenceAdaptor.java:543)
         at com.collaxa.cube.engine.adaptors.oracle.CubeInstancePersistenceAdaptor.store(CubeInstancePersistenceAdaptor.java:83)
         at com.collaxa.cube.engine.data.CubeInstancePersistenceMgr.store(CubeInstancePersistenceMgr.java:367)
         at com.collaxa.cube.engine.CubeEngine.store(CubeEngine.java:5008)
         at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:5266)
         at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1771)
         at com.collaxa.cube.engine.ejb.impl.CubeEngineBean.handleWorkItem(CubeEngineBean.java:306)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAs(Subject.java:396)
         at com.evermind.server.ThreadState.runAs(ThreadState.java:622)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at CubeEngineBean_LocalProxy_4bin6i8.handleWorkItem(Unknown Source)
         at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handle(PerformMessageHandler.java:45)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:138)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at oracle.j2ee.connector.messageinflow.MessageEndpointImpl.OC4J_invokeMethod(MessageEndpointImpl.java:297)
         at WorkerBean_EndPointProxy_4bin6i8.onMessage(Unknown Source)
         at oracle.j2ee.ra.jms.generic.WorkConsumer.run(WorkConsumer.java:266)
         at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
         at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
         at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Thread.java:595)
    Did you ever find a solution to your problem?
    My situation is that I'm running a process that grabs data from a salesforce.com web service and dumps some of the data back into my local database. The process croaks after processing 850 or so records. I have also increased my PermSize memory to 512M.
    Any ideas why all of a sudden after processing that many records it would stop working?
    Thanks,
    Adam

  • Invoking a BPEL process from java

    Hello,
    I tried invoking a BPEL process from java. I got the following error:
    Error deserializing
    return value: java.io.InvalidClassException:
    javax.xml.namespace.QName, local class incompatible:
    classdesc stream serialVersionUID = ..., local class serialVersionUID = ...
    Thank you for helping me.

    Hello,
    Here is the code I use:
    Properties props = new Properties();
    Locator locator = null;
    props.put("orabpel.platform", "ias_10g" );
    props.put("java.naming.factory.initial","com.evermind.server.rmi.RMIInitialContextFactory" );
    props.put("java.naming.provider.url","opmn:ormi://host:port/orabpel" );
    props.put("java.naming.security.principal", "adminuser" );
    props.put("java.naming.security.credentials", "mdp" );
    String securityCredentials = "adminuser";
    String selectedDomain = "default";
    locator = new Locator(selectedDomain,securityCredentials,props);
    IBPELProcessHandle procs[] = locator.listProcesses();
    The error is:
    Exception in thread "main" java.rmi.UnmarshalException: Error deserializing return-value: java.io.InvalidClassException: com.oracle.bpel.client.BPELProcessHandle; local class incompatible: stream classdesc serialVersionUID = 5429682712928177644, local class serialVersionUID = 8176841433835717563
    at com.oracle.bpel.client.util.ExceptionUtils.handleServerException(ExceptionUtils.java:82)
    at com.oracle.bpel.client.Locator.listProcesses(Locator.java:309)
    Thanks for help.
    Edited by: 857737 on 14 sept. 2012 10:00

  • Invoking unix shell scripts from java?

    Hi,
    could someone explain to me how one wuld invoke unix shell scripts from java.
    Also, could you invoke Visual Basic scripts from java.
    Finally, could you do this from an EJB?
    thanks for any help....
    sudu

    I just posted a snippet of this solution in the topic about widows commands chech it out it works just fine for unix shell scripts.
    --Ian                                                                                                                                                                                                                                                                                       

  • Invoke soa 11g process from java

    I want to invoke soa 11g process from java.
    I got reference from following link, but the metioned jar files are not present in the soa suite. could you please let me know if I am using the correct version of soa suite.
    Installed soa suite : ofm_soa_generic_11.1.1.2.0
    files required :
    1. fabric-common.jar located at
    $SOA_HOME\Oracle_SOA1\modules\oracle.fabriccommon_11.1.1
    2. soa-infra-mgmt.jar located at
    $SOA_HOME\Oracle_SOA1\modules\oracle.soa.mgmt_11.1.1
    3. wsclient_extended.jar located at
    $SOA_HOME\Oracle_SOA1\webservices
    4. weblogic.jar or wlfullclient.jar
    Regards,
    Sanjay

    Hi,
    Do you have any idea on invoking soa 11g bpel process thats running on remote system.
    I referred following url but its giving an connection errorerror.
    http://biemond.blogspot.com/2009/11/invoking-soa-suite-11g-service-from.html
    I am getting following exception when calling from standalone java class from Jdeveloper.
    javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://remoteserver:8001/soa-infra: Destination unreachable; nested exception is:
         java.net.ConnectException: Connection timed out: connect; No available router to destination]
    Here is the simiple prog that I tried :
    private void invokeBpelProc() {
    Hashtable jndiProps = new Hashtable();
    jndiProps.put(Context.PROVIDER_URL, "t3://remote_server:8001/soa-infra");
    //jndiProps.put(Context.PROVIDER_URL, "t3://localhost:7001");
    jndiProps.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    jndiProps.put(Context.SECURITY_PRINCIPAL, "weblogic");
    jndiProps.put(Context.SECURITY_CREDENTIALS, "weblogic1");
    jndiProps.put("dedicated.connection", "true");
    Locator locator = null;
    try { 
    // connect to the soa server
    locator = LocatorFactory.createLocator(jndiProps);
    System.out.println("Created locator");
    }catch(Exception ex){
    ex.printStackTrace();
    Regards,
    Sanjay

  • Error Occured while Invoking a BPEL Process from JAVA

    Hi.....
    When initiating a BPEL process from JAVA the code is working fine and the Process is getting initiated.But while using that code in J2EE project as a java code and while calling that method Error is occuring.....
    Here by i am attaching my JAVA Code which runs as an applicateion and package which runs in Server....
    JSP and Java Method Used:
    JSP Code:
    ===============
    <%@ page import=" bo.callbpel" %>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>FEATT - I30</title>
    </head>
    <body>
    <%
    String input=request.getParameter("dnvalue");
    callbpel p=new callbpel();
    String Output=p.Initiate(input);
    out.print("The Input Given to the BPEL Process is : "+input);
    %>
    <BR><BR><BR><BR><BR><BR>
    <%
    out.print("The Reply from BPEL Process is : "+Output);
    %>
    </body>
    </html>
    Java Code:
    package bo;
    import com.oracle.bpel.client.Locator;
    import com.oracle.bpel.client.NormalizedMessage;
    import com.oracle.bpel.client.delivery.IDeliveryService;
    import java.util.Map;
    import java.util.Properties;
    import oracle.xml.parser.v2.XMLElement;
    /*import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest ;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession; */
    //import java.util.*;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    public class callbpel {
         public String Initiate(String value){
              String replyText=null;
              String input = value;
              System.out.println(input);
              String xmlInput= "<ns1:AccessDBBPELProcessRequest xmlns:ns1=\"http://xmlns.oracle.com/AccessDBBPEL\"><ns1:input>"+input+"</ns1:input></ns1:AccessDBBPELProcessRequest>";
              String xml="<ns1:BPELProcess1ProcessRequest xmlns:ns1=\"http://xmlns.oracle.com/BPELProcess1\">";
              xml=xml+"<ns1:input>"+input+"</ns1:input>";
              xml=xml+"</ns1:BPELProcess1ProcessRequest>";
              try{
              Properties props=new Properties();
              props.setProperty("orabpel.platform","ias_10g");
              props.setProperty("java.naming.factory.initial","com.evermind.server.rmi.RMIInitialContextFactory");
              props.setProperty("java.naming.provider.url","opmn:ormi://157.227.132.226:6003:home/orabpel");
              props.setProperty("java.naming.security.principal","oc4jadmin");
              props.setProperty("java.naming.security.credentials","oc4jadmin");
              props.setProperty("dedicated.rmicontext", "true");
              Locator locator = new Locator("default", "bpel", props);
              String uniqueBpelId = com.collaxa.cube.util.GUIDGenerator.generateGUID();
              //System.out.println(uniqueBpelId);
              //java.util.Map msgProps = new HashMap();
              System.out.println("After creating the locator object......");
              IDeliveryService deliveryService =(IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME);
              System.out.println("Before creating the NormalizedMessage object......");
              NormalizedMessage nm = new NormalizedMessage();
              System.out.println("After creating the NormalizedMessage object.*.*.*...");
              //msgProps.put("conversationId",uniqueBpelId);
              //nm.setProperty("conversationId",uniqueBpelId);
              nm.addPart("payload", xml);
              System.out.println("Before creating response object......");
              NormalizedMessage res = deliveryService.request("BPELProcess1", "process", nm);
              System.out.println("After calling the BPELProcess1 .*.*.*...");
              Map payload = res.getPayload();
              System.out.println("BPEL called");
              XMLElement xmlEl=(oracle.xml.parser.v2.XMLElement)payload.get("payload");
              replyText=xmlEl.getText();
              System.out.println("Reply from BPEL Process>>>>>>>>>>>>> "+replyText);
              catch (Exception e) {
              System.out.println("Exception : "+e);
              e.printStackTrace();
              return replyText;
    While Creating and Object for the Class callbpel and Whilw Calling that Method
    callbpel p=new callbpel();
    String Output=p.Initiate(input);
    Its throwing an Error:
    Error Occured is:
    After creating the locator object......
    Before creating the NormalizedMessage object......
    After creating the NormalizedMessage object.*.*.*...
    Before creating response object......
    Apr 24, 2008 9:12:00 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.NoClassDefFoundError: javax/ejb/EJBException
         at com.oracle.bpel.client.util.ExceptionUtils.handleServerException(ExceptionUtils.java:76)
         at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:254)
         at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:83)
         at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:53)
         at bo.callbpel.Initiate(callbpel.java:55)
         at org.apache.jsp.output_jsp._jspService(output_jsp.java:55)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
         at java.lang.Thread.run(Unknown Source)
    For Running JSP i am Using Eclipse 3.2.0 and apache-tomcat-5.5.25
    Please Provide me a Solution......
    Thanks in Advance.....
    Regards,
    Suresh K

    Have got the same problem. Scenario at my end is little different though.
    I am trying to invoke a BPEL process from an ESB Service.
    I am trying to look into it..
    However, would be grateful, if someone can give some insight into this since many are running into this issue without being able to fix.
    Ashish.

  • How to invoke a jsp page from java which does not use Servlets?

    Hello,
    I am working in Documentum. I am trying to invoke a jsp page from another java page which does not use Servlets.
    I tried doing this by just instantiating the java class related to the jsp page from my present java class.In my java class related to the jsp page, I have defined onInit() and onRender() methods.
    Now, I am trying to call the jsp page from my present java class by just instantiating the java class related to the jsp page. This throws a java.lang.NullPointerException.
    Any comments or suggestions on this.Any help would be appreciated.
    Thanks,
    Ranjith M.V

    RanjithM.V wrote:
    Hello,
    Thanks for the reply. One important thing I forgot to mention. I am also using xml component.And?
    As this is the standard way used for coding in Documentum, I do not want to use Beans.Well, JSP's should, in and of themselves, contain no functional code. It should all be only display.
    Without that is it not possible?What did I say? I said,
    masijade wrote:
    It is possible, but I very, very, very, much doubt, that it would be worth the effort.And, if you don't know how, a forum is not truely going to be able to help you implement it (at least not in less than a few years time, at which point it would be outdated).
    >
    Appreciate your understanding and help.
    Thanks,
    Ranjith M.V

  • Invoking asynchronous BPEL process from java ui

    Hi,
    I am invoking an asynchronous BPEL process from java ui.
    I read somewhere that i can obtain an instance handler uing the lookupInstance() method of class Locator using the conversation id provided by the class NormalizedMessage.
    My code looks like this
    // Connect to Oracle BPEL server
    Locator locator = new Locator("default","bpel");
    IDeliveryService deliveryService = (IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
    // Construct a normalized message and send to Oracle BPEL Process Manager
    NormalizedMessage nm = new NormalizedMessage();
    nm.addPart("payload", xml);
    // Initiate the BPEL process
    deliveryService.post("MyLoanFlow", "initiate", nm);
    //Obtain the instance handler
    IInstanceHandle handle = locator.lookupInstance(NormalizedMessage.CONVERSATION_ID);
    But this is giving the error - can not find any instance with conversation id 'conversationId'.
    Also, if i try to obtain a list of instance handles associated with a process , it does not contain the most recently created instance
    IBPELProcessHandle ph = locator.lookupProcess("MyLoanFlow");
    IInstanceHandle[] iHandler = ph.listInstances();
    out.println(iHandler.length + "<br>");
    if i invoke the process for the first time the output is 0.
    can you please help me. it is urgent.

    Hi Sudipto,
    Regarding your second question,
    deliveryService.post("MyLoanFlow", "initiate", nm);
    IBPELProcessHandle ph = locator.lookupProcess("MyLoanFlow");
    IInstanceHandle[] iHandler = ph.listInstances();
    out.println(iHandler.length + "<br>");
    ---- returns 0 ---
    This is because MyLoanFlow is an asynchronous process in your case. So the control is returned to your java block immediately after the request for a new instance is posted. And your second line of code(querying for the list of instances) is executed even before the instance is created on the server side. You can verify this in two ways:
    1. try creating an instance of a synchronous process using IDeliveryService.request - this will always result in the increment since the current thread is blocked till the new instance is created.
    2. for your case, you can try
    Thread.currentThread().sleep(500); - just allow the server some time for completing the instance before you query it for the list of instances..
    and wrt question 1,
    //Obtain the instance handler
    IInstanceHandle handle = locator.lookupInstance(NormalizedMessage.CONVERSATION_ID);
    But this is giving the error - can not find any instance with conversation id 'conversationId'.
    For setting the conversationId, you could do so by including the following inside your .bpel file
    <bpelx:exec name="test-setConversationId" language="java" version="1.4">
    <![CDATA[
    setConversationId("conversationId");
    ]]>
    </bpelx:exec>
    The code:
    IInstanceHandle ins = locator.lookupInstanceByConversationId(NormalizedMessage.CONVERSATION_ID);
    should fetch you the required instance in this case.
    HTH,
    Anuj

  • Invoke a command-line from java

    Hello!
    I wonder if there' s a way to invoke a command or running an .exe file from java code.
    10X,
    Yaron

    Sure, using the exec method in the class Runtime. You have to be careful with it though...
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Invoking a BPEL Process from Java Class

    Hi All,
    I am new to BPEL. I am trying to invoke a BPEL Process using Java.
    This following is the Oracle AS Home : D:\product\10.1.3.1\OracleAS_1
    Credentials to access the default BPEL domain :
    username - oc4jadmin
    password - oc4jadmin
    RMI Port in Oracle AS - 12401
    (code)
    import com.oracle.bpel.client.Locator;
    import com.oracle.bpel.client.dispatch.IDeliveryService;
    import com.oracle.bpel.client.NormalizedMessage;
    import java.util.Hashtable;
    import java.util.Map;
    import javax.naming.Context;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    public class Class1 {
         public static void main(String[] args) {
              try {
              Hashtable jndi = new Hashtable();
              jndi.put(Context.PROVIDER_URL, "ormi://localhost:12401/orabpel");
              jndi.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
              jndi.put(Context.SECURITY_PRINCIPAL, "oc4jadmin");
              jndi.put(Context.SECURITY_CREDENTIALS, "oc4jadmin");
              jndi.put("dedicated.connection", "true");
              Locator locator = new Locator("default", "oc4jadmin", jndi);
              System.out.println( "check 1" );
              IDeliveryService deliveryService = (IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
              System.out.println( "check 2" );
              String xml = "&ltssn xmlns=\"http://services.otn.com\" &gt111222333</ssn>";
              NormalizedMessage nm = new NormalizedMessage( );
              nm.addPart("payload", xml );
              System.out.println( "check 3" );
              NormalizedMessage res = deliveryService.request("CreditRatingService","process",nm);
              System.out.println( "check 4" );
              System.out.println( "BPELProcess CreditRatingService executed!" );
              Map payload = res.getPayload();
              Element part = (Element)payload.get("payload");
              Node outputElement = part.getFirstChild();
              System.out.println("Rating: " + outputElement.getNodeValue());
              catch (Exception ex) {
              ex.printStackTrace();
    (code)
    When I run this, I get the following exception :
    D:\JDeveloper\jdk\bin\javaw.exe -client -classpath D:\JDeveloper\jdev\mywork\mywork\test_bpel_java\ViewController\classes;D:\JDeveloper\jakarta-struts\lib\struts.jar;D:\JDeveloper\jakarta-struts\lib\commons-beanutils.jar;D:\JDeveloper\jakarta-struts\lib\commons-collections.jar;D:\JDeveloper\jakarta-struts\lib\commons-fileupload.jar;D:\JDeveloper\jakarta-struts\lib\commons-digester.jar;D:\JDeveloper\jakarta-struts\lib\commons-lang.jar;D:\JDeveloper\jakarta-struts\lib\commons-logging.jar;D:\JDeveloper\jakarta-struts\lib\commons-validator.jar;D:\JDeveloper\jakarta-struts\lib\jakarta-oro.jar;D:\JDeveloper\j2ee\home\lib\ojsp.jar;D:\JDeveloper\j2ee\home\jsp\lib\taglib\ojsputil.jar;D:\JDeveloper\j2ee\home\oc4j.jar;D:\JDeveloper\j2ee\home\lib\oc4j-internal.jar;D:\JDeveloper\j2ee\home\lib\servlet.jar;D:\JDeveloper\jdev\lib\ojc.jar;D:\product\10.1.3.1\OracleAS_1\bpel\lib\orabpel.jar view.Class1
    check 1
    check 2
    check 3
    Mar 22, 2011 11:04:07 PM oracle.j2ee.rmi.RMIMessages EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER
    WARNING: Exception returned by remote server: {0}
    java.lang.NoClassDefFoundError: javax/ejb/EJBHome
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:242)
         at oracle.oc4j.rmi.ClientRmiTypeCache$InterfaceTypeCache.getNamedInterfaces(ClientRmiTypeCache.java:98)
         at oracle.oc4j.rmi.ClientRmiTypeCache$InterfaceTypeCache.getInterfaceType(ClientRmiTypeCache.java:85)
         at oracle.oc4j.rmi.ClientRmiTypeCache.getCachedType(ClientRmiTypeCache.java:33)
         at com.evermind.server.rmi.RMIClientConnection.getBoundObject(RMIClientConnection.java:981)
         at com.evermind.server.rmi.RMIClientInputStream.resolveObject(RMIClientInputStream.java:26)
         at java.io.ObjectInputStream.checkResolve(ObjectInputStream.java:1346)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
         at com.evermind.server.rmi.RMIClientConnection.handleLookupResponse(RMIClientConnection.java:825)
         at com.evermind.server.rmi.RMIClientConnection.handleOrmiCommandResponse(RMIClientConnection.java:283)
         at com.evermind.server.rmi.RMIClientConnection.dispatchResponse(RMIClientConnection.java:242)
         at com.evermind.server.rmi.RMIClientConnection.processReceivedCommand(RMIClientConnection.java:224)
         at com.evermind.server.rmi.RMIConnection.handleCommand(RMIConnection.java:152)
         at com.evermind.server.rmi.RMIConnection.listenForOrmiCommands(RMIConnection.java:127)
         at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:107)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Thread.java:595)
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/ejb/EJBException
         at com.oracle.bpel.client.util.ExceptionUtils.handleServerException(ExceptionUtils.java:76)
         at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:254)
         at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:83)
         at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:53)
         at view.Class1.main(Class1.java:40)
    Process exited with exit code 1.
    I have used checkpoints in between the code. It works fine till the third one. After that, it raises an exception.
    Can anyone help me out with this?
    Edited by: 846458 on Mar 22, 2011 11:04 AM

    Hi
    Can you try with below code
    package com.otn.samples;
    import java.util.Properties;
    import java.util.Map;
    import javax.naming.InitialContext;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import com.collaxa.xml.XMLHelper;
    import com.oracle.bpel.client.ClientDefs;
    import com.oracle.bpel.client.Locator;
    import com.oracle.bpel.client.NormalizedMessage;
    import com.oracle.bpel.client.delivery.IDeliveryService;
    public class CallBPEL
        public static void main(String[] args) throws Exception {
            if (args.length != 1) {
                System.out.println(
                    "I am here");
                return;
            try{
                String ssn = args[0];
                System.out.println("ssn is " + ssn);
                // properties in the classpath
                Properties props = new java.util.Properties();
                java.net.URL url = ClassLoader.getSystemResource("context.properties");
                props.load(url.openStream());
                System.out.println(props);
                String xml = "<ssn  xmlns=\"http://services.otn.com\">" + ssn + "</ssn>";
                Locator locator = new Locator("default","bpel",props);
                IDeliveryService deliveryService = (IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
                // construct the normalized message and send to collaxa server
                NormalizedMessage nm = new NormalizedMessage( );
                nm.addPart("payload", xml );
                NormalizedMessage res = deliveryService.request("CreditRatingService", "process", nm);
                Map payload = res.getPayload();
                System.out.println( "BPELProcess  CreditRatingService executed!" );
                Element partEl = (Element) payload.get("payload");
                System.out.println( "Credit Rating is " + XMLHelper.toXML(partEl) );
            }catch(Exception e)
                e.printStackTrace();
    }Thanks
    AJ

  • DOS 11g SOA have the Locator API's - How to Invoke a BPEL process from Java

    In BPEL 10.1.3.1, a java client could use the "Locator" API's to look up a BPEL service and invoke it directly from Java,
    Is that still present in SOA 11g ? Or is there another way to look up the BPEL process ...
    Here's an example of the 10g BPEL Service locator facilities :
    Get the BPEL service locator. This is retrieved as follows:
    loc = new Locator(domain, domainPassword);
    The initial installation BPEL domain is "domain" and the initial password is "bpel". We then use the locator to get the delivery service. We could also use the locator to retrieve the workflow service.
    IDeliveryService svc = (IDeliveryService)loc.lookupService(IDeliveryService.SERVICE_NAME);
    Now we have the delivery service we can "deliver" requests to the BPEL process. To do this we first need to create a new message.
    NormalizedMessage msg = new NormalizedMessage();
    String content = "<SyncHelloWorldProcessRequest xmlns=\"http://antony.blog/SyncHelloWorld\">"+
    "<input>"+
    name+
    "</input>"+
    "</SyncHelloWorldProcessRequest>";
    msg.addPart(msgPart, content);

    Can you please tell me how to include adf binding.ws in composite.xml ? My composite.xml for your ref:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!-- Generated by Oracle SOA Modeler version 1.0 at [11/1/10 5:41 PM]. -->
    <composite name="BPEL2"
    revision="1.0"
    label="2010-11-01_17-41-11_593"
    mode="active"
    state="on"
    xmlns="http://xmlns.oracle.com/sca/1.0"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
    xmlns:orawsp="http://schemas.oracle.com/ws/2006/01/policy"
    xmlns:ui="http://xmlns.oracle.com/soa/designer/">
    <import namespace="http://xmlns.oracle.com/CallBPEL_jws/BPEL2/BPELProcess1"
    location="BPELProcess1.wsdl" importType="wsdl"/>
    <service name="bpelprocess1_client_ep" ui:wsdlLocation="BPELProcess1.wsdl">
    <interface.wsdl interface="http://xmlns.oracle.com/CallBPEL_jws/BPEL2/BPELProcess1#wsdl.interface(BPELProcess1)"/>
    <binding.ws port="http://xmlns.oracle.com/CallBPEL_jws/BPEL2/BPELProcess1#wsdl.endpoint(bpelprocess1_client_ep/BPELProcess1_pt)"/>
    </service>
    <component name="BPELProcess1">
    <implementation.bpel src="BPELProcess1.bpel"/>
    </component>
    <wire>
    <source.uri>bpelprocess1_client_ep</source.uri>
    <target.uri>BPELProcess1/bpelprocess1_client</target.uri>
    </wire>
    </composite>
    Eric, when I select the BPEL wsdl file in "Create Web Service Data Control" wizard, immediately I am getting the error. When I click 'OK', the 'Service' dropdown is disabled and blank in the wizard.
    Thanks for pointing to the sample application URL. But it is built in jdev 10g. Can I migrate it to 11g?
    Thanks both of you!

  • Invoking Acrobat PDF compare from Java code

    Need to invoke the Adobe Acrobat XI's PDF compare feature using Java code.
    Description:
    ========
    We are exploring the possibilities of passing 2 PDF's from Java to Adobe Acrobat XI SDK to get the compared results in new PDF.
    If anyone has explored with this feature... please share your thoughts.

    You would need to write a custom plugin to Acrobat that calls the compare APIs (as they are only accessible from C/C++).  Your plugin can then expose whatever from of IAC/IPC that it wishes to communicate with your Java code.
    Of course, this is all DESKTOP code since Acrobat can't be used on a server.

  • Invoking remote IIS server from java

    Hi,
    May I know how to invoke the remote IIS server from java?
    Basically I am designing the administrative tool to start and stop IIS server which is running remote machine.
    Thanks!

    You will need to connect to the remote system using some service other than IIS, since starting IIS is one of your requirements. The usual is to connect using Telnet or SSH. I posted code to connect to a Unix box using Telnet. You could use this to connect to a Windows system that was running a Telnet server.

  • Invoke a shell script from java

    hi all
    does anyone know how to invoke a shell script from your java program?
    thanks
    udam

    Use Runtime.exec(), make sure your script is executable, and make sure it starts with something like #!/bin/sh

Maybe you are looking for