Multi-lingual Java program/problem

Hi,
The following program from the Sun books, is supposed to work with different languages. Except it doesn't!
It has a problem finding the Properties files (?)
It gives the following Exception:
Exception in thread "main" java.util.MissingResourceException: Can't find bundle
for base name MessagesBundle, locale en_GB
here is the Sun program:
import java.util.*;
public class I18NSample {
static public void main(String[] args) {
String language;
String country;
if (args.length != 2) {
language = new String("en");
country = new String("GB");
} else {
language = new String(args[0]);
country = new String(args[1]);
Locale currentLocale;
ResourceBundle messages;
currentLocale = new Locale(language, country);
messages =ResourceBundle.getBundle("MessagesBundle",currentLocale);
System.out.println(messages.getString("greetings"));
System.out.println(messages.getString("inquiry"));
System.out.println(messages.getString("farewell"));
and I have created several properties file (English, French, German, Arabic) as text files. Maybe I have problems with the properties files.
I have followed the steps from the Java Tutorial book from Sun.
Any help would be most welcome.
Akz

First save a java file "MessageBundle.java" in your current directory, for the moment. Then save java files "MessagesBundle_en_GB.java", "MessagesBundle_fr_FR", "MessagesBundle_de_DE" or "MessagesBundle_ar_EG" for example. Compile them to class files.
Then try using your code with various locales.

Similar Messages

  • Multi-lingual Java program

    Hi,
    The following program from the Sun books, is supposed to work with different languages. Except it doesn't!
    It has a problem finding the Properties files (?)
    It gives the following Exception:
    Exception in thread "main" java.util.MissingResourceException: Can't find bundle
    for base name MessagesBundle, locale en_GB
    here is the Sun program:
    import java.util.*;
    public class I18NSample {
    static public void main(String[] args) {
    String language;
    String country;
    if (args.length != 2) {
    language = new String("en");
    country = new String("GB");
    } else {
    language = new String(args[0]);
    country = new String(args[1]);
    Locale currentLocale;
    ResourceBundle messages;
    currentLocale = new Locale(language, country);
    messages =ResourceBundle.getBundle("MessagesBundle",currentLocale);
    System.out.println(messages.getString("greetings"));
    System.out.println(messages.getString("inquiry"));
    System.out.println(messages.getString("farewell"));
    and I have created several properties file (English, French, German, Arabic) as text files. Maybe I have problems with the properties files.
    I have followed the steps from the Java Tutorial book from Sun.
    Any help would be most welcome.
    Akz

    You can create properties files in any text editor, although you're obviously best off with one that can handle the various different characters needed for the different languages.
    As a content managmenet issue, I'd suggest not mixing resource bundles with your compiled class files. For one thing, I believe you can and may need to reuse the same properties file for multiple classes. Also it's easier to manage if things are placed in directories based on type.
    There's no reason you can't create two directories (or directory hierarchies, really) say "classes/" and "resourceBundles/", and then add both directories to your classpath.

  • Java Programming Problem

    Hi all,
    I was looking for this java programming problem which had to do with a large building and there was some gallons of water involved in it too somehow and we had to figure out the height of the buiding using java. This problem is also in one of the java books and I really need to find out all details about this problem and the solution. NEED HELP!!
    Thanks
    mac

    Yes, it will. The water will drain from the bottom of
    the tank until the pressure from the water inside the
    tank equals the pressure from the pipe. In other
    words, without a pump, the water will drain out until
    there is the same amount of water in the tank as in
    the pipe The water pressure depends on the depth of the water, not the volume. So once the depth of the water inside the pipe reaches the same depth as the water inside the tank it will stop flowing. This will never be above the height of the tank.
    I found this applet which demonstrates our problem. If you run it you can drag the guy up to the top, when water in his hose reaches the level of the water in the tank it will stop flowing out.

  • Java program problem

    I'm doing this to practise for a competition on Tuesday, if someone can show me how it works, it would be great. I have been stuck on this for a long time. Thank you very much.
    When a share of common stock of some company is sold, the capital gain (or, sometimes loss) is the difference between the share's selling price and the price originally paid to buy it. This rule is easy to understand for a single share, but if we sell multiple shares of stock bought over a long period of time, then we must identify the shares actually being sold. A standard accounting principle for identifying which shares of a stock were sold in such a case is to use a FIFO protocol (i.e., the shares sold are the ones that have been held the longest). Indeed, this is the default method built into several personal finance software packages. Note, however, that it is also possible to use a LIFO protocol (i.e., the shares sold are the ones that were most recently purchased). As an example, suppose we buy 100 shares at $20 each on day 1, 20 shares at $24 on day 2, 200 shares at $36 on day 3, and then sell 150 shares on day 4 at $30 each. Then applying the FIFO protocol means that of the 150 shares sold, 100 were bought on day 1, 20 were bought on day 2, and 30 were bought on day 3. The capital gain for the LIFO case would therefore be 100(30 - 20) + 20(36 - 30) + 30(30 - 36) or $940. Applying the LIFO protocol, on the other hand, means that of the 150 shares sold, all 150 were bought on day 3. The capital gain (or loss in this case) for the LIFO case would therefore be 150(30 - 36) or -$900.
    Create a class named Stock that implements the Tradable interface:
    public interface Tradable {
    public void buy(int numberShares, int pricePerShare);
    public void sell(int numberShares, int pricePerShare);
    public int getCapitalGain();
    Write a Java program that takes as input a sequence of transactions of the form:
    buy x share(s) of stock y at $z each
    -or-
    sell x share(s) of stock y at $z each
    Assume the transactions occur on consecutive days (with respect to each stock). The values of x and z are integers, and the value of y is a string representing the name of the stock. Given this input, the output should be the total capital gain (or loss) for the entire sequence (i.e., all of the activity on all of the client's stocks) using the LIFO protocol to identify shares. Assume that no more than 10 transactions occur for any given stock.
    Modify your code so Stock is observable. Notifications should be sent whenever there is a negative capital gain (i.e., loss) that occurs as the result of the sale of some stock.
    There are two types of observers, traders and their spouses. Create a class named Trader that implements the Observer interface. Both traders and spouses should be instances of Trader. When the trader receives a notification about a capital loss, he/she should output the string "Oh no, what is my spouse going to think!". The spouse should give his/her spouse three chances for each stock (i.e., output "That's your first chance", "That's your second chance", and then finally "That's enough of that!"). After the third chance, the spouse should stop observing the trading activity. Note that traders can observe at most 2 stocks simultaneously.
    Create 5 instances of Stock and 8 instances of Trader that are inter-related and defined in the following table:
    Stock Trader Spouse(s)
    Microsoft Bill Linda
    HP Linda Bill
    IBM Joe
    Dell Susy Jack
    Bob
    Gateway Jack Susy
    Beth
    Mary
    Test your program on various combinations of trading activity.

    I'm doing this to practise for a competition on Tuesday, if someone can show me how it worksUnless I've missed something in your post, there is nothing to show. You've only posted a set of requirements. It works when someone writes code that fulfills the requirement. What are you having trouble with?

  • Java program problems

    Hello all. I've posted for help on this exact same program before, but I'm just having a heck of a time with this.
    Basically, the output should look sometime like this:
    Name Item Value No.Sold Amount
    Joe 1 $2.00 2 $4.00
    2 $3.00 2 $6.00
    Total Amount: $10.00
    Then you should get an option to add another employee using sentinel controlled repetition. So far, this is the code I've got. I came up with most of it, but one of the helpful users here helped me with the rest...
    import javax.swing.*;
    import javax.swing.JOptionPane;
    import javax.swing.JTextArea;
    import java.text.NumberFormat;
    import java.util.Locale;
    public class Pay1 {
    public static void main( String args[] )
    JTextArea outputArea = new JTextArea( 20, 40 );
    JScrollPane scroller = new JScrollPane( outputArea );
    String header = outputArea.getText();
    outputArea.setText(
    "Employee \tItem \tItem Value \tNumber Sold \tDollar Amount" );
    String output, employeeName, itemNumber, itemValue, numberItemsSold;
    int item, sold;
    double value, dollaramount;
    boolean whileLoop = true;
    while ( whileLoop )
    employeeName = JOptionPane.showInputDialog(
    "Enter an employee name" + "\nPress Enter to keep entering data"
    + "\ntype \"exit\" to quit" );
    if ( employeeName.equalsIgnoreCase( "exit" ) )
    break;
    itemNumber = JOptionPane.showInputDialog( "Item number" );
    numberItemsSold = JOptionPane.showInputDialog( "Number of items sold" );
    itemValue = JOptionPane.showInputDialog( "Item value" );
    item = Integer.parseInt( itemNumber );
    sold = Integer.parseInt( numberItemsSold );
    value = Double.parseDouble( itemValue );
    NumberFormat mf = NumberFormat.getCurrencyInstance( Locale.US );
    dollaramount = sold * value;
    output = employeeName + "\t" + item + "\t"
    + mf.format( value ) + "\t" + sold
    + "\t" + mf.format( dollaramount );
    String tmp = outputArea.getText();
    outputArea.setText( tmp + "\n" + output );
    JOptionPane.showMessageDialog( null, scroller, "Payroll Data",
    JOptionPane.PLAIN_MESSAGE );
    System.exit ( 0 );
    I spoke with the instructor in the class, and thought I understood how to do this, but I really just can't get it. If I saw how somebody else did it, then I think I would understand it alot better. So anybody could please help me with this, I would sooo greatly appreciate it. Thanks in advance.

    yep, but slight change,
    import javax.swing.*;
    import javax.swing.JOptionPane;
    import javax.swing.JTextArea;
    import java.text.*;
    import java.util.*;
    public class Pay1 {
          public static void main( String args[] ) {
          JTextArea outputArea = new JTextArea( 20, 40 );
          JScrollPane scroller = new JScrollPane( outputArea );
          outputArea.setText("Employee \tItem \tItem Value \tNumber Sold \tDollar Amount");
          String output, employeeName, itemNumber, itemValue, numberItemsSold;
          int item, sold;
          double value, dollaramount,total=0;
          boolean whileLoop = true;
          String prev = "";
          while (whileLoop ) {
             employeeName = JOptionPane.showInputDialog("Enter an employee name" +
                                         "\nPress Enter to keep entering data" +
                                         "\ntype \"exit\" to quit" );
             if (employeeName.equalsIgnoreCase( "exit" ) ) break;
             if( prev.equalsIgnoreCase( employeeName ) )
                employeeName = "";
             else
                prev = employeeName;
             itemNumber = JOptionPane.showInputDialog( "Item number" );
             numberItemsSold = JOptionPane.showInputDialog( "Number of items sold" );
             itemValue = JOptionPane.showInputDialog( "Item value" );
             item = Integer.parseInt( itemNumber );
             sold = Integer.parseInt( numberItemsSold );
             value = Double.parseDouble( itemValue );
             NumberFormat mf = NumberFormat.getCurrencyInstance( Locale.US );
             dollaramount = sold * value;
             total+=dollaramount;
             String tmp = outputArea.getText();
             int i=tmp.indexOf("Total Amount")-4;  // get rid of total line if present
             if (i<0) i=tmp.length()-1;
             output = employeeName + "\t" + item + "\t" + mf.format( value ) + "\t" +
                sold + "\t" +  mf.format( dollaramount ) +
                "\n\t\t\tTotal Amount:\t"+mf.format (total);   // add total line
             outputArea.setText( tmp.substring(0,i) + "\n" + output );
             JOptionPane.showMessageDialog( null, scroller, "Payroll Data", JOptionPane.PLAIN_MESSAGE );
          System.exit (0 );
    }

  • JAVA�@Program Problems�iMemory Copy�j

    ���L���R�[�h�����s������
    The Result of Execute
    ��
    import java.util.HashMap;
    import java.util.Map;
    public class Test {
         * @param args
        public static void main(String[] args) throws Exception{
            Map map = new HashMap();
            Map in1 = new HashMap();
            in1.put("1", "test1");
            in1.put("2", "test2");
            in1.put("3", "test3");
            map.put("1", in1);
            Map in2 = new HashMap();
            in2 = ((HashMap)map.get("1"));
            map.put("2", in2);
            HashMap out1 = (HashMap)map.get("1");
            out1.put("2","testusotukijin");
            map.put("1", out1);
            System.out.println(map);
    }       ��RESULT�F{2={3=test3, 2=testusotukijin, 1=test1}, 1={3=test3, 2=testusotukijin, 1=test1}}
    I want result of
    ��
    RESULT�F{2={3=test3, 2=test2, 1=test1}, 1={3=test3, 2=testusotukijin, 1=test1}}�@�@�@
    Help me!

    hi
    in that program finally in1,in2,out1 has same
    reference.
    values "test1" "test2" "test3" (strings) will be
    stored in string pool.whenever we do something in any
    one object ,it will reflect in string pool
    so only we are getting that resultThis has nothing to do with the string pool. It has to do with the fact that both "1" and "2" reference the same HashMap.
    (S)He does the following:
    HashMap map = new HashMap();
    HashMap in1 = new HashMap();
    // assignments into in 1
    map.put("1", in1);
    HashMap in2 = new HashMap();
    in2 = map.get("1");  // this throws away the previously (in2) created HashMap
    /* in2 now references the same HashMap as in1.  Changes to the
    * object (HashMap) referenced by either one of these variables
    * affects the object (HashMap) referenced by both variables because
    * they are THE SAME OBJECT.
    */

  • O Dear! Basic Java Programming problem!

    import java.lang.*;
    import java.util.*;
    import java.io.*;
    import java.net.*;
    import java.util.Random;
    public class QuizApp extends Object
         public static void main(String[] argStrings) throws Exception
              Random random = new Random();
              int generateFirstFigure = random.nextInt(21);
              int generateSecondFigure = random.nextInt(31);
              int generateOperator = random.nextInt(3);
              String operator = "/";
              int correctAnswer = generateFirstFigure + generateSecondFigure;
              if (generateOperator == 0)
                   operator = "+";
                   int correctAnswer = generateFirstFigure + generateSecondFigure;
              if (generateOperator == 1)
                   operator = "-";
                   int correctAnswer = generateFirstFigure - generateSecondFigure;
              if (generateOperator == 2)
                   operator = "/";
                   int correctAnswer = generateFirstFigure / generateSecondFigure;
              //int correctAnswer = generateFirstFigure + operator + generateSecondFigure;
              int incorrectAnswerOne = correctAnswer -2;
              int incorrectAnswerTwo = correctAnswer + 1;
              int incorrectAnswerThree = correctAnswer + 3;
              String questionOne = "What is " + generateFirstFigure + operator + generateSecondFigure + "?"; 
              System.out.println(questionOne);
              System.out.println(incorrectAnswerThree);
              System.out.println(incorrectAnswerOne);
              System.out.println(correctAnswer);
              System.out.println(incorrectAnswerTwo);
    }Basically this code, creates 2 random characters and then allows you to either add, divide or subtract the two numbers... firstly this bit of the code doesnt work, secondly how can the user input a value (the answer) to the math's question?
    Thanks for help,
    Joel

    practissum wrote:
    dketcham, i printed out your hello world pumpkin. its a huge hit in the office!Sorry for propogating the off-topic remarks...but link to the hello world pumpkin?it was the friday coding challenge for last week:
    http://forum.java.sun.com/thread.jspa?threadID=5230548&messageID=9941964#9941964
    It's all about the pretty colors, and trying to squish a simple little program into a squarish-shape, so that another shape can be put within!
    As you can see, I have no real programming skills, but I like pretty colors, so it's all good.

  • Should I upgrade to Lion from 10.6.8 to improve stability of Java program i am running?

    I have a Java program problem, it's unstable and losing connection and freezing. Will an upgrade to Lion from 10.6.8 help?
    thanks

    they don't claim it but it is. I have never had a problem with the 2008 macbook, just the desktop. Narrowed it down to this after trying everything else speaking with Scottrade, Oracle and Apple.
    I tried to downgrade but got lost at the utilitoes terminal part. any easier way? Apple wont help me downgrade through my care program and I have no idea.
    Thanks

  • Multi Lingual String not getting displayed properly with Java 1.5.4

    Hi,
    I have a strange problem and i think the problem is due to java 1.5.4.
    Problem is:
    My application was previously deployed on weblogic6.1 server and jdk used was 1.3.1
    After i migrated my application to weblogic 9.2 and started using jdk 1.5.4, i am not able to correctly view the data which is stored in different languages on browser.
    Some more details:
    OS - Linux.
    Database - Informix 9.2
    Intresting part is :
    If i enter a new multi lingual string from my application (deployed on WLS 9.2 with JDK 1.5.4) and store it in database, and then try to retreive it, it is displayed correctly.
    Issue arises only when the multi lingual string created and stored in database from my old application (deployed on WLS 6.1 with JDK 1.3.1) is retrieved and displayed in the new application (WLS 9.2 with JDK 1.5.4).
    Hope my issue is clear and if any one has any clue as to how to solve this issue. Kindly help

    One thread is enough.
    http://forum.java.sun.com/thread.jspa?messageID=9651015

  • Helps!:How to start multi process in a single java program?

    I wanna to test the querying performance of a Database
    connection poll,and here,not only multi threads,but also multi process I need to start in the same java program cause i have only one PC available.....
    Does that possible?

    In pure java this is not possible.
    A java program with all its thread run in a single
    jvm,
    which is just one process.However, you can have multiple instances of the jvm, I've done it w/ I needed to test some row locking in my database app. If you are in windows and want 3 copies of you program just make a bat file that looks likejavaw.exe -classpath "classesGoHere" MainClass
    javaw.exe -classpath "classesGoHere" MainClass
    javaw.exe -classpath "classesGoHere" MainClassThat will create 3 instances of the jvm and thus three instances of your application. I'm sure the same can be done on multiple platforms.
    Peter

  • Problem while calling a Webservice from a Stand alone java program

    Hello Everyone,
    I am using a java program to call a webservice as follows. For this I have generated the client proxy definition for Stand alone proxy using NWDS.
    Now when I call the method of the webservice I am getting the correct result but along with the result I am getting one error and one warning message in the output.
    The java code to call the webservice is as follows.
    public class ZMATRDESCProxyClient {
         public static void main(String[] args) throws Exception {
              Z_MATRDESC_WSDService ws = new Z_MATRDESC_WSDServiceImpl();
              Z_MATRDESC_WSD port = (Z_MATRDESC_WSD)ws.getLogicalPort("Z_MATRDESC_WSDSoapBinding",Z_MATRDESC_WSD.class);
              String res = port.zXiTestGetMatrDesc("ABCD134");
              System.out.print(res);
    The result I am getting is :
    Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.MessageIdProtocol] could not be loaded (NoClassDefFoundError) !
    Error Message is :com/sap/guid/GUIDGeneratorFactory
    <b>Material Not Found</b> -
    > This is the output of webservice method and it is right.
    Can any one please let me know why I am getting the warning and error message and how can I fix this.
    Thanks
    Abinash

    Hi Abinash,
    I have the same problem. Have you solve that problem?
    I am using a java program to call a webservice too. And I have generated the client proxy definition for Stand alone proxy using NWDS. When I call the method of the webservice I am getting the correct result but along with the result I am getting one error and one warning message in the output.
    The java code to call the webservice is as follows.
    MIDadosPessoaisSyncService service = new MIDadosPessoaisSyncServiceImpl();
    MIDadosPessoaisSync port = service.getLogicalPort("MIDadosPessoaisSyncPort");
    port._setProperty("javax.xml.rpc.security.auth.username","xpto");
    port._setProperty("javax.xml.rpc.security.auth.password","xpto");
    String out = port.MIDadosPessoaisSync("xpto", "xpto");
    System.out.println(out);
    The result I am getting is :
    Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.MessageIdProtocol] could not be loaded (NoClassDefFoundError) !
    Error Message is :com/sap/guid/GUIDGeneratorFactory
    <b>The result of the WS is correct!!!</b>
    The Java project does not have any warning. But the stand alone proxy project has following warnings associated with it.
    This method has a constructor name     MIDadosPessoaisSync.java     
    The import javax.xml.rpc.holders is never used     MIDadosPessoaisSyncBindingStub.java     
    The import javax.xml.rpc.encoding is never used     MIDadosPessoaisSyncBindingStub.java     
    The constructor BaseRuntimeException(ResourceAccessor, String, Throwable) is deprecated     MIDadosPessoaisSyncBindingStub.java
    It is very similar with your problem, could you help me?
    Thanks
    Gustavo Freitas

  • Problems running a java program

    Hello,
    I have absolutely no java experience whatsoever, and I need to fix a program that suddenly stopped running properly after several years without problems. Basically, I have a perl script that calls a java program. Everytime I run this perl script from the web browser, the java program returns an internal error:
    # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://www.blackdown.org/cgi-bin/jdk # # Error ID: 5649525455414C53504143450E4350500024 # # Problematic Thread: prio=5 tid=0x804e680 nid=0x6d16 runnable #
    However, when I run the perl script command line, it runs fine. I added the -verbose option to the java call, and I discovered that the program stops running after it opens the .jar files but before it loads them .... these files have full read permissions, so I don't think that's the problem. Any ideas?
    Thanks!

    ...fix a program that suddenly stopped running properly after several years without problems.Which means either the program changed or the environment changed. I would guess the environment. The most likely possibilities: new version of the operating system, new version of perl, new version of java. Also possible: new version installed of any of the previous without removing older versions, new software not associated with the first, new mapped drives and/or changed env vars.

  • Problem in Creating New position in Siebel CRM 7.8 using java program

    Hi
    We have Siebel CRM with Business Object and Business Component as Position.
    Position Business Component has a manadatory pick list Division.
    When we try to create a new Position by picking the Divison then we are getting the below error
    Logged in OK!
    picking the list
    in the pick() method before
    <Exception>
    <Major No.>256</Major No.><Minor No.>21944</Minor No.><Message>An error has occurred picking the current row.
    Please continue or ask your systems administrator to check your application configuration if the problem persists.(SBL-DAT-00292)</Message><DetailedMessage>Unknown<DetailedMessage>
    <Exception>
    <com.siebel.om.sisnapi.i>
    <Major No.>256</Major No.><Minor No.>21944</Minor No.><Message>An error has occurred picking the current row.
    <Error><ErrorCode>21944</ErrorCode> <ErrMsg>An error has occurred picking the current row.
    Please continue or ask your systems administrator to check your application configuration if the problem persists.(SBL-DAT-00292)</Message><DetailedMessage>Unknown<DetailedMessage>
    Please continue or ask your systems administrator to check your application configuration if the problem persists.(SBL-DAT-00292)</ErrMsg></Error>
    <com.siebel.om.sisnapi.i>
    <Error><ErrorCode>21735</ErrorCode> <ErrMsg>Siebel eScript runtime error occurred in procedure 'BusComp_SetFieldValue' of BusComp [Position]:
    <Error><ErrorCode>21944</ErrorCode> <ErrMsg>An error has occurred picking the current row.
    ConversionError 1616: Undefined and Null types cannot be converted to an object.
    Please continue or ask your systems administrator to check your application configuration if the problem persists.(SBL-DAT-00292)</ErrMsg></Error>
    (SBL-SCR-00141)</ErrMsg></Error>
    <Error><ErrorCode>21735</ErrorCode> <ErrMsg>Siebel eScript runtime error occurred in procedure 'BusComp_SetFieldValue' of BusComp [Position]:
    <Error><ErrorCode>21735</ErrorCode> <ErrMsg>Stack trace:
    BusComp [Position].BusComp_SetFieldValue(), Line: 1110</ErrMsg></Error>
    ConversionError 1616: Undefined and Null types cannot be converted to an object.
    </com.siebel.om.sisnapi.i></Exception>
    (SBL-SCR-00141)</ErrMsg></Error>
    <Error><ErrorCode>21735</ErrorCode> <ErrMsg>Stack trace:
    BusComp [Position].BusComp_SetFieldValue(), Line: 1110</ErrMsg></Error>
    </com.siebel.om.sisnapi.i></Exception>
    at com.siebel.data.SiebelBusComp.pick(SiebelBusComp.java:241)
    at siebelconn.main(siebelconn.java:44)
    Java program
    import com.siebel.data.*;
    import com.siebel.data.SiebelException;
    class siebelconn {
    public static void main (String args [])
    SiebelDataBean m_dataBean = null;
    SiebelBusObject m_busObject = null;
    SiebelBusComp m_busComp = null;
    SiebelBusComp picklistBC = null;
         try{
    m_dataBean = new SiebelDataBean(); //Create Siebel JDB instance
    m_dataBean.login("XXXX", "XXX", "XXX");
         System.out.println("Logged in OK!");
    m_busObject = m_dataBean.getBusObject("Position");
    m_busComp = m_busObject.getBusComp("Position");
    m_busComp.newRecord(false);
    picklistBC = m_busComp.getPicklistBusComp("Division");
    picklistBC.clearToQuery();
    picklistBC.setViewMode(3);
    picklistBC.setSearchSpec("Name", "idmtest");
    //picklistBC.executeQuery(true);
    picklistBC.executeQuery2(true,true);
    if(picklistBC.firstRecord())
    System.out.println("picking the list");
    picklistBC.pick();
    System.out.println("records are there");
    m_busComp.setFieldValue("Name","Access GE HQ 11");
    m_busComp.writeRecord();
    }//if
         if(m_busObject!=null)
    m_busObject.release();
    if(m_busComp!=null)
    m_busComp.release();
    if(picklistBC!=null)
    picklistBC.release();
    if(m_dataBean!=null)
    m_dataBean.logoff();
    catch(Exception e)
    System.out.println(e);e.printStackTrace();
    if(m_busObject!=null)
    m_busObject.release();
    if(m_busComp!=null)
    m_busComp.release();
    if(picklistBC!=null)
    picklistBC.release();
    try
    if(m_dataBean!=null)
    m_dataBean.logoff();
    }catch(Exception e1){System.out.println(e1);}
    Can any body please help us.
    Thanks

    From the error code, it looks like you have a scripting error in the BusComp_SetFieldValue event on the Position
    business component in your application.
    Have you tried to look at that code or to turn of scripting for the application as a total?
    Axel

  • Multi-lingual Translator component in java?

    hello all,
    I want to make a Multi-lingual Translator component in java
    which can be used to convert any existing web site(developed
    using any technology asp/jsp etc) to any foreign language
    viz german, spanish,italian and other major foreign
    languages.
    Please let me know how do i proceed in java with respect to
    the following?:
    1. It has to be developed as a component in java such that
    it can be included in any existing web site as a control
    which simply gives the users the option of converting
    either the current web page from english to any other
    foreign language or simply the entire web site from
    english to any other foreign language
         How to develop it as a component so that it can be
    independently merged into any existing web site(whether
    asp or jsp) as a control? which technology should i be
    using here EJB's or Applets or any other?
    I personally think it can be a applet because with EJB's
    container/application server is required.
    what do you all suggest?
    2. I don't want to use any free translators that are
    available freely on net these days, because a lot of them
    re-directs to their own translation page and includes
    their own banners and or advertisements etc., which may
    not be feasible with us as we have to include this
    utility on our company's web sites
    3. How much time it should take approximately to develop?
    4. If there's any free tool available however without the
    limitations as mentioned above in point 2, then i am not
    averse to using it please let me know if such a tool is
    available.
    5. Please also let me know if there exists already a multi-
    lingual component in java with source code freely
    available anywhere on net, then please give me the link.
    This will help me save a lot of time in developing it.
    Please let me know the answers to above of my queries and
    u"ll be doing a great deal of help here.
    Thanks in advance
    sd76

    JS supports UTF-8... assuming the browser has the proper fonts.
    // _lang.jsp
    <%@ page language="java" contentType="text/html; charset=UTF-8" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
         <title>Language Test</title>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </head>
    <body bgcolor="#ffffff" background="" text="#000000" link="#ff0000" vlink="#800000" alink="#ff00ff">
    <%
    request.setCharacterEncoding("UTF-8");
    String str = "\u7528\u6237\u540d";
    String name = request.getParameter("name");
    // OR instead of setCharacterEncoding...
    //if(name != null) {
    //     name = new String(name.getBytes("ISO8859_1"), "UTF8");
    System.out.println(application.getRealPath("/"));
    System.out.println(application.getRealPath("/src"));
    %>
    req enc: <%= request.getCharacterEncoding() %><br />
    rsp enc: <%= response.getCharacterEncoding() %><br />
    str: <%= str %><br />
    name: <%= name %><br />
    <script language="Javascript">
    alert('<%= name %>'); // should show correctly
    </script>
    <form method="POST" action="_lang.jsp">
    Name: <input type="text" name="name" value="" >
    <input type="submit" name="submit" value="Submit POST" />
    </form>
    <br />
    <form method="GET" action="_lang.jsp">
    Name: <input type="text" name="name" value="" >
    <input type="submit" name="submit" value="Submit GET" />
    </form>
    </body>
    </html>

  • Please help me in this tough problem in Java...im just new in Java program

    my teacher give this as a problem. so tough. we are just starting and we are now in control structures. please help me to finish this problem. And my problem is...
    Write an astrology program. The user types in his or her birthday(month,day,year),
    and the program responds with the user's zodiac sign, the traits associated with each sign
    the user's age(in years,months,day), the animal sign for the year(e.g., Year of the Pig,
    Year of the Tiger), the traits associated with each animal sign, and if the year is a leap
    year or not. The dates covered for each sign can be searched through the horoscope section
    of a newspaper or through the internet. Then enhance your program so that if the user is one
    or two days away from the adjacent sign, the program outputs the nearest adjacent sign as well
    as the traits associated with the nearest sign. The month may be entered as a number from 1 to 12
    or in words, i.e.,January to December. Limit the year of the birthday from 1900 to 2010 only.
    The program should allow the user to repeat the entire process as often as desired.
    You can use:
    import java.text.DateFormat;
    import java.util.Date;
    import java.util.Calendar;
    please...those who are genius out there in java program...help us to pass this project. Im begging! thanks!

    Frowner_Stud wrote:
    According to the second commandment: Thou shall not use the name of the Lord in vain.Is this not the definition of ironic, Mr. Morality?
    i am not cheating. And more of the same.
    we all know that an assignment is an assignment. a homework. homework means you can raise other help from somebody so that you will know the answer.You're not asking for "help" bucko, because you've been given decent help but have chosen to ignore it. No, you're asking for someone to do the work for you, and you may call it what you want, but in anyone else's book, that's cheating.
    dont be fool enough to reply if you dont know the reason why i am typing here Don't be fool enough to think that you can control who can or can't respond.
    because if you are in my part and if i know the answer there is no doubt that i will help you as soon as possible! Just because you have low morals doesn't mean that the rest of us do.
    Thanks for time of reading and God bless you including you family!and to you and yours. Have a blessed day.

Maybe you are looking for

  • URGENT:problem with memory using swing component

    We use Java SDK 1.4.0-b92 on a Sun Blade Machine with Solaris 8 Operating System. We developed a software with a GUI (JFame, JInternalFrame) which have to be refreshed in precise moments and any time we do it there is a big loss of memory(not the Jav

  • Issue while creating Absence Quota for one employee

    Hi Friends, Our customer has a weird issue. When time evaluation is run, One Absence Quota type (Leave in Bank) is not getting generated for Only One Employee. This leave type has been updated with quota in IT 2006 after running PT60 for all other em

  • How do i unlock my ipod on itunes?

    i would like to know how to unlock my pod off of the computer. I let my friend use my ipod and now she has locked me out. Can you plz help me get it unlocked.

  • How to find memory used by page tables

    Is there a way to find out how much memory is currently being used by page tables? I am new to Solaris ;-) I want to quantify the advantages of Intimate Shared Memory (in the context of a large Oracle database with lots of concurrent users). I want t

  • Change of profitability document

    Hello Can anybody tell me about it is possible to change a COPA segment in a FI document without reversing/reposting the FI document? I know it is possible to create a profitability document via KE21N and display a document via KE23, but no KE22... B