NullPointerException when using sharedNode in XML menu (jdev 11.1.1.3)

I am using Jdeveloper 11.1.1.3 and when I use a sharedNode in my ADF XMLMenu, I get a NullPointerException when I start the application for the first time. I know it's the sharedNode because when I remove it i don't get the exception.
Apparently something is not propertly initialized at startup, when I reload the page everything is fine. How can I fix this?
java.lang.NullPointerException
     at org.apache.myfaces.trinidad.model.XMLMenuModel.getFocusRowKey(XMLMenuModel.java:302)
     at org.apache.myfaces.trinidad.component.UIXNavigationHierarchy.getFocusRowKey(UIXNavigationHierarchy.java:79)
     at oracle.adfinternal.view.faces.renderkit.rich.BreadCrumbsRenderer._getItemCount(BreadCrumbsRenderer.java:403)
     at oracle.adfinternal.view.faces.renderkit.rich.BreadCrumbsRenderer.encodeAll(BreadCrumbsRenderer.java:130)

Hm I got it. I also have nested templates and in the outer template I had a breadcrumb referencing the sharedNode menu. Somehow this caused a NullPointerException. The breadcrumb was never meant to reference that menu in the first place so I changed it, but it is still a weird situation, maybe worth a testcase...

Similar Messages

  • Weblogic throws NullPointerException when using ServiceControl.setTimeout

    We are invoking a SOAP service via a com.bea.control.ServiceControl that was generated from a WSDL (right click WSDL, Generate Service Control) using Weblogic 8.1.6.
    SOAP service execution is successful using an http and https endpoint. However, when setting a timeout via ServiceControl.setTimeout(int millisecods) method, the Weblogic API is throwing a NullPointerException when using an https endpoint. When using an http endpoint with the setTimeout method execution is successful.
    DEBUG com.bea.wlw.runtime.jws.call.SoapHttpCall [ExecuteThread: '10' for queue: 'weblogic.kernel.Default']: opening connection to https://[... edit removed ...]
    DEBUG com.bea.wlw.runtime.jws.call.SoapHttpCall [ExecuteThread: '10' for queue: 'weblogic.kernel.Default']: Response generation exception
    Throwable: java.lang.NullPointerException
    Stack Trace:
    java.lang.NullPointerException
         at weblogic.net.http.HttpsClient.openWrappedSSLSocket(HttpsClient.java:455)
         at weblogic.net.http.HttpsClient.openServer(HttpsClient.java:235)
         at weblogic.net.http.HttpsClient.openServer(HttpsClient.java:389)
         at weblogic.net.http.HttpsClient.<init>(HttpsClient.java:209)
         at weblogic.net.http.HttpClient.New(HttpClient.java:228)
         at weblogic.net.http.HttpsURLConnection.getHttpClient(HttpsURLConnection.java:246)
         at weblogic.net.http.HttpsURLConnection.connect(HttpsURLConnection.java:217)
         at weblogic.net.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:189)
         at com.bea.wlw.runtime.jws.call.SoapHttpCall.invoke(SoapHttpCall.java:179)
         at com.bea.wlw.runtime.jws.call.SoapHttpCall.invoke(SoapHttpCall.java:80)
         at com.bea.wlw.runtime.core.control.ServiceControlImpl.invoke(ServiceControlImpl.jcs:1288)
         at com.bea.wlw.runtime.core.control.ServiceControlImpl.invoke(ServiceControlImpl.jcs:1155)
         at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:377)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:433)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:406)
         at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:388)
    DEBUG com.bea.wlw.runtime.jws.call.SoapFault [ExecuteThread: '10' for queue: 'weblogic.kernel.Default']: SoapFault exception throwable e
    DEBUG com.bea.wlw.runtime.jws.call.SoapHttpCall [ExecuteThread: '10' for queue: 'weblogic.kernel.Default']: response code=0, responseMsg=null
    DEBUG com.bea.wlw.runtime.jws.call.SoapHttpCall [ExecuteThread: '10' for queue: 'weblogic.kernel.Default']: closed connection to https://[... edit removed ...]
    WARN WLW.INVOKE.[... edit removed ...] [ExecuteThread: '10' for queue: 'weblogic.kernel.Default']: Id=[... edit removed id ...] Method=[... edit removed method ...]; Failure=com.bea.control.ServiceControlException: SERVICE FAULT:
    Code:java.lang.NullPointerException
    String:null
    Detail:
    END SERVICE FAULT
    ERROR [... edit removed ...]
    [ExecuteThread: '10' for queue: 'weblogic.kernel.Default']: ServiceControlException
    com.bea.control.ServiceControlException: SERVICE FAULT:
    Code:java.lang.NullPointerException
    String:null
    Detail:
    END SERVICE FAULT
         at com.bea.wlw.runtime.core.control.ServiceControlImpl.invoke(ServiceControlImpl.jcs:1268)
         at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:377)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:433)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:406)
         at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:388)

    Thanks for the suggestion. But with -DUseSunHttpHandler=true the Weblogic API is throwing a ClassCastException with or without the timeout value set.
    Failure=com.bea.control.ServiceControlException: SERVICE FAULT:
    Code:java.lang.ClassCastException
    String:null
    Detail:
    END SERVICE FAULT
    ERROR: ServiceControlException
    com.bea.control.ServiceControlException: SERVICE FAULT:
    Code:java.lang.ClassCastException
    String:null
    Detail:
    END SERVICE FAULT
         at com.bea.wlw.runtime.core.control.ServiceControlImpl.invoke(ServiceControlImpl.jcs:1268)
         at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:377)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:433)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:406)
         at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:388)

  • Illustrator CS4 crashes when using save drop down menu on MacBook Pro Yosemite

    Illustrator CS4 crashes when using save drop down menu on MacBook Pro Yosemite. Just purchased a new laptop and it has Yosemite installed.

    Hi Parisian tiger
    What happens when you try to open any file from the same location where you are saving the file using Save As command ?
    Will it be possible to join a connect session with me ?
    Please do let me know about your time availability ?
    Thanks & Regards,
    Raghuveer Singh
    [email protected]
    Time Zone: +5:30 GMT (IST)

  • Java.lang.NullpointerException when use source table as a mapping component

    Hi all,
    I am new to owb and I got NullPointerException when I try to drag a table to my mapping.
    The table is imported and it's from a windows oracle database. The mapping is located on my linux oracle database.
    By the way, I can even deploy the table.
    What have I done wrong and why this happen?
    thanks in advance.
    帖子经 953800编辑过

    Hi Timo,
    Thanks for the reply,
    If I understand correctly I need to apply to the weblogic server 10.3.5 + Sherman patch UPDATE1 patch #12979653 and patch #12917525. After this the ADF Runtime 11.1.1.5 installed in the Production environments will allow me to run my application that is running in ADF Runtime 11.1.2.1. right?
    I'm working on getting this patches installed. Thank you very much for your help.
    I run the test on my local server as a test class and as a web service, it worked perfect, nevertheless in the Production environment I got a interesting answer:
    Production 1 and 2:
    Request:
    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://model/">
    <env:Header/>
    <env:Body>
    <ns1:getVersion/>
    </env:Body>
    </env:Envelope>
    Response
    <?xml version='1.0' encoding='UTF-8'?>
    <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
    <S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
    <faultcode>S:Server</faultcode>
    <faultstring>oracle/jbo/Version</faultstring>
    </S:Fault>
    </S:Body>
    </S:Envelope>
    Request:
    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://model/">
    <env:Header/>
    <env:Body>
    <ns1:getBuildLabel/>
    </env:Body>
    </env:Envelope>
    Response:
    <?xml version='1.0' encoding='UTF-8'?>
    <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
    <ns2:getBuildLabelResponse xmlns:ns2="http://model/">
    <return>oracle.jbo.Version</return>
    </ns2:getBuildLabelResponse>
    </S:Body>
    </S:Envelope>
    Edited by: 917852 on Jul 12, 2012 11:31 AM

  • I can't select Photoshop CC 2014 when using the "Open with" menu in Windows 7

    I have recently installed CC 2014, and uninstalled my CC version. When I go to a jpeg, or any image file in windows explorer, I right-click and "open with" and it isn't listed on my program list to open the file with. I click on "browse programs", find the exe file in adobe-photoshop cc2014 folder and click OK, and it just goes back to the open with menu with no option for photoshop.
    Any ideas on how I can get it on that list, so I can open these files from the file location, instead of opening up photoshop and then searching for the file location within photoshop?
    Also, I don't have any problems opening up the pictures from within photoshop, just within windows explorer.

    I'm having a similar problem, but only with jpg's. I have PS CS6, CC, and CC 2014. Other image file formats function normally with regard to the "open with" list. PS CC 2014 appears on the list. But with jpg's only PS CC appears on the "open with" list and 2014 can't be added by the browsing for it.
    The curious thing is that if I have any of the three versions of Photoshop open, click on Photoshop CC in the "open with" list, the image opens in whatever version is already open on my computer. This is true of all image formats. No matter which version I pick from the "open with" list it opens in the currently running program. I use only the latest version so keeping it open all the time is an easy work around. I won't uninstall any of the earlier versions lest more file association quirks result. it would be nice to have this matter fixed.

  • "java.lang.NullPointerException" when use doFinal(byte[])

    My code here:
    KeyFactory kf = null;
    Cipher cipher = null;
    PrivateKey pk = null;
    byte[] symKey = null;
    try {
    Security.addProvider(new BouncyCastleProvider());
    catch (Exception e) {
    System.err.println("Error loading security provider (" +
    e.getMessage() + ")");
    try {
    kf = KeyFactory.getInstance("RSA");
    catch (NoSuchAlgorithmException ex1) {
    try {
    pk = kf.generatePrivate(priServer);
    catch (InvalidKeySpecException ex3) {
    try {
    cipher = Cipher.getInstance("RSA");
    catch (NoSuchAlgorithmException ex2) {
    catch (NoSuchPaddingException ex2) {
    try {
    cipher.init(Cipher.DECRYPT_MODE, pk);
    catch (InvalidKeyException ex4) {
    try {
    symKey = cipher.doFinal(CEK); //get encode of symmetric key
    when CEK is byte[].
    I got exception :
    java.lang.NullPointerException
         at java.math.BigInteger.remainder(BigInteger.java:1239)
         at org.bouncycastle.crypto.engines.RSAEngine.processBlock(RSAEngine.java:133)
         at org.bouncycastle.jce.provider.JCERSACipher.engineDoFinal(JCERSACipher.java:288)
    where my code wrong? Please help me!
    Note : I use bouncycastle provider.
    Thanks

    bla bla bla
    kf = KeyFactory.getInstance("RSA");
    pk = kf.generatePrivate(priServer);
    cipher = Cipher.getInstance("RSA");
    cipher.init(Cipher.DECRYPT_MODE, pk);IMHO RSA is 2-keys algorithm => you cannot use it in cipher class
    If u need encrypt use PBE for example
    PBEKeySpec pbeKeySpec;
    PBEParameterSpec pbeParamSpec;
    SecretKeyFactory keyFac;
    // Salt
    byte[] salt = ...;
    // Iteration count
    int count = 20;
    // Create PBE parameter set
    pbeParamSpec = new PBEParameterSpec(salt, count);
    // Prompt user for encryption password.
    pbeKeySpec = new PBEKeySpec(pass); //String with
    keyFac = SecretKeyFactory.getInstance("PBEWithMD5AndDES");
    SecretKey pbeKey = keyFac.generateSecret(pbeKeySpec);
    // Create PBE Cipher
    Cipher pbeCipher = Cipher.getInstance("PBEWithMD5AndDES");
    // Initialize PBE Cipher with key and parameters
    pbeCipher.init(Cipher.ENCRYPT_MODE, pbeKey, pbeParamSpec);
    // Our cleartext
    byte[] cleartext = "This is another example".getBytes();
    // Encrypt the cleartext
    byte[] ciphertext = pbeCipher.doFinal(cleartext);

  • NullPointerException when using Scanner

    Hey people,
    I've made this little class for interacting with the user via the console:
    package dyreleg;
    import java.util.Scanner;
    * Communicates with the user via the command line
    * @author majs
    public class ConsoleUI implements UserInteraction {
        private Scanner input;
        public void ConsoleUI() {
            this.input = new Scanner(System.in);
         * Asks the user a given question and returns the answer as a string
         * @param question     the question to ask the user
         * @return          the users full answer
        public String getAnswer(String question) {
            System.out.println(question);
            String answer = this.input.next("\n");
            input.nextLine();
            return answer;
         * Asks the user a given question and forces him/her to answer with either y
         * for yes or n for no.
         * @param question     question the question to ask the user
         * @return          the users answer, true for yes and false for no
        public boolean getAnswerYesNo(String question) {
            System.out.println(question+" (y or n");
            while (true) {
                String answer = this.input.next();
                answer = answer.toLowerCase();
                if (answer.equals("y")) {
                    return true;
                } else if (answer.equals("n")) {
                    return false;
                } else {
                    System.out.println("You must answer y for yes or n for no to the given question");
    }My problem is that when i try to use any of the member functions, (getAnswer and getAnswerYesNo) i get a NullPointerException, and i can't understand why. I know that NullPointerExceptions indicate that the variable isn't set to an object, but as far as i can see that does'nt seem to be the problem here. I've used the Scanner class without problems in the rest of my application before making this class without problems.
    Any kind of help is appreciated.

    Meinertz,
    I've been using / extending this one for a while... I find it's handy for console based user interfaces... which are (lets face it) just soooo seventies.
    package krc.utilz.io;
    // usage:
    // import krc.utilz.io.Console;
    // String name = Console.readLine("Enter your name : ");
    // while ( (score=Console.readInteger("Enter a score between 0 and 100 (enter to quit) : ", 0, 100, -1)) != -1) { ... }
    import java.util.Date;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    public abstract class Console
      private static final java.io.Console theConsole = System.console();
      private static final DateFormat dateFormatter = new SimpleDateFormat("dd/MM/yyyy");
      public static String readLine(String prompt) {
        while(true) {
          try {
            System.out.print(prompt);
            return theConsole.readLine();
          } catch (Exception e) {
            System.out.println("Oops: "+e);
      public static Date readDate(String prompt) {
        while(true) {
          try {
            String response = readWord(prompt+" (dd/mm/yyyy) : ");
            return dateFormatter.parse(response);
          } catch (Exception e) {
            System.out.println("Oops: "+e);
      public static String readWord(String prompt) {
        String response = null;
        while(true) {
          try {
            response = readLine(prompt);
            if( response!=null && response.length()>0 && response.indexOf(' ')<0 ) break;
            System.out.println("Oops: A single word is required. No spaces.");
          } catch (Exception e) {
            System.out.println("Oops: "+e);
        return(response);
      public static char readLetter(String prompt) {
        char result = '\0';
        while(true) {
          try {
            String response = readLine(prompt);
            if ( response!=null && response.length()==1 ) {
              result = response.charAt(0);
              if(Character.isLetter(result)) break;
            System.out.println("Oops: A single letter is required!");
          } catch (Exception e) {
            System.out.println("Oops: "+e);
        return(result);
      public static int readInteger(String prompt) {
        int result = 0;
        String response = null;
        while(true) {
          try {
            response = readLine(prompt);
            if ( response!=null && response.length()>0 ) {
              result = Integer.parseInt(response);
              break;
            System.out.println("An integer is required.");
          } catch (NumberFormatException e) {
            System.out.println("Oops \""+response+"\" is not an integer!");
          } catch (Exception e) {
            System.out.println("Oops: "+e);
        return(result);
      public static int readInteger(String prompt, int lowerBound, int upperBound) {
        int result = 0;
        while(true) {
          result = readInteger(prompt);
          if ( result>=lowerBound && result<=upperBound ) break;
          System.out.println("An integer between "+lowerBound+" and "+upperBound+" (inclusive) is required.");
        return(result);
      public static int readInteger(String prompt, int defualt) {
        String response = null;
        while(true) {
          try {
            response = readLine(prompt);
            return (response!=null && response.trim().length()>0
              ? Integer.parseInt(response)
              : defualt
          } catch (NumberFormatException e) {
            System.out.println("Oops: \""+response+"\" is not an integer!");
          } catch (Exception e) {
            System.out.println("Oops: "+e);
      public static int readInteger(String prompt, int lowerBound, int upperBound, int defualt) {
        int result = 0;
        while(true) {
          result = readInteger(prompt, defualt);
          if ( result==defualt || result>=lowerBound && result<=upperBound ) break;
          System.out.println("An integer between "+lowerBound+" and "+upperBound+" (inclusive) is required.");
        return(result);
      public static double readDouble(String prompt) {
        double result = 0;
        String response = null;
        while(true) {
          try {
            response = readLine(prompt);
            if ( response!=null && response.length()>0 ) {
              result = Double.parseDouble(response);
              break;
            System.out.println("A number is required.");
          } catch (NumberFormatException e) {
            System.out.println("\""+response+"\" cannot be interpreted as a number!");
          } catch (Exception e) {
            System.out.println("Oops: "+e);
        return(result);
      public static double readDouble(String prompt, double lowerBound, double upperBound) {
        while(true) {
          double result = readDouble(prompt);
          if ( result>=lowerBound && result<=upperBound ) return(result);
          System.out.println("A number between "+lowerBound+" and "+upperBound+" (inclusive) is required.");
      public static boolean readBoolean(String prompt) {
        while(true) {
          try {
            String response = readWord(prompt+" (Y/N) : ");
            return response.trim().equalsIgnoreCase("Y");
          } catch (Exception e) {
            System.out.println("Oops: "+e);
    }This software is provided, as is, where is. Feel free to use/abuse/improve it however you wish, unless you are Military or a military contractor, or a manufacturer of guns/bombs/any-other-impliment-of-murder; in which case please go f&#117;ck yourself. If you are George Bush then please consider suicide.
    Cheers. Keith.

  • URGENT! SEGV-errors when using Oracle C XML Parser for Solaris

    I often (not always) got SEGV-error with core dump when I use Oracle Oracle C XML Parser for Solaris. This Error is always got in the call of the the function xmlinit(...) with all params as NULL but the first required for the error code and the second which i assign a macro that evaluates to "US-ASCII". Does anyone knows about this problem?
    I am using a very short, wellformed and validated XML document.
    I would be very glad for some help about this!
    null

    Please provide a sample program along with the version number of the XML parser.

  • Error when using the report context menu option Goto - Documents

    Hi gurus,
    I'm doing some report tests via Analyzer and when a try to use de context menu option "Goto -> Documents" and try to create a new document, the following errors occur:
    "CANNOT GET THE FOLDER FOR ASSIGNMENT"
    "ERROR WHILE LAUNCHING NEW DOCUMENT DIALOG"
    I'm using the nw2004s version. Could someone help me out?
    Thanks in advance.

    Hi Thaigo,
    We are also having the same problem with 2004s SP9 and SP10.
    1. All the 0TCA* are active.
    2. Super admin role is assigned.
    But still getting the above three errors. Somebody who have overcome this problem please share the corresponding changes to be made in KM Configuration
    Thanks and Regards
    Giri Nath

  • Presence problem when using a drop-down menu

    I am trying to show/hide a table when a choice is made from a drop-down menu. It doesn't work until I make the same choice twice, then I get the expected result. The script is under Change and I have used it before successfully, albeit it has typically been using a check box. Is there an easy fix hopefully for this problem? Code below:
    if 
    (this.rawValue == 2){
    form1.Page1.OrderSection.OrderItems.Blower.presence
    = "visible";}
    else
    form1.Page1.OrderSection.OrderItems.Blower.presence
    = "hidden";}
    Thanks

    Drop-down lists work a little differently than expected; in the Change event the rawValue contains the previously selected text.  That's why it works the second time.  The current selection is contained in: xfa.event.newText

  • Nullpointerexception when using servlet with Mysql on a cobalt Raq3 Server

    I'm a student and i have to use servlets and Mysql to make a Database application. Our school has a Cobalt Raq3 server and has installed Java Dev Kit 1.3a.
    First problem they can't tell me their driver manager for Mysql.
    Second problem when i try my servlet it gives a NullpointerException
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class Testingo2 extends HttpServlet {
    // Hier word een Statement en Connectie object aangemaakt die later zullen worden gebruikt om een database aan te spreken
    Statement stm;
    Connection con;
         // Hier word de servlet geinitialiseerd
    public void init() throws ServletException {
         try {
              // Hier wordt de database driver geladen
              Class.forName("org.gjt.mm.mysql.Driver");
              /** Hier gaan we gebruik maken van het Connection Object om verbinding te maken met de database CFP door een           * jdbc.odbc bridge en dit zonder username en passwoord
              con = DriverManager.getConnection("jdbc:mysql://cfp.ehsal.be:3306/cfp","bjorn","disaronno");
              // Hier zorgen we ervoor dat als er een zich een fout voordoet dat deze getoond wordt
                   catch (ClassNotFoundException cnfe ) {
                   System.out.println(cnfe.toString());
                   catch (SQLException e) {
                   System.out.println(e.toString());
    // Als de servlet het einde van zijn levenscyclus heeft bereikt gaat het connectie object worden afgesloten
    public void destroy() {
         try { con.close();}
         catch (SQLException e) {}
    public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
    try {
         /** Hier gaat men met het Connectie object een statement aanmaken,welk dan later zal worden gebruikt voor het           * uitvoeren van query's
         stm = con.createStatement();
         /** Hier gaat men de query "selecteer alles van de tabel projecten" uitvoeren op de cfp database dankzij het      * statement en connection object. Deze gegevens worden dan opgeslagen in de Resultset rs.
         ResultSet rs = stm.executeQuery("SELECT project,land,titel,omschrijving,budget,informatie FROM PROJECTEN ");
         /** Hier gaat men informatie, over de gegevens die in de ResultSet rs zijn opgeslagen, opslaan in ResultSetMetaData      * meta.
         ResultSetMetaData meta = rs.getMetaData();
         // Hiergaat men het aantal kolommen van de tabel tellen en opslagen in de Integer kolom
         int kolom;
         kolom = meta.getColumnCount();
         // Hier declareerd men welk soort meta type we naar browser sturen, hier dus HTML tekst
         res.setContentType("text/html");
         // Hier gaan we een PrintWriter object out aanmaken dat gebruikt zal worden om de html tekst naar de client te sturen
         PrintWriter out = res.getWriter();
         // De basis html code voor deze pagina
         out.println("<HTML >");
         out.println("<BODY BGCOLOR =fd8017>");
         out.println("<H1> <B><CENTER><FONT COLOR='#00008b'> Overzicht van de projecten </FONT></CENTER></B></H1>");
         /** Hier defini�ren we een tabel die van de hoogte en breedte van het scherm volledig gebruik maakt, waarvan de boord      * van de tabel een dikte van 1 heeft, de ruimte tussen de cellen in de tabel en tussen de randen van een cel en de      * inhoud is gelijk aan 2 (in pixels) en een achtergrondkleur fd8017
         out.println("<TABLE HEIGHT='100%' WIDTH='100%' BORDER=1 CELLPADDING = 2 CELLSPACING = 2 BGCOLOR =fd8017>");
              // begintag voor een nieuwe rij
              out.println("<TR>");
              /** Hier creeren we een lus om de kolom hoofden naar de client te sturen. Deze lus begint als j=1 en gaat           * door tot j = aantal kolommen en na elke loop wordt j verhoogd met 1. Normaal werden alle kolom hoofden           * uit de database opgehaald en afgebeeld, maar vermits MySQL geen kolom hoofden aanvaard waar spaties           * inzitten heb ik gekozen om hier de kolom hoofden die uit meer dan 1 woord bestaan op te halen en aan te           * passen. Dit voor estetische redenen, voor het functioneren van de servlet heeft dit echter geen belang
    for(int j=1;j<=kolom;j++){
              if (meta.getColumnName(j).equals("project")) {
              out.println("<TH><FONT COLOR='#00008b'> project nr </TH>");
              else if (meta.getColumnName(j).equals("budget")) {
              out.println("<TH><FONT COLOR='#00008b'> budget (in 1000 �) </TH>");
              else if (meta.getColumnName(j).equals("informatie")) {
              out.println("<TH><FONT COLOR='#00008b'> meer informatie ? </TH>");
              else {
              out.println("<TH><FONT COLOR='#00008b'>");     
              out.println(meta.getColumnName(j)+" ");
              out.println("</TH>");
              // Hier wordt de tag voor een nieuwe rij afgesloten
              out.println("</TR>");
              // Hier initialiseren we een Integer en String die later zullen worden gebruikt
              int k = 0;
              String nummer ="";
    // Dit deel van de programma code gaan we uitvoeren zolang er nog een volgende rij in de database bestaat
    while (rs.next()) {
              // Voor elke nieuwe rij wordt k verhoogd met 1
              k =k +1;
              // De tag voor een nieuwe rij
              out.println("<TR>");
         // Dit deel van de code wordt uitgevoerd zolang Integer i kleiner is dan het aantal kolommen
         for(int i=1;i <= kolom;i++) {
              // Een nieuwe cel waarin de data worden afgebeeld in de kleur #00008b
              out.println("<TD ALIGN='left' VALIGN ='top'>");
              out.println("<FONT COLOR='#00008b'> ");
              /** Hier halen we de kolomnaam op van kolom i en slagen we deze op in de String kolomnaam. Dan gaan we van           * deze naam de overtollige spaties (links en rechts van de naam) wegwerken.
              String kolomnaam = meta.getColumnName(i);
              kolomnaam = kolomnaam.trim();
              /** Als de kolomnaam gelijk is aan "project" dan gaan we de data van deze cel opslagen in de String nummer en           * deze dan doorsturen naar de client. Anders gaan we voort in onze programma code.
              if (kolomnaam.equals("project")) {
              nummer = rs.getString(i);
              out.println(nummer);
              /** Als het vorige niet waar is dan gaan we zien of de kolomnaam gelijk is aan "informatie", als dat zo is           * dan gaan we de data van de cel opslaan in de String celwaarde.
              else if ( kolomnaam.equals("informatie")) {
                   String celwaarde = rs.getString(i);
                   char punt = '.';
                   char under ='_';
                   nummer = nummer.replace(punt,under);               
                   /** Als deze String celwaade gelijk is aan "Y" dan gaan we een hyperlink afbeelden die opgebouwd is                * uit drie delen : de naam "project", de String nummer (de data uit de cel van project waar het                * "." is vervangen door "_" ) en de extensie ".html"
                   if (celwaarde.equals("Y") ){
                   out.println("<A HREF=project" + nummer + ".html> Project" +" "+ k +" </A>");     
                   /** Als de celwaarde niet gelijk is aan "Y" dan gaan we gewoon de naam "Project" en de Integer k                * afbeelden
                   else {
                   out.println("Project" +" " + k);
              else {
              out.println(rs.getString(i));
              out.println("</FONT>");
              out.println("</TD>");
              out.println("</TR>");
         out.println(" </TABLE>");
         out.println("</BODY>");
         out.println("</HTML>");
         // Hier wordt het object Satement afgesloten vermts we het niet meer nodig hebben
         stm.close();
    // Als er bij het uitvoeren van de programma code een fout zich voordoet dan wordt er een foutmelding weergegeven
    catch (SQLException e) {
    System.out.println(e.toString());

    The exception is thrown in the Doget method namely stm = con.createStatement();
    But i think that when i run my servlet that the init method is not used. I believe the problem is the access to the database.
    Thanks for the answer because i'm beginning to hate the cobalt server at my school

  • NullPointerException when using JEditorPane

    I use a JEditorPane to show html in an applet, when I try to load the JEditorPane from an InputStream I get a NullPointerException.
    Stacktrace:
    Exception occurred during event dispatching:
    java.lang.NullPointerException
         at javax.swing.text.html.StyleSheet.getRule(StyleSheet.java:182)
         at javax.swing.text.html.StyleSheet$ViewAttributeSet.<init>(StyleSheet.java:2767)
         at javax.swing.text.html.StyleSheet.getViewAttributes(StyleSheet.java:285)
         at javax.swing.text.html.BlockView.setPropertiesFromAttributes(BlockView.java:314)
         at javax.swing.text.html.BlockView.setParent(BlockView.java:59)
         at javax.swing.plaf.basic.BasicTextUI$RootView.setView(BasicTextUI.java:1061)
         at javax.swing.plaf.basic.BasicTextUI.setView(BasicTextUI.java:480)
         at javax.swing.plaf.basic.BasicTextUI.modelChanged(BasicTextUI.java:468)
         at javax.swing.plaf.basic.BasicTextUI$UpdateHandler.propertyChange(BasicTextUI.java:1518)
         at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java:153)
         at javax.swing.JComponent.firePropertyChange(JComponent.java:3721)
         at javax.swing.text.JTextComponent.setDocument(JTextComponent.java:660)
         at javax.swing.text.JTextComponent.read(JTextComponent.java:1384)
         at javax.swing.JEditorPane.read(JEditorPane.java:400)
    The file I load just contains "<html><body>Test</body></html>", I am loading it using url.openStream();. The file is below the codebase and the url is correct.
    Tell me if you need more information.

    The HTML you say you are trying to use is not technically well-formed. I think you need to include the <head> tag here. All CSS information must be located there, and I am assuming that the parser is looking for this info since it is dying in javax.swing.text.html.StyleSheet.
    Mitch Goldstein
    Author, Hardcore JFC (Cambridge Univ Press)
    [email protected]

  • NullPointerException when using setBindingContext

    Hello,
    I'm having some trouble instantiating a JFrame that has data binding.
    When i instantiate the JFrame in an other class in the same project as the JFrame it works.
    But when i try to instantiate it in a class in an other project (still in the same workspace) it doens't work.
    I get a NullPointerException where ever setBindingContext is called, because panelBinding.getBindingContext() returns null from some reason.
    Can someone explain me why this is?
    Thanks in advance
    Johan Smolders

    Hi Jan,
    First off all thanks for responding.
    The bootstrap code is called before the other elements do there method calls to setBindingContext.
    So the context of panelBinding shouldn't be empty.
    All calls are preformed in the same order as they would be called when you start the JFrame itself.
    Now your second remark made me think.
    When i instantiate my JFrame in the other projects class does it use the wrong Databinding.cpx?
    So the best solution would be: Join all the file's in one project?
    Or can i explicitly tell the JFrame which Databindings it should use?
    Edit:
    As a test i copied my Databindings.cpx file in the project containing the JFrame and named it Databindings2.cpx
    I then edited the JFrame class to use this Databindings2.cpx (so i was sure is wasn't using the Databindings.cpx file of the other project)
    but the same error accured.
    Thx again
    Johan
    Message was edited by:
    Johan Smolders

  • Java.lang.NullPointerException when using DataSource connection and executing CallableStatement

    Hi Guys
    I am having some problem as I am using a DataSource for connections and randomly
    the CallableStatements and PreparedStatements created from this DataSource becomes
    null and everytime I get NullPointerException with this message.
    java.sql.SQLException: java.lang.NullPointerException
         at weblogic.jdbc.rmi.SerialPreparedStatement.setString(SerialPreparedStatement.java:210)
         at .........
    Help will be appreciated..

    Hi Guys
    I am having some problem as I am using a DataSource for connections and randomly
    the CallableStatements and PreparedStatements created from this DataSource becomes
    null and everytime I get NullPointerException with this message.
    java.sql.SQLException: java.lang.NullPointerException
         at weblogic.jdbc.rmi.SerialPreparedStatement.setString(SerialPreparedStatement.java:210)
         at .........
    Help will be appreciated..

  • Can not redirect to other page when using adfc-config.xml in standalone WL

    Hi all,
    I created a very simple fusion app, only have two jspx pages(view1 view2). I drag these two pages to adfc-config file and created a control flow(adfcView2) between these two pages.
    +<?xml version="1.0" encoding="UTF-8" ?>+
    +<adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">+
    +<view id="view1">+
    +<page>/view1.jspx</page>+
    +</view>+
    +<view id="view2">+
    +<page>/view2.jspx</page>+
    +</view>+
    +<control-flow-rule>+
    +<from-activity-id>view1</from-activity-id>+
    +<control-flow-case>+
    +<from-outcome>adfcView2</from-outcome>+
    +<to-activity-id>view2</to-activity-id>+
    +</control-flow-case>+
    +</control-flow-rule>+
    +</adfc-config>+
    When I run the view1.jspx in the embeded WL, all go well, can navigate from view1 to view2.
    But when I created an ear and deployed this ear to a standalone WL, view1 can be displayed successfully, but when I clicked one commandbutton in view1, want to navigator to view2, the page can not be redirected to view2(still show view1.jspx). there is no any error msg in WL Console.
    Did I miss anything for deploying a taskflow app? If I change the view controller to faces-config.xml not adfc-config.xml, all work fine.
    Any info is appreciated.
    Edited by: harth on Oct 25, 2009 7:21 PM

    Hi Harth,
    I guess you are running the jspx page not view activity, check if your url contains .jspx page at the end. If so, run the url without .jspx page at end(which is view id name)
    Eg:
    Give http://<Host_Name>:<Port>/<ContextRoot>/faces/view1 instead of http://<Host_Name>:<Port>/<ContextRoot>/faces/view1.jspxSireesha
    Edited by: Sireesha Pinninti on Oct 25, 2009 8:00 PM

Maybe you are looking for