I need a "bit" of help with an 8 Puzzle

My current situation is that I need to create a working 8 puzzle with Java using a GUI. What I've currently done is at http://nale.f2g.net/EightPuzzle.java . My main problem is that when running it I get a NullPointerException at the line containing tile[blankPos].setText(tile[ndx].getText()); in the swap method.

I get a NPE when ever I use the scramble() method.
The source is the line move(rand.nextInt(4)); .Your Random rand is not instantiated nowhere. Thus it is naturally null.
Make rand in the constructor.
Here's a simpler one. You could use random swap() calls for moving/shuffling/scrambling.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import java.util.Random;
public class ObjectOrientedEightPuzzle extends JFrame implements MouseListener{
  private Piece[] tile;
  private Border etched = BorderFactory.createEtchedBorder();
  private Color tileColor = Color.GRAY;
  private Color blankColor = Color.GREEN;
  private String[] label = {"1", "2", "3", "4", "", "5", "6", "7", "8"};
  private JPanel pane;
  public ObjectOrientedEightPuzzle(){
    setTitle("ObjectOrientedEightPuzzle");
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    pane = (JPanel)getContentPane();
    pane.setLayout(new GridLayout(3,3));
    setResizable(false);
    setSize(400, 400);
    tile = new Piece[label.length];
    for(int ndx = 0; ndx < label.length; ndx++){
      tile[ndx] = new Piece(label[ndx], new Position(ndx));
      tile[ndx].addMouseListener(this);
      pane.add(tile[ndx]);
  public void mouseClicked(MouseEvent e){
    Piece p = (Piece)e.getSource();
    Piece blank = blankPos();
    swap(p, blank);
  public void mousePressed(MouseEvent e){
  public void mouseReleased(MouseEvent e){
  public void mouseEntered(MouseEvent e){
  public void mouseExited(MouseEvent e){
  private void swap(Piece clickp, Piece blankp){
    int i = -1;
    int[] pa;
    int b = blankp.getPosition().getPos();
    pa = clickp.getPosition().getNeighbor();
    for (int p = 0; p < pa.length; ++p){
      if (pa[p] == b){
        i = p;
        break;
    if (i != -1){
      blankp.setText(clickp.getText());
      clickp.setText("");
  private Piece blankPos(){
    int ndx;
    for(ndx = 0; ndx < label.length; ndx++){
      if(tile[ndx].getText().equals("")){
        break;
    return tile[ndx];
  public static void main(String[] args){
    ObjectOrientedEightPuzzle puzzle = new ObjectOrientedEightPuzzle();
    puzzle.setVisible(true);
  // represent the position in the array/grid
  class Position{ // 0 ... 8
    int pos;
    int[] neighbor;
    public Position(int p){
      setPos(p);
    public int getPos(){
      return pos;
    public void setPos(int p){
      pos = p;
      setNeighbor(pos);
    public int[] getNeighbor(){
      return neighbor;
    private void setNeighbor(int p){
      switch (p){
        case 0:
          neighbor = new int[2];
          neighbor[0] = 1;
          neighbor[1] = 3;
          break;
        case 1:
          neighbor = new int[3];
          neighbor[0] = 0;
          neighbor[1] = 2;
          neighbor[2] = 4;
          break;
        case 2:
          neighbor = new int[2];
          neighbor[0] = 1;
          neighbor[1] = 5;
          break;
        case 3:
          neighbor = new int[3];
          neighbor[0] = 0;
          neighbor[1] = 4;
          neighbor[2] = 6;
          break;
        case 4:
          neighbor = new int[4];
          neighbor[0] = 1;
          neighbor[1] = 3;
          neighbor[2] = 5;
          neighbor[3] = 7;
          break;
        case 5:
          neighbor = new int[3];
          neighbor[0] = 2;
          neighbor[1] = 4;
          neighbor[2] = 8;
          break;
        case 6:
          neighbor = new int[2];
          neighbor[0] = 3;
          neighbor[1] = 7;
          break;
        case 7:
          neighbor = new int[3];
          neighbor[0] = 4;
          neighbor[1] = 6;
          neighbor[2] = 8;
          break;
        case 8:
          neighbor = new int[2];
          neighbor[0] = 5;
          neighbor[1] = 7;
          break;
        default:
          throw new IllegalArgumentException(String.valueOf(p));
  // represent the piece of the game == a JLabel disguised
  class Piece extends JLabel{
    private int value;
    private Position pos;
    private String ptext;
    public Piece(String s, Position p){
      super(s);
      setBorder(etched);
      setVerticalAlignment(CENTER);
      setHorizontalAlignment(CENTER);
      setFont(new Font("Courier", Font.BOLD, 30));
      setOpaque(true);
      ptext = s;
      pos = p;
      if (s.equals("")){
        setBackground(blankColor);
      else{
        setBackground(tileColor);
      try{
        value = Integer.parseInt(s);
      catch (NumberFormatException e){
        value = -1;
    public int getValue(){
      return value;
    public Position getPosition(){
      return pos;
    public String getText(){
      return ptext;
    public void setText(String t){
      ptext = t;
      if (t.equals("")){
        setBackground(blankColor);
      else{
        setBackground(tileColor);
      super.setText(t);
    public void setValue(int val){
      value = val;
      ptext = String.valueOf(val);
      if (val < 0){
        ptext = "";
      setText(ptext);
      if (value > 0){
        setBackground(tileColor);
      else{
        setBackground(blankColor);
}

Similar Messages

  • Need a bit of help with css and fullscreen

    I am currently doing a javaFX application for my university project, I have it everything nearly finished, but need to finish the css component to make the application "prettier" (I am not very good on graphic design to be honest). So if i could get a bit of help on this little issue I'd be very grateful.
    is there any way to make fullscreen (and if possible resizing window) to instead rearranging everything to actually do a fullscreen (like the games) and everything "grows accordingly (even though in games what it usually does is to change the screen resolution, is that possible to reproduce with javaFX?) also how to remove the message and the effect on click the "esc" key to exit the fullscreen mode?
    i know that removing the focus effect on an element is with the following (if a button)
    .button:focused{
         -fx-background-insets: 0;
    }but,is there any way to remove the effect on anything focused (TextField, Combo Box, ...)? (tried with a .textfield:focused but it did not work)
    also i wanted to produce the focused effect by this way but it didn't work, how should i do it? (in fact even if i try to put this line on the button:focused, the focused effect gets removed from there, because of the insets line)
    #highlight{
         -fx-background-insets: 2;
         -fx-background-color: yellow;
    public class controller extends StackPane implements Initializable{
         public void highlight(){
              this.getStyleClass().add("highlight");
    and last thing (for the moment) the .button seems to work for all the buttons, but trying another thing like .gridpane or .textfield or .scrollpane does not seem to work, is there any way to make it work or i should add "id" to all the elements and use the # instead?

    i wrote all them in the same thread becsause there were a total of 4 (and could had been more) separated by ----
    should i leave it how it is or open now 4 threads for each question?

  • Need a bit of help with a code

    Hello adobe community!
    i have been fiddling around with FLASH MX and have been making a game VERY slowly.
    i've picked up alot since starting and have restarted making said game MANY MANY times =D...
    But i have now got a copy that is neat and clean and works really well BUT i've come into a bit of a problem.
    i have  _global.goldenticket = 0;   on my first frame along with other variables and i have made a single location where one can aquire a "goldenticket".
    now things are starting to confuse me... ive added a button inside a movie clip which if clicked "should" check if i have a golden ticket and then allow me to jump to the frame specified...
    on(release){
    if(goldenticket=="1"){
    money -= 50;
    energy -=50;
    _root.gotoAndPlay("enter");
    }else{
    this.enabled=false;
    however the button doesnt seem to see my ticket (even tho ive added a dynamic textbox to keep track of how many i have, which is 1)
    ive tried many different ways to go around this but i cannot seem to get it to work...
    please someone help me... in relativly simple answers please =\ im only a few days into flash learning and codeing. but im enjoying what im doing so im learning quickly.
    will have my face to the screen in waiting =D
    Thank you to everyone who took a look at my thread!

    THANK YOU!!!
    REALLY quick response WITH lang i could easily understand...
    mate thank you haha been wrapping my brain for hours on end with other things didnt even occure to me to slap _global infront.

  • Need a bit of help with Jumping in a game

    I making an action game (at least for the sake of this question) and when the user presses the spacebar the character jumps. The problem is, if the character is moving right or left, and jumps while he is moving, he will stop moving in mid-air (if the spacebar is released) and just drop straight down. Example:
    press right arrow key
    player moves right
    press space while pressing arrow key
    player jumps
    let go of spacebar
    player drops straight down (does not continue to move right) //Problem
    It's pretty simple code, actually:
    /* Move player left or right */
    if (pressedRight)
            player.x_pos += player.x_speed;
    else if (pressedLeft)
            player.x_pos -= player.x_speed;
    /* If spacebar is pressed */
    if (pressedSpace && !player.moveUp)
            player.moveUp = true;
            player.y_speed = player.INITIALSPEED;
    /* if you are in "jump mode" */                         
    if (player.moveUp)
            player.y_pos += player.y_speed;
            player.y_speed += .25;
            if (player.y_pos >= TheGround)
                      player.moveUp = false;
                      player.y_speed = 0;
    public boolean keyDown(Event e, int key)
            if(key==Event.LEFT)
                      pressedLeft = true;
            if(key==Event.RIGHT)
                      pressedRight=true;
            if(key==Event.UP)
                      pressedUp=true;
            if(key==Event.DOWN)
                      pressedDown=true;
            if (key ==  ' ')
                      pressedSpace = true;
            repaint();
            return true;
    public boolean keyUp(Event e, int key)
            pressedLeft=false;
            pressedRight = false;
            pressedSpace = false;
            repaint();
            return true;
    }

    Run this code and you'll see what I'm talking about:
    import java.awt.*;
    import java.applet.*;
    public class Testing extends Applet implements Runnable
        Thread runner;
        private Image Buffer;
        private Graphics gBuffer;
        final int theGround = 205;
         boolean pressedLeft, pressedRight, pressedSpace;
         final int width = 10, height = 10;
         final int INITIALSPEED = -5;
         double x_pos = 100;
         double y_pos = 190;
         boolean moveUp = false;
         double y_speed = 3;
         double x_speed = 3;
        //Init is called first, do any initialisation here
        public void init()
            //create graphics buffer, the size of the applet
            Buffer=createImage(size().width,size().height);
            gBuffer=Buffer.getGraphics();
        public void start()
            if (runner == null)
                runner = new Thread (this);
                runner.start();
        public void stop()
            if (runner != null)
                runner.stop();
                runner = null;
        public void run()
            while(true)
                 /* MAIN CODE*/
                //Thread sleeps for 15 milliseconds here
                try {runner.sleep(15);}
                catch (Exception e) { }
                //paint background blue
                gBuffer.setColor(Color.blue);
                gBuffer.fillRect(0,0,size().width,size().height);
                   if (pressedRight)
                        x_pos += 1;
                   else if (pressedLeft)
                        x_pos -= 1;
                   if (pressedSpace && !moveUp)
                        moveUp = true;
                        y_speed = INITIALSPEED;
                   if (moveUp)
                        y_pos += y_speed;
                        y_speed += .15;
                        if (y_pos + height + y_speed >= theGround)
                             moveUp = false;
                             y_speed = 0;
                Draw();
                repaint();
        //is needed to avoid erasing the background by Java
        public void update(Graphics g)
            paint(g);
        public void paint(Graphics g)
            g.drawImage (Buffer,0,0, this);
        public boolean keyDown(Event e, int key)
            if(key==Event.LEFT)
                pressedLeft = true;
            if(key==Event.RIGHT)
            pressedRight=true;
            if (key ==  ' ')
                 pressedSpace = true;
            repaint();
            return true;
        public boolean keyUp(Event e, int key)
            pressedLeft=false;
            pressedRight = false;
            pressedSpace = false;
            repaint();
            return true;
        public void Draw()
              gBuffer.setColor(Color.green);
              gBuffer.fillOval((int)x_pos,(int)y_pos,width,height);
              gBuffer.setColor(Color.yellow);
              gBuffer.drawLine(0, 200, 500, 200);
              gBuffer.drawString(("Move right/left, press space, and it will stop and fall straight down! Why?"), 10, 20);
              gBuffer.drawString(("Hold the spacebar down and it will work like it should."), 10, 30);
              gBuffer.drawString(("ALSO, move left or right then *QUICKLY* release and move in the opposite direction."), 10, 50);
                   gBuffer.drawString(("-- You should see it pause for a second. Why is that?"), 10, 60);
    }Sorry for some reason the tabs get messed up when I cut and pate it from JCreator. :P
    PLEASE HELP!
    Thanks in advance.

  • Need a bit of help with some theory...

    I'm just looking over some past paers for my exam and I'm having trouble understanding exactly what this question is asking for:
    What is an Enterprise computer system? Give an example of an Enterprise system. Critically discuss two alternative development environments that could be used to develop such a system. Suggest which development environment you would choose to develop the example enterprise system you have suggested and why.
    I'm just sure exactly what it means by development enviroments, does it mean a program like JDeveloper? A couple of examples would be really handy
    Thanks

    Think of an Enterprise computer system as nothing more than a resouce pool. A pool of database connections, persistant database objects, mail sessions, messaging sessions. Basically any resouce a developer would need to develop any type of application.
    As for environments... the two I think of are Microsoft .NET and Sun's Java System Application Server Platform. Thay are basically the same in concept, microsoft just repackaged everything good about Java and called it .NET. .NET is (of course) dependant on the Microsoft OS platform, Sun/Java is not.

  • I need a bit of help with my 7600GT

    Alright.
    My motherboard doesn't have a VGA slot, and neither does this Video Card.  I understand that it is remedied with the adapters that are provided, but one must install the drivers for the DVI slots before one can do anything.  I can't get any output on my monitor with the adapters because I can't see what's going on to install the drivers.  I managed to install Windows by taking out my hard drive and putting it into another computer (SATA drive, btw) and I would have done the same with my video card if it weren't for the fact that no other computers in my house have PCI-E slots. 
    Is there any way to get the drivers onto this hard drive without having to search around town for a computer with both a SATA and a PCI-E slot?
    Thanks!

    iamquitethen00b,
    Moan Guide
    Richard

  • I need a bit of help with my iPhone 4...

    I just backed up my phone and I'm trying to update it to iOS 7.0.4. but when I updated my ipod, everything got deleted off of it. I don't want that to happen to my phone even though I know it probably will. If I restore my iPhone and then restore backup AFTER I update my phone, will I get everything back?
    Also, will everything actually be deleted or could I find them somewhere on my laptop?

    iamquitethen00b,
    Moan Guide
    Richard

  • Need a little bit of help with substring...

    Im very new at java programming, and need a bit of help with a problem:
    Here is what I have:
    System.out.print("Enter a string : ");
    Scanner scan = new Scanner (System.in);
    stringy = scan.nextLine();
    Now I want to split the string "stringy" like this: h:hi:hip:hipp:hippo
    I know this uses substring, but I can't figure out how to do it.
    Any help would be great, thanks!

    I know about the length method, what I dont knowis
    how to use the length and substring methodstogether
    to solve the problem i mentioned initially. There are three ingredients to perform this task:
    - String.length()
    - String.substring(int start, int end)
    - for-statement:
    http://java.sun.com/docs/books/tutorial/java/nutsandbo
    lts/for.html
    Pseudo code:IN <- input String from user
    LOOP FROM 0 -> IN.length()
    print IN.substring(?, ?)
    print ":"
    END LOOP
    Remember, Im very new. ;)Remember that by just handing you the solution, you
    will learn far less than finding things out by
    yourself.
    ; )Thanks a lot, i should be able to figure it out froom the pseudo code. :)

  • Little bit of help with the duplication process needed

    Hi
    I trying to duplicate a database from one server to a remote server. They are both running windows server 2003 (my first problem) , the primary server is running oracle 11gR1 and the (hopefully) receiving server is running 11gR2(is that going to be a problem?) and I'm a little stuck on some parts of the process.
    The book I'm using says to edit the listener.ora file to include a SID_DESC of the remote database. Here is my listener.ora file with the modifications
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = test.host.local)(PORT = 1521))
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = CGARDMSTR)
    (ORACLE_HOME = G:\app\administrator\product\11.1.0\db_1)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = CGARDMSTR)
    (ORACLE_HOME =G:\app\administrator\product\11.1.0\db_1)
    (SID_NAME = CGARDMSTR)
    *(SID_DESC* *=*
    *(GLOBAL_DBNAME* *=* cgard)
    *(ORACLE_HOME* *=F:\oracle\product\11.2.0\dbhome_1)*
    *(SID_NAME* *=* cgard)
    (bold is what i added)
    it then said to chnage my tnsnames.ora
    CGARD =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = test.host.local)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = cgard)
    CGARD5DE =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = test.host.local)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = CGARD5DEV)
    CGARDMST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = test.host.local)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = CGARDMSTR)
    cgard =
    *(DESCRIPTION =*
    *(ADDRESS = (PROTOCOL = TCP)(HOST = live.host.local)(PORT = 1521))*
    *(CONNECT_DATA =*
    *(SERVER = DEDICATED)*
    *(SERVICE_NAME = cgard)*
    I changed the local domain to host for business reasons
    The next step was to create a initialization parameter file which I am guessing is a pfile and hopefully not a spfile. It then says to only enter one param db_name and the conversion params if the filesystem is diffrent. Problem is I don't know what to do with this file, if I am suppose to switch the second database to this file then surly I would need some more params? Anyway thats the first of many questions.
    When I try to run through the rman commands it describes it also trips up:
    RMAN> connect auxiliary sys/*********@live.host.local
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-04006: error from auxiliary database: ORA-12170: TNS:Connect timeout occurr
    ed
    The other database is up and connectable via sqldevloper so I'm guessing it was my configuration of listener and tnsnames
    Ok to reiterate my questions are:
    1) what needs to be in the pfile I create for the database thats going to receive the backup and what do I do with that file when I have made it?
    2) I am pretty sure my listener and tsunamis config is completely wrong so can I have some pointers on fixing that?
    3) Was the reason I could not connect to the receiving database my tns and listener config or is it something else?
    Quite a few other questions but untill I know some more about the above I doubt I will be able to ask properly.
    Also if this helps the book I am using is Expert Oracle Database 11g Administration and the page is 835(the method that begins on that page) and I am willing to write out the whole method if you need more details.
    Oh and if you havent figured it out I am very new to this so if some of this sounds very wrong or just stupid just say what I need to change and I will get right on it.
    Thanks
    Alex

    Ok so I have made some progress. Here is where I am currently at:
    RMAN> RUN
    2> {
    3> SET NEWNAME FOR DATAFILE 1 TO 'F:\oracle\oradata\cgard\file1.dbs';
    4> SET NEWNAME FOR DATAFILE 2 TO 'F:\oracle\oradata\cgard\file2.dbs';
    5> SET NEWNAME FOR DATAFILE 3 TO 'F:\oracle\oradata\cgard\file3.dbs';
    6> SET NEWNAME FOR DATAFILE 4 TO 'F:\oracle\oradata\cgard\file4.dbs';
    7> SET NEWNAME FOR DATAFILE 5 TO 'F:\oracle\oradata\cgard\file5.dbs';
    8> SET NEWNAME FOR TEMPFILE 1 TO 'F:\oracle\oradata\cgard\temp1.dbs';
    9> duplicate target database
    10> to cgard
    11> from active database
    12> pfile='F:\oracle\product\11.2.0\dbhome_1\database\initCGARD.ora';
    13> }
    executing command: SET NEWNAME
    starting full resync of recovery catalog
    full resync complete
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    Starting Duplicate Db at 19-NOV-10
    using channel ORA_AUX_DISK_1
    contents of Memory Script:
    set newname for datafile 1 to
    "F:\ORACLE\ORADATA\CGARD\FILE1.DBS";;
    set newname for datafile 2 to
    "F:\ORACLE\ORADATA\CGARD\FILE2.DBS";;
    set newname for datafile 3 to
    "F:\ORACLE\ORADATA\CGARD\FILE3.DBS";;
    set newname for datafile 4 to
    "F:\ORACLE\ORADATA\CGARD\FILE4.DBS";;
    set newname for datafile 5 to
    "F:\ORACLE\ORADATA\CGARD\FILE5.DBS";;
    backup as copy reuse
    datafile 1 auxiliary format
    "F:\ORACLE\ORADATA\CGARD\FILE1.DBS"; datafile
    2 auxiliary format
    "F:\ORACLE\ORADATA\CGARD\FILE2.DBS"; datafile
    3 auxiliary format
    "F:\ORACLE\ORADATA\CGARD\FILE3.DBS"; datafile
    4 auxiliary format
    "F:\ORACLE\ORADATA\CGARD\FILE4.DBS"; datafile
    5 auxiliary format
    "F:\ORACLE\ORADATA\CGARD\FILE5.DBS"; ;
    sql 'alter system archive log current';
    executing Memory Script
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    Starting backup at 19-NOV-10
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=143 device type=DISK
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00001 name=G:\APP\ADMINISTRATOR\ORADATA\CGARDMSTR\SYS
    TEM01.DBF
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/19/2010 16:23:
    52
    ORA-17629: Cannot connect to the remote database server
    ORA-17627: ORA-01017: invalid username/password; logon denied
    ORA-17629: Cannot connect to the remote database server
    continuing other job steps, job failed will not be re-run
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00004 name=G:\APP\ADMINISTRATOR\ORADATA\CGARDMSTR\USE
    RS01.DBF
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/19/2010 16:24:
    24
    ORA-17629: Cannot connect to the remote database server
    ORA-17627: ORA-01017: invalid username/password; logon denied
    ORA-17629: Cannot connect to the remote database server
    continuing other job steps, job failed will not be re-run
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00002 name=G:\APP\ADMINISTRATOR\ORADATA\CGARDMSTR\SYS
    AUX01.DBF
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/19/2010 16:24:
    43
    ORA-17629: Cannot connect to the remote database server
    ORA-17627: ORA-01017: invalid username/password; logon denied
    ORA-17629: Cannot connect to the remote database server
    continuing other job steps, job failed will not be re-run
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00003 name=G:\APP\ADMINISTRATOR\ORADATA\CGARDMSTR\UND
    OTBS01.DBF
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/19/2010 16:25:
    17
    ORA-17629: Cannot connect to the remote database server
    ORA-17627: ORA-01017: invalid username/password; logon denied
    ORA-17629: Cannot connect to the remote database server
    continuing other job steps, job failed will not be re-run
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00005 name=G:\APP\ADMINISTRATOR\ORADATA\CGARDMSTR\RMA
    N01.DBF
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 11/19/2010 16:25:55
    RMAN-03015: error occurred in stored script Memory Script
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/19/2010 16:25:
    55
    ORA-17629: Cannot connect to the remote database server
    ORA-17627: ORA-01017: invalid username/password; logon denied
    ORA-17629: Cannot connect to the remote database server
    RMAN>
    I did issue the commands:
    C:\Documents and Settings\Administrator>rman target /
    Recovery Manager: Release 11.1.0.6.0 - Production on Fri Nov 19 13:55:40 2010
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    connected to target database: CGARDMST (DBID=3160500813)
    RMAN> connect catalog rman/rman
    connected to recovery catalog database
    RMAN> connect auxiliary sys/**********@cgard
    connected to auxiliary database: CGARD (not mounted)
    So I am not quite sure what it wants. I read somewhere about a password file but I don't understand how it will help, also most things I have looked at wernt clear on how to do it. I took a stab anyway:
    G:\app\administrator\product\11.1.0\db_1\BIN>orapwd file=orapwcgard password=*********** entries=20 ignorecase=n
    Was run on the original database host.
    File was then copied to "F:\oracle\product\11.2.0\dbhome_1\database" on the receiving database's host it was then renamed to PWDcgard.ora as there was file there already with that name.
    It did not help(same error).
    The book I am using mentions the 'PASSWORD FILE' param to be used with the duplicate command but I cant find a example on how to use it so any help with that would be great.
    Thanks for the effort so far guys its really appreciated.

  • A little bit of help with Bind variables please

    Hi,
    I am having a bit of trouble with bind variables I have been looking at the Dev guide and the forum to try and achieve this and it is still not happening for me, could anybody please help or point me in the right direction:
    I have created a simple PersonVO with the basic query:
    Select distinct full_name from xxml_people where person_id = :1
    In the PersonVOImpl.java I have added the method:
    public void initQuery(String personId)
    Number person = null;
    try
    person = new Number(personId);
    catch
    (Exception e){}
    setWhereClauseParam(1,person);
    executeQuery();
    Then in the PersonAM I have added the method:
    public void initPersonQuery(String personId)
    getPersonVO1().initQuery(personId);
    I then call this method in my processRequest section of my page controller:
    PersonAMImpl am = (PersonAMImpl) pageContext.getRootApplicationModule();
    String personId = "581";
    am.initPersonQuery(personId);
    When I try and run this I get the error:
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT distinct full_name from xxml_absence_calendar where person_id = :1
    java.sql.SQLException: ORA-01006: bind variable does not exist
    Am I binding the variables correctly? Or am I making some stupid mistake?
    I am ultimately looking to create a messageChoice where the logged in user will see a list of all organisations underneath him and the one level above. I plan to do this by passing the User’s Organisation name into a VO query using the organisation as a Bind Variable. I think once I have worked out how to bind variables this should be straight forward.
    Many Thanks

    Even though the parameter binding values may be same, you should never use the positional param more than once. So always go for the format
    select distinct full_name from xxml_people where supervisor_id = :1
    UNION
    select distinct full_name from xxml_people where person_id = :2
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Need a bit of guidance with ip helper-address on a L3 switch

    Hi All,
    Happy New Year!
    Could some one be kind enough to have a look at a PT file for me and tell me where I am going wrong please?.
    It's a practice one for a college assignment I am working on, for which I have to submit an original network, and then suggest some possible improvements. My first PT file consists of 3 LANs, all using L2 switches configured with VLANs and routing on a stick, with ip helper-address pointing to a DHCP server on one of the LANs. That all works fine.
    Now I am trying to create a test network that uses a L3 switch that has VLANs, I want the end user devices to obtain addressing from a DHCP server on a separate network, I have configured the VLANs, gave them IP addresses, entered the ip helper-address, the link between the switch and router has had the "no switchport" command executed on the switch, I given the connected port on the switch a relevant IP address to the router interface it is connected to, both router and switch have OSPF configured with network statements, but DHCP requests are failing.
    In simulation mode the packets are reaching the DHCP server but are not returning, and I'm a little confused as to what I have done wrong.
    Attached is the PT file, please bear in mind this is just a test PT file that I have been practicing with before creating the final PT file for submission.
    Any advice would be greatly appreciated.
    Kind regards
    Jon

    Hello Haihua,
    Thank you very much for that, I do feel a little stupid now..., I completely forgot about the DG on the server.
    Thanks again.
    Jon

  • I Need some assistant and HELP with my iPod Touch  soon

    Note: Look up above at the Top to read my Problem that I am having with my iPod Touch.
    Can Someone Please HELP ME with my iPod Touch, I am running out of patience, normally when I do need help here I usually get help and a reply within ONE day, but I have posted my problem YESTERDAY, why isn't there someone not replying to my request?? I am getting 55 views but no replys, isn't there anyone out there that can help me??
    I need HELP to reset my IPod Touch to where I had it when I was able to send emails. (can't send emails anymore from my iPod Touch)
    I want to be able to sync and send my iPod Touch sent emails info. to my Computer email program, does anyone know how to do that?
    PLEASE HELP ME AND REPLY if you can solve my problem ASAP.
    Trisha Foster

    Agreed! If you want help soon, call Apples paid support line. Now while you were waiting for us to slowly get around to answering you, you could have downloaded the manual for the ipod, so that you understood the function of the mail sync options in itunes. Mail sync only copies the settings needed to access your mail servers, from the mail client on your computer, over to the ipod touch. It does not copy any actual mail messages, and does not copy any settings from the ipod back to your mail program. The advanced section is meant to be used if you have messed up the settings on the ipod itself. It will ignore any changes to bookmarks, contacts, or mail settings depending on which you check, and will copy new information to the ipod. So in your case if you are able to access, and send mail correctly from the account on your mac, then clicking on the sync mail account button in itunes as well as the replace info on this ipod whatever in the advanced section should transfer over the correct mail account settings to your ipod.

  • Need support person for help with loading the adobe reader

    We purchased Adobe reader but it will not load onto my computer and per my boss I need to get help from you.
    my phone number is 813-445-7295 ext 104

    Nobody will ring you, sorry. But perhaps we can help (this is not Adobe staff).
    Let's start with what you purchased. Check your receipt. Adobe Reader is free, nobody should have charged you for that..
    Then, let us know what you mean by "will not load". If you get any messages, please let us know the exact words.

  • Little bit of help[ with a button.

    Good day all!
    I need help making a button. This is what I want to happen.
    I have a bunch of text, One of the words "merino" is bule as
    to say there is a link hear! And I want an image of the "merino" to
    come up, like a "ALT" box. Or have an image in the "ALT" box?
    I know how to do this in "Flash" i.e just drop in the image
    on the over state of the button event. Easy as pie! This is why I
    cant get to grips with Dreamweaver! I hate it!
    But I am willing to learn and maybe in time love???
    Thanks all!

    "satrop" <[email protected]> wrote in
    message
    news:f0o4t7$954$[email protected]..
    > Good day all!
    >
    > I need help making a button. This is what I want to
    happen.
    >
    > I have a bunch of text, One of the words "merino" is
    bule as to say there
    > is a
    > link hear! And I want an image of the "merino" to come
    up, like a "ALT"
    > box.
    >
    > I know how to do this in "Flash" i.e just drop in the
    image on the over
    > state
    > of the button event. Easy as pie! This is why I cant get
    to grips with
    > Dreamweaver! I hate it!
    >
    > But I am willing to learn and maybe in time love???
    HTML is a lot different from Flash! :-)
    I believe you could do this using DW's Show-Hide layer
    behavior - have
    mousing over the link trigger a layer with the image to
    appear. Someone else
    may have a better idea.
    Just FYI, having to mouse over a link in order to get more
    information about
    it isn't usually appreciated by users. You *might* want to
    re-think this
    plan..
    Patty Ayers | Adobe Community Expert
    www.WebDevBiz.com
    Free Articles on the Business of Web Development
    Web Design Contract, Estimate Request Form, Estimate
    Worksheet

  • Need Some Brain Storming Help WIth a Long Distance Mail Problem

    I would really appreciate anyones input on this...
    Here's the situation. I'm trying to solve a mail problem for my somewhat elderly Mother. The biggest problem is that she is 3800 miles away from me and nowhere near any sort of help or tech support (Rural Alaska) so I'm trying to sort this out over the phone.
    Anyway, she somehow screwed up her mail. All of a sudden the mail she sends comes from MY account! It shows up in my mailbox as having been sent by me. She is using an iBook G4 that I gave her a year or so ago and I suppose it's possible that somehow my mail account was on there somewhere (?). It's like she accidentally switched users or something.
    I have sent her Email to her normal .Mac email address and it does indeed show up in her mailbox when I check the web mail. She is running Tiger and I'm running Leopard.
    I just can't for the life of me figure out what she would have done and I'm hoping that someone might have an idea. She says that the font sizes all changed as well which leads me to believe that she is indeed using my old settings and mail account.
    Once again, any help really appreciated. I'm heading out of town for a week and she really depends on her email. I'm trying desperately to get this solved before I leave. Thanks!

    It looks like Mail has reset its preferences, including the account settings. What follows is a more thorough explanation that should allow you to determine whether that’s really what happened and what your options would be in that case. I’ll provide the full instructions I usually provide to solve this problem when having direct access to the computer, even though you may find some of them not practical or unnecessary.
    Under some circumstances (e.g. lack of available disk space, filesystem corruption, repeated crashes), Mail may discard the current ~/Library/Preferences/com.apple.mail.plist preferences file and create a new one. This file is where all the account settings are stored. As a result, all the non-.Mac account settings are lost. If you have a .Mac account, however, that account would appear to have been preserved because Mail would set it up automatically using the System Preferences > .Mac settings — but may result in a different .Mac account being automatically set up if for some reason the System Preferences > .Mac settings differ from what until then were the Mail account settings...
    What’s the capacity and space available on the startup disk? Take a look at the comments about disk space in the following article, in case they apply to this case:
    Problems from insufficient RAM and free hard disk space
    Verify/repair the startup disk (not just permissions), as described here:
    The Repair functions of Disk Utility: what’s it all about?
    After having fixed all the filesystem issues, if any, and ensuring that there’s enough space available on the startup disk (a few GB, plus the space needed to make a backup copy of the Mail folder), quit Mail if it’s running, and make a backup copy of the ~/Library/Mail folder (e.g. by dragging it to the Desktop while holding the Option (Alt) key down), just in case something else goes wrong while trying to solve the problem. This folder is where all your mail is stored.
    There are at least three ways to restore the account settings:
    (1) Restore ~/Library/Preferences/com.apple.mail.plist from a backup if you have one. Mail shouldn’t be running while you do this.
    (2) Set up your mail accounts again (you may want to quit Mail and trash the new com.apple.mail.plist first to start over). If given the option to import existing mailboxes or something like that, don’t. Just enter the account information and Mail will automagically rediscover the data in ~/Library/Mail/ when done. You’ll also have to re-configure some of the Mail > Preferences settings. For spam-related security reasons, the first thing you should do is go to Preferences > Viewing and disable Display remote images in HTML messages if it’s enabled.
    (3) Mail may have renamed the old preferences file to com.apple.mail.plist.saved. If that’s the case, you may try trashing the new com.apple.mail.plist and renaming the old com.apple.mail.plist.saved back to com.apple.mail.plist. Again, be sure Mail isn’t running while doing this. Given the circumstances, there exists the possibility that com.apple.mail.plist.saved became corrupt, but that often is not the case and the settings can usually be restored by just renaming the file back to com.apple.mail.plist.
    As a side effect of re-creating com.apple.mail.plist, Mail might rename Outbox (which is where messages waiting to be sent are stored) to Delivered. The name of that mailbox is actually a misnomer, as it would contain messages (if any) that couldn’t be delivered for some reason. You can delete that mailbox if you wish.
    Note: For those not familiarized with the ~/ notation, it refers to the user’s home folder. That is, ~/Library is the Library folder within the user’s home folder, i.e. /Users/username/Library.

Maybe you are looking for

  • More than excellent customer service..

    Hi, I normally do not go out of my way to find where to post feedback on customer service, but to me, HP customer service has been more than excellent.  I cannot comment on customer service outside the USA before mid-2008, but the HP service here roc

  • [ Solved ] Firefox profile cannot be loaded .

    After  a few weeks of not updating , ( I was off line ), I updated and Firefox displays the following message ; " Your profile cannot be loaded . It may be missing or inaccesible. "      In  ' Home ' I have .mozilla-backup and under properties - owne

  • Web-app dtd for WL 9.1

    What is the DTD location(weblogic91-web-jar.dtd) for the Web application deployment parameters that are specific to the WebLogic server in WebLogic 9.1

  • I lost my i-tunes online purchase after upgrade to snow leopard...

    Hi I lost my i-tunes online purchases after upgrade to snow leopard... Is there any way to retrieve them? Thanks

  • Panic CPU 0 caller 0xfffffff800064ba7b

    I have x Grey screen with black back ground stating Panic CPU 0 caller 0xfffffff800064ba7b how can fix it!? I've tried restart with shirft key