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

Similar Messages

  • 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"/>

  • 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

  • Error while embedding java into BPEL

    Hi Guys,
    I am getting the following error while embedding Java into BPEL.
    Error: C:\unzipjdev\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\.client (The system cannot find the file specified)
    i checked for .client content , it is not available in the directory.
    Does anybody know about this?

    could you please provide the java exec code snippet that you use in bpel? there is a sample under samples/references/JavaExec

  • Error in a JAVA Code

    Dear Experts,
    I am trying toimplement a JAVA code in SAP NWDS (NetWeaver Develope Studio) and i have imported the necessary jar files also. However there are some errors that I am not able to solve. Below is the JAVA code that i am using
    package JAVAinXSLT;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import java.util.*;
    import java.text.*;
    import com.sap.aii.mapping.api.TransformationInput;
    public class Email extends AbstractTransformation
              public static String getFromEmail(TransformationInput in)throws StreamTransformationException
                        try {
                                  // Read Import Parameters
                               String paramFrom = in.getInputParameters().getString("PARAM_FROM");
                               return paramFrom;
                        catch (Throwable throwable)
                               throwable.printStackTrace();
              public static String getToEmail(TransformationInput in)throws StreamTransformationException
                        try
                                  // Read Import Parameters
                                  String paramTo = in.getInputParameters().getString("PARAM_TO");
                                  return paramTo;
                        catch (Throwable throwable)
                               throwable.printStackTrace();
    The errors that I am getting are:
    1) ERROR: The type Email must implement the inherited abstract method AbstractTransformation.transform(TransformationInput, TransformationOutput)
    This is at public class Email extends AbstractTransformation
    2) ERROR: This method must return a result of type String
    At line public static String getFromEmail(TransformationInput in)throws StreamTransformationException
    3) ERROR: This method must return a result of type String
    At the line public static String getToEmail(TransformationInput in)throws StreamTransformationException
    There seems to be error in declaration.....but I am not able to solve it. So please help me out here
    Thanks,
    Abhishek.

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

  • 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>

  • View Compilation Errors in Embedded Java Activity

    Hi,
    Is there any way to see the compilation errors in the Embedded Java Activity in the BPEL.
    Thanks,
    Ajay

    Hi,
    Exceptions are automatically converted to BPEL faults and thrown back in BPEL.
    But to see some errors , one can use try catch block with audit trail entry in catch block like :
    try {
    catch (Exception e){
    addAuditTrailEntry(e);
    I have not used this so not sure if this will work.
    HTH,
    Ketan

  • 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

  • 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";
    }

  • SOME MOST PROBALE ERROR IN MOST JAVA CODE

    hi...
    Otn team..
    i want to know while i am running some program in netBeans it shows some error ...
    1)class interface or enum expected.
    2)illegal Start of type.
    3)if i use super keyword to add some argument within it than it shows an error that
    "Keyword super should be used at the start of method constructr"
    4)Method does not override or implement method from a supertype
    5)Class SalaryEmploy is public and should be declared in a file names SalaryEmploy..
    can any one please help what are these error and why they comes??

    1 - In
    import java.util.Date;
    public class Caos {
    }You most likely forgot the 'class' keyword.
    2 - It is very likely you have unbalanced '{' somewhere in your code.
    3 - The super keyword is meant to invoke constructors on the super class, and this should happen before your own construction code ever happen, java language defines that the default super constructor is invoked if you do nothing to invoke it and if you invoke it you must do that as the very first thing in your constructor.
    4 - You are marking something with @override which does not override anything, or just implements an interface method if you are using java 5.
    5 - By definition, every public class should be declared on its own file and the file have to have the same name as the class, so class SalaryEmploy shouold be in SalaryEmploy.java

  • Plz help , getting error in my java code

    Can any one tell the reason for this error:
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    is there any size limit for java classes that I am using in my code?
    My code Looks like:
         FileChannel in = null, out = null;
         try {
         in = new FileInputStream(sourceLocation).getChannel();
    System.out.println(in.size() +"RptPageBreak rtn: b 4 read file into buffer, source=" + sourceLocation);
    // read the file into buffer
    // System.out.println("-1 " +in.size() );
    MappedByteBuffer buf = in.map(FileChannel.MapMode.READ_ONLY, 0, in.size());
         //System.out.println("RptPageBreak rtn: AFTER read file into buffer" );
    System.out.println("1: "+ buf.capacity()+" " +in.size() );
    // CharBuffer cb;
                   try {
                        cb = Charset.forName ("UTF-8").decode (buf);
                   } catch (Exception ex) {
                        System.out.println("2:"+ ex.getMessage());
                        ex.printStackTrace();
    System.out.println("2");
    String lines[] = Pattern.compile ("\n").split (cb, 0);
         //System.out.println("RptPageBreak rtn: lines.len=" + lines.length);
         Writer writer = new FileWriter (targetLocation);
         System.out.println("3");
         for (int i = 0, n = lines.length; i < n; i++) {
              // also compare if starts with a CRLF
         if ( ( lines.startsWith("\r\n" + rpt_headg_id) == true ) ||
                   ( lines[i].startsWith("\f" + rpt_headg_id) == true ) ||
    ( lines[i].startsWith(rpt_headg_id) == true ) )
    //if ( lines[i].contains(rpt_headg_id) == true )
         //System.out.println("RptPageBreak rtn: found headg in if loop " + rpt_headg_id );
    writer.write ("1");
    else {
         writer.write (" "); // detail lines shift over 1 by addg a space
    writer.write (lines[i]);
    writer.write ('\n');
    //System.out.println("RptPageBreak rtn: lines[i]=" + i + ' ' + lines[i]);
    writer.close ();
    }catch(Exception e)
         System.out.println("RptPageBreak rtn: Catch Exception: " + e.getMessage() );
         status=false;
    e.printStackTrace();
    finally {
         try {
    if (in != null) in.close();
    if (out != null) out.close();
    status=true;
    catch(Exception e)
         System.out.println("RptPageBreak rtn: Finally-Catch Exception: " + e.getMessage() );
         status=false;
    e.printStackTrace();

    It has nothing to do with classes. It is that you are reading to much info into memory at one time. If you are only going to cycle through the input line for line, anyway, then why don't you simply read the file (or whatever) a line at a time and process it as you read it, rather than loading the entire thing at once?

  • Error when executing Java code, java.lang.NoClassFoundError:

    Hi, I am new learner in Java Programming and I am using J2SDK and notepad to write a code. I don't have problem in compiling using javac filename, however I received an error when executing using java filename.
    The error message I got is Exception in thread "main" java.lang.NoClassDefFoundError: Hello/jawa.
    I have verified this simple code - Hello has no issue but somehow it does not run. I even try to compile and execute in other computer also the similiar error returned.
    My Client Platform is Windows XP Professional.
    I would appreciate any expert can help to suggest me the knowledge/solution to fix this kind of error. Thanks
    Jackie

    It looks like you entered the command "java Hello.java" or "java Hello/java" (I assumed 'jawa' was a typo.)
    You should have entered "java Hello" if your class name is Hello. I am guessing that Hello.java is probably the source code file name. The argument to the java command is the fully qualified class name. "java Hello.java" tells the java command to look for a class named java that is in the Hello package.

  • Error while running java code

    Hi
    I have requirement of converting word document to PDF/A. Iam using the APIs provided by Livecycle ES. I tried to implement the requirement by creating a java program with the jar files provided. But iam getting the following error. Can anyone plz help me?
    ALC-PDG-1000-000: com.adobe.livecycle.generatepdf.client.ConversionException: ALC-PDG-001-000-Conversion failed because of an exception.
    Causing exception message : Remote EJBObject lookup failed for 'ejb/Invocation'; nested exception is:
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    Caused by: java.rmi.RemoteException: Remote EJBObject lookup failed for 'ejb/Invocation'; nested exception is:
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initialise(EjbMessageDispatcher. java:90)
    at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.doSend(EjbMessageDispatcher.java :119)
    at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispat cher.java:57)
    at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)
    at com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient.createPDF(GeneratePdfServ iceClient.java:172)
    at Converttopdfa.main(Converttopdfa.java:44)
    Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initialise(EjbMessageDispatcher. java:84)
    ... 5 more
    Error OCCURRED: ALC-PDG-001-000-Conversion failed because of an exception.
    Causing exception message : Remote EJBObject lookup failed for 'ejb/Invocation'; nested exception is:
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    at com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient.createPDF(GeneratePdfServ iceClient.java:194)
    at Converttopdfa.main(Converttopdfa.java:44)

    XML reading program<br /><br />package com.parser;<br />import static org.w3c.dom.Node.ATTRIBUTE_NODE;<br />import static org.w3c.dom.Node.CDATA_SECTION_NODE;<br />import static org.w3c.dom.Node.COMMENT_NODE;<br />import static org.w3c.dom.Node.DOCUMENT_TYPE_NODE;<br />import static org.w3c.dom.Node.ELEMENT_NODE;<br />import static org.w3c.dom.Node.ENTITY_NODE;<br />import static org.w3c.dom.Node.ENTITY_REFERENCE_NODE;<br />import static org.w3c.dom.Node.NOTATION_NODE;<br />import static org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE;<br />import static org.w3c.dom.Node.TEXT_NODE;<br /><br />import java.io.IOException;<br />import java.io.StringReader;<br />import java.util.ArrayList;<br />import java.util.HashMap;<br /><br />import javax.xml.parsers.DocumentBuilder;<br />import javax.xml.parsers.DocumentBuilderFactory;<br />import javax.xml.parsers.ParserConfigurationException;<br /><br />import org.w3c.dom.Document;<br />import org.w3c.dom.DocumentType;<br />import org.w3c.dom.Node;<br />import org.w3c.dom.NodeList;<br />import org.w3c.dom.Text;<br />import org.xml.sax.InputSource;<br />import org.xml.sax.SAXException;<br /><br />public class MainClass {<br />     <br />     HashMap map = new HashMap();<br />     ArrayList a = new ArrayList(10);<br />  public static void main(String args[]) {<br />    DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();<br />    builderFactory.setNamespaceAware(true);       // Set namespace aware<br />    builderFactory.setValidating(true);           // and validating parser feaures<br />    builderFactory.setIgnoringElementContentWhitespace(true); <br />    <br />    DocumentBuilder builder = null;<br />    try {<br />      builder = builderFactory.newDocumentBuilder();  // Create the parser<br />    } catch(ParserConfigurationException e) {<br />      e.printStackTrace();<br />    }<br />    Document xmlDoc = null;<br /><br />    try {<br />      xmlDoc = builder.parse(new InputSource(new StringReader(xmlString1)));<br /><br />    } catch(SAXException e) {<br />      e.printStackTrace();<br /><br />    } catch(IOException e) {<br />      e.printStackTrace();<br />    }<br />    DocumentType doctype = xmlDoc.getDoctype();       <br />    if(doctype == null) {                             <br />      System.out.println("DOCTYPE is null");<br />    } else {                                          <br />      System.out.println("DOCTYPE node:\n" + doctype.getInternalSubset());<br />    }<br /><br />    System.out.println("\nDocument body contents are:");MainClass m = new MainClass();<br />    m.listNodes(xmlDoc.getDocumentElement(),"");         // Root element & children<br />    <br />    m.abc();<br />  }<br />   public  void abc(){<br />        System.out.println("++++"+a.size());<br />        <br />        for(int i=0; i<a.size();i+=2){<br />                 map.put(a.get(i), a.get(i+1));<br />                 <br />                 <br />                 //map.put(i, i+1);<br />                 <br />                 //map.put(a.get(i), a.get(i+1));<br />            }  <br />        <br />        System.out.println("Map"+map.toString());<br />           <br />        <br />        }<br />  <br />  private void listNodes(Node node, String indent) {<br />     try{<br />          <br />       String nodeName = node.getNodeName();<br />   //System.out.println(indent+" Node: " + nodeName);<br />   // if(nodeName == "id")<br />    short type = node.getNodeType();<br />    <br />   //System.out.println(indent+" Node Type: " + nodeType(type));<br />    if(type == TEXT_NODE){<br />         <br />         <br />//         System.out.println(indent+" Node is: "+(node).getParentNode().getNodeName());<br />         if((node).getParentNode().getNodeName()== "id"){<br />              //System.out.println(indent+" Node is: "+(node).getParentNode().getNodeName());<br />              System.out.println(indent+" key is: "+((Text)node).getWholeText());<br />              a.add(((Text)node).getWholeText());<br />         }<br />         if((node).getParentNode().getNodeName()== "val"){<br />              //System.out.println(indent+" Node is: "+(node).getParentNode().getNodeName());<br />              System.out.println(indent+" value is: "+((Text)node).getWholeText());<br />              a.add(((Text)node).getWholeText());<br />         }<br />         <br />         <br />    }<br />    <br />    NodeList list = node.getChildNodes();       <br />    if(list.getLength() > 0) {                  <br />     // System.out.println(indent+" Child Nodes of "+nodeName+" are:");<br />      for(int i = 0 ; i<list.getLength() ; i++) {<br />        listNodes(list.item(i),indent+"  ");     <br />      }<br />     <br />       <br />    }      <br />     } catch(Exception e){<br />          e.printStackTrace();<br />     }<br />  }<br /><br />  static String nodeType(short type) {<br />    switch(type) {<br />      case ELEMENT_NODE:                return "Element";<br />      case DOCUMENT_TYPE_NODE:          return "Document type";<br />      case ENTITY_NODE:                 return "Entity";<br />      case ENTITY_REFERENCE_NODE:       return "Entity reference";<br />      case NOTATION_NODE:               return "Notation";<br />      case TEXT_NODE:                   return "Text";<br />      case COMMENT_NODE:                return "Comment";<br />      case CDATA_SECTION_NODE:          return "CDATA Section";<br />      case ATTRIBUTE_NODE:              return "Attribute";<br />      case PROCESSING_INSTRUCTION_NODE: return "Attribute";<br />    }<br />    return "Unidentified";<br />  }<br /><br />  static String xmlString ="<?xml version=\"1.0\"?>" +<br />      "  <!DOCTYPE address" +<br />      "  [" +<br />      "     <!ELEMENT address (buildingnumber, street, city, state, zip)>" +<br />      <br />      "     <!ELEMENT buildingnumber (#PCDATA)>" +<br />      "     <!ELEMENT street (#PCDATA)>" +<br />      "     <!ELEMENT city (#PCDATA)>" +<br />      "     <!ELEMENT state (#PCDATA)>" +<br />      "     <!ELEMENT zip (#PCDATA)>" +<br />      "  ]>" +<br />      "" +<br />      "  <address>" +<br />      "    <buildingnumber> 29 </buildingnumber>" +<br />      "    <street> South Street</street>" +<br />      "    <city>Vancouver</city>" +<br />      "" +<br />      "    <state>BC</state>" +<br />      "    <zip>V6V 4U7</zip>" +<br />      "  </address>";<br />  <br />  static String xmlString1 ="<?xml version=\"1.0\"?>" +<br />  "  <!DOCTYPE retrCtx" +<br />  "  [" +<br />  <br />    <br />  "     <!ELEMENT retrCtx (id, val)>" +<br />  <br />  "     <!ELEMENT id (#PCDATA)>" +<br />  "     <!ELEMENT val (#PCDATA)>" +<br />  "       ]>" +<br />  "" +<br />  "<retrCtx ver = '1'>" +<br />  "  <item_map type='std'>" +<br />  "    <item>" +<br />  "    <id>rtrId</id>" +<br />  "    <val>00993236327</val>" +<br />  "    </item>" +<br />  "    <item>" +<br />  "    <id>rtrId2</id>" +<br />  "    <val>009932363278</val>" +<br />  "    </item>" +<br />  "  </item_map> " +<br />  "  <item_map type='std'>" +<br />  "    <item>" +<br />  "    <id>rtrId3</id>" +<br />  "    <val>00993236329</val>" +<br />  "    </item>" +<br />  "    <item>" +<br />  "    <id>rtrId4</id>" +<br />  "    <val>009932363210</val>" +<br />  "    </item>" +<br />  "  </item_map> " +<br />  "  </retrCtx>";<br />}

  • Error in simple java code.

    Hi folks,
       I am having some problem to compile this code, anybody can help me please ?
    Thanks a lot.
    Patricio.
    package Duck02;
    import java.util.List;
    import com.sapportals.portal.prt.component.*;
    import com.sapportals.wcm.repository.IResource;
    import com.sapportals.wcm.repository.ResourceContext;
    import com.sapportals.wcm.repository.ResourceFactory;
    import com.sapportals.wcm.util.uri.RID;
    import com.sapportals.portal.security.usermanagement.IUser;
    import com.sap.netweaver.bc.rf.common.exception.*;
    public class MyFirstComponent extends AbstractPortalComponent
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
              IResourceContext resourceContext = new ResourceContext(user);
              RID rid = RID.getRID("/etc");
              try {
                     IResource resource = ResourceFactory.getInstance().getResource(rid, resourceContext);
                     if( resource != null ) {
                        // resource found
                        System.out.println("resource " + resource.getRID() + " found");
                     } else {
                        // resource not found
                        System.out.println("resource " + resource.getRID() + " does not exist");
              catch( ResourceException e ) {
                          // problem while retrieving the resource
                          System.out.println(
                             "exception while trying to get resource " + e.getRID()
                             + ": " + e.getMessage()

    You could find the jar in your local installation directory of NWDS or you can send me an email at psingh(at)ust.net. Your code should look like following.
    p
    ackage Duck02;
    import java.util.List;
    import com.sapportals.portal.prt.component.*;
    import com.sapportals.wcm.repository.IResource;
    import com.sapportals.wcm.repository.ResourceContext;
    import com.sapportals.wcm.repository.ResourceFactory;
    import com.sapportals.wcm.util.uri.RID;
    import com.sapportals.portal.security.usermanagement.IUser;
    import com.sap.netweaver.bc.rf.common.exception.*;
    public class MyFirstComponent extends AbstractPortalComponent
    public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
    IUser user = WPUMFactory.getUserFactory().getEP5User(request.getUser());
    IResourceContext resourceContext = new ResourceContext(user);
    RID rid = RID.getRID("/etc");
    try {
    IResource resource = ResourceFactory.getInstance().getResource(rid, resourceContext);
    if( resource != null ) {
    // resource found
    System.out.println("resource " + resource.getRID() + " found");
    } else {
    // resource not found
    System.out.println("resource " + resource.getRID() + " does not exist");
    catch( ResourceException e ) {
    // problem while retrieving the resource
    System.out.println(
    "exception while trying to get resource " + e.getRID()
    + ": " + e.getMessage()

  • 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

Maybe you are looking for

  • How to install Adobe Captivate 7

    I have Adobe Captivate 7 and need to know how to downlaod it.  It is very complex and goes through a site called identit-e and I cannot find directions on how to install this product.  any help would be great.  thanks!

  • Open in New Window

    How can I make Safari open a new website when I click an URL on a site? It is annoying not to be able to go back to the original site.

  • ResultSet problem with a jdbc connection pool implementation

    Hi I'm trying to use jdbc connection pool in my java application (js2e 1.4.0_01) from the example at http://www.developer.com/tech/article.php/626141 In my main() code, in addition to JDBCConnection, JDBCConnectionImpl and JDBCPool classes, i use JDB

  • What's app want to be on my ipad

    Hai I searched for whats app in App Store , it's not available in it So I went to whats app home page , tried to download through iPhone . While click download , it's going to App Store . But showing a blank page

  • Camera can't focus in the dark

    Why the led flashlight can't be used to focus on dark photos? The led light on the iPhone 4 is fine for taking photos in completely dark. The only problem is that 90% of the photos taken with almost 0 light are out of focus. If only the led can be tu