The "Volatile" Puzzle

Need a simple example code that works differently with and without "volatile".
I understand the need for 'volatile' keyword and what it does in java. However, I also vaguely remember reading that this is no longer necessary. i.e., the compiler and jvm of these days takes care of local caching and memory writes very smartly. I tried several examples to see if I can reproduce a case where existence of 'volatile' really makes a difference. But, all my attempts went in vain.
Here is an example:
package volatilekw;
public class Thread1 extends Thread{
volatile int answer = 0;
public void setAnswer(int i) {
answer = i;
@Override
public void run() {
for (int i=0;i<100;i++) {
System.out.print(answer);
try {
sleep(10);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
package volatilekw;
public class Thread2 extends Thread{
private Thread1 t = null;
public Thread2(Thread1 t) {
this.t = t;
@Override
public void run() {
for (int i=0;i<100;i++) {
try {
sleep(10);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
if (i == 1)
t.setAnswer(1);
package volatilekw;
public class Gotgo {
public static void main(String[] args) {
Thread1 t1 = new Thread1();
Thread2 t2 = new Thread2(t1);
t1.start();
t2.start();
Irrespective of whether the "answer" is volatile or not, the output is same with JDK 1.6. I ran several times and even tried decrementing sleep value. If my understanding goes right, the writes of thread2 on answer might not be visible to thread t1 until it caches it. But, this is never the case.
Is there a good example that demonstrate that 'volatile' does make a difference? I am looking for a piece of code when run with and without 'volatile' gives two different outputs.

853929 wrote:
Need a simple example code that works differently with and without "volatile".Impossible to produce reliably. Without volatile, some things can happen, depending on timing, the OS's scheduler, the underlying hardware, other processes running, the JVM implementation, etc., but there's no guarantee that those things ever will happen. However, it's generally bad if they do, so volatile is one way of ensuring that they don't.
I understand the need for 'volatile' keyword and what it does in java. However, I also vaguely remember reading that this is no longer necessary. i.e., the compiler and jvm of these days takes care of local caching and memory writes very smartly.Nope. The use-case for volatile is still there.
Volatile was never strictly necessary. We've always been able to accomplish what volatile does by syncing every access to the variable in question. However, when all you need is that all threads see the same copy, and you don't have other atomicity issues to deal with, volatile can save some runtime overhead relative to syncing, and, more importantly, it can make for less cluttered code.
I tried several examples to see if I can reproduce a case where existence of 'volatile' really makes a difference. But, all my attempts went in vain.Try a multi-cpu box, with not much else happening on it, create as many threads as there are CPUs, and have all threads run a loop from 0 to 10,000 or 100,000,00 or millions that does nothing more than x++ on some shared member variable.
With volatile, and N threads and a count up to M, you'll see a final value of N x M.
Without volatile, you might see a value less than N x M.

Similar Messages

  • HT4314 i'm new and i don't know haw to access a new crossword puzzle, the one i already completed keeps coming up...how does one get to the next puzzle?

    in crosswords how does one advance to the next puzzle please, thanks

    Re: That garbage is unreadable.
    If you really want help, stop messing with the fonts and post so that others can read and offer suggestions.
    Or better yet... try a search, I'm certain you'll find a solution to whatever issue you're experiencing.
    I have found that many times it is the things that make you most angry that push you to action. This was the case here. Thank you for causing me to get so angry that I found the answer myself.

  • The shuttle puzzle problem..

    Hi guys;
    for those raedy to rise challenges i present this problem... Any ideas to solve it are welcomed..some code would be a generous action from your part...
    SHUTTLE PUZZLE
    The SHUTTLE PUZZLE of size 3
    consists of 3 white marbles, 3 black
    marbles, and a strip of wood with 7 holes.
    The marbles of the same color are placed
    in the holes at the opposite ends of the
    strip, leaving the center hole empty.
    INITIAL STATE: WWW BBB
    GOAL STATE: BBB WWW
    To solve the shuttle puzzle use only two
    types of moves. Move 1 marble 1 space
    (into the empty hole) or jump 1 marble
    over 1 marble of the opposite color (into
    the empty hole). You may not back up,
    and you may not jump over 2 marbles.
    A Shuttle Puzzle of size N consists of N
    white marbles and N black marbles and
    2N+1 holes.
    Write a program that will solve the
    SHUTTLE PUZZLE for any size N(*10)
    and display the board after each move.
    Use W to represent a white marble and B
    to represent a black marble and a blank to
    represent the empty hole. Test your
    program for N=3 and N=4.
    Sample Run
    N = 3
    WWW BBB
    WWWB BB
    WW BWBB
    W WBWBB
    WBW WBB
    WBWBW B
    WBWBWB
    WBWB BW
    WB BWBW
    BWBWBW
    B WBWBW
    BBW WBW
    BBWBW W
    BBWB WW
    BB BWWW
    BBB WWW

    my friend , here is my own program for the Shutle problem...
    try it and tell me if something is wrong...
    cheers.
    * Created on 23 f�vr. 2004
    * To change the template for this generated file go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    * @author user
    * To change the template for this generated type comment go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    import java.io.*;
    import java.util.*;
    public class Shuttle {
         static int N=3;
         static int ln= 2*N+1;
         static int p=(int) Math.pow(2,N+1);
         static String[] a= new String[ln];
         static boolean shifted= false;
    public static void init()throws IOException {
         /*System.out.println("Enter N:");
         String ss= getString();
         N =(int)Integer.parseInt(ss);*/
         System.out.println("Solved shuttle:");
         ln= 2*N+1;
         p=(int) Math.pow(2,N+1);
         a= new String[ln];
         for(int i=0; i<N;i++)
         a="W";
         a[N]=" ";
         for(int i=N+1; i<a.length;i++)
         a[i]="B";
    public static String getString() throws IOException
         InputStreamReader isr = new InputStreamReader(System.in);
         BufferedReader br = new BufferedReader(isr);
         String s = br.readLine();
         return s;
    public static char getChar() throws IOException{
         String s= getString();
         return s.charAt(0);
    public static void print(String[] a){
         for(int i=0;i<a.length;i++)
              System.out.print(a[i]);
              System.out.println();
    public static int getHole(String[] a){
         int index=-1;
         for(int i=0;i<a.length;i++){
              if(a[i].equals(" ")){
                   index=i;break;
         return index;
    public static void swap(String[] a,int i,int j){
         String X=new String();
         X=a[i];
         a[i]=a[j];
         a[j]=X;
    public static boolean Done(String[]a){
         boolean done=true;
         for(int i=0;i< N; i++){
              if(!a[i].equals("B")){done=false;break;}
         if(!a[N].equals(" ")){done=false;
         for(int i=N+1; i< a.length;i++){
              if(!a[i].equals("W")){ done=false; break;
         return done;
    public static void shuttle(){
         int index=-1;
         //for(int k=0;k<p;k++){
         do{
              print(a);
              index=getHole(a);
              if(index==0){
                   if(a[index+1].equals("B"))swap(a,index,index+1);
                   else if(a[index+1].equals("W")&& a[index+2].equals("B")) swap(a,index,index+2);
                   //else if(a[index+1].equals("W")&& a[index+2].equals("B")) swap(a,index,index+2);
              else if(index==a.length-1){
                   if(a[index-1].equals("B")&&a[index-2].equals("W") )swap(a,index,index-2);
                   else if(a[index-1].equals("W"))swap(a,index,index-1);
              else if(a[index-1].equals("W")&&a[index+1].equals("B") ){
                   if (shifted==false){     swap(a,index,index+1); shifted=true; }
                   else if(shifted==true){ swap(a,index,index-1); shifted=false;
                   else if(a[index-1].equals("B")&&a[index+1].equals("W")){
                        if(((index+2)<=a.length-1)&& a[index+2].equals("B")) swap(a,index+2,index);
                        else if((index-2>=0)&& a[index-2].equals("W") ) swap(a,index-2,index);
              else if(a[index-1].equals("B")&& a[index+1].equals("B") ){
                   if ((index-2>=0)&& a[index-2].equals("W") )swap(a,index-2,index);
                   else if (((index+2)<=a.length-1)&& a[index+2].equals("B") ) swap(a,index-2,index);
                        else swap(a,index,index+1);
                   else if(a[index-1].equals("W")&& a[index+1].equals("W") ){
                        if (((index +2)<=(a.length-1)) && a[index+2].equals("B")) swap(a,index+2,index);
                        else if ((index -2>=0)&& a[index-2].equals("W") ) swap(a,index-2,index);
                        else swap(a,index,index-1);
              }while(Done(a)==false);
              print(a);
         public static void main(String[] args)throws IOException {
              while (true){
                   System.out.println("Enter N:");
                   String ss= getString();
                   N =(int)Integer.parseInt(ss);
              init();
              shuttle();
              System.out.print("another trial(y/n)?: ");
              char c=getChar();
              if (c=='y')continue;
              else if(c=='n'){System.err.println("Bye!");break;}

  • Error in the formation of the crossword puzzle

    The Feb 8/14 and the Feb 9th puzzles that were automatically printed had the wrong format for the puzzles.

    Hi rattlesnake,
    Welcome to the HP Support forums. I understand that the crossword puzzle you have set up for a scheduled delivery to your printer did not print correctly on Feb 8/14 and Feb 9/14.
    Did that hold true for Feb 10/14 and Feb 11/14 versions of the crossword?  There are 4 different crossword puzzle apps available on HP Connected, which one are you subscribed to?
    Thank you.
    Regards,
    Happytohelp01
    Please click on the Thumbs Up on the right to say “Thanks” for helping!
    Please click “Accept as Solution ” on the post that solves your issue to help others find the solution.
    I work on behalf of HP

  • Does JRockit support the volatile keyword?

    Does JRockit support the volatile keyword? If yes, since what version of JRockit is it supported? Will it also be supported on JRockit for Linux.

    A M wrote:
    Does JRockit support the volatile keyword? If yes, since what version of JRockit is it supported? Will it also be supported on JRockit for Linux.AFAIK JRockit always has and always will, including (but not limited to)
    the Linux builds of JRockit.
    However, the actual behaviour of "volatile" hasn't been that well
    defined until Java 5.0, so our interpretation of what volatile should
    mean may or may not have been consistent with SUN's interpretation of
    what volatile should mean.
    Have you been having problems with using volatile? What are you using
    it for in that case? Since volatile might not do what you think it
    does, using locking could be better...
    Regards //Johan

  • About the volatile keyword

    I am learning about the volatile keyword.
    Does it depend on the VM whether the threads do cache its member variables into memory or not even if the volatile keyword is used? Because in my examlpe below the variable "b" is not volatile and it is beeing used in an infinite loop till some other thread change the variable to false. When it happens, the loop stops and I expected that the variable "b" would only be read once since it is not volatile and the loop would never stop.
    Could somebody explain? :-)
    public class VolatileExample {
        public VolatileExample(){
            T1 t1 = new T1();
            new Thread(t1, "T1").start();
            T2 t2 = new T2(t1);
            new Thread(t2, "T2").start();
        class T1 implements Runnable{
            public boolean b = true; // should be read once if not volatile?
            public T1(){
            public void run() {
                while(b){
                    System.out.println("true");
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException ex) {
                System.out.println("false");
        class T2 implements Runnable{
            private T1 r;
            public T2(T1 r){
                this.r = r;
            public void run() {
                try {
                    Thread.sleep(5000);
                    r.b = false; // Here is where I change the other thread´s variable to false
                } catch (InterruptedException ex) {
        public static void main(String[] args){
            new VolatileExample();
    }

    Roxxor wrote:
    Thanks for your answer!
    So a rule of thumb would be: "when sharing a variable among different threads, it should be declared volatile"?I wouldn't say that.
    An absolute rule, however, is, "When sharing a variable among concurrently executing threads, if at least one of the threads will be writing that variable, and if at least one other thread needs to see the writer's update, then you *must* declare the variable volatile or synchronize all access to it."
    That is a bare minimum, of course. By itself, it doesn't guarantee your data will be consistent in a multithreaded context.
    I don't use volatile all that often, because all it does is make writes visible, provide a simple memory barrier, and provide atomicity for doubles and longs. Usually there are more complex requirements that lead to needing synchronization or the classes in java.util.concurrent, and then these end up giving me what volatile would have, plus more.

  • Web sudoku app prints the same puzzle every time?

    We got an 8500A plus from Costco recently. My mom was able to print her favoriate game for the first time, thanks to the web sudoku app and the touch interface. Unfortunately, it seems to print the same puzzle every time for the same category (easy, medium, hard, evil).
    Any tips to make it print something different each time? Is it only updated daily?

    Dear hpllu, 
    You should try unistalling and reinstalling the sudoku app from the ePrintCenter website.
    If I have solved your issue, please feel free to provide kudos and make sure you mark this thread as solution provided!
    Although I work for HP, my posts and replies are my own opinion and not those of HP

  • The 15 puzzle problem !!!

    hey ,
    can nebody help me with the code of the autosolve solution of the 15 block puzzle...or atleast the algorithm that is to be used .....????
    The program requires the computer to solve the puzzle .....oe move at a time .....
    How will i go about it ??

    here is the basic code that will help an user play, i am still trying to automate it, if anyone is able to finish it please let me know import java.applet.Applet;
    import java.awt.Color;
    import java.awt.Event;
    import java.awt.Graphics;
    // <applet code=puzzle width=100 height=100></applet>
    public class Puzzle extends Applet {
         private static final long serialVersionUID = 1L;
         public Piece pieces[] = new Piece[16];
         int i, x, y, currentValue;
         int startX = 50;
         int startY = 50; // start pos of puzzle
         int rowSize = 4;
         int pieceWidth = 50;
         int pieceHeight = 50;
         private int blankPiecePosition;
         Graphics graphics;
         SimplePuzzle simple;
         RandomValue randomValue = new RandomValue(1, 16);
         public void init() {
              graphics = getGraphics();
              /* INITIALIZE THE BLANK PIECES */
              x = startX;
              y = startY;
              for (i = 0; i <= 15; i++) {
                   currentValue = randomValue.getRandomValue();
                   // currentValue = i+1;
                   /* SET THE INITIAL POSTION OF THE BLANK PIECE */
                   if (currentValue == 16) {
                        blankPiecePosition = i;
                   // pict = getImage(getDocumentBase(),image_name+currentValue+".gif");
                   pieces[i] = new Piece(i, currentValue, graphics, x, y, null, this);
                   x += 50;
                   if (x > 200) {
                        x = 50;
                        y += 50;
              /* CREATE A NEW SIMPLE PUZZLE */
              simple = new SimplePuzzle(15, this);
              resize(pieces[0].width * 6, pieces[0].height * 6);
         public void start() {}
         public void stop() {}
         public boolean mouseDown(Event evt, int x, int y) {
              int rel_x, rel_y;
              int click_piece;
              int cur;
              // FIRST CHECK IF THE POINT IS INSIDE THE PUZZLE
              if (isPointInside(x, y)) {
                   // NOW GET THE CLICK PIECE
                   rel_x = (int) (x - startX) / pieceWidth;
                   rel_y = (int) (y - startY) / pieceHeight;
                   click_piece = rel_x + rowSize * rel_y;
                   // IF THE CLICK POINT IS IN THE SAME ROW AS THE BLANK PIECE
                   if (pieces[blankPiecePosition].sameRow(y)) {
                        if (pieces[click_piece].toLeft(pieces[blankPiecePosition])) {
                             cur = pieces[blankPiecePosition].left;
                             while (cur != pieces[click_piece].left) {
                                  pieces[cur].exchangePiece(pieces[blankPiecePosition]);
                                  blankPiecePosition = cur;
                                  cur = pieces[blankPiecePosition].left;
                                  congratulate();
                        } else if (pieces[click_piece].toRight(pieces[blankPiecePosition])) {
                             cur = pieces[blankPiecePosition].right;
                             while (cur != pieces[click_piece].right) {
                                  pieces[cur].exchangePiece(pieces[blankPiecePosition]);
                                  blankPiecePosition = cur;
                                  cur = pieces[blankPiecePosition].right;
                                  congratulate();
                   } else if (pieces[blankPiecePosition].sameColumn(x)) {
                        if (pieces[click_piece].above(pieces[blankPiecePosition])) {
                             cur = pieces[blankPiecePosition].up;
                             while (cur != pieces[click_piece].up) {
                                  pieces[cur].exchangePiece(pieces[blankPiecePosition]);
                                  blankPiecePosition = cur;
                                  cur = pieces[blankPiecePosition].up;
                                  congratulate();
                        } else if (pieces[click_piece].below(pieces[blankPiecePosition])) {
                             cur = pieces[blankPiecePosition].down;
                             while (cur != pieces[click_piece].down) {
                                  pieces[cur].exchangePiece(pieces[blankPiecePosition]);
                                  blankPiecePosition = cur;
                                  cur = pieces[blankPiecePosition].down;
                                  congratulate();
              return true;
         private void congratulate() {
              if (simple.isPuzzleComplete()) {
                   graphics.drawString("Congratulations!!!", 75, 275);
         public void paint(Graphics g) {
              g.setColor(Color.pink);
              g.fillRect(0, 0, size().width, size().height);
              for (int i = 0; i <= (15); i++) {
                   pieces.draw();
         // THIS ROUTINE RETURNS THE VALUE OF A LOCATION
         public int getLocationValue(int arr_loc) {
              return pieces[arr_loc].value.intValue();
         // THIS ROUTINE RETURNS THE VALUE OF THE BLANK LOCATION
         int getBlankLocationValue() {
              return pieces[blankPiecePosition].value.intValue();
         public boolean isPointInside(int x, int y) {
              if ((x >= startX) && (y >= startY)
                        && (x <= startX + rowSize * pieceWidth)
                        && (y <= startY + rowSize * pieceWidth)) {
                   return true;
              } else {
                   return false;
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.Graphics;
    import java.awt.Image;
    public class Piece {
         int width = 50, height = 50;
         int right, left, up, down;
         Integer value; // the value of the Piece
         Integer posX, posY; // the on screen position of the Piece
         Graphics graphics;
         Puzzle objPuzzle;
         public Piece(int index, int val, Graphics agc, int x, int y, Image pict,
                   Puzzle objPuzzle) {
              int temp;
              this.objPuzzle = objPuzzle;
              value = new Integer(val);
              graphics = agc;
              posX = new Integer(x);
              posY = new Integer(y);
              // RIGHT
              temp = index + 1;
              if ((temp == 4) || (temp == 8) || (temp == 12) || (temp == 16))
                   right = -1;
              else
                   right = temp;
              // LEFT
              temp = index - 1;
              if ((temp == 3) || (temp == 7) || (temp == 11))
                   left = -1;
              else
                   left = temp;
              // UP
              temp = index - 4;
              if ((temp < 0))
                   up = -1;
              else
                   up = temp;
              // DOWN
              temp = index + 4;
              if ((temp >= 16))
                   down = -1;
              else
                   down = temp;
         // RETURNS TRUE IF A POINT IS IN THE SAME COL AS y
         public boolean sameColumn(int x) {
              return ((x > posX.intValue()) && (x < posX.intValue() + height));
         // RETURNS TRUE IF A POINT IS IN THE SAME ROW AS x
         public boolean sameRow(int y) {
              return ((y > posY.intValue()) && (y < posY.intValue() + width));
         public boolean toLeft(Piece p) {
              return (posX.intValue() < p.posX.intValue());
         public boolean toRight(Piece p) {
              return (posX.intValue() > p.posX.intValue());
         public boolean above(Piece p) {
              return (posY.intValue() < p.posY.intValue());
         public boolean below(Piece p) {
              return (posY.intValue() > p.posY.intValue());
         public void exchangePiece(Piece blank) {
              Integer temp = value;
              value = blank.value;
              blank.value = temp;
              draw();
              blank.draw();
         public void draw() {
              if (value.intValue() == 16) {
                   graphics.setColor(Color.black);
                   graphics.fillRect(posX.intValue(), posY.intValue(), width, height);
                   graphics.drawRect(posX.intValue(), posY.intValue(), width, height);
              } else {
                   graphics.setColor(Color.yellow);
                   graphics.fillRect(posX.intValue(), posY.intValue(), width, height);
                   graphics.setColor(Color.black);
                   graphics.drawRect(posX.intValue(), posY.intValue(), width, height);
                   graphics.setFont(new Font("Times", Font.BOLD, 16));
                   graphics.drawString(value.toString(), posX.intValue()
                             + (width - graphics.getFontMetrics().stringWidth(
                                       value.toString())) / 2, posY.intValue() + height
                             / 2);
    public class SimplePuzzle{
         int win[] = new int[16];
         int winIndex, startIndex;
         Puzzle puzzle;
         SimplePuzzle(int startPosition, Puzzle puz) {
              for (int i = 0; i < 16 ; i++) {
                   win[i] = i + 1;
              winIndex = 15;
              startIndex = startPosition;
              puzzle = puz;
         public boolean isPuzzleComplete() {
              if (puzzle.getBlankLocationValue() != winIndex) {
                   return false;
              for (int i = 0; i < 16 ; i++) {
                   //System.out.println("Loc Value: "+puzzle.getLocationValue(i)+"\tWin: "+win[i]);
                   if (puzzle.getLocationValue(i) != win[i]) {
                        return false;
              return true;
    // THIS CLASS IS USED TO PROVIDE A UNIQUE RANDOM VALUE FROM
    // A RANGE OF VALUES
    class RandomValue {
         int value[];
         int total;
         RandomValue(int first, int last) {
              int i;
              total = last - first + 1;
              value = new int[total];
              for (i = 0; i < total; i++) {
                   value[i] = first;
                   first++;
         int getRandomValue() {
              int i;
              int ret;
              if (total == 0) {
                   return -1;
              if (total == 1) {
                   total = 0;
                   return value[0];
              i = (int) (Math.random() * total);
              ret = value[i];
              total--;
              for (; i < total; i++) {
                   value[i] = value[i + 1];
              return ret;

  • CS 3 gets error saying can't install -incomplete or damaged files. This CD has only been installed once and it was a puzzle that I solved years ago and I am up against the same puzzle now. How to I properly proceed with the install on an iMac i5 OS 10.10.

    The first question I asked is the same as this one. I have read the PDF and down what it says but it won't get past the error message. The CD is fine and I went through this a long while ago. 2006 I believe. I just set this iMac up last night and there shouldn't be a problem with the Mac or the CD.

    The first question I asked is the same as this one. I have read the PDF and down what it says but it won't get past the error message. The CD is fine and I went through this a long while ago. 2006 I believe. I just set this iMac up last night and there shouldn't be a problem with the Mac or the CD.

  • Could not  find the Jigsaw Puzzle interaction in Adobe Captivate 6.

    There's only 10 interactions in the system. How can I get these fancy interactions for quize?

    Some interactions are only included with later versions. If my memory is correct (do not longer have CP6) that version had only Word Search as game interaction. That was a static widget. Interactive widgets only appeared with version 7 and included JigSaw, Jeopardy,...

  • Help! The taglib used in the Face puzzled me.

    if i quote the taglib using the format below:
    &#65279;<jsp:root version="1.2"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:c="http://java.sun.com/jstl/core"
    xmlns:jsp="http://java.sun.com/JSP/Page"
    >
    <jsp:directive.page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"/>
    .........javascript codes(case1)
    <script>
         function check(form){
              var bbbbbb = form["form3:syainId"].value;
              for (i=0;i < bbbbbb.length;i++){
                   char = bbbbbb.charAt(i);
                   if (char<'0'||char>'9'){
                     alert("aaa");
                     return false;
    </script>
    ..........javascript codes(case2)
    <script language="JavaScript">
         var form = document.getElementById('form3');
         var msg=form["form3:ckmsg"].value;
         if (msg != '') {
              alert(msg);
         form["form3:ckmsg"].value = '';
         var msg=form["form3:message"].value;
         if (msg != '') {
              alert(msg);
         form["form3:message"].value = '';
    </script>)
    </html>
    </jsp:root>if there is the case 2 only, the page will be showed correctly.
    But there is the case 1, the page showed the message below,
    org.apache.jasper.JasperException: /jsp/Syain/J01CMSyainList.jsp(25,15) The content of elements must consist of well-formed character data or markup.
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:83)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:402)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:126)
         org.apache.jasper.compiler.JspDocumentParser.parse(JspDocumentParser.java:241)
         org.apache.jasper.compiler.ParserController.doParse(ParserController.java:235)
         org.apache.jasper.compiler.ParserController.parse(ParserController.java:139)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:237)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:142)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         com.crms.util.SecurityFilter.doFilter(SecurityFilter.java:78)
    if i quote the taglib using the format below:
    <%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    .....................if there is the case 1 only, the page work correctly.
    if there is the case 2, page pop a error message: syntax error ,
    and i chose 'NO', then the page showed.
    So i catch, the case 2 can work correctly if the first taglib format quoted, but it can't if the another taglib format quoted.
    and the case 1 can't work correctly if the first taglib format quoted, but it can if the another taglib format quoted.
    How i use the two case together?
    help is appreciated.
    George

    Hi Tom,
    Thanks a lot.
    What tool do you use to create Raster Map and what tool you use to get the WGS84 project?
    I am a beginner in this area, I hope you can give me more pointers/guides, otherwise, I would have to read up/explore lots of applications before I can start to create my 1st Raster map and get the WGS84 projection to replace the City Guide Map.
    All I want to do is, to create a new sample Map myself, having simple rows of shops and streets, and then collect the coordination, and lastly replace the City Guide map and create a new simulation Script to replace the citywalk.xml
    Thanks a lot in advance.
    Message was edited by:
    nomaduk

  • I can't access the se puzzle in the NY times.

    I contacted the times and they suggested I use a different browser. It does work, but I'd rather have it on Firefox.
    Stopped working when I installed the latest version. Must be difficult to keep everything running.
    Thanks for your help.
    I don't think it's a java issue because I checked that.

    Try [https://support.mozilla.org/en-US/kb/Template:clearCookiesCache clear Cookies & Cache] and check it again
    if you have not the '''latest ''' update to latest, you can check it in: http://www.java.com/en/download/installed.jsp
    thank you
    Please mark "Solved" the answer that really solve the problem, to help others with a similar problem.

  • How can I get the keyboard to work when I try to type in passwords or crossword puzzle words?

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [[/questions/951392]]</blockquote>
    I suddenly can't get what I type in to show up on the screen. It won't print my user name or password to enter a site or print the answers in the crossword puzzle site I use.

    Would you try Firefox beta from the Play Store to see if this helps? What crossword site?

  • A favorite program suddenly won't load and I get the following message: Error reading crossword file. Check/daily-crossword/puzzles/2011-06/dc1-2011.bin is up

    The program was loading ok until a power outage 2 days ago. Since restarting the pc the crossword puzzle won't load and I get the message provided.

    I've had this problem since June 1 and no reply was received from Thinks when I wrote to them about it. In my case, it applies to the crossword puzzle and also to the codebreaker.

  • The letters are appearing as numbers in crossword puzzles.

    I type one letter in the crossword puzzle successfully. All the next letters that I type appear as numbers in the puzzle. It does not matter which puzzle site I use. This happens with usa today, the latimes and stanxwords.
    This does not happen with IE.

    Are that Flash or Java objects?
    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

Maybe you are looking for

  • Parallels desktop 8

    Hello, my question is: for Parallels desktop 8 is better Macbook 13 or 15? MacBook Pro 13 •Intel Core i7 dual-core a 2,9GHz, Turbo Boost fino a 3,6GHz •8GB di SDRAM DDR3 a 1600MHz - 2x4GB •512GB - Unità a stato solido •SuperDrive 8x (DVD±R DL/DVD±RW/

  • Weak Wireless Signal After Power Outage - Anyone else??

    We had a storm Sunday 7/25 and lost power, now my Verizon Fios router's wireless signal is extremely weak and I can't connect to it unless I'm in the same room with the router. Has anyone else experienced this problem? I've had no luck with troublesh

  • What just happened to iTunes Movies store?

    This new format is terrible.The old format, and choices, are gone. Instead, there is a matrix of subjects or titles. Gone is the scrollable listing of latest releases or Genius Recommendations. There is a sellection of "independent" new releases, but

  • Bind Variables at runtimeADF mobile 11g:

    Hi, I am creating the Adf mobile application. In table i have AD,DM,propertynumber,community,totalhomes,occ_curr,occ_fcst columns. In first page i am displaying only AD's.under AD i have more than one DM. In first page of my mobile application,i am s

  • BAPI not extracting orders with category BD and BC

    Hi , i  tried following BAPI to extract orders category datas from live cache. BAPI_POSRVAPS_GETLIST2 BAPI_POSRVAPS_GETLIST3 But both the BAPIs  not extracting orders with ATP category BD , BC . Any one faced this issue? Or  do i missing anything. Is