Why am I still getting ConcurrentModificationException?!

Here is a simple test that I ran on a collection that I have implemented, in which I try to add multiple objects to the collection in multiple threads. I have labelled the methods which modify the colleciton as synchronized, so I had thought it would not allow more than one LinkedCollection.add operation at a time. However, I am getting ConcurrentModificationExceptions from it. Below the test I have included the code for my LinkedCollection class and all other relevant classes, so that it's possible for anyone here to run it if needed. Thanks for any help!
==========================================================================================
public class ThreadTest {
    public static void main(String[] args) {
        LinkedCollection<Integer> c = new LinkedCollection<Integer>();
        for (int i = 0; i < 10; i++) {
            Thread t = new Thread(new Berk(c, i * 10), "Thread " + i);
            t.start();
        System.out.println(c);
    static class Berk implements Runnable {
        private LinkedCollection<Integer> c;
        private int i;
        public Berk(LinkedCollection<Integer> c, int i) {
            this.c = c;
            this.i = i;
        public void run() {
            for (int i = 0; i < 10; i++)
                c.add(this.i + i);
}==========================================================================================
import java.util.Collection;
public class LinkedCollection<E> implements Collection<E>, PublicCloneable<LinkedCollection<E>>, ModificationEventGenerator {
    protected Position<E> head;
    protected int size;
    private LinkedCollection<ModificationListener> listeners;
    public LinkedCollection() {
        this(true);
    protected LinkedCollection(boolean notifyModifications) {
        listeners = notifyModifications ? new LinkedCollection<ModificationListener>(false) : null;
    public boolean isEmpty() {
        return head == null;
    public boolean contains(Object element) {
        return getFirstPosition(element) != null;
    public boolean containsAny(Collection<?> c) {
        for (Object element : c)
            if (contains(element))
                return true;
        return false;
    public boolean containsAll(Collection<?> c) {
        for (Object element : c)
            if (!contains(element))
                return false;
        return true;
    public int occurrences(Object element) {
        return getPositions(element).size();
    public int size() {
        return size;
    public synchronized boolean add(E element) {
        if (element != null) {
            generateModificationEvent();
            if (isEmpty())
                head = new Position<E>(element);
            else
                head.prev = head.prev.next = new Position<E>(element, head.prev, head);
            size++;
            return true;
        return false;
    public synchronized boolean addAll(Collection<? extends E> c) {
        boolean changed = false;
        for (E element : c)
            if (add(element))
                changed = true;
        return changed;
    public synchronized boolean remove(Object element) {
        LinkedCollection<Position<E>> removals = getPositions(element);
        for (Position<E> current : removals) {
            if (size == 1)
                head = null;
            else {
                if (current == head)
                    head = head.next;
                current.prev.next = current.next;
                current.next.prev = current.prev;
                current.prev = current.next = current;
            size--;
        return generateModificationEvent(!removals.isEmpty());
    public synchronized boolean removeAll(Collection<?> c) {
        boolean changed = false;
        for (Object element : c)
            if (remove(element))
                changed = true;
        return changed;
    public synchronized boolean retainAll(Collection<?> c) {
        LinkedCollection<E> removals = new LinkedCollection<E>();
        for (E element : this)
            if (!c.contains(element))
                removals.add(element);
        for (E element : removals)
            this.remove(element);
        return !removals.isEmpty();
    public synchronized void clear() {
        Position next;
        while (size > 0) {
            next = head.next;
            head.prev = head.next = head;
            head = next;
            size--;
        head = null;
        if (listeners != null)
            listeners.clear();
    public Object[] toArray() {
        Object[] array = new Object[size];
        int index = 0;
        for (E element : this)
            array[index++] = element;
        return array;       
    public <T> T[] toArray(T[] type) {
        T[] array = type.length < size ? (T[]) new Object[size] : type;
        int index = 0;
        for (E element : this)
            array[index++] = (T)element;
        if (array.length > size)
            array[index] = null;
        return array;
    public String toString() {
        String s = "";
        for (E element : this)
            s += element.toString() + " ";
        return s;
    public boolean equals(Object o) {
        if (!(o instanceof Collection<?>))
            return false;
        LinkedCollection<?> s = (LinkedCollection<?>)o;
        for (Object element : s)
            if (occurrences(element) != s.occurrences(element))
                return false;
        for (E element : this)
            if (!s.contains(element))
                return false;
        return true;
    public int hashCode() {
        return 0;
    public LinkedCollection<E> clone() {
        LinkedCollection<E> clone = new LinkedCollection<E>();
        clone.addAll(this);
        return clone;
    public void addModificationListener(ModificationListener m) {
        if (listeners != null && !listeners.contains(m))
            listeners.add(m);
    public void removeModificationListener(ModificationListener m) {
        if (listeners != null)
            listeners.remove(m);
    public void generateModificationEvent() {
        if (listeners != null)
            for (ModificationListener m : listeners)
                m.modified(new ModificationEvent(this));
    public boolean generateModificationEvent(boolean condition) {
        if (condition)
            generateModificationEvent();
        return condition;
    public final java.util.Iterator<E> iterator() {
        return new Iterator<E>(this, head, head);
    protected LinkedCollection<Position<E>> getPositions(Object element) {
        LinkedCollection<Position<E>> matches = new LinkedCollection<Position<E>>(false);
        if (!isEmpty()) {
            Position<E> match = head.prev;
            int count = 0;
            while (matches.add(match.next == head && count++ > 0 ? null : (match = getFirstPosition(element, match.next))));
        return matches;
    protected Position<E> getFirstPosition(Object element, Position<E> start) {
        if (!isEmpty()) {
            Iterator i = new Iterator(this, start, head);
            while (i.hasNext())
                if (i.next().equals(element)) {
                    i.terminate();
                    return i.currentPosition();
        return null;
    protected Position<E> getFirstPosition(Object element) {
        return getFirstPosition(element, head);
}==========================================================================================
import java.util.ConcurrentModificationException;
import java.util.NoSuchElementException;
class Iterator<E> implements java.util.Iterator<E>, ModificationListener {
    private ModificationEventGenerator parent;
    protected Position<E> start, end, current, next;
    private boolean started, hasNext, hasNextCalculated, terminatedExternally;
    public Iterator(ModificationEventGenerator parent, Position<E> start, Position<E> end) {
        this.parent = parent;
        parent.addModificationListener(this);
        this.start = start;
        this.end = end;
        current = null;
        next = start;
    public boolean hasNext() {
        checkTerminatedExternally();
        if (!hasNextCalculated) {
            hasNext = !(start == null || (started && (next == null || next == end)));
            hasNextCalculated = true;
        if (!hasNext)
            terminate();
        return hasNext;
    public E next() {
        return nextPosition().element();
    protected Position<E> nextPosition() {
        checkTerminatedExternally();
        if (!hasNext())
            throw new NoSuchElementException();
        started = true;
        hasNextCalculated = false;
        next = (current = next).next;
        return current;
    protected Position<E> currentPosition() {
        return current;
    public void remove() {
        throw new UnsupportedOperationException();
    public void modified(ModificationEvent e) throws ConcurrentModificationException {
        if (e.getSource() == parent)
            throw new ConcurrentModificationException();
    public void terminate() {
        terminate(true);
    private void terminate(boolean externally) {
        checkTerminatedExternally();
        parent.removeModificationListener(this);
        if (externally)
            terminatedExternally = true;
    private void checkTerminatedExternally() {
        if (terminatedExternally)
            throw new UnsupportedOperationException("It is not possible to use an iterator that has been terminated.");
}==========================================================================================
import java.util.Iterator;
public class Position<E> {
    private E element;
    protected Position prev = this, next = this;
    public Position(E element) {
        this.element = element;
    public Position(E element, Position prev, Position next) {
        this(element);
        this.prev = prev;
        this.next = next;
    public E element() {
        return element;
    public String toString() {
        return "[" + prev.element.toString() + "]<[" + element.toString() + "]>[" + next.element.toString() + "] ";
}==========================================================================================
import java.util.EventListener;
public interface ModificationListener extends EventListener {
    public void modified(ModificationEvent e);
}==========================================================================================
import java.util.EventObject;
public class ModificationEvent extends EventObject {
    public ModificationEvent(Object source) {
        super(source);
}==========================================================================================
public interface ModificationEventGenerator {
    public void addModificationListener(ModificationListener m);
    public void removeModificationListener(ModificationListener m);
    public void generateModificationEvent();
}==========================================================================================
public interface PublicCloneable<T extends PublicCloneable<T>> {
    public T clone();
}==========================================================================================

I have changed my tests to call Collections.synchronizedCollection when initialising the collection, but now, although the exceptions no longer occur, hardly any of the elements are being added to the collection! Here is my new test code:
import java.util.Collection;
import java.util.Collections;
public class GeneralTests {
    public static void main(String[] args) {
        Collection<Integer> c = Collections.synchronizedCollection(new LinkedCollection<Integer>());
        for (int i = 0; i < 10; i++) {
            Thread t = new Thread(new Berk(c, i * 10), "Thread " + i);
            t.start();
        System.out.println(c);
    static class Berk implements Runnable {
        private Collection<Integer> c;
        private int i;
        public Berk(Collection<Integer> c, int i) {
            this.c = c;
            this.i = i;
        public void run() {
            for (int i = 0; i < 10; i++)
                c.add(this.i + i);
}

Similar Messages

  • Why am I still getting this message after logging in - This computer is no longer authorized for apps that are installed on the iPhone "Myron Liptzin's iPhone". Would you like to authorize this computer for items purchased from the iTunes Store?

    why am I still getting this message after logging in?  "This computer is no longer authorized for apps that are installed on the iPhone “*************s iPhone”. Would you like to authorize this computer for items purchased from the iTunes Store?"  - after I have logged in and get the message that the computer is already authorized!!!?? - and then the above message pops up again?

    Click here and follow the instructions.
    (71175)

  • Why do I still get class or interface expected error????

    I made sure I closed all the bracket, why do i still get the error.
    Please help
    * ShopCartServletHW3.java
    * Created on November 19, 2007, 5:42 PM
    package ITI;
    import java.io.*;
    import java.net.*;
    import java.lang.*;
    import java.util.*;
    import java.text.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    * @author Administrator
    * @version
    public class ShopCartServletHW3 extends HttpServlet {
        /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
         * @param request servlet request
         * @param response servlet response
        private String pageTop01;
        private String pageTop02;
        private String pageTop03;
        private String pageTop04;
        private String pageTable01Top;
        private String pageTable01Bottom;
        private String pageBottom;
        private String pageItemEmpty;
        private String confirmTable01Bottom;
        private String confirmTableTop;
        private String confirmItemEmpty;
        private Hashtable pageItemList = new Hashtable();
        private Hashtable confirmItemList = new Hashtable();
        private double runningTotal;
        private ShopCartDataHW3 cartData;
        private InvTrackerHW3 invTracker;
        private Hashtable pastOrders;
        public void init() throws ServletException {
             PageTop01 = "<html>"
                    + "<head>"
                    + "<title>Blue Ridge Supply Shopping Cart </title>"
                    + "</head>"
                    + "<style type=\"text/css\">"
                    + "body {font-family: arial}"
                    + "h1 {color: navy}"
                    + "h2 {color: navy}"
                    + "h3 {color: white}"
                    + "h4 {color: white"
                    + "h5 {color: white}"
                    + "h6 {color: navy}"
                    + "p {color: navy}"
                    + "</style>"
                    + "<body>";
            pageTop02 = "<table border=\"0\" width=\"100%\" cellpadding=\"0\">"
                    + "<tr><td width=\"25%\" valign=\"top\">"
                    + "Shopper: ";
            pageTop03 = "<br>"
                    + "<a href=\"RegLoginServletHW3\"> [Log Out]</a>"
                    + " "
                    + "<a href=\"CatServletHW3\">[Continue Shopping]</a></td>"
                    + "<td width=\"50%\" valign=\"bottom\" align=\"center\"><h1>"
                    + "Blue Ridge Supply - Shopping Cart"
                    + "</h1>"
                    + "<td width=\"25%\" valign=\"top\" align=\"right\">"
                    + "Shopping Cart contains ";
            pageTop04 = " items </em> "
                    + "</td></tr></table><hr>";
            pageTable01Top = "<center><h3>"
                    + "Please review sections:"
                    + "</h3><table border=\"1\" cellpadding=\"10\" align=\"center\" valign=\"middle\" bgcolor=\"navy\">"
                    + "<tr><th><h4><br>"
                    + "Quantity"
                    + "</h4></th<th><h4>"
                    + "Item"
                    + "</h4></th><th><h4>"
                    + "Unit Price"
                    + "</h4></th></th><h4>"
                    + "Total Price"
                    + "</h4></th></tr>";
            pageBottom = "</body></html>";
        protected void processRequest(HttpServletRequest request,
                HttpServletResponse response)
                throws ServletException, IOException {
            HttpSession session = request.getSession();
            if (session.isNew() || session == null) {
                sessionError( request, response);
            String userID;
            if (session.getAttribute("userID") != null) {
                userID = (String)session.getAttribute("userID");
            } else {
                sessionError( request, response);
                userID = "";
            Integer cartCount;
            if (session.getAttribute("cartCount") != null)
                cartCount = (Integer)session.getAttribute("cartCount");
            } else {
                sessionError( request, response);
                cartCount = Integer.valueOf(0);
            if (session.getAttribute("pastOrders") != null)
                pastOrders = (Hashtable)
                session.getAttribute("pastOrders");
                } else {
                sessionError( request, response);
                pastOrders = new Hashtable();
            if (session.getAttribute("invTracker") != null)
                invTracker = (InvTrackerHW3)
               session.getAttribute("invTracker");
            String shiptoname;
            String streetaddress;
            String city;
            String state;
            String zip;
            String shipservice;
            String cctype;
            String ccname;
            String ccnum;
            String ccexpmonth;
            String ccexpyear;
            // Shipping information
            Hashtable shipHash;
            if ((session.getAttribute("shipping") != null))
                shipHash = ((Hashtable)session.getAttribute("shipping"));
            } else {
                shipHash = new Hashtable();
            String [] shipping = new String[5];
            if (shipHash.get(userID) != null)  {
                shipping = (String[])shipHash.get(userID);
                shiptoname = shipping[0];
                streetaddress = shipping[1];
                city = shipping[2];
                state = shipping[3];
                zip = shipping[4];
            } else {
                shiptoname = "";
                streetaddress = "";
                city = "";
                state = "";
                zip = "";
            if ((session.getAttribute("shiptoname") != null)) {
            shiptoname = filter((String) session.getAttribute("shiptoname"))
            // Credit information
            if ((session.getAttribute("shipservice") != null)) {
                shipservice = filter((String) session.getAttribute("shipservice"));
            } else {
                shipservice = "";
            if ((session.getAttribute("ccname") != null)) {
                ccname = filter((String) session.getAttribute("ccname"));
            } else {
                ccname = "";     
            if ((session.getAttribute("cctype") != null)) {
                cctype = filter((String) session.getAttribute("cctype"));
            } else {
                cctype = "";
            if ((session.getAttribute("ccnum") != null)) {
                ccnum = filter((String)session.getAttribute("ccnum"));
            } else {
                ccnum = "";
            if ((session.getAttribute("ccexpmonth") != null)) {
                ccexpmonth = filter((String) session.getAttribute("ccexpmonth"));
            } else {
                ccexpmonth = "";
            if ((session.getAttribute("ccexpyear") != null)) {
                ccexpyear = filter((String) session.getAttribute("ccexpyear"));
            } else {
                ccexpyear = "";
            if (session.getAttribute("cart") != null && session.getAttribute("cartKeys") != null)
                cartData = new ShopCartDataHW3((Hashtable) session.getAttribute("cart"), (Hashtable)
                session.getAttribute("cartKeys"));
            else {
                cartData = new ShopCartDataHW3(new Hashtable(), new Hashtable());
            String itemToAdd;
            itemToAdd = (findItemAttribute(request, response));
            if ((itemToAdd != null) && (cartData.getItemID(itemToAdd) == null)) {
                cartData.updateItemID(itemToAdd, 1);
            if (itemToAdd != null) {
                int defaultValue = (cartData.getQty(itemToAdd).intValue());
                int x = getIntParameter(request, itemToAdd, defaultValue);
                if (x < 0) {
                    // do nothing
                } else {
                    cartData.updateItemID(itemToAdd, x);
           Hashtable cart = new Hashtable(cartData.getCart());
           Hashtable cartKeys = new Hashtable (cartData.getCartKeys());
           session.setAttribute("cart", cart);
           session.setAttribute("cartKeys", cartKeys);
           Integer numberOfKeys = new Integer (cartKeys.size());
           session.setAttribute("cartCount", numberOfKeys);
           runningTotal = 0;
           Enumeration keyValues = cartKeys.elements();
           while(keyValues.hasMoreElements()) {
               String key = (String) keyValues.nextElement();
               if (key != null) {
                   setCartPage(key, cartData);
                   setConfirmItemList(key, cartData);
           if (numberOfKeys.intValue() == 0) {
               setCartPage(null, cartData);
           String shippingAndCredit = loadShippingAndCredit(shiptoname, streetaddress, city, state, zip, shipservice, cctype, ccname, ccnum, ccexpmonth, ccexpyear);
           if (numberOfKeys.intValue() == 0) {
               session.setAttribute("confirm", "");
           } else {
               setConfirm(session, cartKeys, numberOfKeys);
           showPage(request, response, userID, cartKeys, numberOfKeys, shippingAndCredit);
        private void showPage(HttpServletRequest request,
                HttpServletResponse response, String userId, Hashtable cartKeys, Integer numberOfKeys, String shippingAndCredit)
                throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            out.println(pageTop01 + pageTop02 + userID + pageTop03 + numberOfKeys + pageTop04);
            out.println(shippingAndCredit);
            out.println(pageTable01Top);
            Enumeration keyValues = cartKeys.elements();
            while(keyValues.hasMoreElements()) {
                String key = (String)keyValues.nextElement();
                if (key != null) {
                    out.println(pageItemList.get(key));
            if (numberOfKeys.intValue() == 0) {
                out.println(pageItemEmpty);
            out.println(pageTable01Bottom + pageBottom);
            out.close();
        private String findItemAttribute(HttpServletRequest request,
                HttpServletResponse response)
                throws ServletException, IOException {
            Enumeration paramNames = request.getParameterNames();
            while(paramNames.hasMoreElements()) {
                String paramName = (String) paramNames.nextElement();
                CatalogHW3 item = new CatalogHW3();
                if (item.getItem(paramName) != null) {
                    return paramName;
            return null;
        private void setCartPage(String key, ShopCartDataHW3 cartData) {
            String pageItemFormat00 = "<form action=\"ShopCartServletHW3\" method=\"post\"><tr bgcolor=\"white\"><td align=\"center\">"
                    + "<input type=\text\" name=\"";
            String pageItemFormat01 = "\" value=\"";
            String pageItemFormat02 = "\" size=\"3\" align=\"right\">"
                    + "<input type=\"submit\" name=\"Update\" value=\"Update\" />"
                    + "<br>";
            String pageItemFormat03 = "</td><td><img src=\"";
            String pageItemFormat04 = "\" align=\"middle\" width=\"48\" height=\"48\"> ";
            String pageItemFormat05 = "</td><td align=\"right\">";
            String pageItemFormat06 = "</td><td align=\"right\">";
            String pageItemFormat07 = "</td></tr></form>";
            DecimalFormat f = new DecimalFormat();
            if (key != null)  {
                int qtyOnHand = invTracker.getQtyOnHand(key);
                int qtyAvailable = qtyOnHand - cartData.getQty(key).intValue();
                if (qtyAvailable < 0) {
                    cartData.updateItemID(key, invTracker.getQtyOnHand(key));
                    qtyAvailable = 0;
                double total = ((cartData.getQty(key).intValue() * cartData.getCost(key)));
                pageItemList.put(key,          pageItemFormat00
                + cartData.getItemID(key)
                                             + pageItemFormat01
                + cartData.getQty(key)
                                             + pageItemFormat02
                + qtyAvaliable + " More Avaliable "
                                             + pageItemFormat03
                + cartData.getImagePath(key)
                                             + pageItemFormat04
                + cartData.getDescription(key)
                                             + pageItemFormat05
                + "$" + f.format(cartData.getCost(key))
                                             + pageItemFormat06
                + "$" + f.format(total)
                                             + pageItemFormat07);
                runningTotal = total + runningTotal;
            } else {
                pageItemEmpty = "<tr bgcolor=\"white\"><td colspan=\"4\" align=\"center\">"
                        + "Your Shopping Cart is empty ... Please buy something."
                        + "</td></tr>";
                runningTotal = 0;
            pageTable01Bottom = "<tr><td colspan=\"4\" align=\"Right\"><h4> Total Order: $ "
                    + f.format(runningTotal)
                    + "</h4></td></tr></table>";
    private void setConfirmItemList(String key, ShopCartDataHW3 cartData) {
        confirmTableTop = "<center><h3>"
                + "Order Details"
                + "<table border=\"1\" cellpadding=\"10\" align=\"center\" valign=\"middle\">"
                + "<tr><th><h4><br>"
                    + "Quantity"
                    + "</h4></th<th><h4>"
                    + "Item"
                    + "</h4></th><th><h4>"
                    + "Unit Price"
                    + "</h4></th></th><h4>"
                    + "Total Price"
                    + "</h4></th></tr>";
        String confirmItemFormat00 = "<tr bgcolor=\"white\"><td align=\"center\">";
        String confirmItemFormat01 = "<td align=\"right\">";
        String confirmItemFormat02 = "</td><td>";
        String confirmItemFormat03 = "<img src =\"";
        String confirmItemFormat04 = "\" align=\"middle\" width=\"48\" height=\"48\"> ";
        String confirmItemFormat05 = "</td><td align=\"right\">";
        String confirmItemFormat06 = "</td><td align=\right\">";
        String confirmItemFormat07 = "</td></tr>";
        DecimalFormat f = new DecimalFormat();
        if (key != null) {
            double total = ((cartData.getQty(key).intValue() * cartData.getCost(key)));
            confirmItemList.put(key,
                                              confirmItemFormat01
                + cartData.getQty(key)
                                             + confirmItemFormat02
                                             + confirmItemFormat03
                + cartData.getImagePath(key)
                                             + confirmItemFormat04
                + cartData.getDescription(key)
                                             + confirmItemFormat05
                + "$" + f.format(cartData.getCost(key))
                                             + confirmItemFormat06
                + "$" + f.format(total)
                                             + confirmItemFormat07);
        confirmTable01Bottom = "<tr><td colspan=\"4\" align=\"Right\"><h4>TOTAL ORDER: $ "
                + f.format(runningTotal)
                + "</h4></td></tr></table>";
    private void setConfirm(HttpSession session,
            Hashtable cartKeys, Integer numberOfKeys)
            throws ServletException, IOException {
        StringBuffer confirm = new StringBuffer(confirmTableTop);
        Enumeration keyValues = cartKeys.elements();
        while(keyValues.hasMoreElements()) {
            String key = (String)keyValues.nextElement();
            if (key != null) {
                confirm.append((String)
                confirmItemList.get(key));
        if (key != null) {
            confirm.append((String)
            confirmItemList.get(key));
    confirm.append(confirmTable01Bottom);
    session.setAttribute("confirm", confirm.toString());
    private String loadShippingAndCredit(String shiptonmae, String streetaddress, String city, String state, String zip, String shipservice, String cctype, String ccname, String ccnum, String ccexpmonth, String ccexyear) {
        String credit01;
        String credit02;
        String credit03;
        String ship01;
        String ship02;
        String ship03;
        String ship04;
        String ship05;
        String ship06;
        credit01 = "<form action=\"PurchConfServletHW3\" method=\"post\">"
                + "<table border=\"1\" cellpadding=\"10\" bgcolor=\"navy\" align\"center\">";
        ship01  =   "<center><h3>"
                + "Please provide your billing and shipping information: "
                + "<input type=\"submit\" name=\"Submit Order\" value=\"Submit Order\" />"
                + "</h3></hr>";
        String
        bill01  = "<tr><td bgcolor=\"white\">"
                + "Card Type:"
                + "<br>"
                + "<select name=\"cctype\">"
                + "<option value=\"Visa\" selected=\"selected\"> Visa</option>"
                + "<option value=\"MasterCard\" selected=\"selected\"> MasterCard</option>"
                + "<option value=\"American Express\" selected=\"selected\">American Express</option>"
                + "</select><br>"
                + "Card Number:"
                + "<br>"
                + "<input type=\"text\" name=\"ccnum\" value=\"";
      credit02  = "\"><br>"
                + "Cardholder Name:"
              + "<br>"
              + "<input type=\"text\" name=\"ccname\" value=\"";
      credit03  = "\"><br>"
                + "Expiration Date:"
              + "<br>"
              + "<select name=\"ccexpmonth\">"
              + "<option value=\"Jan\">Jan</option>"
              + "<option value=\"Feb\">Feb</option>"
              + "<option value=\"Mar\">Mar</option>"
              + "<option value=\"Apr\">Apr</option>"
              + "<option value=\"May\">May</option>"
              + "<option value=\"Jun\">Jun</option>"
              + "<option value=\"Jul\">Jul</option>"
              + "<option value=\"Aug\">Aug</option>"
              + "<option value=\"Sep\">Sep</option>"
              + "<option value=\"Oct\">Oct</option>"
              + "<option value=\"Nov\">Nov</option>"
              + "<option value=\"Dec\">Dec</option>"
              + "</select>"
              + "</td>";
      String
      ship00  = "<td bgcolor=\"white\">"
              + "Ship To Name:"
              + "<br>"
              + "<input type=\"text\" name=\"shiptoname\" size=\"37\" value=\"";
      ship02  = "\"<br>"
              + "Street Address:"
              + "<br>"
              +  + "<input type=\"text\" name=\"streetaddress\" size=\"37\" value=\"";
      ship03  = "\"<br>"
              + "City State Zip:"
              + "<br>"
              + "<input type=\"text\" name=\"city\" size=\"20\" value=\"";
      ship04  = "\">"
              + "<input type=\"text\" name=\"state\" size=\"2\" value=\"";
      ship05  = "\">"
              + "<input type=\"text\" name=\"zip\" size=\"5\" value=\"";
      ship06  = "\"</td>";
      String
      ship00a = "<td bgcolor=\"white\">"
              + "<input type=\"radio\" checked=\"checked\" name=\"shipservice\" value=\"UPS Ground\">UPS Ground"
              + "<br><br>"
              + "<input type=\"radio\"  name=\"shipservice\" value=\"UPS 2nd Day Air\">UPS 2nd Day Air"
              + "<br><br>"
              + "<input type=\"radio\"  name=\"shipservice\" value=\"FedEx Priority\">FedEx Priority"
              + "<br><br>"
              + "<input type=\"radio\"  name=\"shipservice\" value=\"FedEx Ultra\">FedEx Ultra"
              + "</td>";
      String
      ship00c = "</tr>"
              + "</table></form>";
      return credit01
              + ship01
              + bill01
              + ccnum
              + credit02
              + ccname
              + credit03
              + ship00
              + shiptoname
              + ship02
              + ship03
              + streetaddress
              + city
              + ship04
              + state
              + ship05
              + zip
              + ship06
              + ship00a
              + ship00c;
    private void sessionError(HttpServletRequest request,
            HttpServletResponse response)
            throws ServletException, IOException {
        String sessionErrorForm;
        sessionErrorForm = "<form action=\"RegLoginServletHW3\" method=\"post\"><tr bgcolor=\"white\"> <td align=\"center\">"
                + "<h3 align=\"center\">Your request has not been processed - some isseues were found. <br> Please return to the Login page. </h3>"
                + "<input type=\"submit\" name=\"Go to Login\" value=\"Go to Login\" /></form>";
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        out.println(pageTop01 + sessionErrorForm);
        out.close();
    private String filter(String input) {
        StringBuffer filter = new StringBuffer(input.length());
        char c;
        for(int i=0; i<input.length(); i++) {
            c = input.charAt(i);
            if (c == '<') {
                filtered.append("<");
            } else if ( c == '>') {
                filtered.append(">");
            } else if ( c == '"') {
                filtered.append(""");
            } else if (c == '&') {
                filtered.append("&");
            } else {
                filtered.append(c);
        return(filtered.toString());
    private int getIntParameter(HttpSevletRequest request,
            String paramName,
            int defaultValue) {
        String paramString = request.getParameter(paramName);
        int paramValue;
        try {
            paraValue = Integer.parseInt(paramString);
        } catch (NumberFormatException nfe) { // null or bad format
            paramValue = defaultValue;
        return(paramValue);
    //<editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /** Handles the HTTP <code>GET</code>method.
    * @param request servlet request
    * @param response servlet response
    protected void doGet(HttpServletRequest request,
            HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    /** Handles the HTTP <code>POST</code>method.
    * @param request servlet request
    * @param response servlet response
    protected void doPost(HttpServletRequest request,
            HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    /** Returns a short description of the servlet.
    public String getServletInfo() {
        return "Short description";
    // </editor-fold>
    }

    When you have errors, you should post them.
    I got 72 errors when I tried to compile the code you posted. Many of them are due to syntax errors like { and } not lining up.

  • HT204379 I have pointed to my pictures folder and all the pictures are 1mb in size with a lowest resolution 4416 × 3312. Why do I still get blury images in my shifting titles screen saver?

    Hello,
    I have just moved to mac and pointed my screen saver to my pictures folder and all the pictures are 1mb in size with a lowest resolution 4416 × 3312. Why do I still get blury images in my shifting titles screen saver?
    Regards,
    Jan

    finally found it
    http://lifehacker.com/5711409/how-to-search-for-hidden-packaged-and-system-files -in-os-x
    need app find any file
    link at bottam

  • HT201303 I have changed all of my billing info to the correct info. Why am I still getting an error message that says invalid security code?

    I have changed all of my billing info to the correct info. Why am I still getting an error message that says invalid security code?  I have an IPod.

    Welcome to the Apple Community.
    The following article(s) may help you.
    Credit card security code or postcode issues.

  • Why am I still getting Error 16 after installing CS6 on a second computer?

    I have the CS6 version of Design and Web Premium installed on my macbook. Recently I tried installing it on my iMac running Yosemite. When opening any of the CS6 programs I get "Error 16". I have tried changing the permissions in the SLStore and Adobe PCD folders, but to no avail. I have also tried deactivating CS6 on my macbook. Why am I still getting Error 16?

    In this case you may to perform a clean installation once, meaning removing all Adobe products folders.
    First Run cc cleaner tool and clean remove all products
    http://helpx.adobe.com/creative-suite/kb/cs5-cleaner-tool-installation-problems.
    Then Open Applications folder and trash All Adobe related folders
    Click on Finder and then hold Command + Shift + G keys on your keypad
    It will open Go to folder window, type  exactly ~/Library and click on Go
    Then open Application Support
    Rename Adobe folder to Adobeold
    Go back to Library  and open Preferences
    Then trash All Adobe preferences files
    Go back to Library  and open cache ( trash All Adobe related files )
    Click on Finder and then hold Command + Shift + G keys on your keypad
    This time type /Library and click on Go.
    open Application Support
    Rename Adobe folder to Adobeold.
    If  possible restart the computer once.
    Then try to install your suite.

  • Why are we still getting IEEE 1394a • VIA VT 6308P chipsets????!!!!

    Why is it we are still getting redundant IEEE 1394a controllers(400mb/s) on the latest motherboards rather than the newer IEEE 1394b controllers(800mb/s)? This is stupid... the 1394b ports have been around for more than 6 months, there are many supported devices for both a and b yet if you want to do b you still need an apple mac?
    Is there some sort of compatability issue with the newer IEEE 1394b controller or are the "IBM Compatible" manufacturers just too lazy/cheap/stupid to start using it??? I want answers .... I wanted to buy the new P6N Diamond (running a K9N Diamond at the moment) motherboard but am hesitant because there is no IEEE 1394b controller and i have 3 "b" devices that may as well be USB2.0 for all the use they are in conjunction with MSI motherboards... I expected more from MSI with the X-fi and everything else that is included to find that a useful and at times essential piece of technology is left out for a cheaper controller for more profit? Am I going to be forced to go to an other manufacturer for my needs or is MSI going to satisfy a loyal customer of more than 8 years? I am also the IT Manager for a medium sized building company and purchase MSI product for our work machines .... I would be saddened if I was forced to find a more suitable manufacturer due to MSI's greed?

    You should probably write a letter or send an email to MSI.
    This is a user to user forum, MSI does not monitor this forum...
    The board I purchased (975x Powerup) is an enthusiast board, generally speaking the users that purchase them are a finicky bunch. So if a motherboard doesn't support the exact graphics or sound that they require, they find one that does. Since yours is the first post that I have seen concerning IEEE 1394b support, it doesn't look to be a high priority for most users. Also, most of the MSI boards are very reasonably priced, and don't always include the latest toys. That is probably what keeps the price for these motherboards, so low.
    I may be confused about this? But I thought the P6N Diamond is an AMD Nvidia board? If it is, your may want to post your question in that section.
    Anyway, as I mentioned earlier, try writing to MSI about IEEE 1394b support, maybe they can explain why there is no support for it, or let you know when they will implement support.

  • I donated in November AU$20, why am I still getting a request to donate?

    I notice that every time I open my Firefox I still get a request to donate. I donated following their online form and have a Paypal receipt for it. Should the request go away or is it now standard on opening Firefox? Most other organisations e g Wikipedia don't keep reminding you after you've donated.

    ''MaryOz [[#question-1037767|said]]''
    <blockquote>
    I notice that every time I open my Firefox I still get a request to donate. I donated following their online form and have a Paypal receipt for it. Should the request go away or is it now standard on opening Firefox? Most other organisations e g Wikipedia don't keep reminding you after you've donated.
    </blockquote>
    Thanks for the info. No worries about the page. I was concerned that the donation hadn't gone through. All good. :-)

  • Why do I still get prompts to update Divx after I've uninstalled it?

    I've uninstalled Divx, at least I think I have, and I still get prompts for updates. I want these to stop. Maybe somebody out there can help me. I hate Divx, I don't want their stuff on my computer. I'm running OS X Yosemite (10.10.2) on 3.1 GHz iMac.
    <Edited by Host>

    Don't blame you... Tell the method you used to "uninstall" it.
    My install (VERY old) has this in a Spotlight search for " divx " - All should be gone and can be deleted from the search pane*
    *NOTE that if you delete from here, only the path will change to be subsequently in the Trash
    ÇÇÇ

  • Why am I still getting tuntime error message R6034 after reinstalling i tunes?

    I received a error code message R6034 while installing an I tunes update . can any one tell me how to resolve this issue? I have uninstalled and reinstalled I tunes and still get the same error code.

    Hi Lynd7,
    If you are having issues with iTunes after an attempted update, you may find the following article helpful:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Regards,
    - Brenden

  • Why am I STILL getting "No AirPort card installed"?

    Guys, I am really struggling with my laptop. Here's what happened.
    My Macbook Pro 2009 13" was unexpectedly shutting down, freezing, etc. I took it into the Genius Bar and they ended up having to replace my hard drive bracket. Not terribly expensive, not a huge deal. When I got it home, it refused to acknowledge the AirPort card. It gave me "No AirPort card installed" and was not recognizing the hardware. I went back in, told them what happened, and they replaced the AirPort card (free of charge because I think someone there had messed it up since it had been fine before).
    All was well until I had an oopsie moment and it took a serious bump upside while open. The computer wouldn't recognize the AirPort card again so I brought it into the Genius Bar again (and yes, that would be the third time in about a week and a half). They did not charge me and said all they had to do was reseed the card. Wonderful. It worked fine for about a day, then it started acting funny, not recognizing the card, but when I restarted it, all was well. I left it shut and charging last night and when I opened it this morning, yet again, "No AirPort card installed".
    I've reset the PRAM and the SMC, I've restarted the computer multiple times, I've massaged the black hinge some... and now I'm researching USB Wifi adapters because I'm getting really fed up. Anyone have any idea why this keeps happening? Or any suggestions on what to do? The AirPort card is literally less than a month old. I can't go into the Genius Bar every few days to have them reseed my card, plus I'm sure they'd start to hate me.

    Welcome to Apple Support Communities
    If you are still having problems with your card and a new AirPort card doesn't solve anything, just ask for a new logic board. It will replace everything except the display, memory and hard drive, so this should work without any problem. If they refuse, insist because it looks like the only option in your case. Good luck

  • Why do I still get giant gray 'X's instead of an audio player, even with the correct MIME type for my Ogg Vorbis file, whether coded in the audio tag or as a source?

    I uploaded Saturnalia.ogg to my site and used the audio tag to try to display it on my test page. I'd love to ditch the ultra-slow Flash players I currently use, but I don't want to leave most of my site's users wondering what the files sound like, where they are, and why are there giant gray Xs ruining my layout. The audio files work fine in Safari and Opera, and IE uses the correct fallback text. I've tried both coding the file into the audio tag and into source tags. I've set controls="controls" and tried both type="audio/ogg" and type="audio/vorbis". I've tried with and without autoplay.
    According to Mozilla, audio tags are supported, but I'm not seeing any of that support on my site.

    Where are you seeing that?
    Earlier:
    <audio src="dsh.ogg" controls="controls" type="audio/ogg">Your browser does not support the HTML5 audio tag.</audio>
    Now:
    [<object type="application/x-java-applet" width="580" height="15px" controls="controls">
    <param name="archive" value="cortado.jar" />
    <param name="code" value="com.fluendo.player.Cortado.class" />
    <param name="url" value="http://desolosubhumus.webs.com/dsh.ogg" />
    You need to install Java to play this file.
    </object>]<br />
    <audio src="dsh.ogg" type="audio/ogg">
    You need to install Java to play this file.
    </audio>
    *p tags removed for readability
    I know the audio tag should open before the object tag opens and close after the object tag closes, and that I shouldn't need duplicate fallback text, but it wouldn't show up that way. The way I have it set up now finally works on Firefox, IE (plays, not fallback text), Opera, Safari, and Chrome. I'm still trying to tweak the code to make it more standard (audio tags in the proper places), to clean it up so it's not such a huge chunk, and to see if I can get the applet to stay visible (which may not be possible, as the only way I've made it work is as a Cortado VIDEO instead of a purely audio file), and to make it stop autoplaying instead of playing when the user chooses play. Perhaps a Kate stream for track labels and a play button image set directly behind the applet when the play button actually is.

  • Why do I still get Field Point 33153 Error

    I have revised the code to insure that I am writing what should be a valid value to my FieldPoint analog output channels. One channel writes successfully while the other two return a 33153 error. Why do I get an error on those two channels?
    Attachments:
    OPTS_FldPt.iak ‏14 KB
    FldPtTest.llb ‏438 KB

    Rick,
    I looked over the code and could not find any major errors. What complicates the issue is that one of the channels seems to work. Despite this, I was wondering if you are using the English version of Windows? That has been known to cause this same problem in the past (because commas are treated as periods). Can you manually write the same values to the channels in FieldPoint Explorer? If not, the problem might be hardware-related. If so, I would like to get the equipment and run your application myself.
    Regards,
    Michael Shasteen
    Applications Engineering
    National Instruments

  • Why am i still getting Ora-1555?

    Hi All
    I am getting ORA-1555 snapshot old error in my alerts.
    My undo tablespace is 16GB and undo_retention is set for 1Hour.
    When cronjobs start expdp for one table, it throws ORA-1555 in alert logs and expdp skips that tables and moves ahead.
    I want to know while my undo_retention is set to 1Hour and i have undo tablespace of 16GB which is even autoextendable on... then why am i getting this error.
    I believe i should not get this error as if expdp requires more undo on this table then it should have extend the undo tablespace as it is allowed to do so.
    Any help on this would be appreciated.
    OS: Sun Solaris 10
    DB: 10.2.0.3
    Thanks
    aps

    Hi Oradba
    i forgot to mention, from last two days we are getting this error for one new table. which is very small in size as compared to the BIGone i am taking about.
    I decided to test the PL/sql method now and i choosed the new table which has given 1555 error for last two days.
    when i described to see the column with BLOB in table to put in pl sql procedure.... i suddenly realize that this table dont have one.
    i again described the table to confirm this and yes, there is no blob column in it and from last two days we have started getting this error. So i believe there is something more on the corrupt blob stuff.
    what do you say?
    Thanks
    aps

  • Why I'm still getting this message error:

    Unsupported path(s):
    /apple-touch-icon-precompressed.png,
    /apple-touch-icon.png"
    Details:
    Mac OS X 10.10.2
    Adobe Edge Animate CC V. 2014.1.1

    Hi Adrian,
    This is a bug. But we are still working out if it has to be resolved with safari or Edge animate. Will keep you posted on the updates.
    As a workaround please set Chrome or Opera or Firefox as default browser, the alert window will no longer displayed. Chrome and Opera are webkit browsers.
    Please check and let me know if it works.
    Thanks
    Devendra

Maybe you are looking for

  • FBCJ check withdrawal line item

    I have a problem in fbcj I have posted check receipt entry in fbcj check receipts tab successfully. while present check it was not generated ceck withdrawel line item and lot status is check withdrawal line item saved. I have to change this status. i

  • Cannot install apps anymore or launch the Adobe Creative Cloud Client

    Hey, since today I cannot neither access the list of my installed apps on my Mac, nor install or deinstall new ones. (I don't even see the list of applications) Neither the web links, nor a new download of the application manager works. I just get a

  • How to enforce factory instantiation?

    Lets say I want all subclasses of a certain class to be created through a factory. I want to disallow instantiation of subclasses through direct instantiation using "new" . How can I enforce that? I would like the baseclass to enforce this, so that i

  • Stop caching!

    I know you are tinkering with the forum configuration but can I ask you to please switch off the caching. I am getting very tired of having to refresh my browser every time I want to see the latest version of the site - even when it's a change I have

  • Data being duplicated because of setModel

    hi, we are trying to show unique values on our facet filter dropdown. first time it works correctly,from second selection it starts to duplicate the snippet is as follows           var oList = oEvent.getSource();                    var sKey = oList.g