Embedding Java Code(URGENT)

Hello,
I'm trying to do the following, I'm trying to embed Java code into my BPEL process, I have read the tutorial that explains how to embed a java code into BPEL(http://www.oracle.com/technology/products/ias/bpel/pdf/orabpel-Training-Segment10.pdf) but unfortunately the tutorial discusses only how to call the Entity Bean but doesnt mention where in folders(directory) should the bean itself be placed, where are the imports.
I'm going to start with a simple example, a class called Multiplier that has function square, Here is the code for the class:
//Java Multiplier class
public class Multiplier{
public Multiplier(){}
public int square(int x){
return x*x; }
this is code that will be placed in the EXEC(Java code snippet):
//Java Code Snippet goes here...
try{
Object input= getVariableData
("input","payload","/JavaCode");
String parser= input.toString();
int in= Integer.parseInt(parser);
Multiplier obj1= new Multiplier();
int result= obj1.square(in);
addAuditTrailEntry("The square of the input is:"+result);
catch(Exception en){
addAuditTrailEntry(en);
Where should the multiplier class be located(in which folder in the ecplise)or how will the BPEL refer to it ?
Shouldnt I import the Multiplier class in the EXEC(snippet) where should that line go?
Thanks in advance
Hussam Galal

After going through the Forum I saw I question similar to mine, and I found out there's an example similar to what I am trying to do at C:\orabpel\samples\references\JavaExec
I tried to make an example almost exactly like JavaExec and I edited my build.xml to be similar to build.xml of the example but I keep getting this error:
BUILD FAILED: C:\eclipse-SDK-3.0-win32\eclipse\workspace\Calc\build.xml:28: ORABPEL-00017
Java compilation failed.
Failed to compile file(s) "Calc.bpel".
Exception reported is: Calc.bpel:44: ';' expected.
Multiplier mult= new Multiplier();
^
1 error
Please verify that file Calc.bpel is valid java file or if all required libraries are included in your classpath.
classpath: C:\eclipse-SDK-3.0-win32\eclipse\startup.jar;C:\eclipse-SDK-3.0-win32\eclipse\startup.jar;C:\eclipse-SDK-3.0-win32\eclipse;c:\eclipse-SDK-3.0-win32\eclipse\plugins\bpelz_0.9.10\lib\orabpel-ant.jar;c:\eclipse-SDK-3.0-win32\eclipse\plugins\bpelz_0.9.10\lib\orabpel-boot.jar;c:\eclipse-SDK-3.0-win32\eclipse\plugins\bpelz_0.9.10\lib\orabpel-common.jar;c:\eclipse-SDK-3.0-win32\eclipse\plugins\bpelz_0.9.10\lib\orabpel-thirdparty.jar;c:\eclipse-SDK-3.0-win32\eclipse\plugins\bpelz_0.9.10\lib\orabpel.jar;C:\DOCUME~1\temp_ps\LOCALS~1\Temp\bpelc40446.tmp\BPEL-INF\classes
Here's the java code in the EXEC(snippet):
// Java code snippet goes here ...
com.otn.samples.javaexec.Multiplier
Multiplier mult= new Multiplier();
Object obj1= getVariableData("input","payload","/Calc");
String str= obj1.toString();
int in= Integer.parseInt(str);
int result= mult.square(in);
addAuditTrailEntry("The result is: "+result);
Finally here's the my build.xml:
<?xml version="1.0"?>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Run cxant on this file to build, package and deploy the
Calc BPEL process
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<project name="Calc" default="all" basedir=".">
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Name of the domain the generated BPEL suitcase will be deployed to
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
     <property name="deploy" value="default"/>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
What version number should be used to tag the generated BPEL archive?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<property name="rev" value="1.0"/>
     <target name="CompileJava">
     <mkdir dir="${basedir}/BPEL-INF/classes"/>
          <javac srcdir="${basedir}/src" destdir="${basedir}/BPEL-INF/classes"/>
     </target>
<target name="Calc">
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
the bpelc task compiles and package BPEL processes into versioned BPEL
archives (bpel_...jar). See the "Programming BPEL" guide for more
information on the options of this task.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<bpelc home="${home}" rev="${rev}" deploy="${deploy}"/>
</target>
<target name="all" depends="CompileJava, Calc"/>
</project>

Similar Messages

  • XPathFactory error in embedded Java code

    Hi,
    I'm getting the following error when executing embedded Java code which does an XPath expression. Does anyone know why this is happening? Thanks.
    [2006/03/13 17:55:22] "{http://schemas.oracle.com/bpel/extension}bindingFault" has been thrown. less
    <bindingFault xmlns="http://schemas.oracle.com/bpel/extension">
    <part name="summary">
    <summary>Operation failed!; nested exception is: java.lang.IllegalArgumentException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom</summary>
    </part>
    <part name="detail">
    <detail>java.lang.IllegalArgumentException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom</detail>
    </part>
    </bindingFault>

    Hi,
    Refer the URL :http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/mapping/api/AbstractTransformation.html
    regards,
    ganga

  • ORABPEL-05250 - Deployment error after embedding java code

    hi i am getting the following error when deploying my composite i added embedded java and imported the necessary classes i think but if i take the embedded java out it deploys succsefully :
    [09:17:17 PM] Received HTTP response from the server, response code=500
    [09:17:17 PM] Error deploying archive sca_getPickFile_rev1.0.jar to partition "default" on server SANDPIT_SOA
    [09:17:17 PM] HTTP error code returned [500]
    [09:17:17 PM] Error message from server:
    There was an error deploying the composite on SANDPIT_SOA: Error occurred during deployment of component: processGetPckFile to service engine: implementation.bpel, for composite: getPickFile: ORABPEL-05250
    Error deploying BPEL suitcase.
    error while attempting to deploy the BPEL component file "/u01/oracle/FSOAS/product/fmw/user_projects/domains/FSOAS_domain/servers/SANDPIT_SOA/dc/soa_e76b434b-6704-4820-b544-ad56277e0fd9"; the exception reported is: java.lang.RuntimeException: failed to compile execlets of processGetPckFile
    This error contained an exception thrown by the underlying deployment module.
    Verify the exception trace in the log (with logging level set to debug mode).
    [09:17:17 PM] Check server log for more details.
    [09:17:17 PM] Error deploying archive sca_getPickFile_rev1.0.jar to partition "default" on server SANDPIT_SOA
    [09:17:17 PM] #### Deployment incomplete. ####
    [09:17:17 PM] Error deploying archive file:/C:/JDeveloper/mywork/pdfService/getPickFile/deploy/sca_getPickFile_rev1.0.jar
    (oracle.tip.tools.ide.fabric.deploy.common.SOARemoteDeployer)

    Hi
    some times this error comes if the Packages for using JAVA are not i mported into BPEL Weused to get same error but after importing the packages the error usually used to be solved please check whether if the class files which you are using are correctly imported or not
    ex
    <import location="java.util.Properties"
    importType="http://schemas.oracle.com/bpel/extension/java"/>
    <import location="java.io.*"
    importType="http://schemas.oracle.com/bpel/extension/java"/>

  • Embedded Java code with bpelx:exec

    When I embed Java code with bpelx:exec, I would like use classes packaged in a jar file. How do I ensure that the jar file is deployed with the suitcase? I tried adding the library to the JDeveloper project (right-click project, choose properties, libraries), but that did not work.

    Although the tooling does not expose this functionality yet, the bpel packaging and bpelc command line tool support the ability to put a library in BPEL-INF/lib and using it in the exec activity. You can also put classes in BPEL-INF/classes. Please look at:
    [ORACLE_HOME]\integration\orabpel\samples\references\JavaExec for more information.
    -Edwin

  • Execute html file from java code - urgent!!!

    Hi,
    I need help!!
    My application should open html file that located in my computer
    it should be open when some line in JList was choosen
    my question is: How can I open html file from my application
    I work with window XP
    I tried this one :
    Runtime.getRuntime().exec(cmdLine);
    but it doesn't work
    the exeption was: CreateProccess
    Please help! it's urgent!!!!

    http://forum.java.sun.com/thread.jsp?forum=31&thread=497600

  • How do I invoke another s/w from java code(urgent)

    Hi all,
    My code looks like this :
    Runtime rt =Runtime.getRuntime();
    String command = "~/tts/bin/mbrola" +" ~/tts/mbrola/us2 " + " /home/dir1/dir2/final/temp.pho "+
    " - | ~/tts/bin/mbrplay -";
    rt.exec(command );
    Whenever I ru n this code thru java , I get an error that this command was not found but am able to run it in my unix terminal. Would anyone have any clue as to why this is happening.
    Thanks
    Sohini

    Hi all,
    My code looks like this :
    Runtime rt =Runtime.getRuntime();
    String command = "~/tts/bin/mbrola" +"
    la" +" ~/tts/mbrola/us2 " + "
    /home/dir1/dir2/final/temp.pho "+
    " - | ~/tts/bin/mbrplay -";
    rt.exec(command );
    Whenever I ru n this code thru java , I get an error
    that this command was not found but am able to run it
    in my unix terminal. Would anyone have any clue as to
    why this is happening.
    Thanks
    SohiniHi,
    I guess that you're trying to run command WITH arguments, aren't you?
    So, you have to do it this way(just verify arguments):
        Runtime rt =Runtime.getRuntime();
        String command[] = {"~/tts/bin/mbrola", "la", "~/tts/mbrola/us2",
                                              "/home/dir1/dir2/final/temp.pho",  "-", " | ~/tts/bin/mbrplay", "-"}
        rt.exec(command);(making PROGRAM and ARGUMENTS an array - EACH argument SEPARATELY(I don't know their exact number in your script ))
    Hope to help,
    SHW

  • Error in deploying BPEL Process with Embedded Java code

    Hi all,
    I am trying to do a simple sample BPEL Process which invokes a Java class.i have placed the jar file in the classpath and the Process compiles and builds in the BPELDesigner,but when deployed it shows the below error in the BPEL console.The beauty here is it show a success message in the BPEL Designer after deployment.
    <2007-07-19 05:03:07,640> <INFO> <production.collaxa.cube.compiler> validating "C:\OraHome_1\integration\orabpel\domains\production\tmp\.bpel_Employee_1.0.jar\Employee.bpel" ...
    <2007-07-19 05:03:09,187> <ERROR> <production.collaxa.cube.engine.deployment> <CubeProcessFactory::generateProcessClass>
    Process "Employee" (revision "1.0") compilation failed.
    <2007-07-19 05:03:09,187> <ERROR> <production.collaxa.cube.engine.deployment> <CubeProcessLoader::create> Failed to compile classes.
    Failed to compile the generated BPEL classes for "Employee".
    <2007-07-19 05:03:09,187> <ERROR> <production.collaxa.cube.engine.deployment> Process "Employee" (revision "1.0") load FAILED!!
    <2007-07-19 05:03:09,203> <ERROR> <production.collaxa.cube> <BaseCubeSessionBean::logError> Error while invoking bean "domain manager": Error while loading process.
    The process domain encountered the following errors while loading the process "Employee" (revision "1.0"): Failed to compile classes.
    Failed to compile the generated BPEL classes for "Employee".
    If you have installed a patch to the server, please check that the bpelcClasspath domain property includes the patch classes.
    ORABPEL-05215
    Error while loading process.
    The process domain encountered the following errors while loading the process "Employee" (revision "1.0"): Failed to compile classes.
    Failed to compile the generated BPEL classes for "Employee".
    If you have installed a patch to the server, please check that the bpelcClasspath domain property includes the patch classes.
         at com.collaxa.cube.engine.deployment.CubeProcessHolder.bind(CubeProcessHolder.java:1269)
         at com.collaxa.cube.engine.deployment.CubeProcessHolder.loadAndBind(CubeProcessHolder.java:882)
         at com.collaxa.cube.engine.deployment.CubeProcessHolder.loadArchive(CubeProcessHolder.java:824)
         at com.collaxa.cube.engine.CubeEngine.loadProcessArchive(CubeEngine.java:939)
         at com.collaxa.cube.ejb.impl.BPELDomainManagerBean.loadProcessArchive(BPELDomainManagerBean.java:390)
         at IBPELDomainManagerBean_StatelessSessionBeanWrapper34.loadProcessArchive(IBPELDomainManagerBean_StatelessSessionBeanWrapper34.java:2157)
         at com.collaxa.cube.engine.deployment.CubeProcessMonitorWork.run(CubeProcessMonitorWork.java:130)
         at oracle.tip.adapter.fw.jca.work.WorkerJob.go(WorkerJob.java:51)
         at oracle.tip.adapter.fw.common.ThreadPool.run(ThreadPool.java:267)
         at java.lang.Thread.run(Thread.java:534)
    <2007-07-19 05:03:09,234> <ERROR> <production.collaxa.cube.engine.deployment> <CubeProcessMonitorWork::run> Error while loading process archive C:\OraHome_1\integration\orabpel\domains\production\deploy\bpel_Employee_1.0.jar
    ORABPEL-05215
    Error while loading process.
    The process domain encountered the following errors while loading the process "Employee" (revision "1.0"): Failed to compile classes.
    Failed to compile the generated BPEL classes for "Employee".
    If you have installed a patch to the server, please check that the bpelcClasspath domain property includes the patch classes.
         at com.collaxa.cube.engine.deployment.CubeProcessHolder.bind(CubeProcessHolder.java:1269)
         at com.collaxa.cube.engine.deployment.CubeProcessHolder.loadAndBind(CubeProcessHolder.java:882)
         at com.collaxa.cube.engine.deployment.CubeProcessHolder.loadArchive(CubeProcessHolder.java:824)
         at com.collaxa.cube.engine.CubeEngine.loadProcessArchive(CubeEngine.java:939)
         at com.collaxa.cube.ejb.impl.BPELDomainManagerBean.loadProcessArchive(BPELDomainManagerBean.java:390)
         at IBPELDomainManagerBean_StatelessSessionBeanWrapper34.loadProcessArchive(IBPELDomainManagerBean_StatelessSessionBeanWrapper34.java:2157)
         at com.collaxa.cube.engine.deployment.CubeProcessMonitorWork.run(CubeProcessMonitorWork.java:130)
         at oracle.tip.adapter.fw.jca.work.WorkerJob.go(WorkerJob.java:51)
         at oracle.tip.adapter.fw.common.ThreadPool.run(ThreadPool.java:267)
         at java.lang.Thread.run(Thread.java:534)
    Your sugegstions are appreciated..
    Plzz help...
    Regards
    Subramanian

    Hi all..
    Thanks for ur response,but still my problem is not solved...
    Below is the BPEL file and the java class (which isinvoked from the process)
    BPEL FILE
    <!-- Employee -->
    <process name="BusinessTravelProcess" targetNamespace="http://packtpub.com/bpel/travel/" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:emp="http://packtpub.com/service/employee/" xmlns:bpelx="http://schemas.oracle.com/bpel/extension">
    <bpelx:exec import="org.w3c.dom.Element"/>
    <bpelx:exec import="com.packtpub.EmployeeStatus"/>
    <partnerLinks>
    <partnerLink name="employeeTravelStatus" partnerLinkType="emp:employeeLT" myRole="employeeTravelStatusService"/>
    </partnerLinks>
    <variables><!-- input for this process -->
    <variable name="EmployeeTravelStatusRequest" messageType="emp:EmployeeTravelStatusRequestMessage"/><!-- output from the Employee Travel Status web service -->
    <variable name="EmployeeTravelStatusResponse" messageType="emp:EmployeeTravelStatusResponseMessage"/>
    </variables>
    <sequence><!-- Receive the initial request for business travel from client -->
    <receive partnerLink="employeeTravelStatus" portType="emp:EmployeeTravelStatusPT" operation="EmployeeTravelStatus" variable="EmployeeTravelStatusRequest" createInstance="yes"/><!-- Prepare the output -->
    <assign>
    <copy>
    <from>
    <travelClass xmlns="http://packtpub.com/service/employee/">Economy
    </travelClass>
    </from>
    <to variable="EmployeeTravelStatusResponse" part="travelClass"/>
    </copy>
    </assign><!-- Invoke the EmployeeStatus Java class instead of web service -->
    <bpelx:exec name="Java_Embedding_1" language="Java" version="1.4"><![CDATA[
    EmployeeStatus e = new EmployeeStatus();
    String firstName = ((Element)getVariableData(
    "EmployeeTravelStatusRequest", "employee",
    "/employee/FirstName")).getNodeValue();
    String lastName = ((Element)getVariableData(
    "EmployeeTravelStatusRequest", "employee",
    "/employee/LastName")).getNodeValue();
    String empStatus = e.getTravelStatus(firstName, lastName);
    addAuditTrailEntry("Employee status is: " + empStatus);
    setVariableData("EmployeeTravelStatusResponse", "travelClass",
    "/travelClass", empStatus);]]>
    </bpelx:exec>
    <reply partnerLink="employeeTravelStatus" portType="emp:EmployeeTravelStatusPT" operation="EmployeeTravelStatus" variable="EmployeeTravelStatusResponse"/>
    </sequence>
    </process>
    Java File:
    package com.packtpub;
    public class EmployeeStatus {
    public String getTravelStatus (String firstName, String lastName) {
    return "Economy";
    }

  • Error in embedding java code in Bpel process

    I am calling one of the java snippet in my process which in turn uses the files from some jars.
    But I am getting error :
    <2006-11-07 12:08:51,227> <ERROR> <default.collaxa.cube.engine.bpel> BPELExecution
    java.lang.ExceptionInInitializerError
         at bpel.p0.ExecLetBxExe0.execute(ExecLetBxExe0.java:35)
         at com.collaxa.cube.engine.ext.wmp.BPELXExecWMP.__executeStatements(BPELXExecWMP.java:52)
         at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perform(BPELActivityWMP.java:188)
         at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:3408)
         at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1836)
         at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:75)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:166)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:252)
         at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:5438)
         at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:1217)
         at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:511)
         at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:335)
         at ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.handleInvoke(ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.java:1796)
         at com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessageHandler.handle(InvokeInstanceMessageHandler.java:37)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:125)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:123)
         at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:755)
         at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:928)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    Caused by: java.lang.ClassCastException
         at com.misys.eqplus.framework.management.instrumentation.ManagementEvent.<clinit>(ManagementEvent.java:36)
         ... 22 more
    I am putting the jar files in my
    BPEL_INF flder
    and entering it in this in C:\OraBPELPM_1integration\orabpel\domains\default\config\domain
    properties file in C:\OraBPELPM_1\integration\orabpel\domains\default\config
    ear file in C:\OraBPELPM_1\integration\orabpel\system\appserver\oc4j\j2ee\home\applications
    Please help me

    Hello Santosh,
    Are you importing the used java classes using <bpelx:exec import="classname"/>
    Regards,
    Melvin

  • Embedded Java Code - How to retrieve multivalue payload value

    I'm working in my SOA-Composite which is used with OIM and our approval process. Here is an example of the payload data:
    >
    <ns2:RequesterDetails>
    <ns2:FirstName>System</ns2:FirstName>
    <ns2:MiddleName/>
    <ns2:LastName>Administrator</ns2:LastName>
    <ns2:Login>XELSYSADM</ns2:Login>
    <ns2:DisplayName>System Administrator</ns2:DisplayName>
    <ns2:ManagerLogin/>
    <ns2:OrganizationName>Xellerate Users</ns2:OrganizationName>
    <ns2:Email>[email protected]</ns2:Email>
    <ns2:StartDate/>
    <ns2:EndDate/>
    <ns2:Status>Active</ns2:Status>
    <ns2:XellerateType>End-User Administrator</ns2:XellerateType>
    <ns2:UserType>Full-Time</ns2:UserType>
    <ns2:Role>SYSTEM ADMINISTRATORS</ns2:Role>
    <ns2:Role>Test Role 1</ns2:Role>
    <ns2:Role>Test Role 2</ns2:Role>
    </ns2:RequesterDetails>
    >
    I am able to retrieve single values with code like this:
    >
    //Retrieve Requester Login
    Object requesterXMLElem = getVariableData("inputVariable", "payload","/ns3:process/ns4:RequesterDetails/ns4:Login");
    String requesterLogin = ((oracle.xml.parser.v2.XMLElement)requesterXMLElem).getText();
    >
    How do i retrieve the multivalue Role values and not just a single entry?
    Thanks,
    Kevin

    I see what i missed with the doube slash, i thought you had a typo and assumed i used it. If i use the following:
    //Retrieve Requester Roles
    Object requesterRolesXMLElem = getVariableData("inputVariable", "payload","/ns3:process/ns4:RequesterDetails//ns4:Role");
    System.out.println("Requester Roles Type[" + requesterRolesXMLElem.getClass() + "]");
    int requesterRolesCount = ((oracle.xml.parser.v2.XMLElement)requesterRolesXMLElem).getAttributes().getLength();
    System.out.println("Requester Roles Length[" + requesterRolesCount + "]");
    String requesterRole = ((oracle.xml.parser.v2.XMLElement)requesterRolesXMLElem).getText();
    System.out.println("Requester Roles[" + requesterRole + "]");
    I get the following output:
    Requester Roles Type[class oracle.xml.parser.v2.XMLElement]
    Requester Roles Length[0]
    Requester Roles[SYSTEM ADMINISTRATORS]
    I am not seeing how to loop through each if the type is class oracle.xml.parser.v2.XMLElement
    Thanks,
    Kevin

  • Embedded Java in BPEL and exception handling

    Hello everybody,
    i want to use some embedded java code in my BPEL process (bpelx:exec). This code would sometimes throw exceptions. How can i deal with these exceptions to control my BPEL process? I would like, in a sense, to do some catching of java exceptions but at the BPEL level... for example, my java code would throw an exception, that my BPEL process would "catch" and react the way i want. Is it possible to do that?
    Thanks for your help!
    Nicolas

    you need to throw a com.oracle.bpel.client.BPELFault ..
    from the code
    * This class represents a standard fault that may be thrown by the server
    * during run-time. A BPEL fault has defined, minimally, a QName that
    * corresponds to the fault name (there are several standard faults that
    * are supported, please refer to Appendix A - Standard Faults in the BPEL
    * 1.1 specification for a complete list).
    * <p>
    * This class can only be used from within a <code>bpelx:exec</code> activity;
    * the <code>throw</code> activity can be used from BPEL code.
    * <p>
    * Additional information (such as a fault variable) can be passed through
    * as a part. Currently, internal system errors populate error codes and
    * summary messages via parts.
    hth clemens

  • Extracting data from Variable using embedded Java

    I am reading a file from a File Adapter and using a variable to get the File Name. This file is being copied to another folder using File Adapter with the same name.
    Now I want to use this File Name in Embeded Java code to encrypt the file. But I am not able to extract the File Name. I am using the following code;
    String getFileName = (String)getVariableData("FileName_In","inboundHeader","/ns4:InboundFileHeaderType/ns4:fileName");
    When I execute it does not throw any error but does not do anything. Any help would be appreciated.

    Hi,
          apache POI is working, and I have extracted the <b>text</b> in a word document(MSWord <b>2003</b>).
    But it is not working for MS Word <b>2007</b>. ( The client may use any MS Word format)
    I have an other option,
    <b>Word Document -
    (Convert)-----> XML Document -(XML Parser)--
    > Data(Text, images,etc,...)</b>
    I request suggestions and idea on this.
    Thanks,
    Prabhakar.

  • Using Java Embedding Unzip Code and a Trigger File in a BPEL Process

    Hello,
    Thanks in advance to anyone that contributes with any insight.  It is much appreciated.  Having said that I will get to the crux of my problem.
    I am currently using Oracle 11g.  I have created a SOA composite application that incorporates BPEL and Java.  I have the code needed to unzip and extract compressed folders.  However, when this was first built out using BPEL it automatically created a web service in the "exposed service" lane and not a file adapter which I believe is needed in order to trigger the process via a start.txt file for example.  Based on what I know ... this web service automatically connecting to the BPEL process was simply due to the order of operations, etc.  So by creating a 'read' file adapter first and then creating the BPEL process and selecting the template "Define Service Later", it does not automatcially connect the web service to the BPEL process and it will allow me to connect a file adapter to this BPEL process instead ... great.  When opening up the BPEL file I then connect a recieve component to this file adapter and configure appropriately.
    Essentially, my objective in setting up a trigger to start this unzip process is due to the BPEL process before that outputs or writes the .zip folder to the same directory that I want to poll and/or trigger via a start.txt file.  I can get this process to work with a webservice connecting to the BPEL process and by using a Java Embedded in BPEL file, which in turns calls the package/ class that has the java code needed to unzip.
    For some reason whenever I try to use a file adapter instead of the native web service that gets created (as mentioned above) it doesn't work.  It seems to build or compile just fine however, I am getting errors when I try to deploy.
    Note:  The Java code contains all the paths where the zip file is to be taken from and extracted to.  So because this is in the code I don't need the file adapter to handle this.  I just want to use the file adapter so that I can trigger the process via start.txt or something of that nature.
    Thanks to anyone that has any suggestions.
    Kind Regards,
    Kevin
    Errors when attempting to deploy are as follows:
    [04:12:54 PM] Error deploying archive sca_Job2_UnZip_rev1.0.jar to partition "default" on server soa_server1 [http://WN017A.homedepot.com:8001]
    [04:12:54 PM] HTTP error code returned [500]
    [04:12:54 PM] Error message from server:
    There was an error deploying the composite on soa_server1: Deployment Failed: Error occurred during deployment of component: BPELProcess1 to service engine: implementation.bpel, for composite: Job2_UnZip: ORABPEL-05250
    Error deploying BPEL suitcase.
    error while attempting to deploy the BPEL component file "H:\Oracle\Middleware\user_projects\domains\Dev_Acorde\servers\soa_server1\dc\soa_d78eb301-314c-422a-a748-bcfe7d0906e8"; the exception reported is: java.lang.RuntimeException: failed to compile execlets of BPELProcess1
    This error contained an exception thrown by the underlying deployment module.
    Verify the exception trace in the log (with logging level set to debug mode).
    [04:12:54 PM] Check server log for more details.
    [04:12:54 PM] Error deploying archive sca_Job2_UnZip_rev1.0.jar to partition "default" on server soa_server1 [http://WN017A.homedepot.com:8001]
    [04:12:54 PM] ####  Deployment incomplete.  ####
    [04:12:54 PM] Error deploying archive file:/C:/JDeveloper/mywork/Job2_UnZip/Job2_UnZip/deploy/sca_Job2_UnZip_rev1.0.jar
    (oracle.tip.tools.ide.fabric.deploy.common.SOARemoteDeployer)

    Just wanted to provide a screenshot of the BPEL file as supporting documentation to better illustrate my issue.
    Thanks so much,
    Kevin

  • Sample Java  Code to send an HTML mail with embeded image

    Hello,
    Please can I get a sample Java code on sending an HTML mail with embeded image.
    The HTML message and relevant input parameters withhbe supplied from a PL/SQL that will call the class , the class will embed the image and send the mail to the recepient.

    tev wrote:
    Please can I get a sample Java codeNo. This is a forum, not a code mill.
    Recommended reading: How to ask questions the smart way
    db

  • URGENT : Need java code snippet to retrieve uniquemember values OID 11g API

    Hi All,
    We have a requirement to retrieve the uniquemember attribute values using OID 11g API. We are using labeleduri approach for dynamic groups and thus all the uniquemember values are created using dynamic groups.
    When we are trying to retrieve the uniquemember values using Java code snippet, it is not returning the values. The strange thing is: The uniquemember values created using dynamic groups are not visible in ODSM OID console or JExplorer tool. However those values are visible in LDAP Browser v2.8.1 tool.
    So can somebody throw light on this? Any pointers or sample code snippet to retrieve uniquemember values would be grateful.
    Thanks
    Mahendra.

    Hi All,
    We have a requirement to retrieve the uniquemember attribute values using OID 11g API. We are using labeleduri approach for dynamic groups and thus all the uniquemember values are created using dynamic groups.
    When we are trying to retrieve the uniquemember values using Java code snippet, it is not returning the values. The strange thing is: The uniquemember values created using dynamic groups are not visible in ODSM OID console or JExplorer tool. However those values are visible in LDAP Browser v2.8.1 tool.
    So can somebody throw light on this? Any pointers or sample code snippet to retrieve uniquemember values would be grateful.
    Thanks
    Mahendra.

  • Urgent java code help needed

    i need java code for writing following lines in a file
    <?xml version="1.0"?>
    <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
    "http://www.wapforum.org/DTD/wml_1.1.xml">
    Moreover i need code for reading word by word html file.
    PLease reply as soon as possible.
    iwapsms

    for the html-part there are several html-parser, that bould whole parsetrees, which you can traverse (walk) through as you whish. just check google for it (something like: java html parser).
    if that xml you have there is in String-form, just use a Filewriter
    BufferedWriter writer = new BufferedWriter (new FileWriter (new File ("FilePath/filename.xml")));
    writer.write (xmlString);
    writer.close();however, if you have to juggle xml tags, content and attributes a lot, i'd recomend jdom to construct the xml and saxParser to write it.
    again jsut google for it.

Maybe you are looking for