Accessing device registers and microcontroller registers using java

We are writing an application that needs to work with any kind of microcontroller(more specifically targetted towards 8051 and 80188/86 microcontrollers) in a constrained memory environment with code/data not
more than 128 KB or at the most 256 KB.
We would look at using the JVM in hardware rather than software as an accelerator chip on our boards..
However I wanted to know whether there is a way wherein I can accomplish the above platform independence for microcontroller and still access low level registers for the memory mapped I/O devices using Java..
If anybody knows about this please let me know at
[email protected]

Not in pure Java, although you can do that in JNI. But if this is the main purpose of your program, you might as well use C++ or some more low-level language.

Similar Messages

  • RG registers and PLA registers - Extraction Problem

    Hi,
    We have updated balances in table J_2IACCBAL for initial entries for RG registers and PLA registers but the same is not available for extraction in J2I5.
    Could you please advise what the problem is?
    Regards
    Santosh Hegde

    Hi Prasanna,
    We have updated the balance as on 31.03.2007 as per SAP Help. We tried extracting as on 31.03.2007 as well as 01.04.2007.
    Cut over data is as on 31.03.2007 and golive date is 01.04.07.
    Pls help
    Regards
    Santosh Hegde

  • Sale registers and purchase registers

    can anybody help me to know wat do u mean by sales registers and purchase registers.im new to abap and is struggling to understand the flow of there purchase orders and sale orders  and registers.
    im writing a report program where im printing  both sales and purchase registers for a particular period.
    regards...
    Ajith.

    i a sending u the code for sale sregister give reward points if helpful
    Program ID       : zsales_register
    Transaction Code : *
    Author           : Pinak Pani Chaudhuri
    Description      : Sales Register Report
    Project          : SSSL
    Version          : 1.0
    Change History
        Date   |   Programmer   |   Corr. #   |   Description
               |                |             |
               |                |             |
    REPORT  ZSALES_REGISTER
               LINE-SIZE 351
               NO STANDARD PAGE HEADING
               LINE-COUNT 65
               MESSAGE-ID 00.
           TABLES                                                        *
    TABLES: VBRK,                          "Billing Document: Header Data
            VBRP,                          "Billing Document: Item Data
           BKPF,                          "Accounting document header
          t685t,                         "Conditions: Types: Texts
            KNA1,
            KONV.                          "Conditions (Procedure Data)
           INTERNAL TABLES AND STRUCTURES                                *
    *internal table for item data
    DATA: BEGIN OF IT_ITEM OCCURS 0,
             BUDAT LIKE BKPF-BUDAT,
             BELNR LIKE BKPF-BELNR,
             POSNR LIKE VBRP-POSNR,
             VBELN LIKE VBRK-VBELN,
             WERKS LIKE VBRP-WERKS,
             KUNAG LIKE VBRK-KUNAG,
             KNUMV LIKE VBRK-KNUMV,
             NAME1 LIKE KNA1-NAME1,
             BASE_PRICE LIKE KONV-KWERT,
             BAS_EXC_DUTY_RATE LIKE KONV-KBETR,
             BAS_EXC_DUTY_AMT LIKE KONV-KWERT,
             ECESS_RATE LIKE KONV-KBETR,
             ECESS_AMT LIKE KONV-KWERT,
             LST_VAT_RATE LIKE KONV-KBETR,
             LST_VAT_AMT LIKE KONV-KWERT,
             SUBCHARGE_RATE LIKE KONV-KBETR,
             SUBCHARGE_AMT LIKE KONV-KWERT,
             CST_RATE LIKE KONV-KBETR,
             CST_AMT LIKE KONV-KWERT,
             OTHERS LIKE KONV-KWERT,
             V_VAL LIKE KONV-KWERT,
             TOTAL LIKE KONV-KWERT,
          END OF IT_ITEM.
    *internal table to fetch customer name
    DATA: BEGIN OF IT_KNA1 OCCURS 0,
             NAME1 LIKE KNA1-NAME1,
          END OF IT_KNA1.
    *internal table for price data
    DATA: BEGIN OF IT_KONV OCCURS 0,
             KNUMV LIKE KONV-KNUMV,
             KPOSN LIKE KONV-KPOSN,
             KSCHL LIKE KONV-KSCHL,
             KBETR LIKE KONV-KBETR,
             KWERT LIKE KONV-KWERT,
          END OF IT_KONV.
    *Work area fro item internal table
    *data wa_item like it_item.
    *VARIABLES
    DATA: V_VBELN         LIKE VBUK-VBELN,
          V_VAL           LIKE KONV-KWERT,
          TOTAL           LIKE KONV-KWERT,
          V_PR00           LIKE KONV-KWERT,
          V_JEX2           LIKE KONV-KWERT,
          V_JCES           LIKE KONV-KWERT,
          V_JIN2_JIN6           LIKE KONV-KWERT,
          V_ZLSR           LIKE KONV-KWERT,
          V_JIN1           LIKE KONV-KWERT,
          V_OTHERS           LIKE KONV-KWERT,
          V_KSCHL LIKE KONV-KSCHL,
          V_TEMPVAL(15),
          V_BASIC_PRICE    LIKE KONV-KBETR,
          V_REPID   LIKE  SY-REPID.        "For report id
    *SELECTION SCREEN DEFINITIONS
      SELECTION-SCREEN BEGIN OF BLOCK B1.
      SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME TITLE TEXT-000.
      PARAMETERS: P_COMCOD LIKE BKPF-BUKRS." OBLIGATORY.
      SELECT-OPTIONS: S_DATE FOR BKPF-BUDAT." OBLIGATORY.
      SELECTION-SCREEN END OF BLOCK B .
      SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
      SELECTION-SCREEN BEGIN OF LINE.
      PARAMETERS: P_EX1 RADIOBUTTON GROUP RAD1.
      SELECTION-SCREEN COMMENT 5(50) TEXT-EX1.
      SELECTION-SCREEN END OF LINE.
      SELECTION-SCREEN SKIP 1.
      SELECTION-SCREEN BEGIN OF LINE.
      PARAMETERS: P_EX2 RADIOBUTTON GROUP RAD1 DEFAULT 'X'.
      SELECTION-SCREEN COMMENT 5(50) TEXT-EX2.
      SELECTION-SCREEN END OF LINE.
      SELECTION-SCREEN SKIP 1.
      SELECTION-SCREEN END OF BLOCK B2 .
      SELECTION-SCREEN END OF BLOCK B1.
    INITIALIZATION
      INITIALIZATION.
      V_REPID = SY-REPID.
    p_ex1 = 'X'.
    IF P_EX1 = 'X'.
        SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-002.
        PARAMETERS: P_PLANT LIKE VBRP-WERKS." OBLIGATORY.
        SELECTION-SCREEN END OF BLOCK B3 .
    ENDIF.
    *START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM GET_DATA.
    *END-OF-SELECTION
      IF NOT IT_ITEM[] IS INITIAL.
        PERFORM DISPLAY_DATA.
      ELSEif p_plant is initial.
        if p_ex1 = 'X'.
         MESSAGE S011(ZMSG).
        else.
         MESSAGE S012(ZMSG).
        endif.
      else.
       MESSAGE S012(ZMSG).
      ENDIF.
    *&      Form  GET_DATA
          text
    form for get data
    FORM GET_DATA.
    *Getting BKPF-VBRK-VBRP details based on selection values
      IF P_EX1 = 'X' .
        SELECT ABUKRS ABUDAT ABLART ABELNR AAWTYP AAWKEY
               BPOSNR BWERKS B~VBELN
               CKUNAG CVBTYP C~KNUMV
               INTO  CORRESPONDING FIELDS OF TABLE IT_ITEM
               FROM BKPF AS A
               JOIN VBRP AS B
               ON AAWKEY = BVBELN
               JOIN VBRK AS C
               ON BVBELN = CVBELN
               WHERE A~BUKRS = P_COMCOD AND
                     A~BUDAT IN S_DATE AND
                     A~AWTYP = 'VBRK' AND
                     ( A~BLART = 'DR' OR
                       A~BLART = 'DG' OR
                       A~BLART = 'DA' ) AND
                     B~WERKS = P_PLANT.
      ELSEIF P_EX2 = 'X'.
        SELECT ABUKRS ABUDAT ABLART ABELNR AAWTYP AAWKEY
               BPOSNR BWERKS B~VBELN
               CKUNAG CVBTYP C~KNUMV
               INTO  CORRESPONDING FIELDS OF TABLE IT_ITEM
               FROM BKPF AS A
               JOIN VBRP AS B
               ON AAWKEY = BVBELN
               JOIN VBRK AS C
               ON BVBELN = CVBELN
               WHERE A~BUKRS = P_COMCOD AND
                     A~BUDAT IN S_DATE AND
                     A~AWTYP = 'VBRK' AND
                     ( A~BLART = 'DR' OR
                       A~BLART = 'DG' OR
                       A~BLART = 'DA' ).
      ENDIF.
    *Getting KNA1 details based on selection values
      LOOP AT IT_ITEM.
        SELECT SINGLE NAME1 FROM KNA1 INTO IT_KNA1
                            WHERE KUNNR = IT_ITEM-KUNAG.
        APPEND IT_KNA1.
        MOVE IT_KNA1-NAME1 TO IT_ITEM-NAME1.
        MODIFY IT_ITEM.
        CLEAR IT_ITEM.
        CLEAR IT_KNA1.
      ENDLOOP.
    if not it_item[] is initial.
    *Getting pricing for the seleted values
      SELECT KNUMV KPOSN KSCHL KBETR KWERT
             FROM KONV
             INTO TABLE IT_KONV
             FOR ALL ENTRIES IN IT_ITEM
             WHERE KNUMV = IT_ITEM-KNUMV
             AND   KPOSN = IT_ITEM-POSNR.
      LOOP AT IT_KONV.
        IT_KONV-KBETR = IT_KONV-KBETR / 10.
        MODIFY IT_KONV.
        CLEAR IT_KONV.
      ENDLOOP.
    *Filling item table for rest
      PERFORM GET_VALUE.
    ENDFORM.
          FORM DISPLAY_DATA                                             *
      FORM TO DISPLAY OUTPUT                                            *
    TOP-OF-PAGE.
      WRITE: / 'The Sales Register from ', S_DATE-LOW, 'to', S_DATE-HIGH,
               P_COMCOD, P_PLANT.
      SKIP 2.
          FORM DISPLAY_DATA                                             *
    FORM DISPLAY_DATA.
      SORT IT_ITEM BY WERKS VBELN.
      IF P_EX1 = 'X'.
        WRITE: / 'posting date', 16 'billing doc', 30 'sold to party',
        55 'Name', 87 'base price',
        104 'basic exc rate', 122 'basic exc amt', 140 'ecess rate',
        161 'ecess amt', 175 'lst/vat rate', 192 'lst/vat amt',
        209 'surcharge rate', 227 'surcharge amt', 246 'cst rate',
        266 'cst amt', 284 'OTHERS', 301 'sub total'.
        WRITE: SY-ULINE.
        LOOP AT IT_ITEM.
          WRITE: / IT_ITEM-BUDAT, 15 SY-VLINE, 16 IT_ITEM-VBELN,
          30 SY-VLINE, 31 IT_ITEM-KUNAG, 45 SY-VLINE,
          46 IT_ITEM-NAME1, 80 SY-VLINE, 81 IT_ITEM-BASE_PRICE, 98 SY-VLINE,
          99 IT_ITEM-BAS_EXC_DUTY_RATE, 115 SY-VLINE,
          116 IT_ITEM-BAS_EXC_DUTY_AMT, 133 SY-VLINE,
          134 IT_ITEM-ECESS_RATE, 150 SY-VLINE, 151 IT_ITEM-ECESS_AMT,
          168 SY-VLINE, 169 IT_ITEM-LST_VAT_RATE, 185 SY-VLINE,
          186 IT_ITEM-LST_VAT_AMT, 203 SY-VLINE,
          204 IT_ITEM-SUBCHARGE_RATE, 221 SY-VLINE,
          222 IT_ITEM-SUBCHARGE_AMT, 239 SY-VLINE, 240 IT_ITEM-CST_RATE,
          256 SY-VLINE, 257 IT_ITEM-CST_AMT, 274 SY-VLINE,
          275 IT_ITEM-OTHERS, 292 SY-VLINE,
          293 IT_ITEM-V_VAL, 317 SY-VLINE, 318 IT_ITEM-WERKS,
          325 SY-VLINE, 326 IT_ITEM-BELNR.
    *write: sy-uline.
        ENDLOOP.
        WRITE: SY-ULINE.
        SKIP 1.
        WRITE:  81 V_PR00, 116 V_JEX2, 151 V_JCES, 186 V_JIN2_JIN6,
                221 V_ZLSR, 256 V_JIN1, 273 V_OTHERS, 291 IT_ITEM-TOTAL.
      ELSEIF P_EX2 = 'X'.
        SORT IT_ITEM BY WERKS VBELN.
        WRITE: / 'plant', 16 'billing doc', 35 'base price',
        55 'basic exc rate', 75 'basic exc amt', 95 'ecess rate',
        115 'ecess amt', 135 'lst/vat rate', 155 'lst/vat amt',
        175 'surcharge rate', 195 'surcharge amt', 215 'cst rate',
        235 'cst amt', 255 'OTHERS', 275 'sub total'.
        WRITE: SY-ULINE.
        LOOP AT IT_ITEM.
          WRITE: / IT_ITEM-WERKS, 15 SY-VLINE, 16 IT_ITEM-VBELN,
          35 SY-VLINE, 36 IT_ITEM-BASE_PRICE, 55 SY-VLINE,
          56 IT_ITEM-BAS_EXC_DUTY_RATE, 75 SY-VLINE,
          76 IT_ITEM-BAS_EXC_DUTY_AMT, 95 SY-VLINE,
          96 IT_ITEM-ECESS_RATE, 115 SY-VLINE, 116 IT_ITEM-ECESS_AMT,
          135 SY-VLINE, 136 IT_ITEM-LST_VAT_RATE, 155 SY-VLINE,
          156 IT_ITEM-LST_VAT_AMT, 175 SY-VLINE,
          176 IT_ITEM-SUBCHARGE_RATE, 195 SY-VLINE,
          196 IT_ITEM-SUBCHARGE_AMT, 215 SY-VLINE, 216 IT_ITEM-CST_RATE,
          235 SY-VLINE, 236 IT_ITEM-CST_AMT, 255 SY-VLINE,
          256 IT_ITEM-OTHERS, 275 SY-VLINE,
          276 IT_ITEM-V_VAL, 295 SY-VLINE.
    *write: sy-uline.
        ENDLOOP.
        WRITE: SY-ULINE.
        SKIP 1.
        WRITE:  36 V_PR00, 76 V_JEX2, 116 V_JCES, 156 V_JIN2_JIN6,
                196 V_ZLSR, 236 V_JIN1, 256 V_OTHERS, 276 IT_ITEM-TOTAL.
      ENDIF.
    ENDFORM.                               " DISPLAY_DATA
          FORM GET_VALUE                                                *
    TO FETCH THE PRICE FROM IT_KNA1 DEPENDING UPON CONDITION TYPE      *
    FORM GET_VALUE.
    *Getting BASE VALUE
    *clear total.
      LOOP AT IT_ITEM.
        PERFORM GET_PRICE.
      ENDLOOP.
    ENDFORM.
          FORM GET_PRICE                                                *
    FORM GET_PRICE.
      CLEAR V_VAL.
      LOOP AT IT_KONV WHERE KNUMV = IT_ITEM-KNUMV.
                                           " and   kposn = it_item-posnr.
        V_KSCHL = IT_KONV-KSCHL.
        CASE V_KSCHL.
    *For basic value
          WHEN 'PR00'.
            IT_ITEM-BASE_PRICE = IT_ITEM-BASE_PRICE + IT_KONV-KWERT.
            V_VAL = V_VAL + IT_KONV-KWERT.
            V_PR00 = V_PR00 + IT_KONV-KWERT.
          WHEN 'JEX2'.
            MOVE IT_KONV-KBETR TO IT_ITEM-BAS_EXC_DUTY_RATE.
        IT_ITEM-BAS_EXC_DUTY_AMT = IT_ITEM-BAS_EXC_DUTY_AMT + IT_KONV-KWERT.
            V_VAL = V_VAL + IT_KONV-KWERT.
            V_JEX2 = V_JEX2 + IT_KONV-KWERT.
          WHEN 'JCES'.
            IT_ITEM-ECESS_AMT = IT_ITEM-ECESS_AMT + IT_KONV-KWERT.
            V_VAL = V_VAL + IT_KONV-KWERT.
            V_JCES = V_JCES + IT_KONV-KWERT.
          WHEN 'JIN2'.
            IT_ITEM-LST_VAT_AMT = IT_ITEM-LST_VAT_AMT + IT_KONV-KWERT.
            V_VAL = V_VAL + IT_KONV-KWERT.
            V_JIN2_JIN6 = V_JIN2_JIN6 + IT_KONV-KWERT.
          WHEN 'JIN6'.
            IT_ITEM-LST_VAT_AMT = IT_ITEM-LST_VAT_AMT + IT_KONV-KWERT.
            V_VAL = V_VAL + IT_KONV-KWERT.
            V_JIN2_JIN6 = V_JIN2_JIN6 + IT_KONV-KWERT.
          WHEN 'ZLSR'.
            IT_ITEM-SUBCHARGE_AMT = IT_ITEM-SUBCHARGE_AMT + IT_KONV-KWERT.
            V_VAL = V_VAL + IT_KONV-KWERT.
            V_ZLSR = V_ZLSR + IT_KONV-KWERT.
          WHEN 'JIN1'.
            MOVE IT_KONV-KBETR TO IT_ITEM-CST_RATE.
            IT_ITEM-CST_AMT = IT_ITEM-CST_AMT + IT_KONV-KWERT.
            V_VAL = V_VAL + IT_KONV-KWERT.
            V_JIN1 = V_JIN1 + IT_KONV-KWERT.
          WHEN OTHERS.
            IT_ITEM-OTHERS = IT_ITEM-OTHERS + IT_KONV-KWERT.
            V_VAL = V_VAL + IT_KONV-KWERT.
            V_OTHERS = V_OTHERS + IT_KONV-KWERT.
        ENDCASE.
      ENDLOOP.
      TOTAL = TOTAL + V_VAL.
      MOVE V_VAL TO IT_ITEM-V_VAL.
      MOVE TOTAL TO IT_ITEM-TOTAL.
    v_pr00 = v_pr00 + it_item-base_price.
      MODIFY IT_ITEM.
      CLEAR IT_ITEM.
    ENDFORM.                               " GET_PRICE

  • I can not get any updates and therefor not use Java as it only run updates for Mac 10.7. and later? How do i get the updates to install and use Java?

    I can not get ny updates and therefore not use Java, as it only run updates for MAC 10.7. and later. How do i get the updates to install and use JAVA ?

    In Snow Leopard you update Java from Software Update (in the Apple menu). You can check your version by opening Terminal and typing
    java -version
    (don't get creative and type anything else)
    The latest version is 1.6.0_65.

  • Downloading images and audio file using java

    Dear All
    I have a directory on my webserver which contains images,audio files and many other data files.
    I want to download all the file but the problem is when i download image and save it, it is not viewable. I dont want to use Image class as i may have to downlaod audio files too. Please guis which stream shouldi open to download any kind of content using same code.
    Thanks in advance. And if u have some example please let me know
    Regards
    Jafery

    downloading images and audio file using java -------------------------------
    how to write it back to dataoutputstremI don't understand what you are talking about.
    Server: DataOutputStream -> Client: DataInputStream -- the two is a pair.

  • How to access MS Exchange Server Mail and download attachment using Java ??

    Hi guys,
    I need to develop a program to access my inbox from MS Exchange Server and also download the attachment using Java language !! Any example code or any site which got tutorial on this ? Thanks !!

    Here is a java file that connects to a users exchange account, reads all messages, and writes the attachment to the file system.
    import java.io.*;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    public class TestNew {
    public static void main (String args[]) throws Exception {
    // Create empty properties
    Properties props = new Properties();
    // Get session
    Session session = Session.getInstance(props, null);
    // Get the store
    Store store = session.getStore("imap");
    // Connect to store
    store.connect(host, username, password);
    // Get folder
    Folder topFolder = store.getDefaultFolder();
    Folder folder = literature.getFolder("newFolder");
    folder.open(Folder.READ_WRITE);
    Message[] msg = folder.getMessages();
    for(int i = 0; i < msg.length; i++){
    Address[] from = msg.getFrom();
    String subject = msg[i].getSubject();
    Object o = msg[i].getContent();
    if (o instanceof MimeMultipart) { //attachements available?
    MimeMultipart mm = (MimeMultipart) o;
    int mmCount = mm.getCount();
    for (int m = 0; m < mmCount; m++) { // for each part
    Part part = mm.getBodyPart(m);
    String disposition = part.getDisposition();
    if ((disposition != null) && ((disposition.equals(Part.ATTACHMENT) || disposition.equals(Part.INLINE)))) {
    InputStream is = null;
    File tempFile = new File("D:\\TEMP\\mailtest\\" + part.getFileName());
    FileOutputStream fos = null;
    try {
    fos = new FileOutputStream(tempFile);
    is = part.getInputStream();
    int byteCount = 0;
    byte[] bytes = new byte[128];
    while ( (byteCount = is.read(bytes, 0, bytes.length)) > -1) { //use full read() method for GZIPInputStream to be treated correctly
    fos.write(bytes, 0, byteCount);
    finally {
    try {
    if (fos != null)
    fos.close();
    catch (IOException ioe) {}
    try {
    if (is != null)
    is.close();
    catch (IOException ioe) {}
    System.out.println("Content: " + o);
    System.out.println(from[0].toString());
    System.out.println(subject);

  • AIR application and database connectivity (using JAVA)

    Hi
    I am creating AIR application and I want to connect with the database using java database connectivity (JDBC).
    Can any body give me the some suggestion on how to how to do that.
    Please give me any reference for creating AIR application for database connectivity with mysql/access.
    Thanks
    Sameer

    lots of serching on the google and found that For AIR applications either you use Webservices(JAVA/PHP/.Net) or you can use SQLLite.
    Not found any method for direct connectivity with the database using JDBC.
    If any one found direct connecivity withe database using JAVA then please reply.
    Thanks

  • Active Directory accountExpires and pwdLastSet  property using JAVA

    Hi all!
    I´m trying to transform the accountExpires and pwdLastSet property retrieved from Active Directory to a Date/Time object. The value returned is a weird long integer that can´t be converted. Does anyone know something about this?
    I´m using Java 2 SDK 1.4.2.
    I am trying to do the above for accountExpires and pwdLastSet attributes in AD
    Thanks

    DrClap wrote:
    First link returned for Google keywords "active directory date format":
    [http://support.microsoft.com/kb/555936]
    Why, of course, January 1, 1601...

  • How to find cd rom drive in windows and unix platform using java program

    Hi,
    I am having the requirement of finding the cd rom drive
    using java program. I do not know the label and which
    one is the cd rom drive. also I want to know how many
    cd rom drives are there on my system. I want the solution
    for windows and unix platforms.
    If have any suggestions please mail to [email protected]
    Deepak

    Ughhh.. I had the same problem with multi platform file-system detection
    First off - Unix.
    Do you know for sure you have all your drives mounted?? This could be a big problem because java will not see unmounted drives... So you can scour thru your /etc/fstab to find out which drives are available... or you can mount all and show roots... (Yuck!)... You've got timeouts and all sorts of things to worry about...
    I would then shy away from the java.io.File.listRoots() on unix and rely on parsing your fs file. If a user would like to see the medium in the drive. Do a Runtime.exec and mount the drive, then you can grab the filesystem by wrapping it in the java.io.File object. ( NOTE - this will hold well for your NFS mounts as well which might be buried under other FS. So you now have detection for that as well. ) Labels are also noted in this file. Let me know if you don't know the difference between mtab and fstab....
    Second - Winders.... Corney but I love saying that.
    The listRoots is a good solution. As others have said CD-ROMS will not be writable. Use a combination of getName and getPath to decipher the label and mount point.
    Hope this helps!

  • GetSelectedFields()  for time stamp and user stamp using java api

    using Java API's
    getSelectedFields() returns NULL  value if values presented also, for Time stamp and User stamp
    properties in Flat tables , is there any other alternative way to get the SelectedFields values ?
    Edited by: Vijaya Sekhar Reddy Alla on Mar 19, 2008 3:16 PM

    Well, I can't say I solved the problem, because I got another one afterwards.
    As usually I created a GetFieldListCommand, set its needed attributes and executed it. Then I read all the field properties out:
    FieldProperties[] fieldProp = getFieldListCommand.getFields();
    Afterwards it is possible to do what you want. Using a for-loop.
    for (FieldProperties fp : fieldProperties) {
        UserStampFieldProperties usfp = (UserStampFieldProperties) fp; // <= Cast error
        FieldId[] fieldIDs = usfp.getSelectedFields();
    And this is what I get now:
    Exception in thread "main" java.lang.ClassCastException: com.sap.mdm.schema.fields.FixedWidthTextFieldProperties cannot be cast to com.sap.mdm.schema.fields.UserStampFieldProperties
    Why this happens, I don't know. But it should somehow be solveable.

  • Unable to access value in System Environment Variable using Java

    I am using Java code to get the value of a System Environment Variable using the Runtime, Process java classes.
    The code works fine in tomcat, but when deployed in 9ias the code is unable to retrieve the value stored in the System environment variable in Windows 2000.

    Thanks for the comment steve, here is the code which i am using.
         public String getEnvironmentVariable()
                   // This will get the FEDREP_HOME environment variable
                   String FEDREP_HOME = null;
                   Process p = null;
                   Runtime rt = Runtime.getRuntime();
                        try {
                             // invokes a shell-command to retrieve FEDREP_HOME variable
                             String OS = System.getProperty("os.name").toLowerCase();
                                  // Get the Windows 95 environment variable
                                  if (OS.indexOf("windows 9") > -1)
                                            p = rt.exec( "command.com /c echo %FEDREP_HOME%" );
                                  // Get the Windows NT environment variable
                                  else if (OS.indexOf("nt") > -1)
                                            p = rt.exec( "cmd.exe /c echo %FEDREP_HOME%" );
                                  // Get the Windows 2000 environment variable
                                  else if (OS.indexOf("2000") > -1)
                                            p = rt.exec( "cmd.exe /c echo %FEDREP_HOME%" );
                                  // Get the Windows XP environment variable
                                  else if (OS.indexOf("xp") > -1)
                                            p = rt.exec( "cmd.exe /c echo %FEDREP_HOME%" );
                                  // Get the unix environment variable
                                  else if (OS.indexOf("linux") > -1)
                                            p = rt.exec( "sh -c echo $FEDREP_HOME" );
                                  // Get the unix environment variable
                                  else if (OS.indexOf("unix") > -1)
                                            p = rt.exec( "sh -c echo $FEDREP_HOME" );
                                  // Get the unix environment variable
                                  else if (OS.indexOf("sunos") > -1)
                                            p = rt.exec( "sh -c echo $FEDREP_HOME" );
                                  } else
                                            System.out.println("OS not known: " + OS);
                             // set up to read subprogram output
                             InputStream is = p.getInputStream();
                             InputStreamReader isr = new InputStreamReader(is);
                             BufferedReader br = new BufferedReader(isr);
                             // read output from subprogram
                             FEDREP_HOME = br.readLine();
                             br.close();
                        } catch(Exception ex)
                                  System.out.println("Error when getting FEDREP_HOME environment variable");
                                  ex.printStackTrace();
              return(FEDREP_HOME);

  • How to access mobile camera and address book using j2me?

    I m using sun java wireless toolkit 2.5 beta and jdk1.5
    how can i access my mobile camera using j2me ?
    please give some example codes and links .....
    reply as soon as possible.!!!!

    Try this. Hope it help
    try
    Player m_player;
    m_player = Manager.createPlayer("capture://video");
    m_player.realize();
    m_vc = (VideoControl)m_player.getControl("VideoControl");
    m_vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
    m_vc.setDisplayLocation(0, 0);
    m_vc.setDisplayFullScreen(true);
    m_player.start();
    m_vc.setVisible(true);
    catch ( IOException io )
    catch ( MediaException mx)
    Message was edited by:
    RiekeyLee

  • Problem accessing DS 5.1 with SSL using Java

    Hi,
    Could you share with me some guidelines to connect my Java App with my DS 5.1 using SSL?
    My code is:
    import netscape.ldap.*;
    import netscape.ldap.factory.*;
    import org.mozilla.jss.ssl.*;
    public class SSLSample {
    String host;
    String user;
    String password;
    public static final int SSL_PORT = 636;
    public static final String FILTER = "(&(objectclass=inetOrgPerson)(uid=";
    public static final String BASEDN = "dc=siroe,dc=com";
    SSLSample(String h, String u, String p){
    host = h;
    user = u;
    password = p;
    void run(){
    LDAPConnection ld = null;
    String dn = null;
    try {
    ld = new LDAPConnection(new JSSESocketFactory(null));
    ld.connect(host, SSL_PORT);
    String filter = FILTER + user + "))";
    System.err.println("Is connected?: " + ld.isConnected());
    LDAPSearchResults res = ld.search (BASEDN, LDAPv2.SCOPE_SUB, filter, null, false);
    System.err.println("res: " + res);
    if (res != null && res.hasMoreElements ()){
    LDAPEntry entry = res.next();
    dn = entry.getDN();
    System.out.println("User's DN: " + dn);
    } catch(LDAPException e){
    e.printStackTrace();
    } catch(Exception e2){
    e2.printStackTrace();
    } finally {
    try {
    ld.finalize();
    } catch (Exception ex) { }
    public static void main(String [] args){
    if (args.length != 3){
    System.out.println("Usage: SSLSample <server> <user> <passwd>");
    System.exit(-1);
    SSLSample s = new SSLSample(args[0], args[1], args[2]);
    try {
    s.run();
    } catch (Exception e){
    e.printStackTrace();
    The answer of my Output Windows is:
    Is connected?: true
    netscape.ldap.LDAPException: The connection is not available (80); Unknown error
    at netscape.ldap.LDAPConnection.sendRequest(LDAPConnection.java:1809)
    at netscape.ldap.LDAPConnection.search(LDAPConnection.java:2520)
    at netscape.ldap.LDAPConnection.search(LDAPConnection.java:2402)
    at SSLSample.run(SSLSample.java:40)
    at SSLSample.main(SSLSample.java:69)
    Press any key to continue . . .
    And the access log in the IPlanet 5.1 Directory Server is:
    [01/Oct/2002:22:22:04 -0500] conn=2 fd=896 slot=896 SSL connection from 192.168.0.100 to 192.168.0.100
    [01/Oct/2002:22:22:04 -0500] conn=2 SSL 128-bit RC4
    [01/Oct/2002:22:22:04 -0500] conn=2 op=0 SRCH base="dc=siroe,dc=com" scope=2
    filter="(&(objectClass=inetOrgPerson)(uid=jwalker))" attrs=ALL
    [01/Oct/2002:22:22:04 -0500] conn=2 op=0 RESULT err=0 tag=101 nentries=1 etime=0
    [01/Oct/2002:22:22:20 -0500] conn=2 op=1 fd=896 closed - A1
    [01/Oct/2002:23:02:27 -0500] conn=3 fd=896 slot=896 SSL connection from 192.168.0.100 to 192.168.0.100
    [01/Oct/2002:23:02:28 -0500] conn=3 op=0 fd=896 closed - A1
    Please, I will appreciate you all information you could give me.
    Best regards,
    Gregorio

    Do you meant there is no 'subwoofer' in the mixer settings when you set it to 4 speakers (or Quad mode)?
    Its normal. Perfectly normal. Nothing wrong with it. Trust me on that

  • Pls Help--- URGENT... Combining XML file and HTML file Using java program.

    Hi, I need to implemnt this for my project....
    I need to combine XML and HTML file and generate a new HTML file
    Sample XML File:
    <user>
    <txtName>sun</txtName>
    <txtAge>21 </txtAge>
    </user>
    Sample HTML File:
    <body>
    Name: <input type="text" name="txtName" value=""
    Age : <input type="text" Age="txtAge" value=""
    </body>
    I need a java program to combine the above xml and html files and generate the output in HTML.
    Any kind of help is sincerely Appreciated.
    Thanks.

    toucansam wrote:
    So you want us to write it for you? It's pretty straight forward, first parse the xml file with the *[best java xml parser|http://www.google.com/search?&q=parsing+xml+in+java]* and then go through the nodes and construct the html with strings and concatination. Then write the file using *[the best java file writer|http://www.google.com/search?hl=en&q=writing+to+a+file+in+java]*.
    He would do better to use existing tools that make this easy [http://www.ling.helsinki.fi/kit/2004k/ctl257/JavaXSLT/Ch05.html|http://www.ling.helsinki.fi/kit/2004k/ctl257/JavaXSLT/Ch05.html]

  • Problem to access POP3 of MS Exchange Server using Java Mail

    {color:#0000ff}Hi,
    I have a requirement to read emails from my office mailbox using POP3 protocol which is in Microsoft Exchange Server.
    My code is given below.{color}
    {color:#0000ff}*package emailadaptor;*
    import java.util.Properties;
    import javax.mail.Session;
    import javax.mail.Store;
    *public class Test {*
    *public static void main(String[] args) {*
    * // POP3 server name of Exchange Server*
    * String host = "popServer.domain.com";*{color}
    {color:#0000ff}*
    * // User name*
    * String user = "domainName\\userName";*
    * String password = "password";
    * // Get a session. Use a blank Properties object.*
    * Session session = Session.getDefaultInstance(new Properties());
    * try{*
    * // Get a Store object*
    * Store store = session.getStore("pop3");*
    * store.connect(host, user, password);*
    * }catch(Exception e){*
    * e.printStackTrace();*
    *{color:#0000ff}I can ping popServer.domain.com from my machine where I am testing the code.*
    For username I have tried with domainName\\userName and username pattern both but unsuccessful. For example if my username if user1 and my domain name is domain1 than the two patterns I have tried are &lsquo;domain1\\user1&rsquo; and &lsquo;user1&rsquo;.
    For both these cases I am getting same error, and below is my error stack Trace.
    *{color}*
    *{color:#ff0000}javax.mail.AuthenticationFailedException: The requested mailbox is not available on this server.*
    at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:158)
    at javax.mail.Service.connect(Service.java:291)
    at javax.mail.Service.connect(Service.java:172)
    at emailadaptor.Test.main(Test.java:19)
    *{color}*
    *{color:#0000ff}Please give me some idea and steps what is wrong with this code and if any other information is needed then also let me know that.*
    Please help.
    Regards,
    *Gourab{color}
    *{color}

    Turn on session debugging. What does the protocol trace show?
    Are you able to connect with other mail clients, such as Thunderbird?
    (Outlook doesn't count.)

Maybe you are looking for

  • Vendor Consignment stock or vendor managed stock

    Dear All, My client wants to manage vendor consignment stock. Vendor will be given a area and vendor will keep the stock in his area. Based on the plan he will supply the stock. the GR for rawmaterials will be made on the consumption report given by

  • Urgent help for processing XML stream read from a JAR file

    Hi, everyone,      Urgently need your help!      I am reading an XML config file from a jar file. It can print out the result well when I use the following code: =============================================== InputStream is = getClass().getResourceA

  • Out of order library

    I'm running itunes 5.0.1., and yesterday i finally got around upgrading to tiger. anyway, today when i'm trying to play music out of library folder - the songs are playing in a random order. in other words - i do a search function for say "abbey road

  • Gigabit ethernet adapter?

    What is one basicaly? I have looked about but I just don't understand. Thanks

  • Cannot find bean: "bean name" in any scope???? plsssssssssss  Urgent!

    Hi! I have a jsp with Combo boxes, when i select a value of one combo box OnChnage of it the 2nd combo box gets its value dynamically from the database.. Here is my JSP.............................. <script language="JavaScript"> function ELMORG_MNEM


HashFlare