WL 6.1 ArrayOutOfBounds exception

I recently installed WebLogic 6.1 and jdk 1.4.0 on my RedHat 7.2 box.
It seems to install without issue but when I attempt to start the
server this is what I get:
$ ./setEnv.sh
LD_LIBRARY_PATH=/var/www2/bea/wlserver6.1/lib/linux/i686:/var/www2/bea/wlserver6.1/lib/linux/i686/oci816_8
CLASSPATH=/usr/local/java/j2sdk1.4.0/lib/tools.jar:/var/www2/bea/wlserver6.1/lib/weblogic_sp.jar:/var/www2/bea/wlserver6.1/lib/weblogic.jar:
PATH=/var/www2/bea/wlserver6.1/bin:/usr/local/java/j2sdk1.4.0/jre/bin:/usr/local/java/j2sdk1.4.0/bin:/var/www2/bea/wlserver6.1/lib/linux:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/pwhite/bin
Your environment has been set.
$ ./startWebLogic.sh
LD_LIBRARY_PATH=/var/www2/bea/wlserver6.1/lib/linux/i686:/var/www2/bea/wlserver6.1/lib/linux/i686/oci816_8
* To start WebLogic Server, use the password *
* assigned to the system user. The system *
* username and password must also be used to *
* access the WebLogic Server console from a web *
* browser. *
[UnixLoginModule]: succeeded importing info:
uid = 525
gid = 100
supp gid = 100
supp gid = 101
[UnixLoginModule]: added UnixPrincipal,
UnixNumericUserPrincipal,
UnixNumericGroupPrincipal(s),
to Subject
The WebLogic Server did not start up properly.
Exception raised:
java.lang.ArrayIndexOutOfBoundsException
at com.bea.utils.misc.ProcessUtil.base64ToBytes(ProcessUtil.java:552)
at com.bea.utils.misc.Process.validate(Process.java:1231)
at com.bea.utils.misc.Process.isValidSignature(Process.java:518)
at com.bea.utils.misc.ProcessManager.memCheck(ProcessManager.java:647)
at weblogic.t3.srvr.T3Srvr.checkAccess(T3Srvr.java:286)
at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:343)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:202)
at weblogic.Server.main(Server.java:35)
Reason: Fatal initialization exception
I have searched around the WebLogic site and Google and could not find
anything helpful.
Pete

Hi.
If you still see this when running with the JDK (1.3.1_01) that comes with the WLS installation then you should open a case with support. Also, if you are not already doing so you should install service
pack 2 for WLS.
Regards,
Michael
Pete Keiper-White wrote:
Thanks you for the response. I tried using it with 1.3.1_03 and got an
identical error.
Pete
Michael Young <[email protected]> wrote in message news:<[email protected]>...
Hi.
JDK isn't supported yet for WLS. What happens when you use JDK 1.3.1?
Regards,
Michael
Pete Keiper-White wrote:
I recently installed WebLogic 6.1 and jdk 1.4.0 on my RedHat 7.2 box.
It seems to install without issue but when I attempt to start the
server this is what I get:
$ ./setEnv.sh
LD_LIBRARY_PATH=/var/www2/bea/wlserver6.1/lib/linux/i686:/var/www2/bea/wlserver6.1/lib/linux/i686/oci816_8
CLASSPATH=/usr/local/java/j2sdk1.4.0/lib/tools.jar:/var/www2/bea/wlserver6.1/lib/weblogic_sp.jar:/var/www2/bea/wlserver6.1/lib/weblogic.jar:
PATH=/var/www2/bea/wlserver6.1/bin:/usr/local/java/j2sdk1.4.0/jre/bin:/usr/local/java/j2sdk1.4.0/bin:/var/www2/bea/wlserver6.1/lib/linux:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/pwhite/bin
Your environment has been set.
$ ./startWebLogic.sh
LD_LIBRARY_PATH=/var/www2/bea/wlserver6.1/lib/linux/i686:/var/www2/bea/wlserver6.1/lib/linux/i686/oci816_8
* To start WebLogic Server, use the password *
* assigned to the system user. The system *
* username and password must also be used to *
* access the WebLogic Server console from a web *
* browser. *
[UnixLoginModule]: succeeded importing info:
uid = 525
gid = 100
supp gid = 100
supp gid = 101
[UnixLoginModule]: added UnixPrincipal,
UnixNumericUserPrincipal,
UnixNumericGroupPrincipal(s),
to Subject
The WebLogic Server did not start up properly.
Exception raised:
java.lang.ArrayIndexOutOfBoundsException
at com.bea.utils.misc.ProcessUtil.base64ToBytes(ProcessUtil.java:552)
at com.bea.utils.misc.Process.validate(Process.java:1231)
at com.bea.utils.misc.Process.isValidSignature(Process.java:518)
at com.bea.utils.misc.ProcessManager.memCheck(ProcessManager.java:647)
at weblogic.t3.srvr.T3Srvr.checkAccess(T3Srvr.java:286)
at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:343)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:202)
at weblogic.Server.main(Server.java:35)
Reason: Fatal initialization exception
I have searched around the WebLogic site and Google and could not find
anything helpful.
Pete
Michael Young
Developer Relations Engineer
BEA Support

Similar Messages

  • ArrayOutOfBound exception thrown in JAI API

    Hi
    I am getting exception ArrayOutOfBound exception for one of my image sample that i tried.
    The code snippet is
    src is a BufferedImage.
    IndexColorModel icm = (IndexColorModel)src.getColorModel();
    int numBands = 3;
    if(icm.hasAlpha()) numBands = 4;
    byte[][] data = new byte[numBands][icm.getMapSize()];
    if(icm.hasAlpha())
    icm.getAlphas(data[3]);
    icm.getReds(data[0]);
    icm.getGreens(data[1]);
    icm.getBlues(data[2]);
    LookupTableJAI lut = new LookupTableJAI(data);
    dst = (JAI.create("lookup", src, lut)).getAsBufferedImage();
    java.lang.ArrayIndexOutOfBoundsException: 255
         at javax.media.jai.LookupTableJAI.lookup(LookupTableJAI.java:1244)
         at javax.media.jai.LookupTableJAI.lookup(LookupTableJAI.java:1016)
         at com.sun.media.jai.opimage.LookupOpImage.computeRect(LookupOpImage.java:173)
         at javax.media.jai.PointOpImage.computeTile(PointOpImage.java:914)
         at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
         at javax.media.jai.OpImage.getTile(OpImage.java:1129)
         at javax.media.jai.PlanarImage.copyData(PlanarImage.java:2343)
         at javax.media.jai.RenderedOp.copyData(RenderedOp.java:2299)
         at javax.media.jai.PlanarImage.getAsBufferedImage(PlanarImage.java:2525)
         at javax.media.jai.PlanarImage.getAsBufferedImage(PlanarImage.java:2546)
    Thanks in advance.

    Hi,
    it seems that the module processing is not working, if the flag keep attachments is not checked.
    Best regards,
    Nils Kloth

  • How to resolve arrayoutofbounds exception on android?

    public void fetchcontent() throws IOException
                        this.open();
                        ContentValues values = new ContentValues();
                        String csvFilename = "/mnt/sdcard/content.csv";
                        // ArrayList<String> al=new ArrayList();
                        CSVReader csvReader = new CSVReader(new FileReader(csvFilename));
                        //String row[] = null;
                        while((row = csvReader.readNext()) != null) {
                        st1 = row[0];
                        values.put(DatabaseHandler.Column1,st1);
                        st2= row[1];
                        values.put(DatabaseHandler.Column2,st2);
                        st3= row[2];
                        values.put(DatabaseHandler.Column3,st3);
                        st4= row[3];
                        values.put(DatabaseHandler.Column4,st4);
                        st5= row[4];
                        values.put(DatabaseHandler.Column5,st5);
                        database.insert(DatabaseHandler.Table_Name, null, values);
                        csvReader.close();
                        MainActivity.tt1.append("\ncontent table created");
    this is my code for inserting data into a table i have created by i am getting arrayoutofbounds exception ..i am a newbiee please guys help..............................
    this is the logcat output
    02-21 16:27:54.308: E/AndroidRuntime(12511): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.webdata/com.example.webdata.MainActivity}: java.lang.ArrayIndexOutOfBoundsException: length=3; index=3

    Hi.
    Please always specify the version of JDeveloper you are using when you post.
    You are getting this message because the call to <tt>csvReader.readNext()</tt> returns an array with three elements instead of four at least once. You should check your CSV file to see if it contains invalid rows.
    Best Regards,
    Frédéric.

  • IsCallerInRole throws "ArrayOutOfBounds" exception

    If I create a domain from a Weblogic Server Template that I made, a call to "isCallerInRole" from an EJB will throw an ArrayOutOfBounds exception. The template for the server is very vanilla. If I create a domain from scratch I do not get this error. The test is on a Windows 2000 OS running Weblogic server 8.1 sp2, also it occurs on both secure and non-secure T3 connections.
    Here are some other debugging tasks I did on the instance creating the error but error still exists:
    1. Tried creating a new security realm and making it default.
    2. Redeployed EJB.
    3. Compared config.xml and startWeblogic.cmd files from a good instance to a bad one, no differences.
    Any ideas?
    Thanks.

    well,
    f (newCount <= oldCount)
    highest = oldCount;
    else
    highest = newCount;
    should be other way round:
    f (newCount > oldCount)
    highest = oldCount;
    else
    highest = newCount;
    otherwise you get this exception

  • ArrayOutOfBound Exception??!!!WHY

    Dea Forum Members,
    i need some help with my following code -
    private void display() {
         int counter = 0;
         for(char letter = 'A'; letter < 'Z'; letter++) {     
         if(counter == tokenCount) {
         break;
         else {
         rows[letter-'A'].rowDisplay(letter);
         counter++;
    This is actually a part of a cinema hall booking program where the row and seats will be displayed.tokenCount(an instance variable in this class) is the total number of Rows - row[0] is depicted as row 'A' and row[25] is depcited as row 'Z' for the purpose of display.the number of rows ie. tokenCount is being read from a text file....that may be 1 or 2 or maximum 26.row[i] is an object of a row class and rowDisplay(char) is a method of row class for displaying the seats of a particular row object.
    so if the total number of rows(tokenCount) be 2 the for loop should be executed till 'B' only and then it will come out of the for loop as i have issued a break; command.the variable counter is keeping track of the total number of rows processed and if it matches tokenCount,it shud encounter the break; command and come out of the for loop so that further no more array is the loop is processed.so if tokenCount is 2....only row[0] and row[1] will be processed and it will come out of the for loop.but in practise while i am executing the program...i am receing an error as follows -
    ArrayIndexOutOfBoundsException:2
    at BookingProcess.display<BookingProcess.java:92>
    where BookingProcess is the Class containing the method private void display()
    pls do help me with ur suggestions......
    Regards
    RK

    ArrayIndexOutOfBoundsException:2
    at BookingProcess.display<BookingProcess.java:92>
    where BookingProcess is the Class containing the
    method private void display()On line 92 in BookingProcess.java, you're trying to access index 2 of an array that has, at most, elements 0 and 1.
    Can't say any more than that from the information you've provided.
    When you post code, please use [code] and [/code] tags.

  • Life Simulation ~~ Lost in Too many Else/If clauses ~~ Weird Exceptions :)

    Hello
    I decided to code the "Simulation of Life" problem (It is such a common sense algorithm, I feel if I write down the rules here I'll be flamed for assuming readers are not educated enough :S )
    My String array is a 20 by 20 area. Living cells are O , the others are just a blank space.
    I have a randomizer method that randomly places cells. Which works OK.
    A display method to print out the array in console (for now..) which works OK for the first time
    An update method which checks the cells one by one and decides if it is going to live or not. Now this is not the trivial part. Cells at 4 corners, Cells on rows 0 || 19, and cells on columns 0 || 19 are special cases. All the rest are updated depending on the 8 neighbors. I have soooooooooooooooooooo many ifs and elses in this method, sometimes I get a ArrayOutOfBounds exception which happens inside an if clause that only operates if the cell doesnt have row 0 or 19 , column 0 or 19, totally not on a side or corner. Says index is 20, which is impossible :(
    When I remove the mentioned lines, the display method doesn't update and print a new array.
    When I can get this else/if torture, I ll write another code which simulates a plague traveling in the array and make the 2 simulations communicate (virus location will be sent to first simulation, to kill that cell) on a midware for simulations (pRTI).
    Here is my monstrously amateur code
    import se.pitch.prti1516.FederateAmbassadorImpl;
    import se.pitch.prti1516.RTI;
    import hla.rti1516.AttributeHandle;
    import hla.rti1516.FederateAmbassador;
    import hla.rti1516.FederateHandle;
    import hla.rti1516.FederationExecutionAlreadyExists;
    import hla.rti1516.ObjectClassHandle;
    import hla.rti1516.RTIambassador;
    import java.io.File;
    import java.net.MalformedURLException;
    import java.net.URL;
    import javax.swing.JOptionPane;
    public class simOne {
         public String federateType;
         public FederateAmbassador fedAmb;
         public String federationExecutionName;
         public String hostname;
         public int portnumber;
         public RTIambassador rti;
         public FederateHandle federateHandle;
         public String [][] cells = new String[20][20];
         public simOne () throws MalformedURLException, Exception {
         //GET RTI AMBASSADOR
         hostname = "195.87.237.50";
         portnumber = 8989;     
              rti = RTI.getRTIambassador(hostname, portnumber);
              File file = new File("C:\\Documents and settings\\basary\\Desktop\\Workspace\\HelloWorld\\hello.xml");
                   URL url = null;
                        java.net.URI url1 = null;
                                  try {
                                            url1 = file.toURI();
                                            url = url1.toURL();
                                  } catch (MalformedURLException e) {
         //CREATE FEDERATE EXECUTION
                                  federationExecutionName = "Hello";
                 try {                                      
                           rti.createFederationExecution(federationExecutionName, url);
                                } catch (FederationExecutionAlreadyExists e)
       //JOIN FEDERATION EXECUTION                                 
                                     FederateAmbassador fedAmb = null;
                                          String federateType = "Hello";
                                          federateHandle = rti.joinFederationExecution(federationExecutionName, federateType, fedAmb, null);
       //DECLARE PARAMETERS/OBJECTS TO BE PUBLISHED AND/OR REGISTERED                                           
                                          ObjectClassHandle helloClassHandle = rti.getObjectClassHandle("ObjectRoot.Hello.Name");
                                          AttributeHandle greetingHandle = rti.getAttributeHandle(helloClassHandle, "Name1");
                                          AttributeHandle typeHandle = rti.getAttributeHandle(helloClassHandle, "type");
         public static void main (String []args) throws Exception{
              simOne life = new simOne();
              life.setCells();
              life.displayCommune();
              life.updateGeneration();
              life.displayCommune();
              life.updateGeneration();
              life.displayCommune();
              life.updateGeneration();
              life.displayCommune();
              life.updateGeneration();
              life.displayCommune();
              life.updateGeneration();
              life.displayCommune();
         private void setCells() {
              // TODO Auto-generated method stub
              for (int row = 0; row<=19; row++)               
                   for (int column= 0; column<=19 ; column++)
                        int randomize = (int) (100* Math.random());
                        if (randomize < 50)
                             cells [row][column] = "O";
                        else
                             cells [row][column] = " ";
         private void displayCommune() {
              // TODO Auto-generated method stub
              for (int row=0; row <= 19 ; row++ )
                   for (int column= 0; column <= 19 ; column ++)
                   System.out.print(cells[row][column]);     
                   System.out.println("");
              System.out.println("");
         private void updateGeneration() {
              // TODO Auto-generated method stub
              for (int row = 0; row <= 19; row++)
                        for (int column = 0; column <= 19; column++)
                             int liveOnes = 0;
                             //if not alive
                             if ( cells[row][column].equals(""))
                             if (row == 0)
                                  if (column == 0)
                                       if (cells[row][column+1].equals("O"))
                                            liveOnes++;
                                       if (cells[row+1][column].equals("O"))
                                            liveOnes++;
                                       if (cells[row+1][column+1].equals("O"))
                                            liveOnes++;
                        else if (column == 19 )     
                                       if (cells[row][column-1].equals("O"))
                                            liveOnes++;
                                       if (cells[row+1][column-1].equals("O"))
                                            liveOnes++;
                                       if (cells[row+1][column].equals("O"))
                                            liveOnes++;
                   else
                                       if (cells[row][column-1].equals("O"))
                                            liveOnes++;
                                       if (cells[row][column+1].equals("O"))
                                            liveOnes++;
                                       if (cells[row+1][column+1].equals("O"))
                                            liveOnes++;
                                       if (cells[row+1][column-1].equals("O"))
                                            liveOnes++;
                                       if (cells[row+1][column].equals("O"))
                                            liveOnes++;
                   else if (row == 19)
                                  if (column == 0)
                                       if (cells[row-1][column].equals("O"))
                                            liveOnes++;
                                       if (cells[row-1][column+1].equals("O"))
                                            liveOnes++;
                                       if (cells[row][column+1].equals("O"))
                                            liveOnes++;
                        else if (column == 19 )     
                                       if (column == 0)
                                            if (cells[row-1][column].equals("O"))
                                                 liveOnes++;
                                            if (cells[row-1][column-1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row][column-1].equals("O"))
                                                 liveOnes++;
                        else
                                       if (column == 0)
                                            if (cells[row-1][column].equals("O"))
                                                 liveOnes++;
                                            if (cells[row-1][column-1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row-1][column+1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row][column-1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row][column+1].equals("O"))
                                                 liveOnes++;
         else if (row != 0 || row != 19)
                                  if (column == 0)
                                       if (cells[row-1][column].equals("O"))
                                            liveOnes++;
                                       if (cells[row+1][column].equals("O"))
                                            liveOnes++;
                                       if (cells[row-1][column+1].equals("O"))
                                            liveOnes++;
                                       if (cells[row][column+1].equals("O"))
                                            liveOnes++;
                                       if (cells[row+1][column+1].equals("O"))
                                            liveOnes++;
                                  else if (column == 19 )     
                                       if (cells[row+1][column-1].equals("O"))
                                            liveOnes++;
                                       if (cells[row][column-1].equals("O"))
                                            liveOnes++;
                                       if (cells[row-1][column-1].equals("O"))
                                            liveOnes++;
                                       if (cells[row-1][column].equals("O"))
                                            liveOnes++;
                                       if (cells[row+1][column].equals("O"))
                                            liveOnes++;
                        else if ((column != 0 || column != 19) && (row != 0 || row != 19))
                                  if (cells[row-1][column-1].equals("O"))
                                       liveOnes++;
                                  if (cells[row-1][column].equals("O"))
                                       liveOnes++;
                                  if (cells[row-1][column+1].equals("O"))
                                       liveOnes++;
                                  if (cells[row][column-1].equals("O"))
                                       liveOnes++;
                                  if (cells[row][column+1].equals("O"))
                                       liveOnes++;
                                  //life rules to revive an unliving cell here
                             if (liveOnes >= 3)
                                  cells[row][column] = "O";
                             // if alive
                                  else if ( cells[row][column].equals("O")) {
                                  int alive= 0;
                                  if (row == 0)
                                       if (column == 0)
                                            if (cells[row][column+1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row+1][column].equals("O"))
                                                 liveOnes++;
                                            if (cells[row+1][column+1].equals("O"))
                                                 liveOnes++;
                                       else if (column == 19 )     
                                            if (cells[row][column-1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row-1][column-1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row+1][column].equals("O"))
                                                 liveOnes++;
                                       else
                                            if (cells[row][column-1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row][column+1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row+1][column+1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row+1][column-1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row+1][column].equals("O"))
                                                 liveOnes++;
                                  else if (row == 19)
                                       if (column == 0)
                                            if (cells[row-1][column].equals("O"))
                                                 liveOnes++;
                                            if (cells[row+1][column+1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row][column+1].equals("O"))
                                                 liveOnes++;
                                       else if (column == 19 )     
                                            if (column == 0)
                                                 if (cells[row-1][column].equals("O"))
                                                      liveOnes++;
                                                 if (cells[row-1][column-1].equals("O"))
                                                      liveOnes++;
                                                 if (cells[row][column-1].equals("O"))
                                                      liveOnes++;
                                       else
                                            if (column == 0)
                                                 if (cells[row-1][column].equals("O"))
                                                      liveOnes++;
                                                 if (cells[row-1][column-1].equals("O"))
                                                      liveOnes++;
                                                 if (cells[row-1][column+1].equals("O"))
                                                      liveOnes++;
                                                 if (cells[row][column-1].equals("O"))
                                                      liveOnes++;
                                                 if (cells[row][column+1].equals("O"))
                                                      liveOnes++;
                                  else
                                       if (column == 0)
                                            if (cells[row-1][column].equals("O"))
                                                 liveOnes++;
                                            if (cells[row+1][column].equals("O"))
                                                 liveOnes++;
                                            if (cells[row-1][column+1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row][column+1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row+1][column+1].equals("O"))
                                                 liveOnes++;
                                       else if (column == 19 )     
                                            if (cells[row+1][column-1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row][column-1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row-1][column-1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row-1][column].equals("O"))
                                                 liveOnes++;
                                            if (cells[row+1][column].equals("O"))
                                                 liveOnes++;
                                       else
                                            if (cells[row-1][column-1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row-1][column].equals("O"))
                                                 liveOnes++;
                                            if (cells[row-1][column+1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row][column-1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row][column+1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row+1][column-1].equals("O"))
                                                 liveOnes++;
                                            if (cells[row+1][column].equals("O"))
                                                 liveOnes++;
                                            if (cells[row+1][column+1].equals("O"))
                                                 liveOnes++;
         }          //see if a living cell will die or not
                        if (liveOnes <= 2)
                          cells[row][column]="";     
                        else if (liveOnes >= 4)
                             cells[row][column]="";
    }Thanks for the help if you can find the courage to delve into those ifs and elses :)

    instead of exposing a 2D array of Strings, why not create classes Grid and Cell? Grid will have an implementation of a 2D grid of Cells.
    part of the problem with your logic is that you have to continually deal with whether or not an array has been allocated properly and whether or not the reference it holds is null. stop doing that. create the Grid to contain the number of cells it needs, all non-null. Initialize each Cell so it's 100% ready to go - not nul, with proper state.
    Give the Grid the rules for changing the state of each Cell, and let the Cell hang onto the state. I think it'll go better that way.
    %

  • ArrayList() problems

    Hi!
    I need a little help getting an ArrayList to work. I am refactoring some of the classes in one of the O'Reilly books for a class assignment. I believe that I cannot get my ArrayList to add elements into itself. I'm not quite sure what I'm doing wrong. I'll post the code below. The problem arises in the last part of the code (at least I think it does) where i can't get my variable "size" (see the "for loop" below) to be resolved. I have tried initializing the variable at the beginning of the entire class in which case I can get the file to compile to a class. But when I run the class, I still get an ArrayOutOfBounds exception letting me know that my array is still initialized to 1 when i believe that and my index is a larger number (the number I input into the console). the message I get from the command line is:
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Error:
    java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.ArrayList.get(ArrayList.java:326)
    at MyFactorial.computeFactorialCacheB(MyFactorial.java:115) // this would be the second line of the "for" loop
    at MyFactorial.main(MyFactorial.java:134)
    Any help would be greatly appreciated. Thanks in advance.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Here is my code
         public static synchronized BigInteger computeFactorialCacheB(String s) {
         private static int size;
    ArrayList table = new ArrayList();
              table.add(BigInteger.valueOf(1));
              int x = 0;
              try {
                   x = Integer.parseInt(s);
              catch (NumberFormatException e) {
                   System.out.println("the number you enter must be an integer");
              if (x<0) {
                   throw new IllegalArgumentException("x must not be a negative number");     
              else {
                   for(int size = table.size(); size <= x; size++);{
                        BigInteger lastfact = (BigInteger)table.get(size-1);
                        BigInteger nextfact = lastfact.multiply(BigInteger.valueOf(size));
                        table.add(nextfact);
              return (BigInteger) table.get(size-1);
         }

    Thanks for your reply.
    As I said in my original posting, I am refactoring code from one of the O'Reilly books for an assignment. So no, this isn't all my code, just some of it (copyright is duly noted in my assignment).
    The semicolon was a great cach (thanks!) I truly didn't see it. The issue of the "size" variable is what I am trying to solve. When I originally entered the code int my IDE (eclipse) the first declaration of int size inside the for loop was OK but subsequent references to it (still in the for loop) wouldn't resolve.
         for(int size = table.size(); size <= x; size++){
               BigInteger lastfact = (BigInteger)table.get(size-1);
               BigInteger nextfact = lastfact.multiply(BigInteger.valueOf(size));
                    table.add(nextfact);Hence the experimentation with the "size" variable. The use of the ArrayList was one of the parameters of the assignment. I see what you mean by creating a new list each time. The purpose of the method is to return a factorial (n!) using a BigInteger. This loop is pretty much just as it came out of O'rilley. It seems to work fine in their rendition (I guess that's why they get to write books).
    Tanks so much for your help. I'll refactor again and repost (probably tomorrow).
    � regards!

  • Print to screen OR file problem, need help please.

    Hiyo!, im doing a certain program the way to Uni wants me to do it so im using a textFile jar file for all the reading writing etc, i know its not standard java but thats not what im having trouble with.
    Im trying to make a prog that will print its results to screen if the only augument on the command line is the file to read from eg.( java ProgramThree input.txt ).
    but if two arguments are written on the command line eg.( java ProgramThree input.txt output.txt ) then it
    will print the results to the file (output.txt) and not display to screen.
    I know that its just that ive messed up a couple of the "args.length" statments in main() , but my brain gets confused easy :[
    Any help would be sweet. Thanks.
    class ProgramThree
            public static String calc(String line)
                String type[] = {"Valid Isosceles","Valid Equilateral","Valid Scalene","Invalid"};
                String result = null;
              int s1 = 0;
              int s2 = 0;
              int s3 = 0;
              try
                   StringTokenizer st = new StringTokenizer(line);
                   s1 = Integer.parseInt(st.nextToken());
                   s2 = Integer.parseInt(st.nextToken());
                   s3 = Integer.parseInt(st.nextToken());
              catch (Exception e) {e.printStackTrace();}
              if ((s1+s2>s3)&&(s1+s3>s2)&&(s2+s3>s1))
                   if((s1==s2)||(s1==s3)||(s2==s3))
                        if((s1==s2)&&(s1==s3))
                             result = type[1];
                        else
                             result = type[0];
                   else
                        result = type[2];
              else
                   result = type[3];
              return result;
            public static void printScreen(String result)
              System.out.println("\nTriangle is: " +result+ "\n");
            public static void main(String args[])
              String line = null;
              String result = null;
                    if(args.length > 2)
                      System.out.println("Too many Filenames Given!");
                      System.exit(1);
                    textFile inFile = new textFile(args[0], 'r');
                    textFile outFile = new textFile(args[1], 'a');
              while(!inFile.EOF())
                   line = inFile.readLine();
                   if(line == null)
                        break;
                   result = calc(line);
                   if(args.length == 0)
                        printScreen(result);
                   else
                                 outFile.writeLine(result);
                        System.out.println("\nResults written to file.");
              inFile.closeFile();
              outFile.closeFile();
              return;
    }

    Thanks for your reply neil!
    But im not to sure how I would impliment your code into my program :0
    The code that I posted before is throwing an arrayOutOfBounds exception at the line
    inFile = new textFile(args[0], 'r');
    outFile = new textFile(args[1], 'a'); <-----------Here
    This happens if I enter none or one auguments on the command line :/
    But if I enter two auguments it works fine and writes to file..
    I know its because when there is one augument on the command line (or none at all) it opens to outFile for nothing, because its printing to screen?
    The thing is i dont know how to fix this :[
    -thanks

  • Problem in getting the image through URL

    hi all,
    I facing the problem,Inwhich i am unable find the solution...I am using the following code to display the image
    public void doGet(HttpServletRequest request,HttpServletResponse response)
                        throws IOException, ServletException {
                   int data=0;
                   response.setContentType("image/png");
                   ServletOutputStream out = response.getOutputStream();
                   String file = request.getContextPath()+imageNames[0];
                   //String file = "C:/Program Files/Apache Group/Tomcat 4.1/webapps/ImageComm/WEB-INF/images"+imageNames[index];
                   BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));
                   System.out.println("the size of the inputStream is..."+in.available());
                   System.out.println("the context path is..."+request.getContextPath());          
                   while ((data = in.read()) != -1) {
                   out.write(data);
    with the above i am not getting any error at the compile time but it was giving exception like FileNotFoundException.
    but the same thing(URL address) when i am copying on the browser it was displayig the image.
    (what might be the reason)
    one more thing when i commented on the url address and try to use the actual realpath address it was displaying the image with out any problem
    can anybody give me the solution like where to keep my images by which i can able to get the images through url address
    thanks in advance
    lakshman

    hi all,
    I am getting the image from the server.but the problem is i am getting the Exception as ArrayOutOfBound exception.
    It was displaying the Image for the first time.and when ever it was going for the second time in to the paint method it was displaying the IOException in reading the stream from the connection.
    can anybody give me the solution in rectifying that exception.
    thanks in advance
    lakshman

  • Error trying to convert float to expanded form for a check application

    I am writing a program to generate a check, but when it tries to parse the Float (netpay) into a String in expanded form (e.g. 1.23 becomes 1 dollar and twenty-three cents) it throws weird arrayOutOfBounds exceptions
    * Check.java
    * Created on January 23, 2008, 9:55 AM
    package payrollapplication;
    public class Check extends javax.swing.JFrame {
    public Employee emp;
    String expanded;
    /** Creates new form Check */
    boolean debug = true;
    public Check() {
    initComponents();
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
    private void initComponents() {
    date = new javax.swing.JLabel();
    jPanel1 = new javax.swing.JPanel();
    name = new javax.swing.JLabel();
    amtexpanded = new javax.swing.JLabel();
    amtnum = new javax.swing.JLabel();
    empid = new javax.swing.JLabel();
    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("EMP Name Here");
    setAlwaysOnTop(true);
    setCursor(new java.awt.Cursor(java.awt.Cursor.CROSSHAIR_CURSOR));
    setResizable(false);
    addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowActivated(java.awt.event.WindowEvent evt) {
    formWindowActivated(evt);
    date.setText("DATE");
    jPanel1.setBackground(new java.awt.Color(102, 102, 0));
    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGap(0, 429, Short.MAX_VALUE)
    jPanel1Layout.setVerticalGroup(
    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGap(0, 62, Short.MAX_VALUE)
    name.setText("NAME");
    amtexpanded.setText("AMT EXPANDED");
    amtnum.setText("AMT #");
    empid.setText("EMPID");
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(10, 10, 10)
    .addComponent(amtexpanded, javax.swing.GroupLayout.DEFAULT_SIZE, 342, Short.MAX_VALUE))
    .addComponent(name, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
    .addComponent(amtnum, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addComponent(date, javax.swing.GroupLayout.DEFAULT_SIZE, 71, Short.MAX_VALUE)
    .addComponent(empid, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
    .addContainerGap())
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addGap(14, 14, 14)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(date)
    .addComponent(name))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(amtnum)
    .addComponent(amtexpanded, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(empid)
    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    pack();
    }// </editor-fold>
    private void formWindowActivated(java.awt.event.WindowEvent evt) {                                    
    initDisplay(); //Computes the expanded form of the number and fills the windows with information
    amtexpanded.setText(expanded);
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new Check().setVisible(true);
    public void initDisplay() {
    try {
    amtnum.setText("$"+emp.netpay); //Fill in the net pay
    name.setText(""+emp.fname+" "+emp.mname+" "+emp.lname+" "+emp.suffix); //Fill in the name
    System.out.println("NOT YET IMPLEMENTED");
    expanded = "";
    //begin to compute the expanded form
    //determine the length of the left side of the decimal
    expanded = emp.netpay+"";
    String[] split = expanded.split(".");
    int length = split[0].length();
    //Now we compute the first half of the number
    int wholeLength = split[0].length();
    char[] arr = split[0].toCharArray(); //create the character array
    expanded = ""; //Clear it
    if(length == 3) {
    System.out.println("Length of 3, working...");
    //Assume we are starting at the one thousands
    //Since 0 is 1, we need to test for 3 for 1,000s not 4
    switch(arr[3]) {
    case '1': expanded = "One Thousand ";
    case '2': expanded = "Two Thousand ";
    case '3': expanded = "Three Thousand ";
    case '4': expanded = "Four Thousand ";
    case '5': expanded = "Five Thousand ";
    case '6': expanded = "Six Thousand ";
    case '7': expanded = "Seven Thousand ";
    case '8': expanded = "Eight Thousand ";
    case '9': expanded = "Nine Thousand ";
    switch(arr[2]) {
    case '1': expanded = expanded + "One-Hundred ";
    case '2': expanded = expanded + "Two-Hundred ";
    case '3': expanded = expanded + "Three-Hundred ";
    case '4': expanded = expanded + "Four-Hundred ";
    case '5': expanded = expanded + "Five-Hundred ";
    case '6': expanded = expanded + "Six-Hundred ";
    case '7': expanded = expanded + "Seven-Hundred ";
    case '8': expanded = expanded + "Eight-Hundred ";
    case '9': expanded = expanded + "Nine-Hundred ";
    switch(arr[1]) {
    case '0': {
    switch(arr[0]) {
    case '0': expanded = expanded + "";
    case '1': expanded = expanded + "and One";
    case '2': expanded = expanded + "and Two";
    case '3': expanded = expanded + "and Three";
    case '4': expanded = expanded + "and Four";
    case '5': expanded = expanded + "and Five";
    case '6': expanded = expanded + "and Six";
    case '7': expanded = expanded + "and Seven";
    case '8': expanded = expanded + "and Eight";
    case '9': expanded = expanded + "and Nine";
    case '1': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Ten";
    case '1': expanded = expanded + "and Eleven";
    case '2': expanded = expanded + "and Twelve";
    case '3': expanded = expanded + "and Thirteen";
    case '4': expanded = expanded + "and Fourteen";
    case '5': expanded = expanded + "and Fifteen";
    case '6': expanded = expanded + "and Sixteen";
    case '7': expanded = expanded + "and Seventeen";
    case '8': expanded = expanded + "and Eighteen";
    case '9': expanded = expanded + "and Nineteen";
    case '2': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Twenty";
    case '1': expanded = expanded + "and Twenty-One";
    case '2': expanded = expanded + "and Twenty-Two";
    case '3': expanded = expanded + "and Twenty-Three";
    case '4': expanded = expanded + "and Twenty-Four";
    case '5': expanded = expanded + "and Twenty-Five";
    case '6': expanded = expanded + "and Twenty-Six";
    case '7': expanded = expanded + "and Twenty-Seven";
    case '8': expanded = expanded + "and Twenty-Eight";
    case '9': expanded = expanded + "and Twenty-Nine";
    case'3': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Thirty";
    case '1': expanded = expanded + "and Thirty-One";
    case '2': expanded = expanded + "and Thirty-Two";
    case '3': expanded = expanded + "and Thirty-Three";
    case '4': expanded = expanded + "and Thirty-Four";
    case '5': expanded = expanded + "and Thirty-Five";
    case '6': expanded = expanded + "and Thirty-Six";
    case '7': expanded = expanded + "and Thirty-Seven";
    case '8': expanded = expanded + "and Thirty-Eight";
    case '9': expanded = expanded + "and Thirty-Nine";
    case '4': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Fourty";
    case '1': expanded = expanded + "and Fourty-One";
    case '2': expanded = expanded + "and Fourty-Two";
    case '3': expanded = expanded + "and Fourty-Three";
    case '4': expanded = expanded + "and Fourty-Four";
    case '5': expanded = expanded + "and Fourty-Five";
    case '6': expanded = expanded + "and Fourty-Six";
    case '7': expanded = expanded + "and Fourty-Seven";
    case '8': expanded = expanded + "and Fourty-Eight";
    case '9': expanded = expanded + "and Fourty-Nine";
    case '5': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Fifty";
    case '1': expanded = expanded + "and Fifty-One";
    case '2': expanded = expanded + "and Fifty-Two";
    case '3': expanded = expanded + "and Fifty-Three";
    case '4': expanded = expanded + "and Fifty-Four";
    case '5': expanded = expanded + "and Fifty-Five";
    case '6': expanded = expanded + "and Fifty-Six";
    case '7': expanded = expanded + "and Fifty-Seven";
    case '8': expanded = expanded + "and Fifty-Eight";
    case '9': expanded = expanded + "and Fifty-Nine";
    case '6': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Sixty";
    case '1': expanded = expanded + "and Sixty-One";
    case '2': expanded = expanded + "and Sixty-Two";
    case '3': expanded = expanded + "and Sixty-Three";
    case '4': expanded = expanded + "and Sixty-Four";
    case '5': expanded = expanded + "and Sixty-Five";
    case '6': expanded = expanded + "and Sixty-Six";
    case '7': expanded = expanded + "and Sixty-Seven";
    case '8': expanded = expanded + "and Sixty-Eight";
    case '9': expanded = expanded + "and Sixty-Nine";
    case '7': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Seventy";
    case '1': expanded = expanded + "and Seventy-One";
    case '2': expanded = expanded + "and Seventy-Two";
    case '3': expanded = expanded + "and Seventy-Three";
    case '4': expanded = expanded + "and Seventy-Four";
    case '5': expanded = expanded + "and Seventy-Five";
    case '6': expanded = expanded + "and Seventy-Six";
    case '7': expanded = expanded + "and Seventy-Seven";
    case '8': expanded = expanded + "and Seventy-Eight";
    case '9': expanded = expanded + "and Seventy-Nine";
    case '8': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Eighty";
    case '1': expanded = expanded + "and Eighty-One";
    case '2': expanded = expanded + "and Eighty-Two";
    case '3': expanded = expanded + "and Eighty-Three";
    case '4': expanded = expanded + "and Eighty-Four";
    case '5': expanded = expanded + "and Eighty-Five";
    case '6': expanded = expanded + "and Eighty-Six";
    case '7': expanded = expanded + "and Eigthy-Seven";
    case '8': expanded = expanded + "and Eighty-Eight";
    case '9': expanded = expanded + "and Eighty-Nine";
    case '9': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Ninety";
    case '1': expanded = expanded + "and Ninety-One";
    case '2': expanded = expanded + "and Ninety-Two";
    case '3': expanded = expanded + "and Ninety-Three";
    case '4': expanded = expanded + "and Ninety-Four";
    case '5': expanded = expanded + "and Ninety-Five";
    case '6': expanded = expanded + "and Ninety-Six";
    case '7': expanded = expanded + "and Ninety-Seven";
    case '8': expanded = expanded + "and Ninety-Eight";
    case '9': expanded = expanded + "and Ninety-Nine";
    //Now we move down the length, 2, 1 ,
    if(length == 2) {
    System.out.println("length of 2, working...");
    switch(arr[2]) {
    case '1': expanded = expanded + "One-Hundred ";
    case '2': expanded = expanded + "Two-Hundred ";
    case '3': expanded = expanded + "Three-Hundred ";
    case '4': expanded = expanded + "Four-Hundred ";
    case '5': expanded = expanded + "Five-Hundred ";
    case '6': expanded = expanded + "Six-Hundred ";
    case '7': expanded = expanded + "Seven-Hundred ";
    case '8': expanded = expanded + "Eight-Hundred ";
    case '9': expanded = expanded + "Nine-Hundred ";
    switch(arr[1]) {
    case '0': {
    switch(arr[0]) {
    case '0': expanded = expanded + "";
    case '1': expanded = expanded + "and One";
    case '2': expanded = expanded + "and Two";
    case '3': expanded = expanded + "and Three";
    case '4': expanded = expanded + "and Four";
    case '5': expanded = expanded + "and Five";
    case '6': expanded = expanded + "and Six";
    case '7': expanded = expanded + "and Seven";
    case '8': expanded = expanded + "and Eight";
    case '9': expanded = expanded + "and Nine";
    case '1': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Ten";
    case '1': expanded = expanded + "and Eleven";
    case '2': expanded = expanded + "and Twelve";
    case '3': expanded = expanded + "and Thirteen";
    case '4': expanded = expanded + "and Fourteen";
    case '5': expanded = expanded + "and Fifteen";
    case '6': expanded = expanded + "and Sixteen";
    case '7': expanded = expanded + "and Seventeen";
    case '8': expanded = expanded + "and Eighteen";
    case '9': expanded = expanded + "and Nineteen";
    case '2': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Twenty";
    case '1': expanded = expanded + "and Twenty-One";
    case '2': expanded = expanded + "and Twenty-Two";
    case '3': expanded = expanded + "and Twenty-Three";
    case '4': expanded = expanded + "and Twenty-Four";
    case '5': expanded = expanded + "and Twenty-Five";
    case '6': expanded = expanded + "and Twenty-Six";
    case '7': expanded = expanded + "and Twenty-Seven";
    case '8': expanded = expanded + "and Twenty-Eight";
    case '9': expanded = expanded + "and Twenty-Nine";
    case'3': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Thirty";
    case '1': expanded = expanded + "and Thirty-One";
    case '2': expanded = expanded + "and Thirty-Two";
    case '3': expanded = expanded + "and Thirty-Three";
    case '4': expanded = expanded + "and Thirty-Four";
    case '5': expanded = expanded + "and Thirty-Five";
    case '6': expanded = expanded + "and Thirty-Six";
    case '7': expanded = expanded + "and Thirty-Seven";
    case '8': expanded = expanded + "and Thirty-Eight";
    case '9': expanded = expanded + "and Thirty-Nine";
    case '4': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Fourty";
    case '1': expanded = expanded + "and Fourty-One";
    case '2': expanded = expanded + "and Fourty-Two";
    case '3': expanded = expanded + "and Fourty-Three";
    case '4': expanded = expanded + "and Fourty-Four";
    case '5': expanded = expanded + "and Fourty-Five";
    case '6': expanded = expanded + "and Fourty-Six";
    case '7': expanded = expanded + "and Fourty-Seven";
    case '8': expanded = expanded + "and Fourty-Eight";
    case '9': expanded = expanded + "and Fourty-Nine";
    case '5': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Fifty";
    case '1': expanded = expanded + "and Fifty-One";
    case '2': expanded = expanded + "and Fifty-Two";
    case '3': expanded = expanded + "and Fifty-Three";
    case '4': expanded = expanded + "and Fifty-Four";
    case '5': expanded = expanded + "and Fifty-Five";
    case '6': expanded = expanded + "and Fifty-Six";
    case '7': expanded = expanded + "and Fifty-Seven";
    case '8': expanded = expanded + "and Fifty-Eight";
    case '9': expanded = expanded + "and Fifty-Nine";
    case '6': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Sixty";
    case '1': expanded = expanded + "and Sixty-One";
    case '2': expanded = expanded + "and Sixty-Two";
    case '3': expanded = expanded + "and Sixty-Three";
    case '4': expanded = expanded + "and Sixty-Four";
    case '5': expanded = expanded + "and Sixty-Five";
    case '6': expanded = expanded + "and Sixty-Six";
    case '7': expanded = expanded + "and Sixty-Seven";
    case '8': expanded = expanded + "and Sixty-Eight";
    case '9': expanded = expanded + "and Sixty-Nine";
    case '7': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Seventy";
    case '1': expanded = expanded + "and Seventy-One";
    case '2': expanded = expanded + "and Seventy-Two";
    case '3': expanded = expanded + "and Seventy-Three";
    case '4': expanded = expanded + "and Seventy-Four";
    case '5': expanded = expanded + "and Seventy-Five";
    case '6': expanded = expanded + "and Seventy-Six";
    case '7': expanded = expanded + "and Seventy-Seven";
    case '8': expanded = expanded + "and Seventy-Eight";
    case '9': expanded = expanded + "and Seventy-Nine";
    case '8': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Eighty";
    case '1': expanded = expanded + "and Eighty-One";
    case '2': expanded = expanded + "and Eighty-Two";
    case '3': expanded = expanded + "and Eighty-Three";
    case '4': expanded = expanded + "and Eighty-Four";
    case '5': expanded = expanded + "and Eighty-Five";
    case '6': expanded = expanded + "and Eighty-Six";
    case '7': expanded = expanded + "and Eigthy-Seven";
    case '8': expanded = expanded + "and Eighty-Eight";
    case '9': expanded = expanded + "and Eighty-Nine";
    case '9': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Ninety";
    case '1': expanded = expanded + "and Ninety-One";
    case '2': expanded = expanded + "and Ninety-Two";
    case '3': expanded = expanded + "and Ninety-Three";
    case '4': expanded = expanded + "and Ninety-Four";
    case '5': expanded = expanded + "and Ninety-Five";
    case '6': expanded = expanded + "and Ninety-Six";
    case '7': expanded = expanded + "and Ninety-Seven";
    case '8': expanded = expanded + "and Ninety-Eight";
    case '9': expanded = expanded + "and Ninety-Nine";
    if(length == 1) {
    System.out.println("Length of 1 working....");
    switch(arr[1]) {
    case '0': {
    switch(arr[0]) {
    case '0': expanded = expanded + "";
    case '1': expanded = expanded + "and One";
    case '2': expanded = expanded + "and Two";
    case '3': expanded = expanded + "and Three";
    case '4': expanded = expanded + "and Four";
    case '5': expanded = expanded + "and Five";
    case '6': expanded = expanded + "and Six";
    case '7': expanded = expanded + "and Seven";
    case '8': expanded = expanded + "and Eight";
    case '9': expanded = expanded + "and Nine";
    case '1': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Ten";
    case '1': expanded = expanded + "and Eleven";
    case '2': expanded = expanded + "and Twelve";
    case '3': expanded = expanded + "and Thirteen";
    case '4': expanded = expanded + "and Fourteen";
    case '5': expanded = expanded + "and Fifteen";
    case '6': expanded = expanded + "and Sixteen";
    case '7': expanded = expanded + "and Seventeen";
    case '8': expanded = expanded + "and Eighteen";
    case '9': expanded = expanded + "and Nineteen";
    case '2': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Twenty";
    case '1': expanded = expanded + "and Twenty-One";
    case '2': expanded = expanded + "and Twenty-Two";
    case '3': expanded = expanded + "and Twenty-Three";
    case '4': expanded = expanded + "and Twenty-Four";
    case '5': expanded = expanded + "and Twenty-Five";
    case '6': expanded = expanded + "and Twenty-Six";
    case '7': expanded = expanded + "and Twenty-Seven";
    case '8': expanded = expanded + "and Twenty-Eight";
    case '9': expanded = expanded + "and Twenty-Nine";
    case'3': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Thirty";
    case '1': exp

    if(length == 3) {
    System.out.println("Length of 3, working...");
    //Assume we are starting at the one thousands
    //Since 0 is 1, we need to test for 3 for 1,000s not 4
    switch(arr[3]) {Arrays in Java start at index zero, so if the length of an array is 3, then the valid indices are 0,1 and 2.
    You also can make the whole thing much cleaner with using the way things are phrased in English - you say "one million, one hundred and fifty thousand, two hundred and seventy six pounds, thirty seven pence", so if you write a routine which converts an integer between 0 (inclusive) and 1000 (exclusive), and call that for the millions, thousands, units and cents in turn. You also might want to use localized strings in an array instead of coding everything as a sequence of switch statements.

  • OC4J 9.0.3 does not find JSP pages

    I had a working BC4J JSP application supporting my team's project management documents in JDev RC2 which I had successfully deployed into a standalone OC4J 9.0.3 on my Win2K workstation. Because the application failed with a jbo arrayoutofbounds exception when trying to bring up a 4K varchar2 field, I installed the newer OC4J 9.0.3 release, but tried to get JDev RC2 to deploy. Deployment seemed successful, but the JSP's were not recognized. (PS: The application still works with JDev's embedded OC4J engines).
    The JSP's are included in the deployed War file, but I do not see any classes compiled from the JSPs in the OC4J 9.0.3 directories. OC4J does bring up the static HTML pages.
    Seeing that JDev embeds OC4J 9.0.2, I downloaded the OC4J 9.0.2.1 production standalone version and again deployed -- the results were disappointingly the same, though, during the course of trying alternatives I received bc4j.xcfg not on path error.
    Grabbing at straws, I moved the application to the JDev 9.0.2 production version and tried to deploy to both the OC4J versions -- with the same results.
    I then created another workspace, with a single table BC4J component project, a BC4J JSP project, letting JDev generate the BrowseEdit.jsp components, added the default static html page object. Ran under embedded OC4J, but JSP page access failed, while access to the static HTML page worked.
    Because JDev deployments had never failed me before, I am at a complete loss. Too much of a black box!
    My desperation reminds me of a section from a Shakespeare sonnet -- appropriate here:
    "My thoughts and my discourse as madmen's are,
    at random from the true,
    vainly expressed,
    for I have sworn thee fair,
    and thought thee bright,
    who art as black as hell,
    and as dark as night."
    Can anyone help bring the old girl back?

    I meant to say application.xml file. Compare your settings to:
    <?xml version="1.0" standalone='yes'?>
    <!DOCTYPE orion-application PUBLIC "-//Evermind//DTD J2EE Application runtime 1.2//EN" "http://xmlns.oracle.com/ias/dtds/orion-application.dtd">
    <!-- The global application config that is the parent of all the other
         applications in this server. -->
    <orion-application autocreate-tables="true"
         default-data-source="jdbc/OracleDS">
         <web-module id="defaultWebApp" path="../../home/default-web-app" />
         <web-module id="dms0" path="../../home/applications/dms0.war" />
         <web-module id="dms" path="../../home/applications/dms.war" />
    <connectors path="./oc4j-connectors.xml"/>
         <persistence path="../persistence" />
    <!-- Path to the libraries that are installed on this server.
         These will accesible for the servlets, EJBs etc -->
         <library path="../../home/lib" />
         <library path="../../../BC4J/lib" />
         <library path="../../../ord/jlib/ordim.jar" />
         <library path="../../../ord/jlib/ordhttp.jar" />
         <library path="../../../jlib/uix2.jar" />
         <library path="../../../jlib/share.jar" />
         <library path="../../../jlib/regexp.jar" />
         <library path="../../../jlib/jdev-cm.jar" />
    <library path="../../../lib/dsv2.jar" />
    <library path="../../../rdbms/jlib/xsu12.jar" />
    <!-- Path to the taglib directory that is shared
         among different applications. -->
         <library path="../../home/jsp/lib/taglib" />
         <library path="../../../lib/oraclexsql.jar" />
         <library path="../../../jlib/LW_PfjBean.jar" />
         <library path="../../../jlib/bigraphbean.jar" />
         <library path="../../../jlib/bigraphbean-nls.zip" />
         <library path="../../../jlib/jewt4.jar" />
    <!-- Comment the following element to use principals.xml -->
         <jazn provider="XML" location="./jazn-data.xml" />
         <principals path="./principals.xml" />
         <log>
              <file path="../log/global-application.log" />
         </log>
    <commit-coordinator>
    <commit-class
    class="com.evermind.server.OracleTwoPhaseCommitDriver" />
    <property name="datasource"
    value="jdbc/OracleDS"/>
    <!-- Username and password are the optional properties
    replace with your commit_co-ordinator_super_user
         <property name="username"
         value="system" />
         <property name="password"
         value="manager" />
    -->
    </commit-coordinator>
         <data-sources path="data-sources.xml" />
         <namespace-access>
              <read-access>
                   <namespace-resource root="">
                        <security-role-mapping>
                             <group name="administrators" />
                        </security-role-mapping>
                   </namespace-resource>
              </read-access>
              <write-access>
                   <namespace-resource root="">
                        <security-role-mapping>
                             <group name="administrators" />
                        </security-role-mapping>
                   </namespace-resource>
              </write-access>
         </namespace-access>
    </orion-application>

  • Problem in getting the image coordinates  when i zoom in or zoom out

    Hi,
    i have doubts with scaling (Zoom in and Zoom out) using following code but when i zoom in want to get the x and y coordinates but im getting resized coordinates , pls do the needful
    public class TiffTest extends JFrame implements MouseListener
    public TiffTest(String filename)
    RenderedImage source= JAI.create("fileload",filename);
    SubsampleBinaryToGrayDescriptor sb=new SubsampleBinaryToGrayDescriptor();
    RenderingHints rh=new RenderingHints(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_DEFAULT);
    RenderedOp op=sb.create(source,new Float(0.5),new Float(0.5),rh);
    JScrollPane scrollPane = new JScrollPane();
    displayjai dj=new displayjai(op);
    scrollPane.setViewportView(dj);
    getContentPane().add(scrollPane,BorderLayout.CENTER);
    int screen_width=(int)this.getToolkit().getScreenSize().getWidth();
    int screen_height=(int)this.getToolkit().getScreenSize().getHeight();
    setVisible(true);
    setSize(screen_width,screen_height);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setExtendedState(JFrame.MAXIMIZED_BOTH);
    dj.addMouseListener(this);
    JAI.create("filestore",dj.ima,"god.tif","TIFF");
    public static void main(String s[])
    new TiffTest("1_org.tif");
    public void mouseClicked(MouseEvent e){System.out.println(e.getX()+","+e.getY());}
    public void mousePressed(MouseEvent e){}
    public void mouseReleased(MouseEvent e){}
    public void mouseEntered(MouseEvent e){}
    public void mouseExited(MouseEvent e){}
    class displayjai extends DisplayJAI
    RenderedOp ima;
    public displayjai(RenderedOp inputImage)
    super(inputImage);
    ima=inputImage;
    setPreferredSize(new Dimension(ima.getWidth(),ima.getHeight()));
    System.out.println(inputImage.getWidth()+","+inputImage.getHeight());
    Thankx
    Kannan

    hi all,
    I am getting the image from the server.but the problem is i am getting the Exception as ArrayOutOfBound exception.
    It was displaying the Image for the first time.and when ever it was going for the second time in to the paint method it was displaying the IOException in reading the stream from the connection.
    can anybody give me the solution in rectifying that exception.
    thanks in advance
    lakshman

  • Building custom components in jsf 1.2

    HI all
    i am having custom component which has one text field and button together which is extended from a panelgroup component and adding text field and button and child component to this.
    in jsf1.1 i am not getting any error, but jsf 1.2 i am getting arrayoutofbounds exception in processrestorestate.
    when printing the log in jsf1.2 uicomponentbase we can see that after text and button fields are rendered again textfield is rendered.and kid of panel is 4. can you suggest how building the above custom component.
    kid.........4 facet count.0 family javax.faces.Panel
    stateStruct.........[Ljava.lang.Object;@c0f87elength.......2
    childstate.....[Ljava.lang.Object;@fa302clength...2
    Child Count4
    kids....4
    kid.........0 facet count.0 family javax.faces.Input
    stateStruct.........[Ljava.lang.Object;@170d9d4length.......2
    kid.........0 facet count.0 family javax.faces.Command
    stateStruct.........[Ljava.lang.Object;@1ed1c32length.......2
    kid.........0 facet count.0 family javax.faces.Input
    Aug 13, 2008 6:32:49 PM com.sun.faces.lifecycle.Phase doPhase
    SEVERE: JSF1054: (Phase ID: RESTORE_VIEW 1, View ID: ) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@1d63e96]
    Aug 13, 2008 6:32:49 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet Faces Servlet threw exception
    java.lang.ArrayIndexOutOfBoundsException: 2
         at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1185)
         at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1189)
         at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1189)
         at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1189)
         at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1189)
         at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1189)
         at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1189)
         at org.ajax4jsf.application.AjaxStateManager.restoreView(AjaxStateManager.java:235)
         at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:316)
         at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:337)
         at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
         at org.ajax4jsf.application.AjaxViewHandler.restoreView(AjaxViewHandler.java:131)
         at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:176)
         at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
         at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:104)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:147)
         at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:256)
         at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:362)
         at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:488)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at mgeretail.gateway.SecurityFilter.doFilter(SecurityFilter.java:205)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Unknown Source)

    hi
    is there a problem in rendering code in have given for the component. please tell me what is wrong in the code.
    my component code is
    package components;
    import javax.faces.component.html.HtmlInputText;
    import javax.faces.component.html.HtmlCommandButton;
    import javax.faces.component.html.HtmlPanelGroup;
    public class CGLookup extends HtmlPanelGroup
        private HtmlInputText text1;
        private HtmlCommandButton btn1;
        private String key,valueText,id;
        private String width,valueChangeListener;
        private int maxLength;
        private boolean required;
        private static Class valueChangeListenerArgs[]= (new Class[] {javax.faces.event.ValueChangeEvent.class});
        public CGLookup()
            super();
            //this.setSeparator("");
            this.setStyle("width:198px;");
            text1= new HtmlInputText();
            text1.setStyle("width: 150px;");
            btn1 = new HtmlCommandButton();
           // btn1.setMini(true);
           // btn1.setStyle("width: 7px; height: 20px");
            btn1.setLabel("?");
            this.getChildren().add(text1);
            this.getChildren().add(btn1);
        public void setId(String id)
            super.setId(id);
            text1.setId(id+"_txt");
            btn1.setId(id+"_btn");
        public String getText()
            if(text1.getValue() !=null)
                return text1.getValue().toString().toUpperCase();
            return null;
        public void setText(String value)
            if(value!=null)
                text1.setValue(value.toUpperCase());
            else
                text1.setValue(null);
        public int getMaxLength()
            return text1.getMaxlength();
        public void setMaxLength(int value)
            text1.setMaxlength(value);
        public void setRequired(boolean value)
            text1.setRequired(value);
        public void setDisabled(boolean value)
                text1.setDisabled(value);
                btn1.setDisabled(value);
        public String getValueText()
            return valueText;
        public void setValueText(String value)
            valueText = value;
        public String getKey()
            return key;
        public void setKey(String value)
            key = value;
        public String getWidth()
            return width;
        public void setWidth(String value)
            width = value;  
            if (width != null)
                resize();
        public void resize()
            this.setStyle("width:"+width);
            int index = width.indexOf("px");
            String temp = width.substring(0, index);
            int _width = Integer.parseInt(temp);
            _width = _width -48;
            HtmlInputText t1 = (HtmlInputText) this.getChildren().get(0);
            t1.setStyle("width:"+ String.valueOf(_width)+"px");   
    }my tag code is
    package taglib;
    import javax.faces.component.html.HtmlInputText;
    import javax.faces.component.html.HtmlCommandButton;
    import com.sun.rave.web.ui.el.ConstantMethodBinding;
    import java.util.Map;
    import javax.faces.application.Application;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    import javax.faces.webapp.UIComponentTag;
    public class CGLookupTag extends UIComponentTag
        /** Creates a new instance of CGLookupTag */
        public CGLookupTag() {
            block = null;
            separator = null;
            style = null;
            styleClass = null;
            visible = null;
            public String getComponentType()
            return "CGLookuptype";
        public String getRendererType()
            return "javax.faces.component.html.HtmlPanelGroup";
        public void release()
            super.release();
            block = null;
            separator = null;
            style = null;
            styleClass = null;
            visible = null;
        public void setRequired(String value)
        {        this.required = value;    }
          public String getText()
        {   return text;   }
        public void setText(String value)
        {        text = value;    }
        public String getValueText()
        {   return valueText;   }
        public void setValueText(String value)
        {        valueText = value;    }
        public String getKey()
        {   return key;   }
        public void setKey(String value)
        {        key = value;    }
          public String getAction()
        {   return action;   }
        public void setAction(String value)
        {        action = value;    }
          public String getvalueChangeListener()
        {   return valueChangeListener;   }
        public void setvalueChangeListener(String value)
        {        valueChangeListener = value;    }
         public String getWidth()
        {   return width;   }
        public void setWidth(String value)
        {        width = value;    }
         public void setMaxLength(String maxLength)
            this.maxLength = maxLength;
        protected void setProperties(UIComponent _component)
            super.setProperties(_component);
            if(block != null)
                if(isValueReference(block))
                    javax.faces.el.ValueBinding _vb = getFacesContext().getApplication().createValueBinding(block);
                    _component.setValueBinding("block", _vb);
                } else
                    _component.getAttributes().put("block", Boolean.valueOf(block));
            if(separator != null)
                if(isValueReference(separator))
                    javax.faces.el.ValueBinding _vb = getFacesContext().getApplication().createValueBinding(separator);
                    _component.setValueBinding("separator", _vb);
                } else
                    _component.getAttributes().put("separator", separator);
            if(style != null)
                if(isValueReference(style))
                    javax.faces.el.ValueBinding _vb = getFacesContext().getApplication().createValueBinding(style);
                    _component.setValueBinding("style", _vb);
                } else
                    _component.getAttributes().put("style", style);
            if(styleClass != null)
                if(isValueReference(styleClass))
                    javax.faces.el.ValueBinding _vb = getFacesContext().getApplication().createValueBinding(styleClass);
                    _component.setValueBinding("styleClass", _vb);
                } else
                    _component.getAttributes().put("styleClass", styleClass);
            if(visible != null)
                if(isValueReference(visible))
                    javax.faces.el.ValueBinding _vb = getFacesContext().getApplication().createValueBinding(visible);
                    _component.setValueBinding("visible", _vb);
                } else
                    _component.getAttributes().put("visible", Boolean.valueOf(visible));
              if(action != null)
                if(isValueReference(action))
                    javax.faces.el.MethodBinding _mb = getFacesContext().getApplication().createMethodBinding(action, actionArgs);
                   HtmlCommandButton btn = (HtmlCommandButton) _component.getChildren().get(1) ;
                    btn.getAttributes().put("action", _mb);
                } else
                    javax.faces.el.MethodBinding _mb = new ConstantMethodBinding(action);
                     HtmlCommandButton btn = (HtmlCommandButton) _component.getChildren().get(1) ;
                     btn.getAttributes().put("action", _mb);
                if(required != null)
                if(isValueReference(required))
                    javax.faces.el.ValueBinding _vb = getFacesContext().getApplication().createValueBinding(required);
                    HtmlInputText txt = (HtmlInputText) _component.getChildren().get(0) ;
                    txt.setValueBinding("required", _vb);
                } else
                    HtmlInputText txt = (HtmlInputText) _component.getChildren().get(0) ;
                    txt.getAttributes().put("required", Boolean.valueOf(required));
              if(text != null)
                if(isValueReference(text))
                    javax.faces.el.ValueBinding _vb = getFacesContext().getApplication().createValueBinding(text);
                    HtmlInputText txt = (HtmlInputText) _component.getChildren().get(0) ;
                    txt.setValueBinding("text", _vb);
                } else
                    HtmlInputText txt = (HtmlInputText) _component.getChildren().get(0) ;
                    txt.getAttributes().put("text", text);
              if(key != null)
                if(isValueReference(key))
                    javax.faces.el.ValueBinding _vb = getFacesContext().getApplication().createValueBinding(key);
                    _component.setValueBinding("key", _vb);
                } else
                    _component.getAttributes().put("key", key);
              if(valueText != null)
                if(isValueReference(valueText))
                    javax.faces.el.ValueBinding _vb = getFacesContext().getApplication().createValueBinding(valueText);
                    _component.setValueBinding("valueText", _vb);
                } else
                    _component.getAttributes().put("valueText", valueText);
              if(valueChangeListener != null)
                if(isValueReference(valueChangeListener))
                    javax.faces.el.MethodBinding _mb = getFacesContext().getApplication().createMethodBinding(valueChangeListener, valueChangeListenerArgs);
                    HtmlInputText txt = (HtmlInputText) _component.getChildren().get(0) ;
                    txt.getAttributes().put("valueChangeListener", _mb);
                } else
                    throw new IllegalArgumentException(valueChangeListener);
              if(width != null)
                if(isValueReference(width))
                    javax.faces.el.ValueBinding _vb = getFacesContext().getApplication().createValueBinding(width);
                    _component.setValueBinding("width", _vb);
                } else
                    _component.getAttributes().put("width", width);
                if(maxLength != null)
                if(isValueReference(maxLength))
                    javax.faces.el.ValueBinding _vb = getFacesContext().getApplication().createValueBinding(maxLength);
                    HtmlInputText txt = (HtmlInputText) _component.getChildren().get(0) ;
                    txt.setValueBinding("maxLength", _vb);
                } else
                    HtmlInputText txt = (HtmlInputText) _component.getChildren().get(0) ;
                    txt.getAttributes().put("maxLength", Integer.valueOf(maxLength));
        public void setBlock(String block)
            this.block = block;
        public void setSeparator(String separator)
            this.separator = separator;
        public void setStyle(String style)
            this.style = style;
        public void setStyleClass(String styleClass)
            this.styleClass = styleClass;
        public void setVisible(String visible)
            this.visible = visible;
        static Class _mthclass$(String x0)
            try
            {return Class.forName(x0);}
            catch (ClassNotFoundException x1)
            {throw new NoClassDefFoundError(x1.getMessage());}
        private String block;
        private String separator;
        private String style;
        private String styleClass;
        private String visible;
        private static Class actionArgs[] = new Class[0];
        private static Class actionListenerArgs[];
        private static Class validatorArgs[];
        private static Class valueChangeListenerArgs[];
        private String text,valueText,key,required;
        private String action,valueChangeListener;
        private String width,maxLength;
        static
            actionListenerArgs = (new Class[] {
                javax.faces.event.ActionEvent.class
            validatorArgs = (new Class[] {
                javax.faces.context.FacesContext.class, javax.faces.component.UIComponent.class, java.lang.Object.class
            valueChangeListenerArgs = (new Class[] {
                javax.faces.event.ValueChangeEvent.class
    }the component type CGLookuptype refers to first code. in jsf 1.2 UIComponentTag says it is deprecated. what should i use instead of it.

  • Things that bug me about Java: MalformedURLException

    Anyone else think it's funny that when I call
    File f = ...
    URL url = f.toURL()
    I've got to catch a MalformedURLException? When could this exception EVER happen? Can anyone answer that?
    Why is MalformedURLException not a RuntimeException? Of all the exceptions out in java land, this is one that has almost never come up for me, and in any case should be totally preventable by the programmer just as NullPointer or ArrayOutOfBounds exceptions are

    I was under the impression that a File was not directly linked to a physical file. In effect you can create a File instance with almost any gibberish. That gibberish could possibly be invalid when converted to a URL or may not be parasble into a url. (relative file paths may be a source of this (Im not sure though). I belive you can also create an "empty" path
    File f = new File("");There may be senible ways of handling conversion of this to a URL but I don't think it does.
    Even if toURL does succed it does not necessarily produce a valid URL (It does not escape special characters)
    matfud

  • Oracle JDBC ArrayOutOfBoundsException

    I keep getting an ArrayOutOfBounds exception when calling resultSet.updateRow() after modifying the resultset. The stacktrace is as follows.
         Nested exception is:
    java.lang.ArrayIndexOutOfBoundsException: 8
         at oracle.jdbc.driver.OracleSql.computeBasicInfo(OracleSql.java:746)
         at oracle.jdbc.driver.OracleSql.getSqlKind(OracleSql.java:552)
         at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:1105)
         at oracle.jdbc.driver.T4CPreparedStatement.<init>(T4CPreparedStatement.java:25)
         at oracle.jdbc.driver.T4CDriverExtension.allocatePreparedStatement(T4CDriverExtension.java:72)
         at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:945)
         at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:827)
         at oracle.jdbc.driver.UpdatableResultSet.prepare_updateRow_statement(UpdatableResultSet.java:2308)
         at oracle.jdbc.driver.UpdatableResultSet.updateRow(UpdatableResultSet.java:1535)
    The row in question only has 7 columns so this makes sense as is. However, why would the driver try to update 8 columns when only 7 were named in the prepared statement? I've tried googling this every way I can imagine and keep running into dead ends. This only appears to occur on OC4J and occurs with multiple driver versions. Any ideas?

    I encounter the same problem.
    Finally, I solve this case by updating ojdbc14.jar from 10.2.0.1 to 10.2.0.4.

Maybe you are looking for