Paint from a console

i i have a program that load thigns from the db, and draw on a panel and save it to a file without user interaction, is there possible to do the same things but in console mode, just type java program_name and taht does the same things, dont seems to work always get a empty picture.. is there because im in console mode (its not possible to make a jpanel but visible false!?)
thx

i dont get confuse, its my question
i know that console its not gui and gui its not console
but can i make a gui not visible program that can run on console
or like make a panel object, draw on it, without display it to the user, like setVisible(false)
sorry i have problem to explain it in english
check i use this code:
the class objectcloner is ok, and JP make my draw
all this work perfectly with the gui, but isntead of using actionPerformed with the combobox, i would like to pass the data i need in arguments with no graphics in my console windows
(and instead of using JFileChooser pass the file in arguments too)
do you have a idea now what i want?
sorry for my english
//Debut des imports
import javax.swing.JFrame;
import java.awt.Container;
import javax.swing.JPanel;
import java.awt.FlowLayout;
import javax.swing.JComboBox;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import javax.swing.JOptionPane;
import java.awt.GridLayout;
import javax.swing.JLabel;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.Vector;
import java.awt.Color;
import java.awt.Point;
import javax.swing.JComponent;
import java.io.Serializable;
import java.awt.Cursor;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import javax.swing.SwingUtilities;
import java.io.ByteArrayOutputStream;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
import com.sun.image.codec.jpeg.JPEGCodec;
import java.io.FileOutputStream;
import java.io.File;
import java.net.URL;
import java.net.MalformedURLException;
import java.awt.Toolkit;
import java.awt.MediaTracker;
import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.net.InetAddress;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import javax.swing.JFileChooser;
import java.io.ObjectOutputStream;
import java.io.ObjectInputStream;
import java.io.ByteArrayInputStream;
import javax.swing.WindowConstants;
//Fin des imports
//  Class: Maker
public class Maker extends JFrame implements ActionListener
    //Debut declarations
    private boolean vide = true; //savoir si il y a quelque chose de dessiner
    private boolean clone = false; //Savoir si c'est un clonage ou non
    private boolean modif = false; //savoir si il y a eu des modifications depuis la derniere sauvegarde
    private boolean premier = true; //savoir si c'est le premier point ou non
    private boolean image = false; //savoir si une image a ete loader
    private Color coulChoi; //La couleur de dessin
    private Connection con; //Connection a la db   
    private Container contain; //prend le contentpane
    private Image ball; //Image a loader
    private int dlType = 0; //Type de ligne
    private int maxX = -100; //Set le X Maximum
    private int maxY = -100; //Set le Y Maximum
    private int minX = 10000; //Set le X Minimum
    private int minY = 10000; //Set le Y Minimum
    private int al = 20; //Longueur de la fleche
    private int aw = 16; //Hauteur de la fleche
    private int haw = aw/2; //Demi-Hauteur de la fleche
    private int xValues[] = new int[3]; //Sert pour creer les fleches
    private int yValues[] = new int[3]; //Sert pour creer les fleches
    private int width1 = 542; //Largeur du panel dessin
    private int height1 = 384; //Hauteur du panel dessin 
    private JButton bAngle, //pour activer le procesus angle
                    bPreparation, //pour activer le procesus avec preparations
                    bPreparationDouble; //pour activer le procesus avec preparations double
    private JComboBox sAngle, //contiendras les soudures d'angles
                      sPreparation, //contiendras les soudures avec preparations
                      sPreparationDouble; //contiendras les soudures avec preparations doubles
    private JLabel lAngle, //affiche les soudures dangles
                   lPreparation, //affiche les soudures dangles avec penetration
                   lPreparationDouble; //affiche les soudures dangles avec penetration double
    private JPanel panel1, //panel 1
                   panel2, //panel 2
                   panel3, //panel 3
                   panel, //panel principale
                   dessin; //panel ou tout va etre dessiner (invisble pour lengthuser)
    private ResultSet results; //Resultats pour la db
    private Statement statement; //Statement
    private String txt = ""; //Dessin Text
    private Vector data1, //contient les numlogik et fingerprint de la box 1
                   data2, //contient les numlogik et fingerprint de la box 2
                   data3; //contient les numlogik et fingerprint de la box 3
    private Vector poi = new Vector(); //Sauvegarde des points de main libre
    private Vector points = new Vector(); //Sauvegarde des points des courbes
    //Fin declarations
    //  Constructeur: Maker()
    public Maker()
        //Debut initialisations
        contain = getContentPane();
        panel = new JPanel(new GridLayout(3,1));
        panel1 = new JPanel(new FlowLayout());
        panel2 = new JPanel(new FlowLayout());
        panel3 = new JPanel(new FlowLayout());
        sAngle = new JComboBox();
        sPreparation = new JComboBox();
        sPreparationDouble = new JComboBox();
        lAngle = new JLabel("Soudures d'angle");
        lPreparation = new JLabel("Soudures avec pr�paration");
        lPreparationDouble = new JLabel("Soudures avec pr�paration double");
        bAngle = new JButton("Ok");
        bPreparation = new JButton("Ok");
        bPreparationDouble = new JButton("Ok");
        data1 = new Vector();
        data2 = new Vector();
        data3 = new Vector();
        dessin = new JPanel();
        //Fin initialisations
        //Divers settings
        dessin.setSize(width1,height1);
        dessin.setBackground(Color.white);
        dessin.setLayout(null);
        dessin.setVisible(false);
        setTitle("Sauvegarde d'images");
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        //Fin divers settings
        recupComboBox();
        //Listener
        bAngle.addActionListener(this);
        bPreparation.addActionListener(this);
        bPreparationDouble.addActionListener(this);
        //Fin add listener
        //Debut add
        panel1.add(lAngle);
        panel1.add(sAngle);
        panel1.add(bAngle);
        panel2.add(lPreparation);
        panel2.add(sPreparation);
        panel2.add(bPreparation);
        panel3.add(lPreparationDouble);
        panel3.add(sPreparationDouble);
        panel3.add(bPreparationDouble);
        panel.add(panel1);
        panel.add(panel2);
        panel.add(panel3);
        contain.add(dessin);
        contain.add(panel);
        //Fin add
    //Fin Constructor Maker()
    //  Fonction: actionPerformed(ActionEvent)
    public void actionPerformed(ActionEvent e)
        Object obj = e.getSource();
        //JButton bAngle
        if(obj == bAngle)
            int lequel = sAngle.getSelectedIndex();
            doRecup(lequel, 1);
        //Fin JButton bAngle
        else
            //JButton bPreparation
            if(obj == bPreparation)
                int lequel = sPreparation.getSelectedIndex();
                doRecup(lequel, 2);
            //Fin JButton bPreparation
            else
                //JButton bPreparationDouble
                if(obj == bPreparationDouble)
                    int lequel = sPreparationDouble.getSelectedIndex();
                    doRecup(lequel, 3);
                //Fin JButton bPreparationDouble
    //Fin Fonction actionPerformed(ActionEvent)
    //  Fonction: creerImage()
    public void creerImage()
        JFileChooser chooser = new JFileChooser();
        int val = chooser.showSaveDialog(null);
        if(val == JFileChooser.APPROVE_OPTION)
            File fileChoosen = chooser.getSelectedFile();
            String tmp = fileChoosen.toString();
            int pos = tmp.indexOf(".jpeg");
            int pos1 = tmp.indexOf(".jpg");
            if(pos == -1 && pos1 == -1)
                tmp += ".jpeg";
            saveComponentAsJPEG(dessin,contain,tmp);
    //Fin Fonction creerImage()
    //  Fonction: doAngle(int,int)
    public void doRecup(int lequel, int combo)
        String fingerprint = "";
        String numlogik = "";
        switch(combo)
            case 1:
                String dat1[] = ((String[])data1.get(0));
                numlogik = dat1[lequel];
                String datt1[] = ((String[])data1.get(1));
                fingerprint = datt1[lequel];
                break;
            case 2:
                String dat2[] = ((String[])data2.get(0));
                numlogik = dat2[lequel];
                String datt2[] = ((String[])data2.get(1));
                fingerprint = datt2[lequel];
                break;
            case 3:
                String dat3[] = ((String[])data3.get(0));
                numlogik = dat3[lequel];
                String datt3[] = ((String[])data3.get(1));
                fingerprint = datt3[lequel];
                break;
            default:
                JOptionPane.showMessageDialog(null,"Case pas encore implementer");
                break;
        recup(numlogik,fingerprint);
    //Fin Fonction doAngle(int,int)
    //  Fonction: main(String)
    public static void main(String[] args)
        Maker fenetre = new Maker();
        fenetre.setSize(1000,1000); //300,200
        fenetre.pack();
        fenetre.setVisible(true);
    //Fin Fonction main(String)
    //  Fonction: recup(String, String)
    public void recup(String numlogik, String fingerprint)
        try
           Class.forName("org.postgresql.Driver");
        catch(ClassNotFoundException e1)
            JOptionPane.showMessageDialog(null, "1 " + e1.getMessage());
        //Creer la Connection
        try
            con = DriverManager.getConnection("jdbc:postgresql://mydb", "l","p");
        catch(SQLException e1)
            try
                con = DriverManager.getConnection("jdbc:postgresql://mydb", "l","p");
            catch(SQLException e)
                JOptionPane.showMessageDialog(null,"Soit vous n'�tes plus connect� � internet \n ou le port 5432 n'est pas ouvert \n Contactez votre administrateur r�seaux");                
        try
            statement = con.createStatement();
        catch(SQLException eStat)
            JOptionPane.showMessageDialog(null,"stat " + eStat.getMessage());
        try
            results = statement.executeQuery("Select croquishtml from fds WHERE numlogik = '" + numlogik + "' AND fingerprint='" + fingerprint + "';");
            //Add Image
            try
                while(results.next())
                    //get the l/p for that url
                    Authenticator.setDefault(new MyAuthenticator());
                    //creer limage
                    String tmpUrl = results.getString("croquishtml");
                    URL url = new URL(tmpUrl);
                    ball = Toolkit.getDefaultToolkit().createImage(url);
            catch(MalformedURLException urexc)
                JOptionPane.showMessageDialog(null,urexc.getMessage());
            //Permet de prendre le size de l'image par la suite
            MediaTracker track = new MediaTracker(this);
            track.addImage(ball,0);
            try
                track.waitForID(0);
            catch(InterruptedException e)
                System.out.println(e.getMessage());
            //Add image a dessin
            int largeurImg = ball.getWidth(this);
            int hauteurImg = ball.getHeight(this);
            int hauteurDess = (height1 - hauteurImg)/2;
            int largeurDess = (width1 - largeurImg)/2;
            dessin.add(new JP(8, largeurDess, hauteurDess, largeurImg, hauteurImg ), 0);
            image = true;
            repaint();
            //Fin add Image           
            results = statement.executeQuery("Select * from java WHERE numlogik = '" + numlogik + "' AND fingerprint='" + fingerprint + "' AND croquis = (SELECT MAX(croquis) from java WHERE numlogik = '" + numlogik + "' AND fingerprint='" + fingerprint + "');");
            String getTypeForme, getTypeLigne, getPointsX, getPointsY, getTxt, getCoul;
            Vector pttx = new Vector();
            Vector ptty = new Vector();
            while(results.next())
                getTypeForme = results.getString("typeforme");
                getTypeLigne = results.getString("typeligne");
                getPointsX = results.getString("pointsx");
                getPointsY = results.getString("pointsy");
                getTxt = results.getString("txt");
                getCoul = results.getString("couleur");
                int pos1 = 0;
                int pos2 = 0;
                while(pos2 < getPointsX.lastIndexOf("@"))
                    pos2 = getPointsX.indexOf("@",pos1);
                    pttx.add(getPointsX.substring(pos1,pos2));
                    pos1 = pos2+1;
                pttx.add(getPointsX.substring(pos1,getPointsX.length()));
                pos1 = 0;
                pos2 = 0;
                while(pos2 < getPointsY.lastIndexOf("@"))
                    pos2 = getPointsY.indexOf("@",pos1);
                    ptty.add(getPointsY.substring(pos1,pos2));
                    pos1 = pos2+1;
                ptty.add(getPointsY.substring(pos1,getPointsY.length()));
                if (((Integer.parseInt((String)(getTypeForme))) == 4) || ((Integer.parseInt((String)(getTypeForme))) == 5))
                    dlType = Integer.parseInt((String)(getTypeLigne));
                if ((Integer.parseInt((String)(getTypeForme))) == 6)
                    txt = (String)(getTxt);
                //Couleur
                int posr = getCoul.indexOf("r=");
                int posg = getCoul.indexOf("g=");
                int posb = getCoul.indexOf("b=");
                int r = Integer.parseInt((getCoul.substring(posr+2,posg-1)));
                int g = Integer.parseInt((getCoul.substring(posg+2,posb-1)));
                int b = Integer.parseInt((getCoul.substring(posb+2,getCoul.length()-1)));
                coulChoi = new Color(r,g,b);
                //Fin Couleur
                if (((Integer.parseInt((String)(getTypeForme))) == 7) || ((Integer.parseInt((String)(getTypeForme))) == 1) || ((Integer.parseInt((String)(getTypeForme))) == 9))
                    int tmp = pttx.size();
                    minX = 1000;
                    minY = 1000;
                    maxX = -1000;
                    maxY = -1000;
                    for (int i=0;i<tmp;i++)
                        if (Integer.parseInt((String)(pttx.get(i))) > maxX)
                            maxX = Integer.parseInt((String)(pttx.get(i)));
                        else
                            if (Integer.parseInt((String)(pttx.get(i))) < minX)
                                minX = Integer.parseInt((String)(pttx.get(i)));
                        if (Integer.parseInt((String)(ptty.get(i))) > maxY)
                            maxY = Integer.parseInt((String)(ptty.get(i)));
                        else
                            if (Integer.parseInt((String)(ptty.get(i))) < minY)
                                minY = Integer.parseInt((String)(ptty.get(i)));
                    for(int y=0;y<pttx.size();y++)
                        if((Integer.parseInt((String)(getTypeForme))) == 7 || (Integer.parseInt((String)(getTypeForme))) == 9)
                            points.addElement((new Point((Integer.parseInt((String)(pttx.get(y)))),(Integer.parseInt((String)(ptty.get(y)))))));
                        else
                            poi.addElement((new Point((Integer.parseInt((String)(pttx.get(y)))),(Integer.parseInt((String)(ptty.get(y)))))));
                    if((Integer.parseInt((String)(getTypeForme))) == 7 || (Integer.parseInt((String)(getTypeForme))) == 9)
                        dessin.add(new JP(7,minX,minY,maxX-minX,maxY-minY),0);
                        points.removeAllElements();
                    else
                        dessin.add(new JP(1,minX,minY,maxX-minX,maxY-minY),0);
                        poi.removeAllElements();
                    minX = 1000;
                    minY = 1000;
                    maxX = -1000;
                    maxY = -1000;
                else
                    if(8 != Integer.parseInt((String)(getTypeForme)))
                        dessin.add(new JP(Integer.parseInt((String)(getTypeForme)),(Integer.parseInt((String)(pttx.get(0)))),(Integer.parseInt((String)(ptty.get(0)))),(Integer.parseInt((String)(pttx.get(1)))),(Integer.parseInt((String)(ptty.get(1))))),0);
                repaint();
                pttx.removeAllElements();
                ptty.removeAllElements();
            con.close();
            creerImage();
        catch(SQLException sqe)
            JOptionPane.showMessageDialog(null, "#####" + sqe.getMessage());
        dessin.setSize(width1,height1);
    //Fin Fonction recup(String,String)
    //  Fonction: recupComboBox()
    public void recupComboBox()
        boolean errorConnect = false; //Sert a savoir si la connection a la db a ete possible
        //Choisir Driver
        try
            Class.forName("org.postgresql.Driver");
        catch(ClassNotFoundException ce)
            JOptionPane.showMessageDialog(null,"Manque certains fichiers a l'�x�cution (db driver)");
        //Creer la Connection
        try
            con = DriverManager.getConnection("jdbc:postgresql://mydb", "l","p");
        catch(SQLException e1)
            try
                con = DriverManager.getConnection("jdbc:postgresql://mydb", "l","p");
            catch(SQLException e)
                JOptionPane.showMessageDialog(null,"Soit vous n'�tes plus connect� � internet \n ou le port 5432 n'est pas ouvert \n Contactez votre administrateur r�seaux");
                errorConnect = true;                   
        if (!errorConnect)
            //Creer un Etat
            try
                statement = con.createStatement();
            catch(SQLException sqe)
                JOptionPane.showMessageDialog(null,sqe.getMessage());
            //Recupere le select
            try
                results = statement.executeQuery("SELECT nofds, fingerprint, numlogik FROM fds WHERE typefds='ang' ORDER BY nofds,fingerprint,numlogik;");
            catch(SQLException sqe2)
                JOptionPane.showMessageDialog(null,sqe2.getMessage());
            try
                int size = results.getFetchSize();
                if(size == 0)
                    String sAngleData[] = {"Aucune fds"};
                    sAngle = new JComboBox(sAngleData);
                else
                    String sAngleData[] = new String[size];
                    String sAngleNumlogik[] = new String[size];
                    String sAngleFingerprint[] = new String[size];
                    int i=0;
                    while(results.next())
                       sAngleData[i] = results.getString("nofds");
                       sAngleNumlogik[i] = results.getString("numlogik");
                       sAngleFingerprint[i] = results.getString("fingerprint");
                       i++;
                    sAngle = new JComboBox(sAngleData);
                    data1.add(sAngleNumlogik);
                    data1.add(sAngleFingerprint);
            catch(SQLException sqe3)
                JOptionPane.showMessageDialog(null,sqe3.getMessage());
            try
                results = statement.executeQuery("SELECT nofds, fingerprint, numlogik FROM fds WHERE typefds='bab' ORDER BY nofds,fingerprint,numlogik;");
            catch(SQLException sqe2)
                JOptionPane.showMessageDialog(null,sqe2.getMessage());
            try
                int size = results.getFetchSize();
                if(size == 0)
                    String sPreparationData[] = {"Aucune fds"};
                    sPreparation = new JComboBox(sPreparationData);
                else
                    String sPreparationData[] = new String[size];
                    String sPreparationNumlogik[] = new String[size];
                    String sPreparationFingerprint[] = new String[size];                   
                    int i=0;
                    while(results.next())
                       sPreparationData[i] = results.getString("nofds");
                       sPreparationNumlogik[i] = results.getString("numlogik");
                       sPreparationFingerprint[i] = results.getString("fingerprint");                      
                       i++;
                    sPreparation = new JComboBox(sPreparationData);
                    data2.add(sPreparationNumlogik);
                    data2.add(sPreparationFingerprint);                   
            catch(SQLException sqe3)
                JOptionPane.showMessageDialog(null,sqe3.getMessage());
            try
                results = statement.executeQuery("SELECT nofds, fingerprint, numlogik FROM fds WHERE typefds='bbd' ORDER BY nofds,fingerprint,numlogik;");
            catch(SQLException sqe2)
                JOptionPane.showMessageDialog(null,sqe2.getMessage());
            try
                int size = results.getFetchSize();
                if(size == 0)
                    String sPreparationDoubleData[] = {"Aucune fds"};
                    sPreparationDouble = new JComboBox(sPreparationDoubleData);
                else
                    String sPreparationDoubleData[] = new String[size];
                    String sPreparationDoubleNumlogik[] = new String[size];
                    String sPreparationDoubleFingerprint[] = new String[size];                    
                    int i=0;
                    while(results.next())
                       sPreparationDoubleData[i] = results.getString("nofds");
                       sPreparationDoubleNumlogik[i] = results.getString("numlogik");
                       sPreparationDoubleFingerprint[i] = results.getString("fingerprint");                       
                       i++;
                    sPreparationDouble = new JComboBox(sPreparationDoubleData);
                    data3.add(sPreparationDoubleNumlogik);
                    data3.add(sPreparationDoubleFingerprint);                     
            catch(SQLException sqe3)
                JOptionPane.showMessageDialog(null,sqe3.getMessage());
    //Fin Fonction recupBomboBox()
    //  Fonction: repaintDessin()
    public void repaintDessin()
        //repaint dessin
        repaint();
    //Fin Fonction repaintDessin()
    //  Fonction: saveComponentAsJPEG(JComponent, Container, String)
    public static void saveComponentAsJPEG(JComponent cmp, Container cont, String jpegfile)
        Rectangle d = cmp.getBounds();     
        BufferedImage bi = new BufferedImage(d.width, d.height, BufferedImage.TYPE_INT_RGB);     
        Graphics2D g2d = bi.createGraphics();       
        SwingUtilities.paintComponent(g2d,cmp,cont, 0,0,d.width,d.height);     
        saveImageAsJPEG(bi, jpegfile);
    //Fin Fonction saveComponentAsJPEG(JComponent, Container, String)
    //  Fonction: saveImageAsJPEG(BufferedImage, String)
    public static void saveImageAsJPEG(BufferedImage bi, String filename)
        try
            ByteArrayOutputStream boutstream = new ByteArrayOutputStream();       
            JPEGImageEncoder enc = JPEGCodec.createJPEGEncoder(boutstream);       
            enc.encode(bi);       
            FileOutputStream fimage = new FileOutputStream(new File(filename));       
            boutstream.writeTo(fimage);       
            fimage.close();    
        catch (Exception e)
            JOptionPane.showMessageDialog(null,e.getMessage());
    //Fin Fonction saveImageAsJPEG(BufferedImage, String)

Similar Messages

  • Reading a String from the Console.

    Hello,
    I am new to Java... I have to write a program which will read a long value from the console. Can somebody help me in this? or can i read it as a string and then convert to Long ? I prefer the second one as I am planning to convert this code to read a SOAP message... Can somebody help me or pint me to the right direction?
    Thanks,

    Reading it as a string and then parsing it (Long.parseLong(...)) is the way to do this.
    As far as converting to SOAP - slow down. If you're just getting started with java, you're going to be biting off a lot trying to tackle SOAP

  • User defined form usr disapperas from design console (OIM 9.1.0.2)

    Hi,
    I have imported usr.xml from one environment to another, and usr form disapperas from design console. Also getting an error message while importing xml.
    java.util.zip.ZipException: error in opening zip file
    DEBUG,16 Dec 2011 10:35:05,383,[XELLERATE.SERVER],Class/Method: tcDataObj:handleErr - Data: poError.isDetail - Value: com.thortech.xl.orb.dataaccess.tcDataAccessException: DB_WRITE_FAILEDDetail: SQL: ALTER TABLE USR MODIFY Description: ORA-00904: : invalid identifier SQL State: 42000Vendor Code: 904Additional Debug Info:com.thortech.xl.orb.dataaccess.tcDataAccessException
    ERROR,16 Dec 2011 10:35:05,385,[XELLERATE.DDM.IMPORT],Label in use. Please rename.
    ERROR,16 Dec 2011 10:35:05,385,[XELLERATE.DDM.IMPORT],Error Modifying a Column.
    ERROR,16 Dec 2011 10:35:05,385,[XELLERATE.DDM.IMPORT],Exception during import
    com.thortech.xl.ddm.exception.DDMException: Unable to save dataobject for SDC
    com.thortech.xl.ddm.exception.DDMException: Unable to save dataobject for SDC
    Regards,
    Sidharth

    (1) Run following query to verify if there exist entries for administrators for USR form in UDFD form level and provide results to support representative:
    select fug.sdk_key, fug.fug_write,fug.fug_delete, ugp.ugp_key, ugp.ugp_name, fug_rowver from ugp ugp, fug fug where ugp.ugp_key=fug.ugp_key and fug.sdk_key= (select sdk_key from sdk where sdk_name='USR');
    (2)In the case query mentioned above in step(1) does not return any rows then there is need to insert one entry for "system administrator" group and one can execute (please take backup of your database for sure before executing these queries) following queries (
    INSERT INTO FUG (SDK_KEY,UGP_KEY,FUG_WRITE,FUG_DELETE,FUG_DATA_LEVEL,FUG_CREATE,
    FUG_CREATEBY,FUG_UPDATE,FUG_UPDATEBY,FUG_NOTE,FUG_ROWVER)
    SELECT (SELECT SDK_KEY FROM SDK WHERE SDK_NAME='USR'),
    (SELECT UGP_KEY FROM UGP WHERE UGP_NAME='SYSTEM ADMINISTRATORS'),
    1,
    1,
    1,
    SYSDATE,
    (SELECT USR_KEY from USR where USR_LOGIN='XELSYSADM'),
    SYSDATE,
    (SELECT USR_KEY from USR where USR_LOGIN='XELSYSADM'),
    NULL,
    HEXTORAW('000000000000')
    FROM DUAL;

  • Not able to access the Database & Clusterware from OEM Console.

    hi,
    I had installed Oracle RAC 11g R2 in RHEL 5.3 Operating environment. I had installed my Oracle RAC with Enterprise Manager Console.
    Its with the defailt port 1158. After the installation when i try to access my EM Console, i was not able to access the Database and Clusterware from EM Console.
    When i access the EM console with url, I found with Startup and Perform Recovery option. But whereas my database is already startup and running.
    So when i click startup its saying database is already started. Since it is a prodution environment i dont want to go with Perform recovery option.
    Please tell me hw to attach files in this thread so that i can send the snap shot of the console for your reference.
    with regards
    A.Aravind
    Edited by: 795847 on Sep 21, 2010 10:40 PM

    hi,
    As mentioned due to not having the default listener port 1521, we are facing this problem.
    As meniotned i had changed the emoms.properties file and changed the port and my emctl page is opening.
    But am not able to access the other parameters like ASM, Servers, Clusters etc bcoz since in some file it is looking for 1521 default port.
    So is it better to go for emctl deconfig and config again or to change the port the files which required.
    If i do in what are the file the default port will be located related to emctl.
    with regards
    A.Aravind

  • Starting Managed Server from Administration Console

    Hi
    I am new for SOA and fusion. Can anyone share the brief steps that are needed to start/stop a Managed Server from Admin Console.
    I did a fresh install on RHEL5 and configure a domain. i was able to start the services from script which are created when creating a domain.
    But when i assigned a Managed Server to a Node Manager and try starting the Managed server. It does not start and in the log i can see exceptions like below
    Failed to invoke startup class "JPS Startup Class", java.lang.ClassNotFoundException: oracle.security.jps.wls.JpsWlsStartupClass
    java.lang.ClassNotFoundException
    Failed to invoke startup class "ODL-Startup", java.lang.ClassNotFoundException: oracle.core.ojdl.weblogic.ODLConfiguration
    java.lang.ClassNotFoundException
    I start the services in below order
    Weblogic Server
    node Manager
    and
    soa_server
    Thanks
    Hari

    you must set to true the StartScriptEnabled property in nodemanager.properties

  • To launch MS paint from SAP

    I have a requirement to launch MS paint from SAP.
    On pressing a button in SAP screen, MS paint has to be launched for the end-user.
    Thanks in advance.
    Locking this thread, Please search before posting any thread
    Edited by: Vijay Babu Dudla on Jan 9, 2012 7:00 AM

    There are several ways to do that.
    Just check the method EXECUTE of CL_GUI_FRONTEND_SERVICES class. pass APPLICATION as "mspaint"
    Regards
    -V

  • Unable to start Managed server from admin console using nodemanager

    I changed the ip address and hostname of the server on which Weblogic Server 10.3.5 is running. After that I am unable to start the managed servers using Admin console. Is there any changes in the nodemanager configuration files which need to be done to start the managed servers from admin console.

    Hi there,
    Can you check the following configuration in Weblogic admin console ?
    1- Check which listen address mentioned under the Machine configuration ( Environment > Machines > select appropriate nodemanager machine >Configuration > Node Manager ). If it is pointing to old host name, change it to new one.
    2- Once you done with Step 1. Check whether the machine is reachable or not. ( Machine > [Your Machine] > Monitoring > status.
    3- If still isuse persists.. Check the managed server startup log files ( for eg:- managedserver1.out under the path $DOMAIN_HOME\Servers\managedserver1\logs directory.
    Thanks
    Lakshman

  • Unable to start Managed servers from admin console

    Hello!
    We have a problem to start Managed Servers throw Node manager.
    We get an error:
    <Jan 26, 2012 2:17:54 PM> <INFO> <peoplesoft> <PIA1> <Boot identity properties saved to "/software/psoft/pt851/webserv/peoplesoft/servers/PIA1/data/nodemanager/boot.properties">
    Jan 26, 2012 2:17:54 PM weblogic.nodemanager.server.ServerManager log
    INFO: Boot identity properties saved to "/software/psoft/pt851/webserv/peoplesoft/servers/PIA1/data/nodemanager/boot.properties"
    <Jan 26, 2012 2:17:54 PM> <INFO> <peoplesoft> <PIA1> <Startup configuration properties saved to "/software/psoft/pt851/webserv/peoplesoft/servers/PIA1/data/nodemanager/startup.properties">
    Jan 26, 2012 2:17:54 PM weblogic.nodemanager.server.ServerManager log
    INFO: Startup configuration properties saved to "/software/psoft/pt851/webserv/peoplesoft/servers/PIA1/data/nodemanager/startup.properties"
    <Jan 26, 2012 2:17:54 PM> <INFO> <peoplesoft> <PIA1> <Server error log also redirected to server log>
    Jan 26, 2012 2:17:54 PM weblogic.nodemanager.server.LogFileRotationUtil log
    INFO: Server error log also redirected to server log
    <Jan 26, 2012 2:17:54 PM> <INFO> <peoplesoft> <PIA1> <Starting WebLogic server with command line: /software/psoft/pt851/webserv/peoplesoft/bin/startManagedWebLogic.sh >
    Jan 26, 2012 2:17:54 PM weblogic.nodemanager.server.ServerManager log
    INFO: Starting WebLogic server with command line: /software/psoft/pt851/webserv/peoplesoft/bin/startManagedWebLogic.sh
    <Jan 26, 2012 2:17:54 PM> <INFO> <peoplesoft> <PIA1> <Working directory is '/software/psoft/pt851/webserv/peoplesoft'>
    Jan 26, 2012 2:17:54 PM weblogic.nodemanager.server.ServerManager log
    INFO: Working directory is '/software/psoft/pt851/webserv/peoplesoft'
    <Jan 26, 2012 2:17:54 PM> <INFO> <peoplesoft> <PIA1> <Rotated server output log to "/software/psoft/pt851/webserv/peoplesoft/servers/PIA1/logs/PIA1.out00001">
    Jan 26, 2012 2:17:54 PM weblogic.nodemanager.server.LogFileRotationUtil log
    INFO: Rotated server output log to "/software/psoft/pt851/webserv/peoplesoft/servers/PIA1/logs/PIA1.out00001"
    <Jan 26, 2012 2:17:54 PM> <INFO> <peoplesoft> <PIA1> <Server error log also redirected to server log>
    Jan 26, 2012 2:17:54 PM weblogic.nodemanager.server.LogFileRotationUtil log
    INFO: Server error log also redirected to server log
    <Jan 26, 2012 2:17:54 PM> <INFO> <peoplesoft> <PIA1> <Server output log file is '/software/psoft/pt851/webserv/peoplesoft/servers/PIA1/logs/PIA1.out'>
    Jan 26, 2012 2:17:54 PM weblogic.nodemanager.server.ServerManager log
    INFO: Server output log file is '/software/psoft/pt851/webserv/peoplesoft/servers/PIA1/logs/PIA1.out'
    <Jan 26, 2012 2:17:54 PM> <INFO> <peoplesoft> <PIA1> <Server failed during startup so will not be restarted>
    Jan 26, 2012 2:17:54 PM weblogic.nodemanager.server.ServerManager log
    INFO: Server failed during startup so will not be restarted
    <Jan 26, 2012 2:17:54 PM> <WARNING> <Exception while starting server 'PIA1'>
    java.io.IOException: Server failed to start up. See server output log for more details.
    at weblogic.nodemanager.server.ServerManager.start(ServerManager.java:331)
    at weblogic.nodemanager.server.Handler.handleStart(Handler.java:567)
    at weblogic.nodemanager.server.Handler.handleCommand(Handler.java:118)
    at weblogic.nodemanager.server.Handler.run(Handler.java:70)
    at java.lang.Thread.run(Thread.java:662)
    Jan 26, 2012 2:17:54 PM weblogic.nodemanager.server.Handler handleStart
    WARNING: Exception while starting server 'PIA1'
    java.io.IOException: Server failed to start up. See server output log for more details.
    at weblogic.nodemanager.server.ServerManager.start(ServerManager.java:331)
    at weblogic.nodemanager.server.Handler.handleStart(Handler.java:567)
    at weblogic.nodemanager.server.Handler.handleCommand(Handler.java:118)
    at weblogic.nodemanager.server.Handler.run(Handler.java:70)
    at java.lang.Thread.run(Thread.java:662)
    Additional information:
    weblogic 10.3.3
    PT8.51.11
    Linux x86_64 RH5
    When we starting Manged servers manualy, it's works fine.
    Thank you.

    Hello!
    The problem is found.
    We tried to startup managed server by running startManagedServer.sh script, but this script expecting to get parameters.
    The NodeManager unable to send parameters to script that appears in nodemanager.properties file (StartScriptName).
    So, I created a new script startPIA.sh, that calls to startManagedServer.sh and sends it 2 parameters:
    ./startManagedWebLogic.sh $SERVER_NAME $ADMIN_URL
    Now, we can start and stop managed servers from admin console, BUT we still have an error in NodeManager:
    <Jan 29, 2012 11:15:39 AM> <INFO> <peoplesoft> <PIA1> <Server failed during startup so will not be restarted>
    Jan 29, 2012 11:15:39 AM weblogic.nodemanager.server.ServerManager log
    INFO: Server failed during startup so will not be restarted
    <Jan 29, 2012 11:15:39 AM> <WARNING> <Exception while starting server 'PIA1'>
    java.io.IOException: Server failed to start up. See server output log for more details.
    at weblogic.nodemanager.server.ServerManager.start(ServerManager.java:331)
    at weblogic.nodemanager.server.Handler.handleStart(Handler.java:567)
    at weblogic.nodemanager.server.Handler.handleCommand(Handler.java:118)
    at weblogic.nodemanager.server.Handler.run(Handler.java:70)
    at java.lang.Thread.run(Thread.java:662)
    Jan 29, 2012 11:15:39 AM weblogic.nodemanager.server.Handler handleStart
    WARNING: Exception while starting server 'PIA1'
    java.io.IOException: Server failed to start up. See server output log for more details.
    at weblogic.nodemanager.server.ServerManager.start(ServerManager.java:331)
    at weblogic.nodemanager.server.Handler.handleStart(Handler.java:567)
    at weblogic.nodemanager.server.Handler.handleCommand(Handler.java:118)
    at weblogic.nodemanager.server.Handler.run(Handler.java:70)
    at java.lang.Thread.run(Thread.java:662)
    There are no errors in managed servers logs.
    PIA1.out:
    <Jan 29, 2012 11:15:38 AM> <INFO> <NodeManager> <Server output log file is '/software/psoft/pt851/webserv/peoplesoft/servers/PIA1/logs/PIA1.out'>
    Attempting to start WebLogic Server PIA1
    No activity will be logged to this window.
    Server activity will be logged to /software/psoft/pt851/webserv/peoplesoft/servers/PIA1/logs/PIA1_*
    PID for WebLogic Server PIA1 is: 27018
    <Jan 29, 2012 11:15:39 AM> <FINEST> <NodeManager> <Waiting for the process to die: 26847>
    <Jan 29, 2012 11:15:39 AM> <INFO> <NodeManager> <Server failed during startup so will not be restarted>
    <Jan 29, 2012 11:15:39 AM> <FINEST> <NodeManager> <runMonitor returned, setting finished=true and notifying waiters>
    The status of managed server in admin console is RUNNING, but "Status of Last Action" is FAILED.
    What can be the reason?
    Thank you.

  • Can't start CMS 4.7 from admin console

    I can't start cms instance from admin console. When i try to start it says "operation error: unable to start the server". I tried to start the server from command line, it seems ok, so when i back to admin console and try to open CMS, it says "server off" and the server was already started from command line successfully.
    DOES ANYONE KNOW WHAT HAPPENS???
    thanks,
    Marcelo

    Hi, did you manage to solve the problem mentioned here...i'm having the same problem now.
    Br

  • Cluster connectivity from OMS console

    I've successfully installed 10g agent (10.2.0.4) on a linux cluster, but I'm having problems with cluster and database connectivity from the console (10gR4 on solaris 10). I can ssh to both cluster nodes from the OMS server no problem. I can sqlplus to cluster database from the OMS server as well. But when I try to use the same credentials in console, I'm getting "Connection to crs01 as user oracle failed.". Message in emoms.trc doesn't reveal much either:
    "2008-10-08 10:38:24,033 [EMUI_10_38_22_/console/pref/setCredentials$targetType=host] ERROR creds.SetPrefCreds testCreds.1592 - SetPrefCreds.testCreds(): CredsException: Connection to crs01 as user oracle failed.".
    Same for database connection ("Connection to TSTRAC as user system failed.", "2008-10-08 10:40:10,404 [EMUI_10_40_10_/console/pref/setCredentials$targetType=oracle*_database] ERROR creds.SetPrefCreds testCreds.1592 - SetPrefCreds.testCreds(): CredsException: Connection to TSTRAC as user system failed."
    Any advice or tip how to setup more detailed tracing?
    Thanks,
    Julius

    Yes, that's how I discovered I had a problem :) I was entering preferred credentials and tried to test and it failed. So I tried from a telnet session on oms server and it worked. I can't connect from oms console only. Do you know where the oms gets connection description from? Tnsnames.ora?

  • Delete Report painter from group

    How to delete a Report painter from a group which is assign to it.
    I mean I have created a report assign it to a group to run it. But I want to delete it can some tell what is the way to delete it.
    Regards,
    Kiran
    Message was edited by:
            Kiran Chopade

    Hi,
    You can delete a report from a report group from transaction code GR52.
    Enter the report group in transaction code and press enter. It will display the reports attached to the report group. Select the report which needs to be deleted and click on delete ?(red icon).
    Thanks
    Murali.

  • Manual transfering of Report Painter from one system to other

    Hi!
    I need to do manual transfering of Report Painter from one system to other.
    No transport request is available, that is why it is manual transfering.
    How to do it?
    For example I have this information:
    Object file name: <b>Y_P04_99000009</b>     
    Object description: <b>"Report Painter LEI-411 (library 8A2)"</b>
    Will reward,
    Mindaugas

    I hope you can export from one client and import to other client.
    Already Ferry Mentioned GR22 Transaction.
    Use GR22->utilities -> export ( Keep it as one .txt file)
    Login into other system ,
    Use GR22 -> Utilities->Import ( Use .txt file here)
    Thanks
    Seshu

  • Security Permissions from Management Console Not Being Replicated on SQL Server Database

    Hi Everyone,
    We have been encountering issues with access to Reporting Services for most console users since we upgraded to SCCM 2012 R2. We have observed that since the R2 upgrade, security permissions
    that are set in the console are not being replicated on the SQL database. Users/Groups that had access prior to the R2 upgrade are now only able to access Reports via the web interface. All new users/groups are not able to get access at all.
    We are not sure what the problem could be and would appreciate any guidance.
    We have tried the following without success:
    Manually adding new users/groups to the database
    Reinstalling the the Reporting Service point and Reporting Service, Removing all of the security groups from the console and from the database, and Adding the security groups back
    to the console.
    Our current environment:
    SCCM 2012 R2
    1 Site
    Primary Site:
    OS: Server 2008 R2
    Roles: Site Server / Software Update Point / Management
    Point
    SQL Server
    OS: Server 2008 R2
    SQL Version: Microsoft SQL Server 2008 R2
    Roles: Site Database Server / Reporting Services Point

    Thanks for your feedback.
    Permissions
    We have two main types of users: Full Administrators and local departmental IT administrators. (Local IT Admins only have full control over their own departmental collections. They have Read/Add to All Systems.)
    The only account that's currently able to run Reports from both the console and web is the admin account used to perform the R2 upgrade. 
    Full Administrator
    Role: Full Administrator
    Scope: All instances of the objects that are related to the assigned security roles.
    Local Departmental Administrator
    Role: Full Administrator & Read/Add
    Scope: Main Departmental Collection (Full Admin) & All Systems, All Users, and All User Groups (Read/Add)
    Report Service Execution
    On the database, we have tried assigning the Report Service Execution Account to the built-in Network Service Account, Local Service Account, and to a separate AD role account.
    Error Messages
    Console: We are able to select reports from the Console however nothing appears when we click on Run.
    Web: Generating Reports from the Web works for only the Full Administrators. Nothing appears for a Local Departmental Admin.
    This is a partial output from srsrp.log:
    Set configuration    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:05 PM    2588 (0x0A1C)
    Check state    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:05 PM    2588 (0x0A1C)
    Check server health.    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:05 PM    2588 (0x0A1C)
    Successfully created srsserver    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:05 PM    2588 (0x0A1C)
    Reporting Services URL from Registry [http://132.205.120.154/ReportServer/ReportService2005.asmx]    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:05 PM    2588 (0x0A1C)
    Reporting Services is running    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:05 PM    2588 (0x0A1C)
    Retrieved datasource definition from the server.    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:05 PM    2588 (0x0A1C)
    [SCM-SQL.concordia.ca] [CM_SCM] [ConfigMgr_SCM] [SCM-SQL.CONCORDIA.CA]    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:05 PM    2588 (0x0A1C)
    [MSSQLSERVER] [1] [] [CONCORDIA\SVC-SCM_REPORT]    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:05 PM    2588 (0x0A1C)
    [1] [0]    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:05 PM    2588 (0x0A1C)
    Confirmed version [10.50.2811.0] for the Sql Srs Instance.    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:05 PM    2588 (0x0A1C)
    Retrieved datasource definition from the server.    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:05 PM    2588 (0x0A1C)
    Updating data source {5C6358F2-4BB6-4a1b-A16E-8D96795D8602} at ConfigMgr_SCM    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:05 PM    2588 (0x0A1C)
    Loading localization resources from directory [E:\SMS_SRSRP\SrsResources.dll]    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:05 PM    2588 (0x0A1C)
    Looking for 'English (United States)' resources    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:05 PM    2588 (0x0A1C)
    Looking for 'English' resources    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:05 PM    2588 (0x0A1C)
    Found resources for 'English'    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:05 PM    2588 (0x0A1C)
    Confirmed the configuration of SRS role [ConfigMgr Report Users].    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:06 PM    2588 (0x0A1C)
    Confirmed the configuration of SRS role [ConfigMgr Report Administrators].    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:06 PM    2588 (0x0A1C)
    Error retrieving users - [The EXECUTE permission was denied on the object 'spGetReportUsers', database 'CM_SCM', schema 'SCCM_Rpt'.].    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:06 PM    2588 (0x0A1C)
    Error retrieving users - [The EXECUTE permission was denied on the object 'spGetReportUsers', database 'CM_SCM', schema 'SCCM_Rpt'.].    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:06 PM    2588 (0x0A1C)
    Confirmed the security policy for folder [/].    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:06 PM    2588 (0x0A1C)
    Error retrieving users - [The EXECUTE permission was denied on the object 'spGetReportUsers', database 'CM_SCM', schema 'SCCM_Rpt'.].    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:06 PM    2588 (0x0A1C)
    Error retrieving users - [The EXECUTE permission was denied on the object 'spGetReportUsers', database 'CM_SCM', schema 'SCCM_Rpt'.].    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:06 PM    2588 (0x0A1C)
    Confirmed the security policy for folder [/ConfigMgr_SCM].    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:06 PM    2588 (0x0A1C)
    Error retrieving users - [The EXECUTE permission was denied on the object 'spGetReportUsers', database 'CM_SCM', schema 'SCCM_Rpt'.].    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:06 PM    2588 (0x0A1C)
    Error retrieving users - [The EXECUTE permission was denied on the object 'spGetReportUsers', database 'CM_SCM', schema 'SCCM_Rpt'.].    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:06 PM    2588 (0x0A1C)
    Confirmed the security policy for folder [/ConfigMgr_SCM/Asset Intelligence].    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:06 PM    2588 (0x0A1C)
    Error retrieving users - [The EXECUTE permission was denied on the object 'spGetReportUsers', database 'CM_SCM', schema 'SCCM_Rpt'.].    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:06 PM    2588 (0x0A1C)
    Error retrieving users - [The EXECUTE permission was denied on the object 'spGetReportUsers', database 'CM_SCM', schema 'SCCM_Rpt'.].    SMS_SRS_REPORTING_POINT    3/10/2015 2:28:06 PM    2588 (0x0A1C)

  • Clients upgraded with CU3 still shown with lower version from SCCM console

    Hello,
    A couple of months ago, I upgraded all my clients with CU3. 
    As I still have about 2% of clients not shown as upgraded to CU3 when I look in the console, I started to investigate on client side. It appears those clients properly got the upgrade. From control panel, I can see the CU3 version is displayed.
    Any idea why the version is not correctly reported from the console ?
    Regards.

    The client should provide that information after a heartbeat discovery. Could it be that those clients missed a few heartbeats? If so, trigger them and the information should update.
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • Unable to install sccm client from SCCM console install client option

    Hi
    Unable to install client on windows 7 64 bit enterprise from sccm console. The client is discovered in sccm console with status client = NO, so we want to install sccm client from console remotely.
    We cannot enable push install. my id has full access on SCCM site server SCCM product also admin rights on workstations. I am able to access net bios path SMS_<site code> of site server then client path from client machine. machine is in domain and
    is boundry of sccm .
    Client push install in console is diabled
    Regards Sushain KApoor

    Hi!
    Examine the ccm.log located in <SCCM 2007 InstallationPath>\LOGS on the site server.
    Best regards
    Henrik

Maybe you are looking for