Error in hashtable

Hi,
i have the following code. the hashtables have been defined at class level.
public void calculateUserDetails()
Enumeration objEnumKeys = hashAllDetails.keys();
while(objEnumKeys.hasMoreElements())
  String strHashKey = (String)objEnumKeys.nextElement();
UserDetails objUserDetails = (UserDetails) hashAllDetails.get(strHashKey);
intBasicPacksTotalCount += objUserDetails.CountBasicPacks;
intAdvancedPacksTotalCount += objUserDetails.CountAdvancedPacks;
  int intCurrentUserSoldSmsCount = getSoldSmsCountToUser(objUserDetails);
intTotalSoldSmsCount = intTotalSoldSmsCount + intCurrentUserSoldSmsCount;
int intCurrentUserUtilizedSmsCount = intCurrentUserSoldSmsCount - objUserDetails.SmsBalance;
intTotalUtilizedSmsCount += intCurrentUserUtilizedSmsCount;
intActivePacksCount += getUserActiveSMSPacksCount(objUserDetails, intCurrentUserUtilizedSmsCount);           
  int intTotalCountPackPurchased = packPurchased(objUserDetails);
            hashABCD= new Hashtable();
hashABCD.put("tPackPurchased",intTotalCountPackPurchased);
hashABCD.put("UserUtilizedSmsCount",intCurrentUserUtilizedSmsCount);
  hashABCD.put("SmsBalance",objUserDetails.SmsBalance);
            boolean newFlag=NewUser(objUserDetails);
            if(newFlag==true)
                 hashABCD.put("NewUser","Yes");
            else
                 hashABCD.put("NewUser","No");
       hashDisplay.put(objUserDetails.UserId,hashABCD);
           }               //End while
     }     UserDetails is my class.
i m getting the folling error.
C:\trainee>javac BulkSmsFunctions.java
BulkSmsFunctions.java:366: cannot resolve symbol
symbol : method put (java.lang.String,int)
location: class java.util.Hashtable
hashABCD.put("TotalCountPackPurchased",intTotalCountPackPurcha
sed);
^
BulkSmsFunctions.java:369: cannot resolve symbol
symbol : method put (java.lang.String,int)
location: class java.util.Hashtable
hashABCD.put("CurrentUserUtilizedSmsCount",intCurrentUserUtili
zedSmsCount);
^
BulkSmsFunctions.java:372: cannot resolve symbol
symbol : method put (java.lang.String,int)
location: class java.util.Hashtable
hashABCD.put("SmsBalance",objUserDetails.SmsBalance);
^
3 errors
please help me out.

hi,
Thanks a lot .
Do i wrap int into an integer using
Integer.parseInt() ???
please help.Use the constructor, unless you're using java 1.5, in which a static method valueOf(int) has been introduced.

Similar Messages

  • Error in hashtable mapping

    hi all,
    in the following code, I get an error in the "find()" method in
    this statement
    comparedURL = (Document)ht.get(findElement);
    It gives me a null ptr exception..
    any ideas...?
    Here is the code
    static void compareDocuments ( Hashtable ht )
    Enumeration keys = ht.keys();
    Document doc = null;
    String findElement = "";
    try
    while ( keys.hasMoreElements())
    doc = (Document ) ht.get(keys.nextEleme());
    for(int h=0;h<doc.getOutgoingLinks().size();h++)
    findElement = (String)doc.getOutgoingLinks.elementAt(h));
    find ( ht,doc,findElement);
    catch ( .... )
    static void find ( Hashtable ht, Document d, String findElement)
    Enumeration keys = ht.keys();
    Document comparedURL = null;
    double incomingWeight = 0.0;
    System.out.println(findElement);
    try
    comparedURL = (Document)ht.get(findElement);
    comparedURL.incomingWeight = d.getOutgoingCount();
    comparedURL.rank+= (d.rank/comparedURL.incomingWeight);
    catch ( NullPointerException npe )
    npe.printStackTrace();

    Well, could you show us that output? And please show
    one of the keys that you are passing to the get method
    as well.This is what the hashtable contains
    http://www.bnet.att.com:80/leadstories/96-10-16/recentletters.htm,1.0
    http://www.brabys.co.za:80/caversham/botswana/Tati.htm,1.0
    http://www.brazzil.com:80/aug93.htm,1.0
    http://www.brabys.co.za:80/caversham/botswana/first.htm,1.0
    http://www.bnet.att.com:80/leadstories/96-10-17/recentletters.htm,1.0
    http://www.bnet.att.com:80/leadstories/96-10-17/bookmark.htm,1.0
    http://www.brazzil.com:80/oct93.htm,1.0
    http://www.brazzil.com:80/sep93.htm,1.0
    http://www.atr.org:80/townhall/FRC/net/st96e5.html,1.0
    http://www.brabys.co.za:80/caversham/wcape/Tourism.htm,1.0
    the hash function is
    doc = new Document(
    docNo,header,incomingVector,ogVector, incomingCount,outgoingCount,incomingWeight,
    outgoingWeight,rank);
    hash function
    ht.put(header,doc)

  • Error in Hashtable put method-Can not resolve symbol

    Hi there!I am new to using java.util.Hashtable.
    I am using it for a command line instant messaging program for holding the list of clients and list of client names currently connected to the server.
    However when I compile my server with the command javac server.java it seems to give errors can not resolve symbol method put (java.lang.object,int).
    Here is my code for my server:
    * @(#)server.java
    * @author
    * @version 1.00 2008/3/22
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.net.ServerSocket;
    import java.net.Socket;
    import java.util.*;
    public class server {
              static int key1=0;
              static Hashtable nameHolder=new Hashtable();
              //static ArrayList nameHolder=new ArrayList();
              //static ArrayList clientsConnected =new ArrayList();
              static Hashtable clientsConnected =new Hashtable();
         public static void main(String[] args) throws IOException {
              //nameHolder.add("controlelement");
              Socket connect=null;
              String name =null;
              PrintWriter out=null;
              BufferedReader in =null;
              String machinename;
              int port=0;
         ServerSocket serverSocket = null;
         serverSocket = new ServerSocket(2222);
         boolean listeningports = true;
         try {
                   if(args.length > 0)
                   port = Integer.parseInt(args[0]);
                   System.out.println(port);
                   else
                        System.out.println("You must enter port number");
                        System.exit(1);
                   while(true)
                             System.out.println("Hakan");
                             connect=serverSocket.accept();
                   in = new BufferedReader(new InputStreamReader(connect.getInputStream()));
                        System.out.println("Hakan");
                   String girdi = in.readLine();
                   StringTokenizer nameAl=new StringTokenizer(girdi);
                   String ad=null;
                   String host=null;
                   int portofclient=0;
                   int m=0;
                   while(nameAl.hasMoreTokens())
                        if(m==0)
                             ad=nameAl.nextToken();
                             System.out.println("Adim"+ad);
                        else if(m==1)
                             host=nameAl.nextToken();
                             System.out.println("Hostum"+host);
                        else if(m==2)
                             portofclient = Integer.parseInt(nameAl.nextToken());
                             System.out.println("Listening portum"+portofclient);
                             break;
                        m++;
                   out = new PrintWriter(connect.getOutputStream(), true);
                   System.out.println("Haso");
                   if(!isUsed(ad))
                        System.out.println(girdi);
                        System.out.println("H�so");
                        //Object fason=(Object)ad;
                        nameHolder.put(key1,ad);
    //The error seems to occur here
                        client myclient=new client(ad,host,portofclient);
                        //Object garson=(Object)myclient;
                        clientsConnected.put(key1,myclient);
                        key1++;
                        //clientInfoHolder.add(girdi);
                        out.println("Kullan&#305;mda");
                        System.out.println("Haso");
                        new MultiClientManager(connect).start();
                   else
                        //System.out.println("kulanilmaz");
                        out.println("Kullanim disi");
         catch(Exception e)
              System.out.println("You did not specify port number");
              System.out.println("Or connection was not established due to specifying invalid or used port");
              e.printStackTrace();
         public static boolean isUsed( String name )
                   if( nameHolder.containsValue(name) )
                        return true;
                   return false;
         public static client Ask(String name)
              ArrayList lombak=(ArrayList) clientsConnected.values();
              for(int i=0;i<lombak.size();i++)
                   client semsi = (client)lombak.get(i);
                   if(semsi.nickname.compareTo(name)==0)
                        return semsi;
              return null;
         public static int returnkeyoffromclients(String name)
              ArrayList lombak=(ArrayList)clientsConnected.values();
              for(int i=0;i<lombak.size();i++)
                   client semsi = (client)lombak.get(i);
                   if(semsi.nickname.compareTo(name)==0)
                        return i;
              return 0;
         public static int returnkeyoffromnames(String name)
              ArrayList lombak=(ArrayList)nameHolder.values();
              for(int i=0;i<lombak.size();i++)
                   String semsi = lombak.get(i).toString();
                   if(semsi.compareTo(name)==0)
                        return i;
              return 0;
    }

    Excuse me for not putting my code between tags. I am just sleepless.
    I am sending it again.
    * @(#)server.java
    * @author
    * @version 1.00 2008/3/22
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.net.ServerSocket;
    import java.net.Socket;
    import java.util.*;
    public class server  {
              static int key1=0;
              static Hashtable nameHolder=new Hashtable();
              //static ArrayList nameHolder=new ArrayList();
              //static ArrayList clientsConnected =new ArrayList();
              static Hashtable clientsConnected =new Hashtable();
             public static void main(String[] args) throws IOException {
                  //nameHolder.add("controlelement");
                  Socket connect=null;
                  String name =null;
                  PrintWriter out=null;
                  BufferedReader in =null;
                  String machinename;
                  int port=0;
                 ServerSocket serverSocket = null;
                 serverSocket = new ServerSocket(2222);
                 boolean listeningports = true;
                 try {
                        if(args.length > 0)
                             port = Integer.parseInt(args[0]);
                             System.out.println(port);
                        else
                             System.out.println("You must enter port number");
                             System.exit(1);
                        while(true)
                                  System.out.println("Hakan");
                                   connect=serverSocket.accept();
                             in = new BufferedReader(new InputStreamReader(connect.getInputStream()));
                                  System.out.println("Hakan");
                             String girdi = in.readLine();
                             StringTokenizer nameAl=new StringTokenizer(girdi);
                             String ad=null;
                             String host=null;
                             int portofclient=0;
                             int m=0;
                             while(nameAl.hasMoreTokens())
                                  if(m==0)
                                       ad=nameAl.nextToken();
                                       System.out.println("Adim"+ad);
                                  else if(m==1)
                                       host=nameAl.nextToken();
                                       System.out.println("Hostum"+host);
                                  else if(m==2)
                                       portofclient = Integer.parseInt(nameAl.nextToken());
                                       System.out.println("Listening portum"+portofclient);
                                       break;
                                  m++;
                             out = new PrintWriter(connect.getOutputStream(), true);
                             System.out.println("Haso");
                             if(!isUsed(ad))
                                  System.out.println(girdi);
                                  System.out.println("H�so");
                                  //Object fason=(Object)ad;
                                  nameHolder.put(key1,ad);
                                  client myclient=new client(ad,host,portofclient);
                                  //Object garson=(Object)myclient;
                                  clientsConnected.put(key1,myclient);
                                  key1++;
                                  //clientInfoHolder.add(girdi);
                                  out.println("Kullan&#305;mda");
                                  System.out.println("Haso");
                                  new MultiClientManager(connect).start();
                             else
                                  //System.out.println("kulanilmaz");
                                  out.println("Kullanim disi");
                 catch(Exception e)
                      System.out.println("You did not specify port number");
                      System.out.println("Or connection was not established due to specifying invalid or used port");
                      e.printStackTrace();
             public static boolean isUsed( String name )
                       if( nameHolder.containsValue(name) )
                            return true;
                       return false;
             public static client Ask(String name)
                  ArrayList  lombak=(ArrayList) clientsConnected.values();
                  for(int i=0;i<lombak.size();i++)
                       client semsi = (client)lombak.get(i);
                       if(semsi.nickname.compareTo(name)==0)
                            return semsi;
                  return null;
             public static int returnkeyoffromclients(String name)
                  ArrayList lombak=(ArrayList)clientsConnected.values();
                  for(int i=0;i<lombak.size();i++)
                       client semsi = (client)lombak.get(i);
                       if(semsi.nickname.compareTo(name)==0)
                            return i;
                  return 0;
             public static int returnkeyoffromnames(String name)
                  ArrayList lombak=(ArrayList)nameHolder.values();
                  for(int i=0;i<lombak.size();i++)
                       String semsi = lombak.get(i).toString();
                       if(semsi.compareTo(name)==0)
                            return i;
                  return 0;
         These are the lines that are responsible from the error.
    nameHolder.put(key1,ad);
    client myclient=new client(ad,host,portofclient);
    //Object garson=(Object)myclient;
    clientsConnected.put(key1,myclient);

  • Why do I get this error with hashtables

    This is the first time I am using hashtables. I tried to make a simple example using these lines
         Hashtable dates = new Hashtable ();
         dates.put("christmas", "25 Dec");but I end up getting these errors:
    RLearner.java:9: <identifier> expected
         dates.put("christmas", "25 Dec");
                     ^
    RLearner.java:9: package dates does not exist
         dates.put("christmas", "25 Dec");
                 ^can you please tell me why I get these errors, I think I've included all the packages, but again, Im not sure
    Thanx

    import java.util.Hashtable;
    public class test {
      public static void main(String[] args) {
        Hashtable test = new Hashtable();
        test.put("christmas","25 Dec");
    }

  • Hashtable problems?

    I just discovered hashtables :D mmm.. i find hashname.put(object, object); to be too much.. so i wrote a adhoc method for walking through two arrays and putting them into hastables :D though, i had some errors:
    public Hashtable makeHash(int cap, String allString[], int allInt[])
         Hashtable hash = new Hashtable(cap);
         int i = 0;
         while(i < allString.length && i < allInt.length)
              hash.put(allString, new Integer(allInt[i]));
              i++;
         return hash;
    then i ran this method:
    String days[]=
         "Sun",
         "Mon",
         "Tue",
         "Wed",
         "Thu",
         "Fri",
         "Sat"
    offset[] = {0, 1, 2, 3, 4, 5, 6};
    makeHash(7, days[], offset[]);in eclipse, there is a red mark under the comma right after days[] in the makeHash parameter... when i mouse over it, it gave me an "Syntax error on token ",","." expected".. anyone know what i'm doing wrong?

    int[] offset = {0, 1, 2, 3, 4, 5, 6} ; is valid, and, I think int offset[] = {0, 1, 2, 3, 4, 5, 6}; However, I don't think offset[] = <whatever> is valid anywhere except as part of the delaration. After declaring int[] offest or int offset[], you just use offest without the [] to refer to the array.

  • Infinite loop - "Some actions taken while...offline could not be completed"

    I have 4 IMAP accounts (.Mac, Gmail and 2 at SpamArrest). Occasionally, I get in this infuriating state where I keep getting the following error:
    "Some actions taken while the account "ClickMarkets-SA" was offline could not be complete online.
    Mail has undone actions on some messages so that you can redo the actions while online. Mail has saved other message in mailbox "INBOX.Sent Messages" in "On My Mac" so that you can complete the
    actions while online.
    Additional information: The connection to the server "mail.spamarrest.com" on port 993 timed out."
    The only way I've found to resolve this infinite loop of messages (which subsequently backs up all other mail processing) is to quit mail, then cd to ~/Library/Mail/[email protected]/.OfflineCache and delete everything in there then relaunch mail.
    In each cases, I end up with a mailbox folder (Sent or Drafts) in the folder "On My Mac" which has one copy for each attempt at handling the message "online."
    I opened up the Connection Doctor and looked at the log details and saw that Mail is opening a socket to spamarrest and starting an APPEND operation on my INBOX.Drafts folder -- I have "store drafts on server" checked. It appears the APPEND operation is hanging and causing a timeout (see transcript below). This happens every 60 seconds. The error that I see after the timeout is:
    * BYE [ALERT] Fatal error: INTERNAL ERROR: Keyword hashtable memory corruption.: Input/output error
    Who's Fatal error is that?
    SpamArrest is trying to tell me the problem is with both of my computers and not their server. (Yes, this is hitting both my MacBook Pro and my iMac). Can anyone shed some more light on this? IMAP should be able to handle multiple computers so I don't see that as a problem. Is my Mail app not following protocol? Is it a filesystem issue (e.g. SpamArrest doesn't like the name of the folder)?
    Thanks.
    Chip
    Here is the log file segment:
    CONNECTED May 19 17:13:11.939 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x189d0050 -- thread:0x1db74280
    READ May 19 17:13:12.266 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x189d0050 -- thread:0x1db74280
    * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE AUTH=CRAM-MD5 AUTH=PLAIN ACL ACL2=UNION] IMAP ready.
    WROTE May 19 17:13:12.301 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x189d0050 -- thread:0x1d314d10
    1.785 LOGIN clickmarkets *******
    READ May 19 17:13:12.365 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x189d0050 -- thread:0x1d314d10
    1.785 OK connected to proxy server.
    WROTE May 19 17:13:12.405 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x189d0050 -- thread:0x1d314d10
    2.785 CAPABILITY
    READ May 19 17:13:12.463 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x189d0050 -- thread:0x1d314d10
    * CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE AUTH=CRAM-MD5 ACL ACL2=UNION
    2.785 OK CAPABILITY completed
    WROTE May 19 17:13:12.501 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x189d0050 -- thread:0x1d314d10
    3.785 LIST "" ""
    READ May 19 17:13:12.561 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x189d0050 -- thread:0x1d314d10
    * LIST (\Noselect) "." ""
    3.785 OK LIST completed
    WROTE May 19 17:13:12.616 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x189d0050 -- thread:0x1d314d10
    4.785 APPEND "INBOX.Drafts (ClickMarkets-SA)" (\Seen \Draft $NotJunk NotJunk) "19-May-2009 17:07:30 -0700" {4525}
    READ May 19 17:13:13.627 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x189d0050 -- thread:0x1d314d10
    + OK
    WROTE May 19 17:13:13.663 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x189d0050 -- thread:0x1d314d10
    X-Uniform-Type-Identifier: com.apple.mail-draft
    From: Chip Roberson <[email protected]>
    To: "Charles S. Roberson" <[email protected]>
    X-Universally-Unique-Identifier: 155cc0fa-b377-4dd6-a5e6-d6563a23c711
    Subject: PM Test 1
    X-Apple-Auto-Saved: 1
    X-Apple-Mail-Remote-Attachments: YES
    X-Apple-Windows-Friendly: 1
    Message-Id: <[email protected]>
    Content-Type: text/html;
    charset=US-ASCII
    Content-Transfer-Encoding: quoted-printable
    Mime-Version: 1.0 (Apple Message framework v935.3)
    X-Apple-Base-Url: x-msg://85/
    Date: Tue, 19 May 2009 17:07:30 -0700
    X-Apple-Mail-Signature: 34D68E00-8E23-44FB-B72C-FFA86BB66FB3
    <html><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space; ">I'm starting to wonder if this =
    will ever fail when I need it to fail!<div><br><div =
    id=3D"AppleMailSignature"> <span class=3D"Apple-style-span" =
    style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
    Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
    font-weight: normal; letter-spacing: normal; line-height: normal; =
    orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; =
    white-space: normal; widows: 2; word-spacing: 0px; =
    -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: =
    0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
    auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space; "><span class=3D"Apple-style-span" =
    style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
    Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
    font-weight: normal; letter-spacing: normal; line-height: normal; =
    orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
    widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
    -webkit-border-vertical-spacing: 0px; =
    -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
    auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space; "><span class=3D"Apple-style-span" =
    style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
    Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
    font-weight: normal; letter-spacing: normal; line-height: normal; =
    orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
    widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
    -webkit-border-vertical-spacing: 0px; =
    -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
    auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space; "><span class=3D"Apple-style-span" =
    style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
    Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
    font-weight: normal; letter-spacing: normal; line-height: normal; =
    orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
    widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
    -webkit-border-vertical-spacing: 0px; =
    -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
    auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space; "><span class=3D"Apple-style-span" =
    style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
    Helvetica; font-size: 12px; font-style: normal; font-variant: normal; =
    font-weight: normal; letter-spacing: normal; line-height: normal; =
    orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
    widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
    -webkit-border-vertical-spacing: 0px; =
    -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
    auto; -webkit-tex
    WROTE May 19 17:13:13.697 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x189d0050 -- thread:0x1d314d10
    t-stroke-width: 0px; "><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space; ">--
    Chip =
    Roberson
    [email protected]
    http://www.linkedi=
    n.com/in/chiproberson
    =
    <br =
    class=3D"Apple-interchange-newline">
    </body></html>=
    READ May 19 17:14:13.626 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x189d0050 -- thread:0x1d314d10
    * BYE Disconnected for inactivity.
    * BYE [ALERT] Fatal error: INTERNAL ERROR: Keyword hashtable memory corruption.: Input/output error
    CONNECTED May 19 17:14:19.092 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x182eff40 -- thread:0x1db74280
    READ May 19 17:14:19.414 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x182eff40 -- thread:0x1db74280
    * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE AUTH=CRAM-MD5 AUTH=PLAIN ACL ACL2=UNION] IMAP ready.
    WROTE May 19 17:14:19.449 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x182eff40 -- thread:0x19fed040
    1.786 LOGIN clickmarkets *******
    READ May 19 17:14:19.517 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x182eff40 -- thread:0x19fed040
    1.786 OK connected to proxy server.
    WROTE May 19 17:14:19.555 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x182eff40 -- thread:0x19fed040
    2.786 CAPABILITY
    READ May 19 17:14:19.622 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x182eff40 -- thread:0x19fed040
    * CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE AUTH=CRAM-MD5 ACL ACL2=UNION
    2.786 OK CAPABILITY completed
    WROTE May 19 17:14:19.659 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x182eff40 -- thread:0x19fed040
    3.786 LIST "" ""
    READ May 19 17:14:19.718 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x182eff40 -- thread:0x19fed040
    * LIST (\Noselect) "." ""
    3.786 OK LIST completed
    WROTE May 19 17:14:19.755 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x182eff40 -- thread:0x19fed040
    4.786 APPEND "INBOX.Drafts (ClickMarkets-SA)" (\Seen \Draft $NotJunk NotJunk) "19-May-2009 17:07:30 -0700" {4525}
    READ May 19 17:14:19.818 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x182eff40 -- thread:0x19fed040
    + OK
    WROTE May 19 17:14:19.855 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x182eff40 -- thread:0x19fed040

    Okay I did a little more digging and found another thread that answers this issue.
    http://discussions.apple.com/thread.jspa?threadID=1276506

  • Bean value forward to servlet

    Hi all,
    i have bean package cedars;
    import java.util.Hashtable;
    import java.util.*;
    public class FormBean {
          private String name = null;
          private String stuNumber = null;
          private String facultyName= null;
          private String quesOne = null;
          private String quesTwo = null;
          private String quesThree = null;
          private String quesFour= null;
          private String quesFive= null;
          private String quesSix= null;
          private String quesSeven= null;
          private String quesEight= null;
          private String quesNine= null;
          private String quesTen= null;
          private String quesEleven= null;
          private String quesTwelve= null;
          private String quesThirteen= null;
          private String quesFourteen= null;
          private String quesFifteen= null;
          private String quesSixteen= null;
          private String quesSeventeen = null;     
          private String quesEighteen=null;
          private String quesNineteen=null;
          private String quesTwenty=null;
          private String quesTwentyOne=null;
          private Hashtable errors = new Hashtable();
          public boolean validate() {
                  boolean allOk=true;
                  if (stuNumber.equals("")|| stuNumber.length() !=10) {
                      errors.put("stuNumber","Please enter a valid student Number");
                      stuNumber="";
                      allOk=false;
                    } else {
                        try {
                            int x = Integer.parseInt(stuNumber);
                          } catch (NumberFormatException e) {
                            errors.put("stuNumber","Please enter a valid student Number");
                            stuNumber="";
                            allOk=false;
                    }//else
                  return allOk;        
          public String getErrorMsg(String s) {
                  String errorMsg =(String)errors.get(s.trim());
                  return (errorMsg == null) ? "":errorMsg;
         public FormBean () {
              again(); 
         /* Name */
           public String getName() {
             return (this.name);
           public void setName(String name) {
             this.name = name;
           /* Student number */
           public String getStuNumber(){
             return (this.stuNumber);
           public void setStuNumber(String stuNumber){
             this.stuNumber = stuNumber;
           /* gender */
           private String gender= null;
           public String getGender(){
             return (this.gender);
           public void setGender(String gender) {
             this.gender = gender;
           /*college*/
           public String getFacultyName(){
             return (this. facultyName);
           public void setFacultyName(String  facultyName){
             this. facultyName=facultyName;
           /*degree*/
           String degree=null;
           public String getDegree() {
                  return (this.degree);
           public void setDegree(String degree){
             this.degree =degree;
           /* year */
           private String year = null;
           public String getYear() {
             return (this.year);
           public void setYear(String year){
             this.year = year;
           /*question one */
           public String getQuesOne() {
             return (this.quesOne);
           public void setQuesOne(String quesOne){
             this.quesOne = quesOne;
           /*question two */
           public String getQuesTwo() {
             return (this.quesTwo);
           public void setQuesTwo(String quesTwo){
             this.quesTwo = quesTwo;
           /*question Three */
           public void setQuesThree(String quesThree){
             this.quesThree = quesThree;
           /*question four */
           public String getQuesFour() {
             return (this.quesFour);
           public void setQuesFour(String quesFour){
             this.quesFour = quesFour;
           /*question five */
           public String getQuesFive() {
             return (this.quesFive);
           public void setQuesFive(String quesFive){
             this.quesFive = quesFive;
           /*question six */
           public String getQuesSix() {
             return (this.quesSix);
           public void setQuesSix(String quesSix){
             this.quesSix =quesSix;
           /*question seven */
           public String getQuesSeven(){
             return (this.quesSeven);
           public void setQuesSeven(String quesSeven){
             this.quesSeven =quesSeven;
           /*question Eight */
           public String getQuesEight() {
             return (this.quesEight);
           public void setQuesEight(String quesEight){
             this.quesEight =quesEight;
           /*question Nine */
           public String getQuesNine() {
             return (this.quesNine);
           public void setQuesNine(String quesNine) {
             this.quesNine =quesNine;
           /*question Ten */
           public String getQuesTen(){
             return (this.quesTen);
           public void setQuesTen(String quesTen){
             this.quesNine =quesTen;
           /*question Eleven*/
           public String getQuesEleven(){
             return (this.quesEleven);
           public void setQuesEleven(String quesEleven) {
             this.quesEleven =quesEleven;
           /* question Twelve*/
           public String getQuesTwelve(){
             return (this.quesTwelve);
           public void setQuesTwelve(String quesTwelve) {
             this.quesTwelve =quesTwelve;
           /* question Thirteen**/
           public String getQuesThirteen() {
             return (this.quesThirteen);
           public void setQuesThirteen(String quesThirteen) {
             this.quesThirteen =quesThirteen;
           /*question Fourteen*/
           public String getQuesFourteen() {
             return (this.quesFourteen);
           public void setQuesFourteen(String quesFourteen) {
             this.quesFourteen =quesFourteen;
           /* question Fifteen*/
           public String getQuesFifteen(){
             return (this.quesFifteen);
           public void setQuesFifteen(String quesFifteen) {
             this.quesFifteen =quesFifteen;
          /* question Sisteen*/
           public String getQuesSixteen(){
             return (this.quesSixteen);
           public void setQuesSixteen(String quesSixteen) {
             this.quesSixteen =quesSixteen;
          /* question Seventeen */
           public String getQuesSeventeen (){
             return (this.quesSeventeen );
           public void setQuesSeventeen (String quesSeventeen ) {
             this.quesSeventeen=quesSeventeen ;
           /* question Eighteen*/
           public String getQuesThree(){
             return (this.quesThree);
         public String getQuesEighteen (){
                  return (this.quesEighteen );
         public void setQuesEighteen(String quesEighteen ){
                  this.quesEighteen =quesEighteen ;
           /*question Nineteen*/
         public String getQuesNineteen(){
             return (this.quesNineteen );
          public void setQuesNineteen(String quesNineteen ){
               this.quesNineteen =quesNineteen ;
         /*Twenty*/
      public String getQuesTwenty(){
         return (this.quesTwenty );
      public void setQuesTwenty(String quesTwenty ){
         this.quesTwenty =quesTwenty ;
         /*Twenty-One*/
    public String getQuesTwentyOne(){
    return (this.quesTwentyOne );
    public void setQuesTwentyOne(String quesTwentyOne ) {
          this.quesTwentyOne =quesTwentyOne ;     }
    public void setErrors(String key, String msg) {
             errors.put(key,msg);
           public void again(){                               
                  setName("");
                  setStuNumber("");
                  setGender("");
                  setFacultyName("");
                  setDegree("");            
                  setYear("");           
                  setQuesOne("");
                  setQuesTwo("");
                  setQuesThree("");
                  setQuesFour("");
                  setQuesFive("");
                  setQuesSix("");
                  setQuesSeven("");
                  setQuesEight("");
                  setQuesNine("");
                  setQuesTen("");
                  setQuesEleven("");
                  setQuesTwelve("");
                  setQuesThirteen("");
                  setQuesFourteen("");
                  setQuesFifteen("");     
                  setQuesSixteen("");
                  setQuesSeventeen("");
                  setQuesEighteen("");
                  setQuesNineteen("");
                  setQuesTwenty("");
                  setQuesTwentyOne("");
    }and process.jsp
    %@ page import="java.util.*" %>
    <html>
      <head>
    <jsp:useBean id="formHandler" class="cedars.FormBean" scope="request">
    <jsp:setProperty name="formHandler" property="*"/>
    </jsp:useBean>
    <%
       if (formHandler.validate()) {%>
    <jsp:forward page="/servlet/Insert"/>
    <% } else { %>
    <jsp:forward page="/resubmit.jsp"/>
    <% } %>
    </body>
    </html>row now the forward to resubmit.jsp is work , but forward to <jsp:forward page="/servlet/Insert"/>
    is not work , why?
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import javax.sql.*;
    import pool.ConnectionPool;
    public class Insert extends HttpServlet {   
        Connection conn = null;
        Statement stmt = null;
         ResultSet rs = null;
         PreparedStatement ps = null;
         ConnectionPool connectionPool = null;
       * We want to initialized the JDBC connections here
        public void init()
                 String jdbcDriver = "com.mysql.jdbc.Driver";
                 String dbURL ="jdbc:mysql://localhost/survey?";
                 try
                 //instantiate the connection pool object by passing the
                 //jdbc driver, database URL, username, and password
                 connectionPool = new ConnectionPool(jdbcDriver, dbURL,
                 "root","mysql");
                 //specify the initial number of connections to establish
                 connectionPool.setInitialConnections(5);
                 //specify number of incremental connections to create if
                 //pool is exhausted of available connections
                 connectionPool.setIncrementalConnections(5);
                 //specify absolute maximum number of connections to create
                 connectionPool.setMaxConnections(20);
                 connectionPool.createPool(); //create the connection pool
                 catch(Exception e)
                 System.out.println("Error: " + e);
    /** Destroys the servlet.
        public void destroy() {
        public void doGet(
        HttpServletRequest request,
        HttpServletResponse response)
        throws IOException, ServletException {  
           }// end of DoGet
    public void doPost(HttpServletRequest req, HttpServletResponse res)
        throws ServletException, IOException {    
         res.setContentType("text/html");
         PrintWriter out = res.getWriter(); 
       try {        
        //Get the incoming data parameters from the client         
               String  name=req.getParameter("name");
               String  stuNumber=req.getParameter("stuNumber");
               String  gender=req.getParameter("gender");
               String  facultName=req.getParameter("facultyName");
               String  degree=req.getParameter("degree");          
               String  year=req.getParameter("year");        
               String  quesOne=req.getParameter("quesOne");
               String  quesTwo=req.getParameter("quesTwo");
               String  quesThree=req.getParameter("quesThree");
               String  quesFour=req.getParameter("quesFour");
               String  quesFive=req.getParameter("quesFive");
               String  quesSix=req.getParameter("quesSix");
               String  quesSeven=req.getParameter("quesSeven");
               String  quesEight=req.getParameter("quesEight");
               String  quesNine=req.getParameter("quesNine");
               String  quesTen=req.getParameter("quesTen");
               String  quesEleven=req.getParameter("quesEleven");
               String  quesTwelve=req.getParameter("quesTwelve");
               String  quesThirteen=req.getParameter("quesThirteen");
               String  quesFourteen=req.getParameter("quesFourteen");
               String  quesFifteen=req.getParameter("quesFifteen");
               String  quesSixteen=req.getParameter("quesSixteen");
               String  quesSeventeen=req.getParameter("quesSeventeen");
               String  quesEighteen=req.getParameter("quesNineteen");
               String  quesNineteen=req.getParameter("quesNineteen");
               String  quesTwenty=req.getParameter("quesTwenty");
               String  quesTwentyOne=req.getParameter("quesTwentyOne");
               String ErrMsg="";
               String found="";
               HttpSession userSession = req.getSession(true);   
               HttpSession session=req.getSession();
               for (int i=0; i<stuNumber.length(); i++){              
                    char ch=stuNumber.charAt(i);
                   if (Character.isLetter(ch)){
                     found =found +ch;}
                * check the empty fields
                       if (stuNumber.equals("") ||                    
                                ((found.length()>=1 ))||                         
                                (stuNumber.length()!=10))
                           out.println("<html>");                        
                           out.println("<body bgcolor=\"#FFFFFF\">");
                            out.println("<center>");
                           out.println("<strong> Valid Studend number is require!<strong>");
                           out.println("</center>");
                           out.println("</body>");                        
                           out.println("</html>");
                           out.close();
                       Integer q1=0, q2=0, q3=0, q4=0, q5=0, q6=0, q7=0, q8=0,q9=0,q10=0;
                       Integer q11=0, q12=0, q13=0, q14=0, q15=0, q16=0, q17=0, q18=0, q19=0, q20=0,q21=0;
                         q1 = Integer.valueOf(quesOne);
                         q2 = Integer.valueOf(quesTwo);
                         q3 = Integer.valueOf(quesThree);
                         q4 = Integer.valueOf(quesFour);
                         q5 = Integer.valueOf(quesFive);
                         q6 = Integer.valueOf(quesSix);
                         q7 = Integer.valueOf(quesSeven);
                         q8 = Integer.valueOf(quesEight);
                         q9 = Integer.valueOf(quesNine);
                          q10 = Integer.valueOf(quesTen);
                          q11 = Integer.valueOf(quesEleven);
                          q12 = Integer.valueOf(quesTwelve);
                          q13 = Integer.valueOf(quesThirteen);
                          q14 = Integer.valueOf(quesFourteen);
                           q15 = Integer.valueOf(quesFifteen);
                           q16 = Integer.valueOf(quesSixteen);
                            q17 = Integer.valueOf(quesSeventeen);
                             q18 = Integer.valueOf(quesEighteen);
                             q19 = Integer.valueOf(quesNineteen);
                             q20 = Integer.valueOf(quesTwenty);
                              q21 = Integer.valueOf(quesTwentyOne);
                       Integer total=0;
                       total=q1+q2+q3+q4+q5+q6+q7+q8+q9+q10+q11+q12+q13+q14+q15+q16+q17+q18+q19+q20+q21;
                       /*if form is valid, catch the session*/
                         userSession.setAttribute("stuNumber",stuNumber );
                           userSession.setAttribute("quesOne",quesOne); 
                           userSession.setAttribute("quesTwo",quesTwo); 
                           userSession.setAttribute("quesThree",quesThree); 
                           userSession.setAttribute("quesFour",quesFour); 
                           userSession.setAttribute("quesFive",quesFive); 
                           userSession.setAttribute("quesSix", quesSix); 
                           userSession.setAttribute("quesSeven",quesSeven); 
                           userSession.setAttribute("quesEight",quesEight); 
                           userSession.setAttribute("quesNine",quesNine); 
                           userSession.setAttribute("quesTen",quesTen); 
                           userSession.setAttribute("quesTwelve", quesTwelve);
                           userSession.setAttribute("quesEleven",  quesEleven);
                           userSession.setAttribute("quesThirteen", quesThirteen);
                           userSession.setAttribute("quesFourteen", quesFourteen);
                           userSession.setAttribute("quesFifteen",   quesFifteen);              
                          userSession.setAttribute("quesSixteen",  quesSixteen);             
                          userSession.setAttribute("quesSeventeen",quesSeventeen);
                          userSession.setAttribute("quesEighteen", quesEighteen);
                          userSession.setAttribute("quesNineteen",quesNineteen);
                          userSession.setAttribute("quesTwenty",quesTwenty);
                           userSession.setAttribute("quesTwentyOne",quesTwentyOne);
                           userSession.setAttribute("total",total);
                            RequestDispatcher disp;
                            disp = getServletContext().getRequestDispatcher("/confirmation.jsp");
                            disp.forward(req, res);      
                          //get free connection from pool
                            conn =connectionPool.getConnection();      
                //select a database
               // conn.setCatalog("survey");
                /* add this part*/
                stmt = conn.createStatement();
                rs = stmt.executeQuery("SELECT*  FROM survey where stuNumber='"+stuNumber+"'");
                    int count =0;//how many rows we can find.
                    while (rs.next()){
                        count++;
                    connectionPool.returnConnection(conn);
                 if(count<1){                       
                          conn.setAutoCommit(false);
                        String  sql="insert into survey(name, stuNumber, gender,facultyName,degree, year, quesOne, quesTwo, quesThree, quesFour, quesFive, quesSix,quesSeven, quesEight, quesNine,quesTen,quesEleven, quesTwelve, quesThirteen, quesFourteen,quesFifteen, quesSixteen, quesSeventeen, quesEighteen, quesNineteen, quesTwenty, quesTwentyOne)";
                                             sql+="value(?, ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
                              ps = conn.prepareStatement(sql);
                              stmt = conn.createStatement();
                               ps.setString(1, name);
                              ps.setString(2, stuNumber);
                              ps.setString(3, gender);
                              ps.setString(4, facultName);
                              ps.setString(5, degree);
                              ps.setString(6, year);
                              ps.setString(7, quesOne);
                              ps.setString(8, quesTwo);
                              ps.setString(9, quesThree);
                              ps.setString(10, quesFour);
                              ps.setString(11, quesFive);
                              ps.setString(12, quesSix);
                              ps.setString(13, quesSeven);
                              ps.setString(14, quesEight);
                              ps.setString(15, quesNine);
                              ps.setString(16, quesTen);
                              ps.setString(17, quesEleven);
                              ps.setString(18, quesTwelve);
                              ps.setString(19, quesThirteen);
                              ps.setString(20, quesFourteen);
                              ps.setString(21, quesFifteen);
                              ps.setString(22, quesSixteen);
                              ps.setString(23, quesSeventeen);
                              ps.setString(24, quesEighteen);
                              ps.setString(25, quesNineteen);
                              ps.setString(26, quesTwenty);
                              ps.setString(27, quesTwentyOne);
                              ps.executeUpdate();                   
                         conn.commit();
                      conn.setAutoCommit(true);   
                      connectionPool.returnConnection(conn);
                 /* doing the update*/
                 else{
                      conn.setAutoCommit(false);
                      String sql2 = "UPDATE survey set name=?";
                        sql2+= ", gender=?,facultyName=?,degree=?, year=?, quesOne=?, questwo=?, quesThree=?, quesFour=?, quesFive=?, quesSix=?,";
                        sql2+= "quesSeven=?,quesEight=?, quesNine=?, quesTen=?,quesEleven=?, quesTwelve=?, quesThirteen=?, quesFourteen=?";
                        sql2+=",quesFifteen=?, quesSixteen=?, quesSeventeen=?, quesEighteen=?, quesNineteen=?, quesTwenty=?, quesTwentyOne=?";
                        sql2+="WHERE stuNumber=?";
                        ps = conn.prepareStatement(sql2);
                        stmt = conn.createStatement();
                         ps.setString(1, name);                    
                          ps.setString(2, gender);
                          ps.setString(3, facultName);
                          ps.setString(4, degree);
                          ps.setString(5, year);
                          ps.setString(6, quesOne);
                          ps.setString(7, quesTwo);
                          ps.setString(8, quesThree);
                          ps.setString(9, quesFour);
                          ps.setString(10, quesFive);
                          ps.setString(11, quesSix);
                          ps.setString(12, quesSeven);
                          ps.setString(13, quesEight);
                          ps.setString(14, quesNine);
                          ps.setString(15, quesTen);
                          ps.setString(16, quesEleven);
                          ps.setString(17, quesTwelve);
                          ps.setString(18, quesThirteen);
                          ps.setString(19, quesFourteen);
                          ps.setString(20, quesFifteen);
                          ps.setString(21, quesSixteen);
                          ps.setString(22, quesSeventeen);
                          ps.setString(23, quesEighteen);
                          ps.setString(24, quesNineteen);
                          ps.setString(25, quesTwenty);
                          ps.setString(26, quesTwentyOne);
                          ps.setString(27,  stuNumber);
                          ps.executeUpdate();                   
                   conn.commit();
                 conn.setAutoCommit(true);   
                 connectionPool.returnConnection(conn);
        }catch (SQLException e) {
              throw new ServletException(e);
         finally {
              try {
                   if(rs != null)
                        rs.close();
                   if(stmt != null)
                        stmt.close();
                   if(ps != null)
                        ps.close();
                   if(conn != null)
                        conn.close();
                   connectionPool.returnConnection(conn);
              } catch (SQLException e) {}
    } // end doPost
    public String getServletInfo()
        return "A Simple Servlet";
    }// end of ContrInsert

    The way to do this with a JSP is use an HTML Form tag to pass all the information on to a new page, and save the new info while creating this new page

  • Difficult: How to write a SplitInputStream?

    Hi,
    I am trying to implement a SplitReader. The basic concept is "shared behavior, cloned data".
    Let me explain.. Given a parent InputStream, users can retrieved unlimited amounts of children-inputstreams. These children mirror parent behavior in every possible way. If the parent read() throws a IOInterruptedException after 30 seconds (say the parent is a SockeReader) the children should show the same behavior. This does not mean to say that the moment the parent object throws a IOInterruptedException all children should experience the same; rather, the implementation of the children read() should be identical to the parent read().
    Furthermore, while behavior is "shared", the data is distinct. If data is recieved by the parent stream, they are immediately "pushed" into all the children streams. If one child reads off its stream, this does not remove data away from any of the other streams; in this way their state is distinct.
    So far, I have managed to implement the data-mirroring aspect of SplitInputStream (ie: each stream gets a copy of the parent data) but I have no idea how to "share" the parent behavior across all children. Ideally I want this class to work for all future subclasses of InputStream which may not exist yet. The behavior "sharing" should be generic enough such that it'll automatically work for all future uses of this class.
    Can anyone please help or throw some ideas my way? The more discussion the better!
    Thanks,
    Gili
    (email = [email protected])

    I'm not sure that I fully understood what was it that you wanted, but here is my stab at it.
    I understood that you want the errors to appear to the children as they appear to the parent stream, but only when the "child" stream encounters that same spot where the error occurs. If so, then what you have to do, is "tag" the spots where the error occured.
    These code fragments contain only some relevant code, but should portray the idea.
    public ParentStream extends SomeInputStream {
      private String data = "";
      private int errorCode = -1;
      private Hashtable errors = new Hashtable();
      public ChildStream cloneStream() {
          return new ChildStream(data);
      public void doReading() {
          try {
              data += super.read(); // Or whatever...
          } catch(Exception e) {
              errors.put(new Integer(errorCode--),e);
              data += errorCode;
      public Throwable getError(Integer errCode) {
             return errors.get(errCode);
    public ChildStream {
        private String data;
        private ParentStream parent;
        int index = 0;
        public ChildStream(ParentStream parent, String data) {
              this.data = data;
              this.parent = parent;
        private int read() {
            int i = data.charAt(index++);
            if(i < 0) { // Error...
               try {
                   // This is done using reflection so that the stacktrace will point to the correct
                   // place, not the parentstream, but each of the child streams
                   Class _cl = Class.forName(parent.getError(new Integer(i)).getClass());
                   Constructor const =
                          _cl.getDeclaredConstructor(new Class[]{new String("").getClass()});
                    throw (Throwable)const.newInstance(new Object[]{parent.getError(new Integer(i))});
               catch(Exception e) {
                   e.printStackTrace();
    }Hope this made any sense ;).
    Tuomas Rinta

  • How to programmatically set the Visibility of an Iview INVISIBLE ?

    Hi ..... I need to programmatically set the visibility of an IView for a user Invisible - In order to achieve that , I am trying the below code....But getting errors-
    Code -
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sapportals.portal.pcd.gl.PcdInitialContextFactory");
                 env.put("com.sap.portal.jndi.requested_aspect","com.sap.portal.pcd.gl.PersistencyAspect");
    env.put("java.naming.factory.object", "__IPcdContext__");
    InitialContext iCtx = null;
    String iViewID = "pcd:portal_content/ABC/1Portal/mywork/iviews/XYA_iViews/adf.ivw_ess_jspdynpage";
                 iCtx = new InitialContext(env);
                 IiView result =(IiView)iCtx.lookup(iViewID);     
                 IiViews iViewSrv = (IiViews)PortalRuntime.getRuntimeResources().getService(IiViews.KEY);
    INewObjectDescriptor IVtoCreate =(INewObjectDescriptor) iViewSrv.instantiateDescriptor(CreateMethod.NEW,"par:/applications/com.sap.km.cm/components/navigation",request.getUser());
    IVtoCreate.putAttribute("com.sap.portal.navigation.invisible", true);
    the above method putAttribute is not apllicablt for (String,Boolean)\
    Please suggest as to how can I programmatically set an Iview Visible/Invisible .

    I think the property is com.sap.portal.navigation.Invisible with a capital I for invisible...
    This blog has an example: Hiding portal role content with a simple iView

  • JNI and Native Threads Doesn't work

    I am writing a wrapper class in C++ for a java class that publishes a message to JMS. In the C++ code I create the class, and call the one method. Everything does what it is supposed to, UNLESS more than one thread calls it. All the C++ wrapper stuff is in a DLL, and the classpath is correct for the java side, I then run an exe that is linked with the dll. The dll exposes one method that creates the java class, and calls the method. when more than one thread enters the DLL, I start getting class not found exceptions?? where as if I just call the method multiple times in a single thread, all works fine?? Please help, code included
    -----------------------DLL CODE-------------------------------
    extern "C"
    BOOL APIENTRY DllMain(HINSTANCE hInst,DWORD reason,LPVOID reserved)
    switch (reason)
    case DLL_PROCESS_ATTACH:
    if(!crit_init)
    printf("Initializing Critical Section\n");
    InitializeCriticalSection(&cs);
    crit_init = true;
    EnterCriticalSection(&cs);
    if(jvm == NULL)
    char buffer[1024];
    int portNum = -1;
    JavaVMInitArgs vm_args;
    JNIEnv *env = NULL;
    JavaVMOption options[4];
    memset(buffer,0,sizeof(buffer));
    strcat(buffer,"-Djava.class.path=");
    strcat(buffer,getenv("CLASSPATH"));
    printf("\nClassPath :\n\n%s",buffer);
    printf("\n\n");
    options[0].optionString = "-Djava.compiler=NONE"; // disable JIT
    options[1].optionString = buffer; // user classes
    options[2].optionString = "-Xms64M";
    options[3].optionString = "-Xmx64M";
    vm_args.version = JNI_VERSION_1_2;
    vm_args.options = options;
    vm_args.nOptions = 4;
    vm_args.ignoreUnrecognized = 1;
    printf("Creating JVM\n\n");
    if(JNI_CreateJavaVM(&jvm, (void **)&env, &vm_args ) != 0)
    printf("Failed to Create JVM!\n");
    LeaveCriticalSection(&cs);
    return false;
    printf("JVM Created\n\n");
    LeaveCriticalSection(&cs);
    return true;
    case DLL_PROCESS_DETACH:
    break;
    case DLL_THREAD_ATTACH:
    break;
    case DLL_THREAD_DETACH:
    break;
    /* Returns TRUE on success, FALSE on failure */
    return TRUE;
    DLLIMPORT char* publishAndWait(char * destination,
    char* payloadFormat, char* transactionType,
    char *payload, int timeoutSec)
    JNIEnv* jEnv = NULL;
    if(jvm->AttachCurrentThread((void**) &jEnv, NULL) || jEnv == NULL)
    printf("AttachCurrentThread error\n");
    return NULL;
    EnterCriticalSection(&cs);
    if(jmsStub == NULL)
    int portNum = -1;
    char buffer[10];
    memset(buffer,0,sizeof(buffer));
    itoa(portNum,getenv("CORBA_RESP_PORT"),10);
    printf("Creating JMSStub Instance\n");
    jmsStub = new JMSStub(getenv("WL_URL"),getenv("WL_CONN_FACTORY"),portNum,jEnv);
    printf("JMSStub Created\n\n");
    LeaveCriticalSection(&cs);
    return jmsStub->publishAndWait(destination,payloadFormat,
    transactionType,payload,timeoutSec,jEnv);
    int retDetVal = jvm->DetachCurrentThread();
    if(retDetVal)
    printf("DetachCurrentThread error %d\n", retDetVal);
    return NULL;
    ----------------------JMS STUB CLASS (IN DLL)-------------------------
    JMSStub::JMSStub(string wlURL, string connectionFactory, int responsePort,JNIEnv* jEnv)
    printf("Setting Local Strings\n");
    this->wlURL = wlURL;
    this->connectionFactory = connectionFactory;
    this->responsePort = responsePort;
    printf("Local Strings Set\n");
    // load class
    this->loadMethodIDs(jEnv);
    localObject = jEnv->NewObject(jmsStubCls,stubMethodMap.find("<init>")->second,
    jEnv->NewStringUTF(wlURL.c_str()),jEnv->NewStringUTF(connectionFactory.c_str()),
    responsePort,false);
    // create global reference so garbage collection will not take place
    printf("Creating GlobalRef to JMSStub Instance\n");
    globalObject = jEnv->NewGlobalRef(localObject);
    void JMSStub::loadMethodIDs(JNIEnv* jEnv)
    printf("Getting Hashtable Class\n");
    hashTableCls = jEnv->FindClass("java/util/Hashtable" );
    printf("Getting JMSStub Class\n");
    jmsStubCls = jEnv->FindClass("com/pacificare/common/jms/JMSStub");
    if(hashTableCls == NULL)
    printf("Error Getting Hashtable information!!\n");
    exit(-255);
    if(jmsStubCls == NULL)
    printf("Error Getting JMSStub information!!\n");
    exit(-255);
    printf("Getting Hashtable Methods\n");
    /* Get Hashtable Constructor */
    hashMethodMap.insert(MethodIDMap::value_type("<init>",
    jEnv->GetMethodID(hashTableCls, "<init>","()V")));
    /* get put method id */
    hashMethodMap.insert(MethodIDMap::value_type("put",jEnv->GetMethodID(hashTableCls, "put",
    "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;")));
    printf("Getting JMSStub Methods\n");
    /* get JMSStub constructor */
    stubMethodMap.insert(MethodIDMap::value_type("<init>",jEnv->GetMethodID(jmsStubCls, "<init>",
    "(Ljava/lang/String;Ljava/lang/String;IZ)V" )));
    /* find the publishAndWait method */
    stubMethodMap.insert(MethodIDMap::value_type("publishAndWait",jEnv->GetMethodID(jmsStubCls,"publishAndWait",
    "(Ljava/lang/String;Ljava/util/Hashtable;I)Ljava/lang/String;")));
    bool JMSStub::hasExceptionOccurred(JNIEnv* jEnv)
    jthrowable     jthr = NULL;
    jthr = jEnv->ExceptionOccurred();
    if(jthr == NULL)
    return false;
    jEnv->ExceptionDescribe();
    jEnv->ExceptionClear();
    return true;
    char* JMSStub::publishAndWait(char * destination,
    char* payloadFormat, char* transactionType,
    char payload, int timeoutSec,JNIEnv jEnv)
    jmethodID hpMid = hashMethodMap.find("put")->second;
    // Strings used in methods, constructors, ect
    jstring destinationStr = jEnv->NewStringUTF(destination);
    jstring payloadFormatStr = jEnv->NewStringUTF(payloadFormat);
    jstring transTypeStr = jEnv->NewStringUTF(transactionType);
    jstring payloadStr = jEnv->NewStringUTF(payloadFormat);
    jobject localHashtable = jEnv->NewObject(hashTableCls,hashMethodMap.find("<init>")->second);
    jEnv->CallObjectMethod(localHashtable,hpMid,jEnv->NewStringUTF("^^^^^payloadFormat"),payloadFormatStr);
    jEnv->CallObjectMethod(localHashtable,hpMid,jEnv->NewStringUTF("^^^^^transactionType"),transTypeStr);
    jEnv->CallObjectMethod(localHashtable,hpMid,jEnv->NewStringUTF("^^^^^payload"),payloadStr);
    jstring retStr = (jstring)jEnv->CallObjectMethod(globalObject,
    stubMethodMap.find("publishAndWait")->second,
    destinationStr,localHashtable,timeoutSec);
    if(hasExceptionOccurred(jEnv))
    printf("Exception has occurred.\n");
    return NULL;
    else
    if(retStr == NULL)
    return NULL;
    const char *utfPtr = jEnv->GetStringUTFChars(retStr,0);
    int len = jEnv->GetStringUTFLength(retStr);
    char returnStr = (char)malloc(len);
    memset(returnStr,0,len);
    memcpy(returnStr,utfPtr,len);
    jEnv->ReleaseStringUTFChars(retStr,utfPtr);
    return returnStr;
    ------------------------------EXE------------------------------------
    DWORD WINAPI ThreadFunc( LPVOID lpParam )
    char buffer = (char )lpParam;
    const char *tst = publishAndWait("vitria.jms.authreq","XML","276",buffer,120);      
    if(tst == NULL)
    printf("No Response\n");
    else
    printf("%s\n",tst);
    delete tst;
    tCntDone++;
    _endthread();
    char * readFile(char* fileName)
    FILE *xmlFile = NULL;
    printf("Opening File %s\n",fileName);
    if((xmlFile = fopen(fileName,"r")) == NULL)
    printf("Unable to open File %s\n",fileName);
    exit(-256);
    long fileLen = filelength(fileno(xmlFile));
    char *buffer = new char[30000];
    memset(buffer,0,sizeof(buffer));
    fread(buffer,fileLen,1,xmlFile);
    buffer[fileLen] = '\0';
    fclose(xmlFile);
    return buffer;
    int main(int argc, char *argv[])
    DWORD dwThreadId[2];
    HANDLE hThread[2];
    char *buffer = NULL;
    if(argc < 2)
    printf("You must supply the name of the xml file as an argument!!\n");
    exit(-255);
    buffer = readFile(argv[1]);
    printf("%s\n",buffer);
    for(int i = 0; i < 2; i++)
    printf("Creating Thread %x\n",i);
    hThread[i] = CreateThread(NULL,0,ThreadFunc,buffer,0,&dwThreadId);
    Sleep(1000);
    while(tCntDone < 2)
    Sleep(3000);
    //printf("Threads Complete %x\n",tCntDone);
    CloseHandle(hThread[0]);
    CloseHandle(hThread[1]);
    /*for(int x = 0; x < 2;x++)
    const char *tst = publishAndWait("vitria.jms.authreq","XML","276",buffer,120);      
    if(tst == NULL)
    printf("No Response\n");
    else
    printf("%s\n",tst);
    delete tst;
    delete(buffer);

    Ok, I have done some more testing. It appears that two native threads cannot access the same java object, even if a global reference exist, and you call AttachCurrentThread, and using that env pointer to make calls. It always fails with some java error, like ClassNotFoundError, and only on the second native thread created. Is this a part of the spec or is it a bug, or am I having an operator malfuntion?

  • How to verify if user already exists in MySQL database using JSP?

    Hi, I am trying to create a website that allows users to register and then login. All regsitration details are stored in a MySQL table and I am attempting to have a java bean check that a new user does not already exist by looking up the username. However, I cannot get this to work, the bean is allowing anyone through. I believe there may be a problem with my while loop as the bean checks through the stored usernames in the database. Any suggestions appreciated thanks. See my code below:[
    code]package foo;
    import java.sql.*;
    import java.util.*;
    public class FormBean {
         private String firstName;
         private String lastName;
         private String email;
         private String userName;
         private String password1;
         private String password2;
         private Hashtable errors;
         public boolean validate() {
              boolean allOk=true;
              if (firstName.equals("")) {
                   errors.put("firstName","Please enter your first name");
                   firstName="";
                   allOk=false;
              if (lastName.equals("")) {
                   errors.put("lastName","Please enter your last name");
                   lastName="";
                   allOk=false;
              if (email.equals("") || (email.indexOf('@') == -1)) {
                   errors.put("email","Please enter a valid email address");
                   email="";
                   allOk=false;
              if (userName.equals("")) {
                   errors.put("userName","Please enter a username");
                   userName="";
                   allOk=false;
    try {
              String database = "******hidden******";
              Class.forName("com.mysql.jdbc.Driver");
              Connection conn = DriverManager.getConnection(database,"********hidden*******");
              Statement stat = conn.createStatement();
              String query="SELECT u_name FROM users;";
              String DbUserName="";
              ResultSet rst=stat.executeQuery(query);
              while(rst.next()) {
    DbUserName=rst.getString("u_name");
    if (userName.equals(DbUserName)) {
    allOk=false;
    errors.put("userName","User name already exists, please choose another");
    userName="";
    conn.close();
    break;
    } catch (Exception ex) {
    ex.printStackTrace();
              if (password1.equals("") ) {
                   errors.put("password1","Please enter a valid password");
                   password1="";
                   allOk=false;
              if (!password1.equals("") && (password2.equals("") || !password1.equals(password2))) {
                   errors.put("password2","Please confirm your password");
                   password2="";
                   allOk=false;
    return allOk;
         public String getErrorMsg(String s) {
              String errorMsg =(String)errors.get(s.trim());
         return (errorMsg == null) ? "":errorMsg;
         public FormBean() {
         firstName="";
         lastName="";
         email="";
    userName="";
         password1="";
         password2="";
         errors = new Hashtable();
         public String getFirstName() {
              return firstName;
         public String getLastName() {
              return lastName;
         public String getEmail() {
              return email;
         public String getUserName() {
              return userName;
         public String getPassword1() {
              return password1;
         public String getPassword2() {
              return password2;
         public void setFirstName(String fname) {
              firstName =fname;
         public void setLastName(String lname) {
              lastName =lname;
         public void setEmail(String eml) {
              email=eml;
         public void setUserName(String u) {
              userName=u;
         public void setPassword1(String p1) {
              password1=p1;
         public void setPassword2(String p2) {
              password2=p2;
         public void setErrors(String key, String msg) {     
              errors.put(key,msg);

    Hmm, tried that and now have more build errors in the finally section.
    init:
    deps-jar:
    Compiling 1 source file to C:\resin-2.1.11\doc\examples\basic\WEB-INF\classes\JavaLibrary1\build\classes
    C:\resin-2.1.11\doc\examples\basic\WEB-INF\classes\JavaLibrary1\test\FormBean.java:57: cannot resolve symbol
    symbol  : variable rst
    location: class foo.FormBean
                if (rst != null) rst.close();
    C:\resin-2.1.11\doc\examples\basic\WEB-INF\classes\JavaLibrary1\test\FormBean.java:57: cannot resolve symbol
    symbol  : variable rst
    location: class foo.FormBean
                if (rst != null) rst.close();
    C:\resin-2.1.11\doc\examples\basic\WEB-INF\classes\JavaLibrary1\test\FormBean.java:58: cannot resolve symbol
    symbol  : variable stat
    location: class foo.FormBean
                if (stat != null) stat.close();
    C:\resin-2.1.11\doc\examples\basic\WEB-INF\classes\JavaLibrary1\test\FormBean.java:58: cannot resolve symbol
    symbol  : variable stat
    location: class foo.FormBean
                if (stat != null) stat.close();
    C:\resin-2.1.11\doc\examples\basic\WEB-INF\classes\JavaLibrary1\test\FormBean.java:59: cannot resolve symbol
    symbol  : variable conn
    location: class foo.FormBean
                if (conn != null)  conn.close();
    C:\resin-2.1.11\doc\examples\basic\WEB-INF\classes\JavaLibrary1\test\FormBean.java:59: cannot resolve symbol
    symbol  : variable conn
    location: class foo.FormBean
                if (con != null)  conn.close();
    6 errors
    BUILD FAILED (total time: 1 second)Just for a quick test, I deleted the sql exception and finally code and replaced it with a regular exception just to see what happened and got no build errors, however when I run the form I am getting an sql exception from the prepared statement, parameter out of range (1 > 0). I tried reading into prepared statements, and although I now understand their basics, I still have no idea why I'm getting this error?

  • Mail cannot clear Drafts in .OfflineCache but can save to Drafts on server

    OK, I've been chasing this problem (and other related issues) for three days now and I'm at wits end.
    I see that I am not alone with the the Mac Mail app getting stuck with messages in its .OfflineCache folder for an email account that it can not process. The common response is to quite Mail, and delete the contents of .OfflineCache, if not the whole directory.
    In the case in front of me now, I have 7 versions of a draft message (destined for "Drafts"), a delete of that draft message and a copy of that message destined for "Sent Messages". Obviously, for a while Mail could not execute these commands to the IMAP server at SpamArrest.
    What I don't understand is why can I continue to save new files to Drafts and Sent Messages but the .OfflineCache cannot clear itself?
    I don't want to just delete the files in .OfflineCache (partly because I need the one in Sent Messages) but I because that is just treating the symptom and not fixing the recurring problem of messages ending up .OfflineCache on a fairly regular basis.
    Why can't Mail clear the .OfflineCache?

    I keep looking at the IMAP protocol output from the Connection Doctor and I'm stymied at why I'm getting a time out. In tracing the log, I see us connect on port 993 with thread 0x187564f0:
    CONNECTED May 24 23:00:28.046 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x1917bbc0 -- thread:0x187564f0
    We then start a new thread 0x191581a0 which performs all the subsequent actions including the APPEND:
    WROTE May 24 23:00:29.286 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x1917bbc0 -- thread:0x191581a0
    4.35 APPEND INBOX.Drafts (\Seen \Draft $NotJunk NotJunk) "24-May-2009 17:21:45 -0700" {5050}
    READ May 24 23:00:29.356 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x1917bbc0 -- thread:0x191581a0
    + OK
    WROTE May 24 23:00:29.367 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x1917bbc0 -- thread:0x191581a0
    X-Uniform-Type-Identifier: com.apple.mail-draft
    From: Chip Roberson <[email protected]>
    The next thing I see is a timeout on thread, 0x191581a0:
    READ May 24 23:01:29.355 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x1917bbc0 -- thread:0x191581a0
    * BYE Disconnected for inactivity
    It would seem that my client is in a wait state, waiting for a response from the WRITE which it does not get a response. Given that I have written to this Drafts folder before, I know it can be done but right now I can't.
    SpamArrest swears they don't see anything on their side and that the problem must be on my Mac but what could it be?
    The only other clue is that immediately after the Disconnect message, I get the hashtable error:
    READ May 24 23:01:29.437 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x1917bbc0 -- thread:0x187564f0
    BYE [ALERT] Fatal error: INTERNAL ERROR: Keyword hashtable memory corruption: Input/Output error
    That seems to be a direct result of the timeout but it's hard to know for sure. I wish I knew what "keyword hashtable".
    I've done all the standard stuff (e.g. rebuilding, reindexing, permissions, etc.) so I'm struggling to find something else to do. I just wish I could get some more visibility into the problem. Given the symptoms I'm seeing in other threads in this forum, I don't think I'm on the only one with this problem. Am I?

  • IMAP time out on port 993

    Hello,
    Since 2 days I have every minute a "time out" pop up on mail app regarding my imaps accounts.
    I own the mailserver so i know that the problem doesnt come from there.
    What should i do ?
    I dont really want to delete the pref & cache because it is huge mailboxes and here in Australia we have some internet quota...
    help..

    Jerume,
    Search this forum for the string ".OfflineCache" and you'll find several messages describing how to fix this problem in the short term.
    What has happened, I think, is that at some point you were editing a message (and possibly sent it) and Mail.app thought you were offline so it saved the drafts files and sent message in the .OfflineCache in ~/Library/Mail. The problem I'm having is that when that happens, Mail.app is never able to clear the .OfflineCache once you go online again.
    The net result is that every minute it tries to resend the message and fails, in my case with a timeout and INTERNAL ERROR: Keyword hashtable memory corruption:
    READ May 19 17:14:13.626 [kCFStreamSocketSecurityLevelNegotiatedSSL] -- host:mail.spamarrest.com -- port:993 -- socket:0x189d0050 -- thread:0x1d314d10
    * BYE Disconnected for inactivity.
    * BYE [ALERT] Fatal error: INTERNAL ERROR: Keyword hashtable memory corruption.: Input/output error
    I have not been able to figure out how to resolve this from my end. SpamArrest swears it's not their problem.
    Chip

  • The method is undefined for the type

    HI I have a javabean class:
    package database;
    import java.util.*;
    import java.io.*;
    public class CompanyFormBean implements Serializable{
      private String companyparentid;          
      private String companyname;               
      private Hashtable errors;
      //private String notify;
    public boolean validate() {
        boolean allOk=true;
        if (companyname.equals("")) {
          errors.put("companyname","Please enter your Company Name.");
          companyname="";
          allOk=false;
        return allOk;
      public String getErrorMsg(String s) {
        String errorMsg =(String)errors.get(s.trim());
        return (errorMsg == null) ? "":errorMsg;
    // public CompanyFormBean(){}
      public CompanyFormBean() {
        companyparentid          = "";
        companyname               = "";
        errors = new Hashtable();
      public String getCompanyparentid() {
        return companyparentid;
      public String getCompanyname() {
        return companyname;
      public void setCompanyparentid(String fcompanyparentid) {
        companyparentid = fcompanyparentid;
      public void setCompanyname(String fcompanyname) {
        companyname = fcompanyname;
      public void setErrors(String key, String msg) {
        errors.put(key,msg);
    }after the form is submitted I try to display the values
    <%@ page import="database.CompanyFormBean" %>
    <jsp:useBean id="formHandler" class="database.CompanyFormBean" scope="session"/>
    <html>
    <head>
    <title></title>
    <meta name="Generator" content="EditPlus">
    <meta name="Author: Irene Nessa" content="">
    <meta name="Keywords" content="">
    <meta name="Description: creates a new member account" content="">
    </head>
    <body>
    <form name="reg" method="post" action="ProcessMemberRegistration.jsp" onsubmit='return formValidator()'>
    <table>
         <tr>
         <td>Create A New Account</td>
         </tr>
         <tr>
              <td>Existing Company</td>
              <td>
                   <input type="text" name="companyparentid" value='<%=formHandler.getCompanyparentid()%>'>
                   <!-- <select name="campanyparentid" onchange="setcompany(this)">
                        <option>Better Homes</option>
                        <option>Emaar</option>
                   </select>
                   <font size="" color="#FF0033"><b><i>OR</i></b></font>-->
              </td>
         </tr>
         <tr>
              <td>Company Name *</td>
              <td><input type="text" name="companyname" value='<%=formHandler.getCompanyname()%>'>
              </td>
         </tr>
    </table>
    <br>
         <br>
         <input type="reset">  <input type="submit" value='Check Form' />
    </form>
    </body>
    </html>But I keep getting the following errors:*The method getCompanyparentid() is undefined for the type CompanyFormBean* But it defind and the bean class complies. Any idea what am doing wrong.
    thanks.

    I actually got the same error in the same situation the following is my error and Stacktrace. I was trying to using AJAX to retrieve the message from DB and display it in a text area when user click a radio button. It works well untill I add a new method getMessage(String), please help!
    Mar 2, 2009 10:01:03 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 22 in the jsp file: /getmessage.jsp
    The method getMessage(String) is undefined for the type Item
    19: <jsp:setProperty name="items" property="categoryId" value="<%=catid%>" />
    20: <jsp:setProperty name="items" property="effectiveIndicator" value="C" />
    21: <%
    22: String msg = items.getMessage(id);
    23: String decodedmsg = new String(msg.getBytes("iso-8859-1"), "Big5");
    24: System.out.print("MSG: " + msg);
    25: System.out.print("Deco-MSG: " + decodedmsg);
    An error occurred at line: 26 in the jsp file: /getmessage.jsp
    The method write(String) is undefined for the type HttpServletResponse
    23: String decodedmsg = new String(msg.getBytes("iso-8859-1"), "Big5");
    24: System.out.print("MSG: " + msg);
    25: System.out.print("Deco-MSG: " + decodedmsg);
    26: response.write(decodedmsg);
    27: %>
    Stacktrace:
    at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
    at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
    at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:415)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:308)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
    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.valves.AccessLogValve.invoke(AccessLogValve.java:517)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
    at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
    at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
    at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
    at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
    at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:686)
    at java.lang.Thread.run(Thread.java:619)

  • Use string as identifier in array?

    hi, is it possible to use String as identifier in arrays instead of numbers? if so, how do you do it?

    lol.. mmm.. well, i just discovered hashtables :D mmm.. i find hashname.put(object, object); to be too much.. so i wrote a adhoc method for walking through two arrays and putting them into hastables :D though, i had some errors:
    public Hashtable makeHash(int cap, String allString[], int allInt[])
         Hashtable hash = new Hashtable(cap);
         int i = 0;
         while(i < allString.length && i < allInt.length)
              hash.put(allString, new Integer(allInt[i]));
              i++;
         return hash;
    then i ran this method:
    String days[]=
              "Sun",
              "Mon",
              "Tue",
              "Wed",
              "Thu",
              "Fri",
              "Sat"
    int offset[] = {0, 1, 2, 3, 4, 5, 6};
    makeHash(7, days[], offset[]);in eclipse, there is a red mark under the comma right after days[] in the makeHash parameter... when i mouse over it, it gave me an "Syntax error on token ",","." expected".. anyone know what i'm doing wrong?

Maybe you are looking for

  • What Songs are iTunes Plus in iTunes 9 Store?

    I just upgraded to iTunes 9. In the iTunes Store, you used to be able to tell which tracks were iTunes PLUS because they had a little "+" sign next to them. Now, none do? What does this mean? Is this a bug? Are ALL iTunes audio files now iTunes PLUS?

  • 2 Web Servers on one Business Hub?

    We had a two-wire hub and we've just moved to new offices and have a new BT Business Hub 3.  We have five static IP addresses and we have two servers on the end of it. I have one server running on a static IP via port forwarding and the web site (Sha

  • Error when install wlss22 on solaris 10 x86

    encountered error during installation of wlss22 (solaris build) on my solaris 10 x86 pls help $./wlss220_solaris32.bin bash: ./wlss220_solaris32.bin: Invalid argument

  • Should I switch?

    I'm presently a happy Debian user looking for a better experience, and I'm wondering if Archlinux might be the answer.  I've heard lots of great stuff about it. I love that Debian has all the packages I want and a huge, active community.  Apt is grea

  • Vanishing point for camera matching: any chance it's been tuned up to function?

    I've been trying to use the VP tool in CS5 to do some camera matching work for 3dsMax. The potential is huge - it is really intuitive and fast to set up in Photoshop, but the exports never seem to work right. The cameras do not line up properly when