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()

Similar Messages

  • Calling simple Java Code from 11g BPM

    Hi,
    I know this has been round the houses but I cant find a satisfactory solution for my scenario. I would like to call some simple java code from BPM (11.1.1.6). I guess I need to expose it as a service but it seems overkill to be via soap so any advice you can give would be much appreciated. Creating a jar that I can call somehow would be perfect.
    This is my scenario:
    - I am creating a Security POC for BPM
    - The BPM Process is exposed as a web service and authenticated using SAML
    - I am testing by calling the WS from OSB
    - I want to be able to get the WLS Principal and display the username and the roles for the launching user, from within the BPM process
    - This is possible using some simple weblogic client api code shown below
    - So all I want to do is call this code from BPM somehow
    - Anyone point me in the right direction ?
    cheers
    Tony
    subject = Security.getCurrentSubject();
    for(Principal p: subject.getPrincipals()) {
    if(p instanceof WLSGroupImpl) {
    groupList.add(p.getName());
    } else if (p instanceof WLSUser) {
    principal = p.getName();
    }

    The problem to communiate java classes and forms solved !
    i have add my .jar file to $OA_JAVA/oracle/apps/fnd/jar and now i can communicate between forms and java.
    I can create an object, i can get simple message from class, but when i try to create
    ServiceFactory factory = ServiceFactory.newInstance();
    ive got ORA-105100...
    can anybody help ?

  • Missing Defines Error in Simple Java Stored Procedure

    Anyone have any suggestions on what might be causing the unusual behavior described below? Could it be a 10g java configuration issue? I am really stuck so I'm open to just about anything. Thanks in advance.
    I am writing a java stored procedure and am getting some SQLException's when executing some basic JDBC code from within the database. I reproduced the problem by writing a very simple java stored procedure which I have included below. The code executes just fine when executed outside of the database (10g). Here is the output from that execution:
    java.class.path=C:\Program Files\jEdit42\jedit.jar
    java.class.version=48.0
    java.home=C:\j2sdk1.4.2_04\jre
    java.vendor=Sun Microsystems Inc.
    java.version=1.4.2_04
    os.arch=x86
    os.name=Windows XP
    os.version=5.1
    In getConnection
    Executing outside of the DB
    Driver Name = Oracle JDBC driver
    Driver Version = 10.1.0.2.0
    column count=1
    column name=TEST
    column type=1
    TEST
    When I execute it on the database by calling the stored procedure I get:
    java.class.path=
    java.class.version=46.0
    java.home=/space/oracle/javavm/
    java.vendor=Oracle Corporation
    java.version=1.4.1
    os.arch=sparc
    os.name=Solaris
    os.version=5.8
    In getConnection
    We are executing inside the database
    Driver Name = Oracle JDBC driver
    Driver Version = 10.1.0.2.0
    column count=1
    column name='TEST'
    column type=1
    MEssage: Missing defines
    Error Code: 17021
    SQL State: null
    java.sql.SQLException: Missing defines
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:158)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
    at oracle.jdbc.driver.OracleResultSetImpl.getString(Native Method)
    at OracleJSPTest.test(OracleJSPTest:70)
    Here is the Java code:
    // JDBC classes
    import java.sql.*;
    import java.util.*;
    //Oracle Extensions to JDBC
    import oracle.jdbc.*;
    import oracle.jdbc.driver.OracleDriver;
    public class OracleJSPTest {
    private static void printProperties(){
         System.out.println("java.class.path="+System.getProperty("java.class.path"));
         System.out.println("java.class.version="+System.getProperty("java.class.version"));
         System.out.println("java.home="+System.getProperty("java.home"));
         System.out.println("java.vendor="+System.getProperty("java.vendor"));
         System.out.println("java.version="+System.getProperty("java.version"));
         System.out.println("os.arch="+System.getProperty("os.arch"));
         System.out.println("os.name="+System.getProperty("os.name"));
         System.out.println("os.version="+System.getProperty("os.version"));
    private static Connection getConnection() throws SQLException {
         System.out.println("In getConnection");      
    Connection connection = null;
    // Get a Default Database Connection using Server Side JDBC Driver.
    // Note : This class will be loaded on the Database Server and hence use a
    // Server Side JDBC Driver to get default Connection to Database
    if(System.getProperty("oracle.jserver.version") != null){
              System.out.println("We are executing inside the database");
              //connection = DriverManager.getConnection("jdbc:default:connection:");                    
              connection = new OracleDriver().defaultConnection();
    }else{
         System.out.println("Executing outside of the DB");
         DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
         connection = DriverManager.getConnection("jdbc:oracle:thin:@XXX.XXX.XXX.XX:XXXX:XXXX","username","password");
    DatabaseMetaData dbmeta = connection.getMetaData();
    System.out.println("Driver Name = "+ dbmeta.getDriverName());
    System.out.println("Driver Version = "+ dbmeta.getDriverVersion());
    return connection;
    public static void main(String args[]){     
         test();     
    public static void test() {   
         printProperties();
    Connection connection = null; // Database connection object
    try {
         connection = getConnection();
         String sql = "select 'TEST' from dual";
         Statement stmt = connection.createStatement();
    ResultSet rs = stmt.executeQuery(sql);     
         ResultSetMetaData meta = rs.getMetaData();     
         System.out.println("column count="+meta.getColumnCount());
         System.out.println("column name="+meta.getColumnName(1));
         System.out.println("column type="+meta.getColumnType(1));
         if(rs.next()){
              System.out.println(rs.getString(1));
    } catch (SQLException ex) { // Trap SQL Errors
         System.out.println("MEssage: " + ex.getMessage());
         System.out.println("Error Code: " + ex.getErrorCode());
         System.out.println("SQL State: " + ex.getSQLState());
         ex.printStackTrace();
    } finally {
    try{
    if (connection != null || !connection.isClosed())
    connection.close(); // Close the database connection
    } catch(SQLException ex){
    ex.printStackTrace();
    Message was edited by:
    jason_mac

    Jason,
    Works for me on Oracle 10.1.0.3 running on Red Hat Enterprise Linux AS release 3 (Taroon).
    Java code:
    import java.sql.*;
    * Oracle Java Virtual Machine (OJVM) test class.
    public class OjvmTest {
      public static void test() throws SQLException {
        Connection conn = DriverManager.getConnection("jdbc:default:connection:");
        PreparedStatement ps = null;
        ResultSet rs = null;
        try {
          ps = conn.prepareStatement("select 'TEST' from SYS.DUAL");
          rs = ps.executeQuery();
          if (rs.next()) {
            System.out.println(rs.getString(1));
        finally {
          if (rs != null) {
            try {
              rs.close();
            catch (SQLException sqlEx) {
              System.err.println("Error ignored. Failed to close result set.");
          if (ps != null) {
            try {
              ps.close();
            catch (SQLException sqlEx) {
              System.err.println("Error ignored. Failed to close statement.");
    }And my PL/SQL wrapper:
    create or replace procedure P_J_TEST as language java
    name 'OjvmTest.test()';And here is how I execute it in a SQL*Plus session:
    set serveroutput on
    exec dbms_java.set_output(2000)
    exec p_j_testGood Luck,
    Avi.

  • 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

  • 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

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

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

  • Can you write simple Java code in a UNIX function and run it? See example....

    Hi,
    I'm new to Java and I have a question.
    Is there any possible way a simple script like the below would work in a UNIX function called from a shell script. I know you're not supposed to do this but can you?
    Thanks in advance,
    javatst() {
       $JAVA_HOME/bin/java  <<- _java
      public class HelloWorld {
      public static void main(String[] args) {
      System.out.println("Hello, World");
      _java
    javatst

    2894431 wrote:
    You can run a java class from a shell script like below:
    #!/bin/sh
    exec /usr/bin/java -DsysParam1="var1_val" -DsysParam2="var2_val" -cp jar1:jar2:jar3 /home/unixUserName/javaClasses/Test.java
    exit 0
    No!
    This is neither a valid answer to the OPs question (since your script does not create the content of Test.java) nor working.
    The java executable can only run *.class files which contain byte code of the intermediate language generated by the javac executable.
    Your suggestion leads to a ClassNotFound exception.
    bye
    TPD

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

  • How can I access the Oracle CEP from the a simple java code

    I want to access the current values in coherence cache and show those in a screen. So for that I want to create a java class which can access the Coherence cache of the CEP application and get the current values in the Cache.
    Do anyone had any sample code for this, or any idea how to do this.

    As mentioned, you can use Spring to pass a reference to your cache to an event bean as shown below.
    Once you have a reference to the cache you can use whatever Coherence APIs you need.
    For example: get an object based on the key, perform an invoke, or a query to get the values that you want to display.
    Here's some sample code:
    IN EPN
    <wlevs:caching-system id="CoherenceCachingSystem" provider="coherence" />
    <wlevs:cache id="TransactionCache" caching-system="CoherenceCachingSystem"
              value-type="TransactionAmount" key-class="com.oracle.poc.event.TransactionAmountKey">                                   
    </wlevs:cache>
    <wlevs:event-bean id="TransactionCacheQuery" class="com.oracle.cep.eventbeans.TransactionCacheQuery">
         <wlevs:listener ref="P1TotalChannel" />
         <wlevs:instance-property name="transactionCache" ref="TransactionCache" />
    </wlevs:event-bean>
    EVENT BEAN:
    import com.tangosol.net.NamedCache;
    import com.tangosol.util.aggregator.DoubleSum;
    import com.tangosol.util.filter.EqualsFilter;
    public class TransactionCacheQuery implements StreamSource, StreamSink {
         private StreamSender streamSender_;
         @SuppressWarnings("unchecked")
         private Map transactionCache;     
         @SuppressWarnings("unchecked")
         public void setTransactionCache(Map transactionCache) {
              this.transactionCache = transactionCache;
         public void setEventSender(StreamSender sender) {
              streamSender_ = sender;
         public void onInsertEvent(Object event) throws EventRejectedException {
              if (event != null){
                   if (event instanceof MyEvent){
                        MyEvent my = (MyEvent)event ;
                        NamedCache cache = (NamedCache)transactionCache ;
                        Object totalAmount = cache.aggregate(
                                  new EqualsFilter("getACCT_NUMBER", my.getACCT_NUMBER()),
                                  new DoubleSum("getAmount"));
                        double transactionsTotal = 0.00 ;
                        if (totalAmount instanceof Double){
                             transactionsTotal = ((Double)totalAmount).doubleValue();
                        my.setTransactionsTotal(transactionsTotal);
                        // send new event to the processor
                        streamSender_.sendInsertEvent(my);     
    }

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

  • Simple Java Code Problems inc Compiling

    Heya all ive been working on a portfolio for the last few weeks and i have a couple of problems with certain programs i have tryed to make , would it be possable for someone to point out where im going wrong and give me some kind of information on how to correct the problem
    Problem 1
    import java.util.*;
    public class Number4
    public static void main(String[] args)
    // input the Number
    double Integer;
    System.out.print("Enter a Number : ");
    Scanner kybd = new Scanner(System.in);
         Integer = kybd.nextInt();
    // process the Number to produce either Positive,Negative or Zero
    String Number;
    if ( Integer > 0 )
         Number = "Positive_";
    else if ( Integer < 0 )
         Number = "Negative_";
    else
         Number = "Zero_";
    System.out.print("The Number is " + Number);
    if (Integer %2 ==0)
    System.out.println("The number is Even");
    else
    System.out.println("The number is Odd");
    This program works fine but when i input a zero i get " The Number is Zero _ The Number is even " , I wish for it to only display "The Number is Zero"
    Also as a side note is there a way to make a space withought using "_"

    mlk wrote:
    When you post code, please use code tags as described in [Formatting tips|http://forum.java.sun.com/help.jspa?sec=formatting] on the message entry page. It makes it much easier to read.
    The Formatting tips page no longer has formatting tips. o_O
    ~

  • Error -- Java code using OIM API to find no of users in OIM

    Hi Experts,
    I hav a requirement that I need to query OIM to find out the total no of active users in the system using a stand alone java program to determine some other process. So I have developed a simple java code but it fails in the below line
    rset=userIntf.findAllUsers(map);  -- It throws null pointer exception
    I have tried with deleteUser() instead of findUsers() , still it throws the null pointer exception on the same line.I have checked the other posts in the forum but could not find out where is the mistake. Can u please suggest me??
    Here is the code
    System.setProperty("XL.HomeDir","D:/bea-oim/xellerate");
    System.setProperty("java.security.auth.login.config","D:/bea-oim/xellerate/config/authwl.conf");
    System.setProperty("java.security.policy","D:/bea-oim/xellerate/config/xl.policy");
    System.setProperty("log4j.configuration","D:/bea-oim/xellerate/config/log.properties");
    tcUtilityFactory utilityFactory = null;
    tcUserOperationsIntf userIntf = null;
              try
                   tcResultSet rset;
                   ComplexSetting config = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
                   final Hashtable env = config.getAllSettings();
                   tcSignatureMessage moSignature = tcCryptoUtil.sign("xelsysadm","PrivateKey");
                   utilityFactory = new tcUtilityFactory(env, moSignature);
                   userIntf=(tcUserOperationsIntf)utilityFactory.getUtility("Thor.API.Operations.tcUserOperationsIntf");
                   HashMap map = new HashMap();
                   map.put("Users.Status","Active");
                   rset=userIntf.findAllUsers(map);
    System.out.println(rset.getRowCount());
         catch(NullPointerException ne)
         System.out.println(ne.getMessage());
         ne.printStackTrace();
         catch(Exception e)
         System.err.println(e.getMessage());
         e.printStackTrace();
    Thanks & Regards
    INIYA

    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    import java.util.HashMap;
    import java.util.Properties;
    import java.util.*;
    import Thor.API.tcUtilityFactory;
    import Thor.API.Operations.*;
    import Thor.API.tcResultSet;
    import com.thortech.xl.crypto.tcCryptoUtil;
    import com.thortech.xl.util.config.ConfigurationClient;
    * @author Rajiv
    public class CreateBulkUsers {
    public static void main(String args[])
    System.setProperty("XL.HomeDir", "E:\\oim\\server\\xellerate");
    System.setProperty("java.security.auth.login.config", "E:\\oim\\server\\xellerate\\config\\auth.conf");
    System.setProperty("java.security.policy", "E:\\oim\\server\\xellerate\\config\\xl.policy");
              tcUtilityFactory utilityFactory = null;
    tcUserOperationsIntf userIntf = null;
    try
    com.thortech.xl.util.config.ConfigurationClient.ComplexSetting config = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
    java.util.Hashtable env = config.getAllSettings();
    com.thortech.xl.crypto.tcSignatureMessage moSignature = tcCryptoUtil.sign("xelsysadm", "PrivateKey");
    utilityFactory = new tcUtilityFactory(env, moSignature);
    // System.out.println((new StringBuilder()).append("utilityFactory = ").append(utilityFactory).toString());
    userIntf = (tcUserOperationsIntf)utilityFactory.getUtility("Thor.API.Operations.tcUserOperationsIntf");
    HashMap map = new HashMap();
    map.put("Users.Status", "Active");
    tcResultSet rset = userIntf.findAllUsers(map);
    System.out.println(rset.getRowCount());
    catch(NullPointerException ne)
    System.out.println(ne.getMessage());
    ne.printStackTrace();
    catch(Exception e)
    System.err.println(e.getMessage());
    e.printStackTrace();
    Include all the JARs to run this class from outside not only of OIm of JBoss or Weblogic also.
    eg: jboss\client and jboss\lib

Maybe you are looking for

  • Help on performance

    Hi ALL I am new to this forum I am jez learning ABAP . I anm sure that this site will help me grow in SAP via the help of all the gurus I thank U all in advance I have written a code and there is a Performance issue . The particular form 'cal_no_of_o

  • Dialog Instance Installation failed at start instance phase

    Hi Experts, I am using SWPM to do the installation for the DI (ECC6.0 EHP4) but failed on start instance phase. I got below error when i run R3trans -d. Kernel 7.21 oracle client 11.2.03 When i manually run the command R3trans -d then return error as

  • Retractor for Statistical Key Figures Not Sending Values

    I have configured the standard retractor for primary costs and stat key figures based on all the documentation.  Primary costs retract perfectly.  Stat Key Figures do not send over the values. I have configured UPBR_RETRACT with UPB_RET_STKEYFIG.  In

  • After installing lxde my network stopped to work

    I have installed lxde and my network stopped to work. I didnt changed anything in rc.conf. What is the problem?

  • IPhone won't connect to Macbook Pro Hotspot!

    When I make my Macbook Pro into a hotspot my iPhone won't connect to the network. It'll detect, but won't connect. Running OS X 10.8.2 and  iOS 6.1 on an iPhone 5. Help!