How to display Oracle error in web page

Hi ,
I am developing an application in Weblogic 10.2 and java . The data is fetched in oracle and i storre it in vector and display the same in the webpage .Whenever an oracle error or exception occurs , i need that ORA message to be displayed on the page , instead i get the error from Weblogic server being displayed on the page .The weblogic exception takes the precedence and it is displayed. Can anyone let me knwo how to display the oracle error instead of these head breaking lines , since it irritates the end users
<Feb 10, 2009 6:38:31 AM MST> <Error> <HTTP> <BEA-101020> <[ServletContext(id=11
504434,name=DefaultWebApp,context-path=/DefaultWebApp)] Servlet failed with Exce
ption
java.lang.NullPointerException
at jsp_servlet.__ttt_cust_info._jspService(__ttt_cust_info.java:505)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:1077)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:465)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:348)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:7047)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3902)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2773)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
>

I'm not convince that the null pointer exception is coming from the database. Rather, whatever you wrote to package the result might be at fault. Regardless, typically, to avoid the web container swallowing an exception is to catch it yourself. Your database call will need to catch the exception and repackage it for the JSP. A bad style would be to use scriptlet and catch the exception, but it could be useful for debugging.

Similar Messages

  • How to display Japanese Text in web page?

    Hi,
    I am trying to get this i18n stuff right for a few days but don't seem to find all answers.
    I am using Sybase databse to store Japanese characters. A perl script inserts the chars in table. Then I use a test JSP program to display the chars.
    <%@ page contentType="text/html; charset=UTF-8" %>
    <%@ page language="java" %>
    <%@ page import="java.io.*" %>
    <%@ page import="java.sql.*" %>
    <%@ page import="java.util.*" %>
    <%@ page import="javax.sql.*" %>
    <%@ page import="javax.servlet.*" %>
    <%@ page import="javax.servlet.http.*" %>
    <%@ page import="javax.naming.InitialContext" %>
    <%@ page import="java.text.SimpleDateFormat" %>
    <html>
    <head><title>testing for utf string</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </head>
    <body>
    <%
    Connection conn = null;
    Statement stmt = null;
    ResultSet rs = null;
    try{
            InitialContext context = new InitialContext();
            DataSource ds = (DataSource) context.lookup(System.getProperty("TESTDS"));
            conn = ds.getConnection();
            stmt = conn.createStatement();
            rs = stmt.executeQuery("select comment from TestTable");
            while(rs.next()){
                    out.println("<br>");
                    out.println("the comment is : <Textarea Cols=\"90\" Rows=\"5\" Name=\"Comment\">"+rs.getString(1)+"</Textarea>");
                    out.println("<br>");
                    out.println("the comment is "+rs.getString(1));
    }catch(Exception e){
            e.printStackTrace();
    }finally{
            try{
            if(rs != null) {rs.close();}
            if(stmt != null) {stmt.close();}
            if(conn != null) {conn.close();}
            }catch(Exception e){}
    %>
    </body>
    </html>But the page does not display correctly. If I change the charset as JIS, then it seems to work. But my web page will be having chars from multiple language and I think utf-8 is the right charset for that.
    Any pointers?
    Thanks

    What JSP/Servlet server are you using and what version?
    Try this just for debugging:
    Remove the rs.getString(1) from the out.println() call. Just assign the returned value to a local String variable and display the variable using (I hope I'm remembering correctly) this:
    <%= myVariable %>
    I'm curious whether directly inserting the text into the page is somehow different from sending it via out.println.
    Regards,
    John O'Conner

  • Help in retrieveing Blob from Oracle db and display it on a web page

    I am using Sun Studio creator2 and this is what I want to achieve:
    When I click on "Load" button, the image is displayed on the web page(the application is a web application)
    I have dropped the "image" object from the pallette
    Having the database image displayed in the image field, when I enter the image ?Id? and click on the ?Load? button.
    Here is my piece of code:
    public String loadButton_action() {
    HttpServletRequest request = null;
    HttpServletResponse response = null;
    String connectionURL = "jdbc:oracle:thin:@//localhost:1521/cdecentre1";;
    /*declare a resultSet that works as a table resulted by execute a specified
    sql query. */
    ResultSet rs = null;
    // Declare statement.
    PreparedStatement psmnt = null;
    // declare InputStream object to store binary stream of given image.
    InputStream sImage;
    Connection connection = null;
    String driverName = "oracle.jdbc.driver.OracleDriver";
    String dbName = "cdecentre1";
    String userName = "christian";
    String password = "cc";
    String theid = (String)idField.getValue(); //reading the image id
    try{
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    connection = DriverManager.getConnection(connectionURL, userName, password);
    /* prepareStatement() is used for create statement object that is
    used for sending sql statements to the specified database. */
    psmnt = connection.prepareStatement("SELECT image FROM CHRISTIAN.PICTURES WHERE id = ?");
    psmnt.setString(1, theid);
    rs = psmnt.executeQuery();
    if(rs.next()) {
    byte[] bytearray = new byte[1048576];
    int size=0;
    sImage = rs.getBinaryStream(1);
    //response.reset();
    response.setContentType("image/jpeg");
    while((size=sImage.read(bytearray))!= -1 ){
    response.getOutputStream().write(bytearray,0,size);
    rs.close();
    psmnt.close();
    connection.close(); } }
    } catch(Exception ex){
    System.out.println("error :"+ex);
    return null; }
    At the moment, when I click on the ?Load? button, the image is not present in the image field.
    I am only obtaining a message inside the message component.
    What should I do to have the image displayed in on the web page?
    Your help will be highly appreciated.

    A comprehensive dissertation from Javaworld: http://www.javaworld.com/javaworld/jw-05-2000/jw-0505-servlets.html
    Published 05/05/2000, ergo Java 1.0/1 era... still a valid explanation of the problem and the fundamental solution, but take the code (esp ImageIO) from here
    http://blog.codebeach.com/2008/02/creating-images-in-java-servlet.html
       1. package com.codebeach.servlet; 
       2.  
       3. import java.io.*; 
       4. import javax.servlet.*; 
       5. import javax.servlet.http.*; 
       6. import java.awt.*; 
       7. import java.awt.image.*; 
       8. import javax.imageio.*; 
       9.  
      10. public class ImageServlet extends HttpServlet 
      11. { 
      12.     public void doGet(HttpServletRequest req, HttpServletResponse res) 
      13.     { 
      14.         //Set the mime type of the image 
      15.         res.setContentType("image/jpeg"); 
      16.  
      17.         try 
      18.         { 
      19.             Create an image 200 x 200 
      20.             BufferedImage bufferedImage = new BufferedImage(200, 200, BufferedImage.TYPE_INT_RGB); 
      21.  
      22.             //Draw an oval 
      23.             Graphics g = bufferedImage.getGraphics(); 
      24.             g.setColor(Color.blue); 
      25.             g.fillOval(0, 0, 199,199); 
      26.  
      27.             Free graphic resources 
      28.             g.dispose(); 
      29.  
      30.             //Write the image as a jpg 
      31.             ImageIO.write(bufferedImage, "jpg", res.getOutputStream()); 
                        ////////////// NICE !!!! //////////////
      32.         } 
      33.         catch (IOException ioe) 
      34.         { 
      35.            e.printStackTrace();
      36.         } 
      37.     } 
      38. }  Edited by: corlettk on 19/01/2009 23:22 ~~ {color:#FF0000}Never{color} eat an exception!

  • How to display all data on one page in web app

    Hello.
    So I have web app JSF (IceFaces framework) + JBoss all Crystal Report working perfectly. So I have page with Crystal Report tags (e.g.
    <bocrv:reportPageViewer reportSource="#{crystalReport.reportPath}" ...
    in this report I have table with some data (data from DB) and I want to display this data on one page. Unfortunately now this data are moving to the next page and unfortunately I even donu2019t know how switch to the next page (I see only info e.g. 1with 2).
    So how to display this data on one page if its impossible how to torn on pagination.

    So I canu2019t do this, I canu2019t display all data on one page (until Iu2019m using JSF tags)?
    In JSF tags Iu2019m setting only path to file. In my bean Iu2019m using u201CReportClientDocumentu201D object itu2019s easy way to load report file (u201Copenu201D method) and set parameters (u201CgetDataDefController().getParameterFieldController()u201D method) and also connect to data base (u201Clogonu201D method) but I havenu2019t this property u201CsetSeparatePages(boolean)u201D.
    Maybe Iu2019m doing this wrong and there is a simpler way maybe I can use somehow u201CCrystalReportVieweru201D please give my any advice.

  • Oracle CODE Submission Web Page - MAKE IT WORK  finally ( not temporary! )

    Is it possible to finally FIX Oracle Code Submission web page. Last year ( last half ) it return errors, same this time. Is any possible way to finally FIX it without anytime alert that it is not working or broken. As far as I understand that the place were we share our code/tips/ideas, not publish our friends or something like that. I think if we use it, then at least put warning prior than we try to submit. No conversations about re-type same code ( tip used SQL, new tip - SAME but using PL/SQL function ), but at least make it work.
    Thanks/Ilya

    Thanks, Olivier. That may help me in future and shows me where I can edit some of the HTML code (though I've no experience yet of even reading HTML or Javascript, let alone editing it!).
    The web page I'm trying to edit has a URL of https://....../sap/bc/gui/sap/its/bbpstart which fits your example but the templates under service BBPSTART seem to bear no resemblance to the screen I need. The code under services BBPSC01 and BBPSC02 looks more relevant but still doesn't refer to the screen input field that I'm looking to edit.
    Doing View Source on the web-page dumps the (very lengthy) generated code. Extracted from the header of that code-dump is...
    This page was created by the SAP Integrated ITS, WebAS: SRA, workprocess: 0
    Template: bbpsc02/99/saplbbp_sc_ui_its_2000.html
    Does that point me to the actual editable source?
    (I am using SE80 in the SRA system.)
    I wrote the above on 3rd Jan but was unable to post it.
    Since then I have found template SAPLBBP_SC_UI_ITS 2000 in service BBPSC01 does bear a resemblance to the displayed page code but as a scanty framework. The generated code has vastly more lines. I can't yet see how the template becomes the web page and where all the addditional lines of code come from and are edited.

  • I keep getting an intermittent error on web pages where a blue box with a question mark appears instead of pictures.  For example Facebook and Zappos would load normally on one visit, but if I visit other websites and return I get the blue box.

    I keep getting an intermittent error on web pages where a blue box with a question mark appears instead of pictures.  For example Facebook and Zappos would load normally on one visit, but if I visit other websites and return I get the blue box instead of pictures. If I restart the problem will go away temporarly. However, normally returnes in time.

    HI,
    From the Safari Menu Bar click Safari/Preferences then select the Appearance tab. Tick the box next to: Display images when the page opens.
    If that box is already ticked, from the Safari Menu Bar, click Safari / Empty Cache. When you are done with that...
    From the Safari Menu Bar, click Safari / Reset Safari. Select the top 5 buttons and click Reset. Relaunch Safari. If you still have problems loading images, go here for trouble shooting 3rd party plugins or input managers which might be causing the problem. Safari: Add-ons may cause Safari to unexpectedly quit or have performance issues
    Web pages now include a small icon or 'favicon' which is visible in the address bar and next to bookmarks. These icons take up disk space and slow Safari down. It is possible to erase the icons from your computer and start fresh. *To delete Safari's icon cache using the Finder, open your user folder, navigate to ~/Library/Safari/ and move this file "webpageIcons.db to the Trash.*
    Make sure Safari is not running in Rosetta. Right or control click the Safari icon in your Applications folder then click Get Info. In the Get Info window click the black disclosure triangle so it faces down. Where you see Open using Rosetta... make sure that is NOT selected.
    If you still have problems, go to the Safari Menu Bar, click Safari/Preferences. Make note of all the preferences under each tab. Quit Safari. Now go to ~/Library/Preferences and move this file com.apple.safari.plist to the Desktop. Relaunch Safari. If it's a successful launch, then that .plist file needs to be moved to the Trash.
    Carolyn

  • How can I delete an old web page ??

    How can I delete an old web page ?? I have created a web page some time ago and now I want to delete it but i do not know how to do it: can anyone help me ?

    Delete the web page where it is published.
    If it is published to MobileMe, then you need to log into MobileMe and go to your iDisk or mount it on your desktop and then delete it from your Web/sites folder.
    If you have published to a server, then you'll need to download Cyberduck, Filezilla or Transmit - all dedicated ftp programmes to connect with your host/server and then delete your old files from the server.
    It really is not hard.

  • How to display an error message after validation in Formatted Search?

    Hi SBO experts,
    if an error is detected on validation in a Formatted Search, how to display an error message to the user entering the data?
    Thanks & Regards,
    Raghu Iyer

    i created a formatted search query & attached it to the field 'Quantity' at Line Item level in Sales Order screen. just for testing purpose, i eneterd the following code lines in the query validating 'Quantity'
    if $[$38.11.0] > 50
    begin
    select @error = 1
    select @error_message = 'Vendor code cannot begin to X sign.'
    end
    the system throws the error : Internal error (8180) occurred [Message 131-183]
    actually, i need to display an error message to the user if Quantity is not in multiples of the OITM.SalFactor2
    if $[$38.11.0] % (SELECT T0.[SalFactor2] FROM OITM T0 WHERE T0.[ItemCode]  = $[$38.1.0]) > 0
    begin
    select @error = 1
    select @error_message = 'Error in Quantity.'
    end
    but, this expression to get the remainder itself seems to have some error
    $[$38.11.0] % (SELECT T0.[SalFactor2] FROM OITM T0 WHERE T0.[ItemCode]  = $[$38.1.0])
    i guess, % operator is used for modulo (to find the remainder of one number divided by another.) ? am i right ?
    Regards,
    Raghu Iyer

  • How to display an error message on screen?

    Hi experts,
    In screen painter, how to display an error message in the message area just below the screen?
    Thanks!

    hi wuyia,.
    Write like this;
    Message 'Process completed Successfuly' TYPE 'S'.
    Message 'Want to Overwrite Value' TYPE 'W'.
    Message 'Press enter to continue' TYPE 'I'.
    Message 'Invalid Input' TYPE 'E'.
    S - Success
    W - Warning
    I - Information
    E - Error
    You can adjust your GUI option to display the message in a Popup or in the status bar.
    Regards
    Karthik D

  • How do i Hyperlink to a web page from a java application?

    How do i Hyperlink to a web page from a java application using internet explorer as my default web browser?

    It's very simple.You can start any Application with the class Runtime. The command is an array consisting of the path of .exe and the file to be open.
    String [] cmd={path of IE+Filename.exe,"URL of your website"}
    try
    Runtime.getRuntime().exec(cmd);
    catch (Exception e)
    System.err.println(e.toString());
    }

  • How do I close the current web page in Safari?

    UPgraded to IOS 8 because a friend said it cured his problems, so I took the plunge.
    BIg mistake.
    THis question concerns Safari.
    how do I close the current web page?

    I just found how to do this on my iPad!  At the top right are two squares overlapping.  Click on that and you will get your page hanging in space.  There is an X on the top (I think) left.  Click on that and TaDa!  Lost of hoops, but glad I found it.

  • How to display query result in seperated page.

    How to display query result in seperated page, if the results are very big (more than 5000 records) and there are so many concurrent users (about 500 - 1000 users).
    Are there any solutions or frameworks?
    Plese help me .........
    thanks,
    --bhasin

    Hi,
    How to display query result in seperated page?I think RowSet will be the better technology to use in this
    situation.For more information on this please visit http://developer.java.sun.com/developer/Books/JDBCTutorial/chapter5.html
    which explains in detail about RowSets.
    Hope this helps.
    Good Luck.
    Gayam.Srinivasa Reddy
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support/

  • How to create progress bar in web page!!!

    Dear,
    I do not know how to create progress bar in web page?
    Please show me the way to solve it.
    Best regards,
    Huy

    God your lucky/lazy
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import javax.swing.*;
    import java.util.*;
    import java.io.*;
    public class ProgressBar extends Applet
      private boolean isStandalone = false;
      private int width;
      private int height;
      private double percentComplete;
      private double fundsTarget;
      private double fundsRaised;
      private Properties values;
      private String propertiesFile;
      private JPanel jPanel1 = new JPanel();
      private JProgressBar PB_FUNDS_PROGRESS = new JProgressBar();
      private GridLayout gridLayout1 = new GridLayout();
      private BorderLayout borderLayout1 = new BorderLayout();
      private JPanel jPanel2 = new JPanel();
      private JLabel jLabel1 = new JLabel();
      private JLabel jLabel2 = new JLabel();
      private JLabel jLabel3 = new JLabel();
      private GridBagLayout gridBagLayout1 = new GridBagLayout();
      private JPanel jPanel3 = new JPanel();
      private JLabel jLabel4 = new JLabel();
      //Construct the applet
      public ProgressBar()
      //Initialize the applet
      public void init()
        try
          jbInit();
        catch(Exception e)
          e.printStackTrace();
      //Component initialization
      private void jbInit()
      throws Exception
        fundsTarget = new Double( 100 ).doubleValue();
        fundsRaised = new Double( 50 ).doubleValue();
        PB_FUNDS_PROGRESS.setBackground(Color.green);
        PB_FUNDS_PROGRESS.setForeground(Color.red);
        this.setLayout(gridLayout1);
        jPanel1.setLayout(borderLayout1);
        jPanel2.setLayout(gridBagLayout1);
        jPanel1.setBackground(Color.white);
        jPanel2.setBackground(Color.white);
        jPanel3.setBackground(Color.white);
        jLabel2.setBackground(Color.white);
        jLabel1.setBackground(Color.white);
        jLabel3.setBackground(Color.white);
        jLabel4.setText(" ");
        jLabel1.setText(" ");
        jLabel2.setText(" ");
        jLabel3.setText(" ");
        this.setBackground(Color.white);
        this.add(jPanel1, null);
        jPanel1.add(PB_FUNDS_PROGRESS,  BorderLayout.CENTER);
        jPanel1.add(jPanel2, BorderLayout.SOUTH);
        jPanel2.add(jLabel2, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
         GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 0), 0, 0));
        jPanel2.add(jLabel1, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0,
         GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 150, 5, 5), 0, 0));
        jPanel2.add(jLabel3, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
         GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6, 5, 4, 150), 0, 0));
        jPanel1.add(jPanel3, BorderLayout.NORTH);
        jPanel3.add(jLabel4, null);
        propertiesFile = this.getCodeBase().getFile().replaceAll("%20", " ")+"funds.properties";
        System.out.println("Properties file at " + propertiesFile);
        values = new Properties();
        try
          values.load(new FileInputStream(propertiesFile));
          fundsTarget = new Double( values.getProperty("TARGET", "100").toString() ).doubleValue();
          fundsRaised = new Double( values.getProperty("RAISED", "50").toString() ).doubleValue();
          System.out.println("target: " + fundsTarget + " raised: " + fundsRaised);
        catch (IOException ioe)
          System.err.println(ioe.getMessage());
        percentComplete = (fundsRaised/fundsTarget)*100;
        System.out.println(percentComplete);
      //Start the applet
      public void start()
        PB_FUNDS_PROGRESS.setMaximum(new Double(fundsTarget).intValue());
        PB_FUNDS_PROGRESS.setMinimum(0);
        repaint();
      //Stop the applet
      public void stop()
      public void paint(Graphics g)
        Graphics2D g2 = (Graphics2D)g;
        PB_FUNDS_PROGRESS.setValue(new Double(fundsRaised).intValue());
        String percent = Double.toString(percentComplete).substring(0, 4);
        jLabel4.setText("Currently At " + percent + "%");
        jLabel1.setText("100%");
        jLabel2.setText("50%");
        jLabel3.setText("0%");
      //Destroy the applet
      public void destroy()
      public String getAppletInfo()
        return "Funds progress applet by A really nice person";
    }

  • How to display flash file in adf pages

    how to display flash file in adf pages need help

    Thanks all,
    It is resolved.
    the code i am using to display a flash is below.
    <f:verbatim>
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version
    =10,0,0,0" width="300" height="300" id="11gR1_aniH_grey" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="false" />
    <param name="wmode" value="transparent" />
    <param name="movie" value="mx2004demo.swf" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#4d5c64" />     
    <embed src="../Images/mx2004demo.swf" quality="high" width="300" height="300" name="mx2004demo.swf" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false"
    type="application/x-shockwave-flash" wmode="transparent"
    pluginspage="http://www.adobe.com/go/getflashplayer" />
         </object>
    </f:verbatim>

  • How to display duplicate key in web report?

    Hi Experts,
    Can anybody tell me how to display duplicate key in web report?
    I know in the Bex analyzer, we can allow the duplicate key to be dispalyed via the 'query property' by right click, and in the 'display option' tab, there is an option which named 'forbid duplicate key', if we don't select this option, the duplicate key will be dispalyed in the report result in BEx analyzer.
    But how can I do this in Web report? Thanks in advance.
    Eileen

    Hi,
    <b>I know in the Bex analyzer, we can allow the duplicate key to be dispalyed via the 'query property' by right click, and in the 'display option' tab, there is an option which named 'forbid duplicate key', if we don't select this option, the duplicate key will be dispalyed in the report result in BEx analyzer.</b>
    Do the same and execute report in web.You can able to see the same.
    Cheers
    Karthik

Maybe you are looking for

  • Can you lock touch screen when watching videos!??

    Can you lock the screen so it doesn't become a touch screen when watching videos!?? Just got new ipod (7th gen) and this driving me crazy that I think I'm going to continue to use my older one unless there is a solution out there. I watch tv shows wh

  • Customize Standard Purchase Order template

    We have requirement to customize the 'Standard Purchase Order Stylesheet', XSL template. I am trying to follow the below approach; 1. Use standard oracle template 'PO_STANDARD_XSLFO.xsl' and customize it as per client requirements. 2. Create a templa

  • HT2371 How to change language list order in iOS?

    I using on my iPhone ukrainian language as primary language. In language list second language is english, third language is russian. So if app haven't ukrainian lang, it using english. I want change second lang to russian. How I can do it?

  • Photoshop CC – Where can I find "Generate/web assets"?

    On MAX there was a demonstration of a new comman to be found unter menu "File/Generate/Web-Assets? Am I blind? Where can I find this command?

  • Re: Broadband Light off (no connection)

    Hi, This morning I noticed that I no longer have broadband. I have a blue power light and a blue wireless light, but have no broadband or phone lights. I have checked all connections, tried a new filter, removed all other items and just have the Home