Return an Image from a subclass to a graphics class

Hello
I'm wondering how to return an Image generated by one class to a class which works as a graphics class. The graphics class is run from a main class. Let me make up a schedule:
Image-generator return Image -> graphics class paint
I have tried just making an Image and using the getGraphics to connect a graphics object to it, but it doesn't seem to work.
Thanks in advance

Okay, here are the pieces of code we use. (Comments are in Swedish but they are barely relevant, and explain merely basically what is happening in the program)
The applet is compilable, but there is a nullpointerexception in Elefanträknaren, at getGraphics(). Believe me, I have tried finding the solution to this already.
Spelet (main method)
import java.applet.*;
import java.awt.*;
public class Spelet extends Applet
     /*Elefanträknaren testerna;*/
     Ritaren ritarN;
     Graphics g;
     public void init()
          /*testerna = new Elefanträknaren();*/
          ritarN = new Ritaren(g, getSize().width, getSize().height);
          setLayout(new GridLayout(1, 1));
          add(ritarN);
     public void start()
          ritarN.startaTråd();
     public void stop()
          ritarN.stoppaTråd();
     public void update(Graphics g)
          paint(g);
}Ritaren (graphics object)
import java.awt.*;
public class Ritaren extends Panel implements Runnable
     Elefanträknaren e;
     Graphics g;
     int bredd, höjd;
     //Trådobjekt
     Thread tråd;
     public Ritaren(Graphics g, int bredd, int höjd)
          this.bredd = bredd;
          this.höjd = höjd;
          e = new Elefanträknaren(bredd, höjd);
     public void startaTråd()
          if( tråd == null )
               tråd = new Thread(this); //Skapa tråden
               tråd.start(); //Kör igång
               e.startaTråd();
     public void stoppaTråd()
          if( tråd != null )
               tråd.interrupt();
               tråd = null;
     public void paint(Graphics g)
          g.drawImage(e.getSpökbilden(), 0, 0, this);
     public void update(Graphics g)
          paint(g);
     public void run()
          while( tråd != null )
               repaint();
               try
                    Thread.sleep(33);
               catch(Exception e){}
}Elefanträknaren (class generating the Image)
import java.awt.*;
import java.util.*;
import java.awt.image.BufferedImage;
import javax.swing.ImageIcon;
public class Elefanträknaren extends Panel implements Runnable
     //Vektorn som innehåller alla Elefant-klasser
     private Vector elefanterna;
     //Ritobjektet för den dubbelbuffrade bilden
     private Graphics gx;
     //Bildobjektet för dubbelbuffringen
     private Image spökbilden;
     private int bredd, höjd;
     //Trådvariabeln
     private Thread tråd;
     //Rörelsen uppdateras 30 ggr/s. RÄKNARE håller koll på när en elefant ska läggas till (efter 30 st 30-delar = 1 ggr/s)
     int RÄKNARE = 30;
     int ÄNDRING = RÄKNARE;
     //DELAY betecknar delayen mellan två bilder/frames. 33 ms delay = 30 FPS
     int DELAY = 33;
     //Konstruktor
     public Elefanträknaren(int bredd, int höjd)
          elefanterna = new Vector();
          this.bredd = bredd;
          this.höjd = höjd;
     //Kör igång tråden/ge elefanterna liv
     public void startaTråd()
          if( tråd == null )
               tråd = new Thread(this); //Skapa tråden
               tråd.start(); //Kör igång
               //Dubbelbuffringen initieras - detta måste ligga i startaTråd()
               //spökbilden = new BufferedImage(bredd, höjd, BufferedImage.TYPE_INT_ARGB);
               spökbilden = createImage(bredd, höjd);
               gx = spökbilden.getGraphics();
     //Stoppa tråden/döda elefanterna
     public void stoppaTråd()
          if( tråd != null )
               tråd.interrupt();
               tråd = null;
     //Lägg till en elefant i vektorn
     private void läggTillElefant(Elefant e)
          elefanterna.add(e); //Lägg till en Elefant som objekt i vektorn
          Elefant temp = (Elefant)     elefanterna.get(elefanterna.size()-1);
          temp.startaTråd(); //Starta Elefantens tråd - ge Elefanten liv
     //Sätter ihop bilden som ska sickas till Ritaren
     public void uppdaterarN()
          //Rensa skärmen från den förra bilden
          gx.fillRect(0, 0, bredd, höjd);
          for( int i = 0; i < elefanterna.size(); i++ )
               Elefant temp = (Elefant) elefanterna.get(i);
               gx.drawImage(temp.getBild(), temp.getX(), temp.getY(), null);
     public Image getSpökbilden()
          return spökbilden;
     //Tråd-loopen
     public void run()
          while( tråd != null )
               RÄKNARE++;
               if( RÄKNARE >= ÄNDRING )
                    läggTillElefant(new Elefant(11, 50, 900));
                    RÄKNARE = 0;
               uppdaterarN();
               //repaint();
               try
                    Thread.sleep(DELAY);
               catch(Exception e){}
}Elefant (a class which Elefanträknaren turns into an Image:
import java.awt.*;
import java.util.*;
import javax.swing.ImageIcon;
public class Elefant extends Panel implements Runnable
     private int x, y; //Elefantens koordinater
     private int hälsa; //Elefantens hälsa
     private int RÖRELSESTEG = 10;//Antal pixlar elefanten ska röra sig i sidled
     private int DELAY;
     //Animation
     private Vector bilderna = new Vector();
     private Vector bilderna2 = new Vector();
     private int fas; //Delen av animationen som ska visas
     private boolean framåt;
     //Tråddelen
     private Thread tråd;
     public Elefant(int x, int y, int hastighet)
          this.x = x;
          this.y = y;
          DELAY = 1000 - hastighet;
          hälsa = 100;
          framåt = true;
          fas = 0; //Nollställ fasen
          //Få fram bildernas namn
          for( int i = 0; i <= 5; i++ )
               Image temp = new ImageIcon("Z:\\Projektet\\gamal\\Projektet\\Mappen\\mediat\\png\\jumbo" + i + ".png").getImage();
               bilderna.add(temp);
               Image temp2 = new ImageIcon("Z:\\Projektet\\gamal\\Projektet\\Mappen\\mediat\\png\\jumbo" + i + "r.png").getImage();
               bilderna2.add(temp2);
     //get-variabler
     public int getX() { return x; }
     public int getY() { return y; }
     //Kör igång tråden/ge elefanten liv
     public void startaTråd()
          if( tråd == null )
               tråd = new Thread(this); //Skapa tråden
               tråd.start(); //Kör igång
     //Rör elefanten i sidled
     private void rörelse()
          //Animering
          if( fas < 5 ) fas++;
          else     fas = 0;
          //Flytta ner elefanten när den når en av spelets kanter
          if( x >= 800 || x <= 10 ) y += 85;
          //Kontrollera riktning
          if( x >= 800 ) framåt = false;
          else if( x <= 10 ) framåt = true;
          //Positionering
          if( framåt ) x += RÖRELSESTEG;
          else x -= RÖRELSESTEG;
     //Hämtar den aktuella bilden, och returnerar den
     public Image getBild()
          Image temp;
          if( framåt ) temp = (Image) bilderna.get(fas);
          else temp = (Image) bilderna2.get(fas);
          return temp;
     /* Tråd-hantering */
     //Stoppa tråden/döda elefanten
     public void stoppaTråd()
          if( tråd != null )
               tråd.interrupt();
               tråd = null;
     //Körs när elefanten är vid liv
     public void run()
          while( tråd != null )
               rörelse();
               try
                    Thread.sleep(DELAY);
               catch(Exception e){}
}

Similar Messages

  • Weird one..  i can't return a variable from the extended to the super class

    Hey everyone, i hope i'm not annoying you guys :)
    So today's problem is to return a variable (int) from a method of the extended class and print it ont the super class.
    I'm just testing the super class , if it works fine.
    So the extended class ( FileIO) just read the file txt and return the integer or string ( from the txt file)
    I already did a main method to that class and tested it, it works fine.
    So now the problem is to print the integer ( that the extended class gets from the txt. ) inside the Super class. I mean , is the same thing but now im testing the Super class , just have to do the same thing, a super class method calls the extended class method and receive the integer from the txt file.
    i think the problem is when i create the instance of the FileIO object , maybe its constructor ...i don't know.
    The name of the txt file is passed from the super class to the extended class, but i think the error is not from there.
    this.aero_le = new BufferedReader(new FileReader(super.ficheiroleitura_aero()));  //  super calls ficheiroleitura_aero()  and receive the name of the txt file ( e.g "temp.txt")  so i think that is correct.
    here's the code of the Super class public class Aeroporto {
         private String filereader_voo = "temporary.txt";
         private String filereader_aero = "temp.txt";
         private String siglaAero = "";
         public FileIO file;
         public Aeroporto(){};
         public Aeroporto(String filereader_voo, String filereader_aero) throws IOException{
              this.filereader_voo = filereader_voo;
              this.filereader_aero =filereader_aero;     
              file = new FileIO();
         public String siglaAero() {
              return siglaAero; }
         public String filereader_aero(){
              return filereader_aero;
    public int nrLines() throws IOException{   // it was supose to retunr the number of lines ( integer) from the txt file .
              return Integer.parseInt(file.lerLinhaN(1,1));
    // main() {
    Aeroporto a = new Aeroporto();
              int v = a.nrLines();
              System.out.print(v);
    // ***********************************************************+
    // Extended Class
    public class FileIO extends Aeroporto{
         private String ficheiroescrita;
         private PrintWriter vooescreve, aeroescreve ;
         private BufferedReader voo_le, aero_read;
         public FileIO(){}
         public FileIO(String filereader_voo, String filereader_aero, String ficheiroescrita) throws IOException {
              super(filereader_voo, filereader_aero);
              this.ficheiroescrita = ficheiroescrita;
              //If file does not exists , create one.
              try{
                   this.aero_read = new BufferedReader(new FileReader(super.filereader_aero()));
                   aero_read.close();
              catch(IOException ex){
                   this.aeroescreve = new PrintWriter(new FileWriter(ficheiroescrita));
                   aeroescreve.close();
    public String lerLinhaN(int line, int column) throws IOException{  // this method works fine , i already tested this class.
              this.aero_read = new BufferedReader(new FileReader(super.filereader_aero()));
              for(int i = 0; i != line-1; ++i) aero_read.readLine();
              String linha = aero_read.readLine();
              String [] words = linha.split(" ");
              return words[column-1];
    Maybe the error is that i use to test the Super class a default contructor on both classes... i don't know where the error is, i also did two small classes ( super and another that extends ) and get the string "Hello" from the super and print it inside the extended..and it works, that's why i think the error is when i call the extended class .. need help.
    thanks.

    Ok,
    This one might actually work... atleast it compiles.import java.io.BufferedReader;
    import java.io.FileReader;
    import java.io.File;
    import java.io.PrintWriter;
    import java.io.FileWriter;
    import java.io.IOException;
    public abstract class FileIO {
         public static boolean CreateOutputFileIfNotExists(
              String outputFilename //the name of the file to ensure exists.
         ) throws IOException
              final String functionName = "FileIO.CreateOutputFileIfNotExists";
              boolean retVal = false;
              //If the output file does does not exist then create it.
              //post condition: output file exists or an IOException has been thrown.
              BufferedReader infile = null;
              try{
                   infile = new BufferedReader(new FileReader(outputFilename));
                   retVal = true;
              } catch(IOException ex) {
                   PrintWriter outfile = null;
                   try {
                        outfile = new PrintWriter(new FileWriter(outputFilename));
                        retVal = true;
                   } catch(IOException ex2){
                        throw new IOException(functionName + ": cannot create output file " + outputFilename, ex2);
                   } finally {
                        outfile.close();
                        if (outfile.checkError()) {
                             throw new IOException(functionName + ": error on output stream " + outputFilename);
              } finally {
                   try {
                        infile.close();
                   } catch(IOException ex){
                        throw new IOException(functionName + ": cannot close output file " + outputFilename, ex);
              return(retVal);
         public static String readLine(
                   String  inputFilename //the name of the file to read.
              , int     lineNumber    //1 based number of the line to read from.
         ) throws IOException
              final String functionName = "FileIO.readLine";
              String outputLine = null;
              // reads the numbered "lineNumber" from "inputFilename".
              BufferedReader infile = null;
              try {
                   infile = new BufferedReader(new FileReader(new File(inputFilename)));
                   for(int i=1; i<lineNumber; ++i) infile.readLine();
                   outputLine = infile.readLine();
              } catch(IOException ex){
                   throw new IOException(functionName + ": cannot read input file " + inputFilename, ex);
              } finally {
                   try {
                        infile.close();
                   } catch(IOException ex){
                        throw new IOException(functionName + ": cannot close input file " + inputFilename, ex);
              return(outputLine);
         public static String readWord(
                   String inputFilename  //the name of the file to read.
              , int lineNumber        //1 based number of the line to read from.
              , int wordNumber        //0 based number of the word to read.
         ) throws IOException
              final String functionName = "FileIO.readWord";
              String outputWord = null;
              // reads the numbered space-seperated "wordNumber" from the numbered "lineNumber" of "inputFilename"
              try {
                   String[] words = FileIO.readLine(inputFilename, lineNumber).split(" ");
                   if (wordNumber>0 && wordNumber<words.length) outputWord = words[wordNumber-1];
              } catch(IOException ex){
                   throw new IOException(functionName + ": cannot read input file " + inputFilename, ex);
              return(outputWord);
    }Design notes... FileIO is a generic helper class... there is nothing specific to Airports, flights, or any other "domain" specific stuff in it... so it's re-usable... you can keep it and reuse it on other projects, or even share it with your friends.
    So... The airport class will just call the static methods on FileIO like this    ....
        int lineNumber=1;
        int wordNumber=1;
        String airportCode = FileIO.readWord(airportsFilename, lineNumber, wordNumber);
        ....How's that?
    corlettk: my now mandatory edit.

  • Consume a web service from JME that returns an image

    Hi,
    I have a web service that returns an image in base64binary format, but when i use the wscompile tool to generate the stub i get an error becuase seems that JME does not support base64binary -> byte[] convert. My question is: How can i return an image from web service to consume from JME?.
    Thanks in advance.
    Bruno

    I tried this and works fine, but i see this like a workaround instead of a solution. Do you know why JME doesn't support this type of data? I think that is weird because i don't see a limitation on JME for use it.
    Thanks for repsonse.

  • Problem loading images from a return value of a function

    hello, I write because I uin problem in loading images from a return value of a function.
    I created a database with a field "image" of type string, where I put the physical address of the image. I have written like this: {__DIR__ }foto.jpg
    Place the code, so you understand better
    function imageViewImage(): javafx.scene.image.Image {
    connetti();
    lass.forName(driverName);
    con = DriverManager.getConnection(url,user,"");
    stmt = con.createStatement();
    var richiesta:String = "SELECT image from viaggio WHERE id_viaggio=7";
    rs1 = stmt.executeQuery(richiesta);
    var result :String;
    rs1.next();
    risultato = rs1.getString("image");
    JOptionPane.showMessageDialog(null, result);
    var imagez = Image{
    url:"{result}";
    return imagez;
    The image is in the source code package
    First I connect to the database, run the query and I take the contents of the image.
    Can anyone help me?
    Is right to put in the database {__DIR__} foto.jpg or do I put only foto.jpg?

    Hello unkus_nob,
    I would rather suggest you to save only filename of that image like "foto.jpg" in database. And just concat it with the String variable containing "{__DIR__}".
    Actually the javafx compiler converts the {__DIR__} to the existing class directory path something like : "jar:file:/..../".
    var currentDir ="{__DIR__}";
    risultato = "{currentDir}{rs1.getString("immagine"})"; 
    var image = Image{
        url:risultato
    return image;--NARAYAN G.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • If I barrow an image from iPhoto, that is drag it to another file or the desktop it seems to half disappear.  It still shows until I try to enlarge it then I get a triangle exclamation mark in the enlarged field, once I return to Photos or an Album it is

    If I barrow an image from iPhoto, that is drag it to another file or the desktop it seems to half disappear.  It still shows until I try to enlarge it then I get a triangle exclamation mark in the enlarged field, once I return to Photos or an Album it is there.  However it can no longer be dragged into another file.  How can I recover these images?  Is there a better way to duplicate a image to locate in outside of iPhoto?
    I never had this problem in previous versions of iPhoto.

    The ! turns up when iPhoto loses the link to the original file.
    What version of iPhoto? Assuming 09 or later...
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In early versions of Library Manager it's the File -> Rebuild command. In later versions it's under the Library menu.)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  
    Regards
    TD

  • Return Image from JNI

    hi....
    sorry.. someone knows if i can get a icon or image from native code
    i'm tried to do this but i dont know so much c++.
    i can return int values and String values but image u Object from C++
    i think is diferent someone knows how to do it
    thans and please helpme on this...

    Generally, very very generally, on these forums and others, people often asks how to do XYZ in a coding level. And at the same time, you often give straight reply to them questions however complex or brittle tasks they are. We see very few occasion in which you interrogate design level viability or soundness of the intention those questions imply.
    I think wise reply should often ignore the question itself and instead ask its application level objective or circumstance. Then you may give much better solution than straight answer to the original question.
    Q: How to kill mosquitos in the room without harming my baby?
    Straight Answer: Use drug ABC and tool PQR.
    Wise Ansewer: Forget killing them. Buy and install good screens.

  • How do you make an Image from a Graphics?

    1) Is it possible to make an Image from a graphics?
    I've returned the Graphics of an image in the method of one class so that I can work with it in another class. I was looking for a setGraphics in the Image class but there isn't one. Nor is there a graphics.createImage(). What I'd really like to do is get the background image, draw on it in a separate class, then return it to the original class (for buffering purposes).
    2) is there any way to make a blank Image of given dimensions (without actually making a .gif of a blank screen)? I want to draw on the background even if it is blank, but I can't get the Graphics of a null Image.
    thanks in advance.. :-) jen

    thanks for all your help guys!
    i looked at those websites.
    The reason why the site's buffered images work is becuase they are using the paint method in a single class. (i.e. they are not calling the graphics from someplace else). If you call a Graphics (using getGraphics and the like) from someplace else, you don't get a reference or pointer; you get a COPY. The copy will helpfully record your instructions. But the original graphics doesn't get the instructions. That's my problem. My graphics instructions are not getting sent to the originating Graphics, so drawRect never gets executed.
    Another problem is that I often have no background picture in my container, and hence, I have a null pointer when I try to draw stuff on the returned Graphics.
    So what I want to do is create an image in the subclass of the rectangles, lines, whatever, and send it to my handy little setBackground(Image im) method in my superclass. And whenever the background image is null, create a white image to draw on.
    I am calling the graphics from the background of a custom lightweight container. I would REALLY REALLY not like to mess with my container code... it took me a long time to get it working.
    I also don't want to override paint. That would make all the buffering work I did obsolete. :-(

  • Error While loading a image from database

    Purpose
    Error While loading the Image from the database
    ORA-06502: PL/SQL : numeric or value error:Character string buffer too small
    ORA-06512: at "Sys.HTP" ,line 1480
    Requirement:
    I am developing the web pages using PSP(Pl/sql Serverpages) . I have a requirement to show a image in the webpage. I got the following procedures from the oracle website.
    I have created the following table to store the images
    create table DEMO
    ID INTEGER not null,
    THEBLOB BLOB
    And I also uploaded the Images. Now I am try to get a image from the table using the following procedure .But I am getting the error message line 25( htp.prn( utl_raw.cast_to_varchar2( l_raw ) );) .at it throws the following error messages
    ORA-06502: PL/SQL : numeric or value error:Character string buffer too small
    ORA-06512: at "Sys.HTP" ,line 1480
    Procedure that I used to get the image
    create or replace package body image_get
    as
    procedure gif( p_id in demo.id%type )
    is
    l_lob blob;
    l_amt number default 30;
    l_off number default 1;
    l_raw raw(4096);
    begin
    select theBlob into l_lob
    from demo
    where id = p_id;
    -- make sure to change this for your type!
    owa_util.mime_header( 'image/gif' );
    begin
    loop
    dbms_lob.read( l_lob, l_amt, l_off, l_raw );
    -- it is vital to use htp.PRN to avoid
    -- spurious line feeds getting added to your
    -- document
    htp.prn( utl_raw.cast_to_varchar2( l_raw ) );
    l_off := l_off+l_amt;
    l_amt := 4096;
    end loop;
    exception
    when no_data_found then
    NULL;
    end;
    end;
    end;
    What I have to do to correct this problem. This demo procedure and table that I am downloaded from oracle. Some where I made a mistake. any help??
    Thanks,
    Nats

    Hi Satish,
    I have set the raw value as 3600 but still its gives the same error only. When I debug the procedure its throwing the error stack in
    SYS.htp.prn procedure of the following line of code
    if (rows_in < pack_after) then
    while ((len - loc) >= HTBUF_LEN)
    loop
    rows_in := rows_in + 1;
    htbuf(rows_in) := substr(cbuf, loc + 1, HTBUF_LEN);
    loc := loc + HTBUF_LEN;
    end loop;
    if (loc < len)
    then
    rows_in := rows_in + 1;
    htbuf(rows_in) := substr(cbuf, loc + 1);
    end if;
    return;
    end if;
    Its a system procedure. I don't no how to proceed .. I am really stucked on this....is their any other method to take picture from the database and displayed in the web page.....???? any idea..../suggesstion??
    Thanks for your help!!!.

  • Not able to download image from database

    not able to download image from database am in jdeveloper 11g release 2 am using this example
    : http://tompeez.wordpress.com/2011/11/26/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-2/
    hi am not able to down load my image my jsp xml is
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document title="sms4200.jspx" id="d1">
    <af:messages id="m1"/>
    <af:form id="f1" usesUpload="true">
    <af:panelStretchLayout topHeight="211px" id="psl1" inlineStyle="width:1338px; background-color:Navy;">
    <f:facet name="top">
    <af:panelHeader text="Sms Intergration Sources" id="ph1">
    <f:facet name="context"/>
    <f:facet name="menuBar"/>
    <f:facet name="toolbar"/>
    <f:facet name="legend"/>
    <f:facet name="info"/>
    <af:panelStretchLayout id="psl2" inlineStyle="height:178px; width:1018px;" topHeight="22px"
    endWidth="589px" startWidth="55px" bottomHeight="33px">
    <f:facet name="end">
    <af:panelHeader text="Office" id="ph2"
    inlineStyle="width:900px; background-color:Navy;">
    <f:facet name="context"/>
    <f:facet name="menuBar"/>
    <f:facet name="toolbar"/>
    <f:facet name="legend"/>
    <f:facet name="info"/>
    <af:panelFormLayout id="pfl3" inlineStyle="background-color:Navy;" rows="1">
    <f:facet name="footer"/>
    <af:inputText label="#{bindings.Name1.hints.label}"
    required="#{bindings.Name1.hints.mandatory}"
    columns="20"
    maximumLength="#{bindings.Name1.hints.precision}"
    shortDesc="#{bindings.Name1.hints.tooltip}" id="it2">
    <f:validator binding="#{bindings.Name1.validator}"/>
    </af:inputText>
    <af:inputText
    label="#{bindings.LocalUpDirectory1.hints.label}"
    required="#{bindings.LocalUpDirectory1.hints.mandatory}"
    columns="20"
    maximumLength="#{bindings.LocalUpDirectory1.hints.precision}"
    shortDesc="#{bindings.LocalUpDirectory1.hints.tooltip}"
    id="it3">
    <f:validator binding="#{bindings.LocalUpDirectory1.validator}"/>
    </af:inputText>
    </af:panelFormLayout>
    </af:panelHeader>
    </f:facet>
    <f:facet name="top">
    <af:inputText value="#{bindings.IntegrationTypeName1.inputValue}"
    label="#{bindings.IntegrationTypeName1.hints.label}"
    required="#{bindings.IntegrationTypeName1.hints.mandatory}"
    columns="#{bindings.IntegrationTypeName1.hints.displayWidth}"
    maximumLength="#{bindings.IntegrationTypeName1.hints.precision}"
    shortDesc="#{bindings.IntegrationTypeName1.hints.tooltip}" id="it1">
    <f:validator binding="#{bindings.IntegrationTypeName1.validator}"/>
    </af:inputText>
    </f:facet>
    </af:panelStretchLayout>
    </af:panelHeader>
    </f:facet>
    <f:facet name="center">
    <!-- id="af_one_column_header_stretched" -->
    <af:decorativeBox theme="dark" id="db1" inlineStyle="width:1050px; background-color:Navy;">
    <f:facet name="center">
    <af:panelGroupLayout layout="scroll" id="pgl3" inlineStyle="background-color:Navy;">
    <af:panelStretchLayout id="psl3" inlineStyle="width:1012px; height:502px;"
    topHeight="133px" startWidth="0px">
    <f:facet name="center">
    <af:panelStretchLayout id="psl5" endWidth="659px" startWidth="171px">
    <f:facet name="center"/>
    <f:facet name="start"/>
    <f:facet name="end">
    <af:panelGroupLayout layout="scroll" id="pgl2">
    <af:inputFile label="Select Image" id="if1" autoSubmit="true"
    valueChangeListener="#{ImageBean.uploadFileValueChangeEvent}"/>
    <af:commandButton actionListener="#{bindings.CreateInsert.execute}"
    text="Restart Load Image Process"
    disabled="#{!bindings.CreateInsert.enabled}"
    id="cb2"/>
    <af:commandButton actionListener="#{bindings.Commit.execute}"
    text="Save"
    disabled="#{!bindings.Commit.enabled}"
    id="cb3"/>
    <af:commandButton text="View" id="cb1"
    partialSubmit="true"
    unsecure="#{ImageBean.downloadButton}"
    action="#{image.downloadImage}"
    binding="#{image2.downloadButton}"/>
    </af:panelGroupLayout>
    </f:facet>
    <f:facet name="top"/>
    </af:panelStretchLayout>
    </f:facet>
    <f:facet name="start"/>
    <f:facet name="top">
    <af:panelStretchLayout id="psl4" startWidth="232px" endWidth="296px"
    bottomHeight="18px" topHeight="11px">
    <f:facet name="bottom"/>
    <f:facet name="center"/>
    <f:facet name="start">
    <af:panelFormLayout id="pfl1" labelAlignment="top">
    <f:facet name="footer"/>
    <af:inputText label="File from PC to be Transfered" id="it4"/>
    </af:panelFormLayout>
    </f:facet>
    <f:facet name="end">
    <af:panelFormLayout id="pfl2" labelAlignment="top" maxColumns="10">
    <f:facet name="footer">
    <af:inputText value="#{bindings.DocumentName.inputValue}"
    label="File Transfered to Database"
    required="#{bindings.DocumentName.hints.mandatory}"
    columns="50"
    rows="1"
    maximumLength="#{bindings.DocumentName.hints.precision}"
    shortDesc="#{bindings.DocumentName.hints.tooltip}"
    id="it5" simple="false">
    <f:validator binding="#{bindings.DocumentName.validator}"/>
    </af:inputText>
    </f:facet>
    </af:panelFormLayout>
    </f:facet>
    <f:facet name="top"/>
    </af:panelStretchLayout>
    </f:facet>
    </af:panelStretchLayout>
    </af:panelGroupLayout>
    </f:facet>
    </af:decorativeBox>
    </f:facet>
    </af:panelStretchLayout>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    and my log file is
    <ViewHandlerImpl> <_checkTimestamp> Apache Trinidad is running with time-stamp checking enabled. This should not be used in a production environment. See the org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION property in WEB-INF/web.xml
    <UIXEditableValue> <_isBeanValidationAvailable> A Bean Validation provider is not present, therefore bean validation is disabled
    the method am calling is
        public BlobDomain downloadImage() {
            FacesContext facesContext = null;
            OutputStream outputStream = null;
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
            // get an ADF attributevalue from the ADF page definitions
            AttributeBinding attr = (AttributeBinding)bindings.getControlBinding("Documentimage");
            if (attr == null) {
                return null;
            // the value is a BlobDomain data type
            BlobDomain blob = (BlobDomain)attr.getInputValue();
            try { // copy hte data from the BlobDomain to the output stream
                IOUtils.copy(blob.getInputStream(), outputStream);
                // cloase the blob to release the recources
                blob.closeInputStream();
                // flush the outout stream
                outputStream.flush();
            } catch (IOException e) {
                // handle errors
                e.printStackTrace();
                FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), "");
                FacesContext.getCurrentInstance().addMessage(null, msg);
            return blob;
        }i get this error when clicking the button
    error when not able to download image
    <BeanHandler> <getStructure> Failed to build StructureDefinition for : sms4200.ImageBean
    <UIXEditableValue> <_isBeanValidationAvailable> A Bean Validation provider is not present, therefore bean validation is disabled
    Edited by: Tshifhiwa on 2012/06/03 10:53 AM
    Edited by: Tshifhiwa on 2012/06/03 10:56 AM
    Edited by: Tshifhiwa on 2012/06/03 10:57 AM

    hi i try to run your sample am geting this error
    Error 500--Internal Server Error
    oracle.jbo.DMLException: JBO-27200: JNDI failure. Unable to lookup Data Source at context jdbc/HRDS
         at oracle.jbo.server.DBTransactionImpl.lookupDataSource(DBTransactionImpl.java:1453)
         at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:329)
         at oracle.jbo.common.ampool.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:203)
         at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolConnect(ApplicationPoolMessageHandler.java:600)
         at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolMessage(ApplicationPoolMessageHandler.java:417)
         at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:8972)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:4606)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2536)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2346)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3245)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:571)
         at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:234)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:504)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:499)
         at oracle.adf.model.bc4j.DCJboDataControl.initializeApplicationModule(DCJboDataControl.java:517)
         at oracle.adf.model.bc4j.DCJboDataControl.getApplicationModule(DCJboDataControl.java:867)
         at oracle.adf.model.binding.DCDataControl.setErrorHandler(DCDataControl.java:487)
         at oracle.jbo.uicli.binding.JUApplication.setErrorHandler(JUApplication.java:261)
         at oracle.adf.model.BindingContext.put(BindingContext.java:1318)
         at oracle.adf.model.binding.DCDataControlReference.getDataControl(DCDataControlReference.java:247)
         at oracle.adf.model.BindingContext.instantiateDataControl(BindingContext.java:1020)
         at oracle.adf.model.dcframe.DataControlFrameImpl.doFindDataControl(DataControlFrameImpl.java:1645)
         at oracle.adf.model.dcframe.DataControlFrameImpl.internalFindDataControl(DataControlFrameImpl.java:1514)
         at oracle.adf.model.dcframe.DataControlFrameImpl.findDataControl(DataControlFrameImpl.java:1474)
         at oracle.adf.model.BindingContext.internalFindDataControl(BindingContext.java:1150)
         at oracle.adf.model.BindingContext.get(BindingContext.java:1103)
         at oracle.adf.model.binding.DCParameter.evaluateValue(DCParameter.java:82)
         at oracle.adf.model.binding.DCParameter.getValue(DCParameter.java:111)
         at oracle.adf.model.binding.DCBindingContainer.getChildByName(DCBindingContainer.java:2748)
         at oracle.adf.model.binding.DCBindingContainer.internalGet(DCBindingContainer.java:2796)
         at oracle.adf.model.binding.DCExecutableBinding.get(DCExecutableBinding.java:115)
         at oracle.adf.model.binding.DCUtil.findSpelObject(DCUtil.java:329)
         at oracle.adf.model.binding.DCBindingContainer.evaluateParameterWithElCheck(DCBindingContainer.java:1478)
         at oracle.adf.model.binding.DCBindingContainer.findDataControl(DCBindingContainer.java:1608)
         at oracle.adf.model.binding.DCIteratorBinding.initDataControl(DCIteratorBinding.java:2542)
         at oracle.adf.model.binding.DCIteratorBinding.getDataControl(DCIteratorBinding.java:2477)
         at oracle.adf.model.binding.DCIteratorBinding.getAttributeDefs(DCIteratorBinding.java:3319)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.fetchAttrDefs(JUCtrlValueBinding.java:514)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeDefs(JUCtrlValueBinding.java:465)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeDef(JUCtrlValueBinding.java:541)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeDef(JUCtrlValueBinding.java:531)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding$1JUAttributeDefHintsMap.(JUCtrlValueBinding.java:4104)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeHintsMap(JUCtrlValueBinding.java:4211)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.getHints(JUCtrlValueBinding.java:2564)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.internalGet(JUCtrlValueBinding.java:2389)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlAttrsBinding.internalGet(FacesCtrlAttrsBinding.java:275)
         at oracle.adf.model.binding.DCControlBinding.get(DCControlBinding.java:749)
         at javax.el.MapELResolver.getValue(MapELResolver.java:164)
         at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
         at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
         at com.sun.el.parser.AstValue.getValue(Unknown Source)
         at com.sun.el.ValueExpressionImpl.getValue(Unknown Source)
         at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
         at org.apache.myfaces.trinidad.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:73)
         at oracle.adfinternal.view.faces.renderkit.rich.LabelLayoutRenderer.getLabel(LabelLayoutRenderer.java:929)
         at oracle.adfinternal.view.faces.renderkit.rich.LabelLayoutRenderer.encodeAll(LabelLayoutRenderer.java:213)
         at oracle.adfinternal.view.faces.renderkit.rich.LabeledInputRenderer.encodeAll(LabeledInputRenderer.java:215)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer._encodeFormItem(PanelFormLayoutRenderer.java:1088)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer.access$100(PanelFormLayoutRenderer.java:50)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1604)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1523)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:318)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:283)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer._encodeChildren(PanelFormLayoutRenderer.java:420)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer.encodeAll(PanelFormLayoutRenderer.java:208)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:447)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$1500(PanelGroupLayoutRenderer.java:30)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:734)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:637)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:318)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:283)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:360)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeCenterFacet(PanelStretchLayoutRenderer.java:879)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeCenterPane(PanelStretchLayoutRenderer.java:1294)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeMiddlePanes(PanelStretchLayoutRenderer.java:351)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeAll(PanelStretchLayoutRenderer.java:316)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:2194)
         at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer.access$400(RegionRenderer.java:50)
         at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer$ChildEncoderCallback.processComponent(RegionRenderer.java:707)
         at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer$ChildEncoderCallback.processComponent(RegionRenderer.java:692)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:318)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:283)
         at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer._encodeChildren(RegionRenderer.java:297)
         at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer.encodeAll(RegionRenderer.java:186)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at oracle.adf.view.rich.component.fragment.UIXRegion.encodeEnd(UIXRegion.java:323)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeCenterFacet(PanelStretchLayoutRenderer.java:879)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeCenterPane(PanelStretchLayoutRenderer.java:1294)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeMiddlePanes(PanelStretchLayoutRenderer.java:351)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeAll(PanelStretchLayoutRenderer.java:316)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
         at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
         at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:274)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
         at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
         at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1277)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1655)
         at oracle.adfinternal.view.faces.component.AdfViewRoot.encodeAll(AdfViewRoot.java:91)
         at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:399)
         at org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ChangeApplyingVDLWrapper.renderView(ViewDeclarationLanguageFactoryImpl.java:350)
         at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
         at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
         at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:165)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:1027)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:334)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:232)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:122)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: javax.naming.NameNotFoundException: While trying to lookup 'jdbc.HRDS' didn't find subcontext 'jdbc'. Resolved ''; remaining name 'jdbc/HRDS'
         at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
         at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:247)
         at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
         at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
         at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:411)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at oracle.jbo.server.DBTransactionImpl.lookupDataSource(DBTransactionImpl.java:1439)
         ... 190 more
    my connection.xml is
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <References xmlns="http://xmlns.oracle.com/adf/jndi">
    <Reference name="HRDS" className="oracle.jdeveloper.db.adapter.DatabaseProvider" credentialStoreKey="HRDS" xmlns="">
    <Factory className="oracle.jdeveloper.db.adapter.DatabaseProviderFactory"/>
    <RefAddresses>
    <StringRefAddr addrType="sid">
    <Contents>smsdev</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="subtype">
    <Contents>oraJDBC</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="port">
    <Contents>1521</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="hostname">
    <Contents>localhost</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="user">
    <Contents>hr</Contents>
    </StringRefAddr>
    <SecureRefAddr addrType="password"/>
    <StringRefAddr addrType="oraDriverType">
    <Contents>thin</Contents>
    </StringRefAddr>
    </RefAddresses>
    </Reference>
    </References>
    Edited by: Tshifhiwa on 2012/06/04 2:20 PM

  • I am unable to email an image from camera roll. the image gets "stuck". cannot input email address or subject line. am unable to cancel and go back to camera roll

    i am unable to email images from my camera roll. the image gets "stuck". cannot insert email address or subject line. cannot cancel... return to camera roll.
    what to do. i tries taking new picture and sending it in an email... same thing... gets "stuck "
    Waht to do ?

    Hello lohmann8,
    Thank you for providing so much detail about the issue you are experiencing with emailing photos from the Camera Roll.
    The first thing I recommend is quitting and relaunching the applications on your iPhone:
    Double-click the Home button.
    Swipe left or right until you have located the app you wish to close.
    Swipe the app up to close it.
    You can find the full article here:
    iOS: Force an app to close
    http://support.apple.com/kb/ht5137
    If you are still seeing the same issue after quitting and relaunching the Photos and Camera app, I recommend restarting your phone and then resetting if it's still not working:
    Restarting your device
    Press and hold the Sleep/Wake button for a few seconds until the red "slide to power off" slider appears, and then slide the slider.
    Press and hold the Sleep/Wake button until the Apple logo appears.
    Note: Reset your device only if you are unable to restart it.
    Resetting your device
    Press and hold the Sleep/Wake button and the Home button together for at least ten seconds, until the Apple logo appears.
    You can find the full article here:
    iPhone, iPad, iPod touch: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/ht1430
    If the issue persists, the last thing I recommend is backing up and restoring your iPhone:
    iOS: How to back up and restore your content
    http://support.apple.com/kb/HT1766
    iTunes: Restoring iOS software
    http://support.apple.com/kb/HT1414
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Pasting Image  from Mac clipboard to Java Based Application.

    Hi,
    I am working on "iMac 10.2.7". I need to paste an image from other
    application using "Java version 1.4.1". I am trying to retrieve the image
    from the system clipboard after it is copied from some other application. I
    am pasting the code which illustrates my requirement. It works fine on
    windows. But does not work on Mac.
    On Mac it does not cross the supported data flavor check
    (clipData.isDataFlavorSupported(DataFlavor.imageFlavor) where clipData is
    the Transferable object). It seems Mac has some InputStream instead of Image
    in the clipboard when some image is copied. I tried to read that InputStream
    using ImageIO.read(java.io.InputStream). But that is also returning null.
    Thanks
    Santanu
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import java.awt.datatransfer.*;
    import javax.swing.*;
    public class ClipboardTest extends JFrame implements KeyListener{
         JLabel label;
         static Toolkit kit = null;
         static Clipboard clipboard = null;
         public static void main (String arg[]) {
              kit = Toolkit.getDefaultToolkit();
              clipboard = kit.getSystemClipboard();
              JLabel l = new JLabel();
              JButton button = new JButton("Paste from clipboard");
              final ClipboardTest ct = new ClipboardTest(l);
              ct.getContentPane().add(l,BorderLayout.CENTER);
              ct.getContentPane().add(button,BorderLayout.SOUTH);
              ct.setVisible(true);
         button.addActionListener(
              new ActionListener() {
                   public void actionPerformed(ActionEvent ae) {
                        pasteImage(ct.label);
         button.addKeyListener(ct);
         public ClipboardTest (JLabel l) {
              label = l;
         public static void pasteImage(JComponent jComp) {
                   jComp.setTransferHandler(new ImageSelection());
                   TransferHandler handler = jComp.getTransferHandler();
                   Transferable clipData = clipboard.getContents(null);
              if (clipData != null) {
              if (clipData.isDataFlavorSupported(DataFlavor.imageFlavor)) {
                   handler.importData(jComp, clipData);
         //Key listener methods
         public void keyPressed(KeyEvent e) {
         int c = e.getKeyCode();
         if (c == 86) {
              if (e.isControlDown()) {
                   pasteImage(label);
         public void keyReleased(KeyEvent e) {}
         public void keyTyped(KeyEvent e) {}
    class ImageSelection extends TransferHandler implements Transferable {
         /* DataFlavor instance that holds imageflavor value*/
         private static final DataFlavor flavors[] = {DataFlavor.imageFlavor};
         private Image image;
         public boolean importData(JComponent comp, Transferable transferable) {
         try {
         if (transferable.isDataFlavorSupported(flavors[0])) {
         image = (Image)transferable.getTransferData(flavors[0]);
                   if (comp instanceof JLabel) {
                   ((JLabel)comp).setIcon(new ImageIcon(image));
                   comp.repaint();
                   return true;
         } catch (Exception ignored) {
              ignored.printStackTrace();
         return false;
         // Transferable Interface methods
         public Object getTransferData(DataFlavor flavor) {
         if (isDataFlavorSupported(flavor)) {
         return image;
         return null;
         public DataFlavor[] getTransferDataFlavors() {
         return flavors;
         public boolean isDataFlavorSupported(DataFlavor flavor) {
         return flavor.equals(flavors[0]);

    Here are two commercial options:
    JTwain + JSane
    http://asprise.com/product/jtwain/index.php
    Morena
    http://www.gnome.sk/Twain/jtp.html
    Haven't tested them, so don't no how good they are, nor how easy they are to use on multiple platforms.

  • Load images from folder

    I havent used flash in a couple years and i'm feeling a
    little lost (not that i knew what i was doing before!) I am however
    determined and can understand the code, i just am a little
    overwhelmed.
    I'd like to tell a movie clip to look into a specific folder
    (via url or whatever) and load all images from that folder into the
    movie clip. I do not want to have to give the movie the exact
    address of each image, as they files may change / be added to over
    time.
    i know in AS3 i have to use the loader class and then the
    addChild to put the loaded stuff into the movie (and thats all i
    know), but i just dont know how to get all available images
    blindly. any help? please and thank you

    You have the right info for the Loader and addChild part.
    But I'm afraid you can't use flash to request a directory
    listing on your server directly. You can have a script on your
    server return the directory listing to flash after the script
    performs a directory listing (e.g. php).
    Other than that approach (using serverside scripting)...
    You could have all the images with a common naming convention
    and a numeric suffix and just keep loading in turn until you
    encounter a loading error (which your code is set up to
    detect).....
    e.g. image1.jpg, image2,jpg etc
    or:
    You could set up some manually coded xml to point to the urls
    of each image etc. It seems you want to avoid this though. (This is
    pretty much the same idea as the server side scripting except that
    instead of using scripting you create the data by 'hand' as xml).

  • Get Images from jar. getResource() not working

    I've read some of the posts in the forum and I've tried the solutions but still cant get the images in my program.
    I'll write all the things I've tried (All of them works fine when I run them from bluej):
    1- The code used in the jar files in demo folder of jdk:
    /** Inside the main class: */
    private static ResourceBundle resources;  
        static {
            try {
                resources = ResourceBundle.getBundle("resources.Recursos", Locale.getDefault());
            } catch (MissingResourceException mre) {
                JOptionPane.showMessageDialog(new JFrame(), "ResourceBundle not found","Error",JOptionPane.ERROR_MESSAGE);
                System.exit(1);
    public String getResourceString(String nm)
            String str;
            try {       
                str = resources.getString(nm);   
                  } catch (MissingResourceException mre) {       
                str = null;
            return str;
        public URL getResource(String key)
            String name = getResourceString(key);
            if (name != null)
                URL url = getClass().getResource(name); //  Here is the exception
                return url;  
            return null;
        public ImageIcon loadImage(String image_name)
            URL image_url = null;    
            try
                image_url = getResource(image_name);             
                if (image_url != null)
                    return new ImageIcon(image_url);
                else
                return null;                  
            }catch(Exception e)
                JOptionPane.showMessageDialog(new JFrame(), e.getMessage() + "In load Image","Error",JOptionPane.ERROR_MESSAGE);
                return null;
    /** Inside the constructor */
    abrirButton = new JButton(loadImage("open"));
    }//End of the class}
    The ResourceBundle is a file named: Recursos.properties and it's in a folder inside the folder of my *.class and *.java And have this information:
    Title=Recursos
    ElementTreeFrameTitle=Elements
    ViewportBackingStore=false
    open=resources/open24.gif
    save=resources/saveAs24.gif
    cut=resources/cut24.gif
    copy=resources/copy24.gif
    paste=resources/paste24.gif
    analisis=resources/bean24.gif
    This one, runs with the jar, but the images are not in the buttons and I get the Dialog message telling me that there was an error in loadImage. Check that method. I used this dialogs to track the error and the exception it's generated by:
    URL url = getClass().getResource(name);
    in public URL getResource(String key) method.
    2- I also tried to follow the instructions of this article that describes how to get resources from jars:
    http://www.javaworld.com/javaworld/jw-07-1998/jw-07-jar-p2.html
    This is the first page of the article:
    http://www.javaworld.com/javaworld/jw-07-1998/jw-07-jar.html
    And I did something like this:
    /** Inside constructor */
    abrirButton = new JButton(new ImageIcon(getImageFromJAR("Imagenes/open24.gif")));
    /** Inside of my main class */
    public Image getImageFromJAR(String fileName)
               try{
               if( fileName == null ) return null;          
               Image image = null;
               Toolkit toolkit = Toolkit.getDefaultToolkit();          
                image = toolkit.getImage( getClass().getResource(fileName) );           
                return image;
                }catch(Exception exc){
                    JOptionPane.showMessageDialog(new JFrame(), "Exception loading the image","Error",JOptionPane.ERROR_MESSAGE);
                    return null;
    ...The images in this one are in the folder Imagenes inside the folder of my *.class and *.java
    This one work fine in bluej too, but the jar... It doesn't even start.
    3- And the last one.
    abrirButton = new JButton(new ImageIcon(getClass().getResource("Imagenes/open24.gif"));Works fine in bluej, not running in jar.
    Am I doing something wrong? Please somebody help me.
    thanks in advance

    Are you putting the image files inside the jar? If you are, then use "jar tf jarfile.jar" to display the contents of the jar and make sure the files are there and inside the right directory. If you are not, then you can not use getClass().getResource() from a jar file because it will look inside the jar file.
    If you are getting an error message, please post it.

  • How do i load images from a folder?

    Hello everyone,
    Please can someone help me as i am stuck.
    I am trying to research loading images from a folder called /images/unknown (unknown is a customer number and is stored in a variable called customerNo).
    I feel that i will need to load the images into an array then display them to the screen with a viewer.
    Can anybody help me.
    Thanks in advance

    Welcome to the Sun forums.
    irknappers wrote:
    ...Please can someone help me as i am stuck.You might want to be more exact in future, about what you are stuck on.
    import javax.imageio.ImageIO;
    import java.io.FileFilter;
    import java.io.File;
    import javax.swing.JFileChooser;
    class LoadImages {
        public static void main(String[] args) {
            String[] suffixes = ImageIO.getReaderFileSuffixes();
            FileFilter fileFilter = new FileFilterType(suffixes);
            File directory = null;
            if (args.length==1) {
                directory = new File( args[0] );
            } else {
                JFileChooser fileChooser = new JFileChooser();
                fileChooser.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY );
                int result = fileChooser.showOpenDialog( null );
                if ( result == JFileChooser.APPROVE_OPTION ) {
                    directory = fileChooser.getSelectedFile();
                } else {
                    System.err.println("Must select a directory to proceed, exiting.");
            File[] images = directory.listFiles( fileFilter );
            for (File file : images) {
                System.out.println(file);
            System.out.println( "The rest is left an exercise for the reader.  ;-)" );
    class FileFilterType implements FileFilter {
        String[] types;
        FileFilterType(String[] types) {
            this.types = types;
        public boolean accept(File file) {
            for (String type : types) {
                if ( file.getName().toLowerCase().endsWith( type.toLowerCase() ) ) {
                    return true;
            return false;
    }

  • How to Increase Number of Images from 500 in a LR3 Flash Gallery

    I noticed people asking (and I myself needed to know) so I thought I would explain how to increase the number of images (from 500) in a Flash gallery in Light Room 3
    1. I exported a Flash gallery from LR3 and it capped the gallery at 500 images.
    2.  Because I had roughly 600 images to put in the gallery, I exported the  remaining 100 as a separate flash gallery. (Going ahead and exporting 2  galleries will save you headache in a later step)
    3. I combined  all the images folders (copying "large" images from one folder to the  "large" folder in the gallery I want to upload to my site, etc.) so that  the files are all in one location.
    4. The next step is to  increase the gallery maximum in the code. Access (from the exported  gallery) GALLERYNAME/resources/mediaGroupData/group.xml and open the group.xml file. The line of code you will be changing is <media totalGallerySize="500"> Change the 500 to the number of photos you want in the gallery.
    5.  This next step isn't too complicated, but it is specific. You know have  to tell that flash file to look for the images you just transferred to  the images folder. The best way to do this is to open the group.xml file  for the second gallery you exported. Copy all the code beginning with <item>  to the bottom of the page. This code tells the gallery to look at your  specific images (Note: you'll notice within each item the names of your  image file)
    6. Return to the (other) group.xml file of the gallery you plan to use (with all your images in it). Scroll to the bottom and erase the lines </media> and </mediagroup> becaue you will repaste them in a moment. Next, paste the copied code there.
    7. Save & check your browser!
    I hope this was clear...please comment back and I'll clarify if needed.
    ro

    500 images in a single gallery is too many - think of the poor viewer!
    But if you must create Flash galeries with more than 500 images, you're better off editing the underlying engine - here's one link showing how to do it

Maybe you are looking for

  • Problem Encoding WMV to FLV with Media Encoder CS4 (but not with CS3)

    Hello, I have been attempting to encode some WMV files with Flash Media Encoder CS4 (I have Adobe Creative Suite CS4 installed) but it has failed, generating this error: - Source File: C:\Documents and Settings\usf\Desktop\incoming\ch01.wmv - Output

  • Issue in adding not null constraint on 250 G  table with 50 million rows.

    Guys, I need to add not null constraint on 2 column of a table with 50 million rows and ~250 GB in size, These 2 columns are newly added and I have also update the value for each of these columns to not null for each row. After that I am adding not n

  • Command line to change file type association?

    I'm trying to find the correct way to change the association for .PDF files by command line, to add to a deployment script.  The client mahcines have Reader X and Acrobat 7.  I'm trying to get it so by default, all users on a machine will use Acrobat

  • Waiting for sprint contract to end...

    I was wanting to get an iphone for Christmas, but my plan with sprint is not up until June. I have been told that no part of the iphone will work until the phone is activated. Is there any way I can accomplish this without paying a full contract for

  • G450 suddenly turned off ?

    i have a g450 laptop,,,when i play game, it's always Turned Off after 10-30 minutes ....sometimes when i play video or browsing internet , it's turned off too.... why this is happened to my laptop? is it because my procie or VGA are dusty ?   i wanna