(JSF) newbie null reference exception

error:
javax.faces.FacesException: #{Login.ValidateLogin}: java.lang.NullPointerException
I am a Java web development scrub / newbie. I am assuming this is because i did not have an instance of the Login class. However, tutorials that i have seen have done similar tasks without creating an instance (and they are not static classes) so i am confused. Please help me understand why i am getting this error and how to make this simple web application work. Thanks in advance.
faces configuration:
<faces-config>
<managed-bean>
<managed-bean-name>Login</managed-bean-name>
<managed-bean-class>Security.Login</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/Login.jsf</from-view-id>
<navigation-case>
<from-action>#{Login.ValidateLogin}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>LoginValid.jsf</to-view-id>
</navigation-case>
<navigation-case>
<from-action>#{Login.ValidateLogin}</from-action>
<from-outcome>fail</from-outcome>
<to-view-id>LoginInvalid.jsf</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
web.xml file:
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
Login.jsp/jsf whatever:
<f:view>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>JSP Page</title>
</head>
<body>
<h:form>
<table>
<tr>
<td><h:outputText value="Username: "/></td>
<td><h:inputText id="username" value="#{Login.username}" /></td>
</tr>
<tr>
<td><h:outputText value="Password: "/></td>
<td><h:inputSecret id="password" value="#{Login.password}" /></td>
</tr>
<tr>
<td> </td>
<td><h:commandButton value="login" action="#{Login.ValidateLogin}" /></td>
</tr>
</table>
</h:form>
</body>
</html>
</f:view>
Login class definition:
package Security;
public class Login {
private String username;
private String password;
public Login() {} // Inline Constructor for Login class
public String getUsername() { return username; }
public String getPassword() { return password; }
public void setUsername(String username) { this.username = username; }
public void setPassword(String password) { this.password = password; }
public String ValidateLogin() {
if(username.equals("ianmcdavid") && password.equals("cole")) {
return "success";
else {
return "fail";
}

you are apparently also a Java "newbie", otherwise you would have posted/searched for your best friend in the world: the exception stacktrace. I hope you realize that learning Java web development is a frustrating and confusing thing to do if you don't know proper core Java.
Lets use some good old fashioned reasoning. See this code:
if(username.equals("ianmcdavid") && password.equals("cole")) {
return "success";
}When the class is created, username and password will be null. Might that perhaps be the cause of the NullPointerException?
Try this in stead:
if("ianmcdavid".equals(username) && "cole".equals(password)) {
return "success";
}That won't ever cause an NPE while still providing the same functionality.

Similar Messages

  • [C#] Getting a Null Reference Exception on Program.

    * Removed Since its Solved *
    Solved my own error, Please remove post Ty Grati!
    Last edited by kanazky (2012-04-01 22:11:36)

    Make sure you run your query in Toad or SQL before additing it to the VO object.
    Usually null pointer exception caused by a null value from the query or the query is wrong. You cant just modify the VO query blindly, if you are adding conditions then its OK, but if you are adding new fields you need to extend the VO object.,
    Ravi

  • Null reference exception using Microsoft.Unity on DisposeOfChildContainer()

    I am working on mvc application which also has webapi. Application is throwing System.NullReference Exception in production.
    (MVC 5, WebApi 2.0, .Net 4.5, Unity 3.0)
    Error message
    System.NullReferenceException: Object reference not set to an instance of an object.
    Stack trace
    at Unity.Mvc5.UnityDependencyResolver.DisposeOfChildContainer()
    at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    This is how the container is built and is called from Application_Start in global as UnityBootstrapper.Initialize(); -
    public static class UnityBootstrapper
    public static void Initialize()
    var container = BuildUnityContainer();
    DependencyResolver.SetResolver(new Unity.Mvc5.UnityDependencyResolver(container));
    GlobalConfiguration.Configuration.DependencyResolver = new Unity.WebApi.UnityDependencyResolver(container);
    ControllerBuilder.Current.SetControllerFactory(new UnityMvcControllerFactory(container));
    private static IUnityContainer BuildUnityContainer()
    var container = new UnityContainer();
    // MVC/WebApi controller factories
    container.RegisterInstance<IHttpControllerActivator>(new UnityApiControllerActivator(container,
    new DefaultHttpControllerActivator()));
    // NHibernate sessions
    container.RegisterInstance<ISessionBuilder>(SessionBuilder.Instance);
    container.RegisterType<IClientCodeRequestContext, ClientCodeRequestContext>(
    new CurrentRequestContextLifetimeManager<IClientCodeRequestContext>());
    container.RegisterType<IUnitOfWork, UnitOfWork>(
    new CurrentRequestContextLifetimeManager<IUnitOfWork>(),
    new InjectionConstructor(container.Resolve<ISessionBuilder>()));
    container.RegisterType<IUnitOfWorkContext>(
    new InjectionFactory(c => container.Resolve<IUnitOfWork>().CommonContext));
    container.RegisterType<IUnitOfWorkClientContext>(
    new InjectionFactory(
    c => container.Resolve<IUnitOfWork>()[container.Resolve<IClientCodeRequestContext>().ClientCode]));
    //Repositories
    container.RegisterType<IUserRepository, UserRepository>();
    //Business Logic
    container.RegisterType<IMembershipPrincipalBusiness, MembershipPrincipalBusiness>();
    // Other
    container.RegisterType<IAuthenticationProvider, CoreMembershipProvider>();
    return container;
    In global.asax.cs-
    protected void Application_PostAuthenticateRequest(object sender, EventArgs e)
    var principalBusiness = DependencyResolver.Current.GetService<IMembershipPrincipalBusiness>();
    The issue is in production only and is caught by newrelic.
    Is the exception a bug in unity or something is missed in this implementation. I have been searching the issue since a week but could not get anything.

    Hello,
    For issues related with MVC, please post it to the MVC forum:http://forums.asp.net/1146.aspx, the current forum is used to discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections,
    I/O, Regigistry, Globalization, Reflection.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Emulator Threading Issue: Null Reference Exception with CloudQueue.CreatIfNotExists

    I am using Azure 2.2 SDK and Storage library (2.1.0.1).
    var queueClient = CloudStorageAccount.DevelopmentStorageAccount.CreateCloudQueueClient();
    var queue = queueClient.GetQueueReference("etsuttest");
    for (int index = 0; index < 2; ++index)
     Task.Factory.StartNew(() => GetCommand(queueClient));
    GetCommand(queueClient);
    private void GetCommand(CloudQueueClient queueClient)
     int counter = 0;
     var queue = queueClient.GetQueueReference("test");
     while true)
      queue.CreateIfNotExists();
     // Dequeue code..
      Thread.Sleep(1000);
    The exception:
    Microsoft.WindowsAzure.Storage.StorageException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object.
    Result StackTrace: 
    at Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException[T](HttpStatusCode[] expectedStatusCodes, HttpStatusCode actualStatusCode, T retVal, StorageCommandBase`1 cmd, Exception ex)
       at Microsoft.WindowsAzure.Storage.Queue.CloudQueue.<CreateQueueImpl>b__14(RESTCommand`1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx)
       at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](StorageCommandBase`1 cmd, IRetryPolicy policy, OperationContext operationContext)
     --- End of inner exception stack trace ---
        at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](StorageCommandBase`1 cmd, IRetryPolicy policy, OperationContext operationContext)
       at Microsoft.WindowsAzure.Storage.Queue.CloudQueue.Create(QueueRequestOptions options, OperationContext operationContext)
       at Microsoft.WindowsAzure.Storage.Queue.CloudQueue.CreateIfNotExists(QueueRequestOptions options, OperationContext operationContext)
       at GetCommand(CloudQueueClient queueClient) in

    Thank you for reporting this and we apologize for the inconvenience. We will fix this issue in an upcoming release.

  • Flexunit stage null reference

    I am trying to test some of my AS classes in flexunit.  Some of the methods reference the stage from components that are passed to it. When I set up the flexunit testing application I use the following code:
    core = new FlexUnitCore();
    core.visualDisplayRoot = this;
    core.addListener( new UIListener( uiListener ));
    However, I still get a null reference exception whenever the stage is referenced.  I was wonding if anyone knew what is going on or what I am doing wrong.
    Thanks!

    Okay, a few things.
    If you are using Flex, you don't need to set the visualDisplayRoot. That is for ActionScript only projects.
    Second, display objects in Flash don't have access to the stage until they are on the display list. So, saying
    new Image() won't add that item to the display list.
    I am not sure what Control.initApp() does, but in one of your unit tests, they way you get something on the display list is to use the UIImpersonator:
    UIImpersonator.addChild( someImage );
    After that someImage would have access to the stage. However, bigger problem. Unit tests are about isolation and if you components need to get out to the stage or if Control.initApp() somehow adds the item directly to the display list you are going to continue to have different issues as you won't be able to keep things in isolation to test.
    Hope that clarifies a little bit,
    Mike

  • Crystal report (crystalReportsViewer) crash with null pointer exception

    Hi,
    My application are simple : m_crystalReportsViewer.ViewerCore.ReportSource = report; but in throw exception null pointer when I call showDialog.
    I see in code, we have method ShowTabHeader.
    private void ShowTabHeader(bool isShow)
        Grid child = VisualTreeHelper.GetChild(this.tabViews, 0) as Grid;
        TabPanel panel = child.FindName("HeaderPanel") as TabPanel;
        if (!isShow)
            panel.Visibility = Visibility.Collapsed;
        else
            panel.Visibility = Visibility.Visible;
    My problem :  child.FindName("HeaderPanel") as TabPanel return null
    =>  if (!isShow)
            panel.Visibility = Visibility.Collapsed;
        else
            panel.Visibility = Visibility.Visible;
    throws null pointer exception.
    Do you have any idea about this?
    Thanks.
    Here is stack trace :
    Unerwarteter Fehler im System ---> System.NullReferenceException: Object reference not set to an instance of an object.
       at SAPBusinessObjects.WPF.Viewer.ReportAlbum.ShowTabHeader(Boolean isShow)
       at SAPBusinessObjects.WPF.Viewer.ReportAlbum.ItemsChangedEventHandler(Object sender, ItemsChangedEventArgs e)
       at System.Windows.Controls.Primitives.ItemsChangedEventHandler.Invoke(Object sender, ItemsChangedEventArgs e)
       at System.Windows.Controls.ItemContainerGenerator.OnItemAdded(Object item, Int32 index)
       at System.Windows.Controls.ItemContainerGenerator.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
       at System.Windows.Controls.ItemContainerGenerator.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
       at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
       at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
       at System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
       at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
       at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
       at System.Windows.Controls.ItemCollection.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
       at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
       at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
       at System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
       at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
       at System.Windows.Data.ListCollectionView.ProcessCollectionChangedWithAdjustedIndex(NotifyCollectionChangedEventArgs args, Int32 adjustedOldIndex, Int32 adjustedNewIndex)
       at System.Windows.Data.ListCollectionView.ProcessCollectionChanged(NotifyCollectionChangedEventArgs args)
       at System.Windows.Data.CollectionView.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
       at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
       at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
       at System.Collections.ObjectModel.Collection`1.Add(T item)
       at SAPBusinessObjects.WPF.Viewer.ReportAlbum.OnCreateNewDocumentViewComplete(CreateNewDocumentArgs args)
       at SAPBusinessObjects.WPF.Viewer.DelegateMarshaler.<>c__DisplayClass6`1.<Invoke>b__4(Object )
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       --- End of inner exception stack trace ---
    Edited by: duyhai707 on Jul 13, 2011 7:42 PM
    Edited by: duyhai707 on Jul 13, 2011 8:09 PM

    A lot I don't understand in here... actually, I don't understand anything in your post:
    When you call ShowDialog, what exactly are you trying to show?  The code is the decompiled showtabheader method of the viewer. So, are you trying to override the viewer control and reportalbum?  My guess is that the null reference is for the reportalbum's child object which is not the reportalbum object of the viewer.  I don't understand why the code since its all handled internally to the viewer anyhow.
    Perhaps searching the forum for code sample will help?
    Also, see the [WPF Demo|http://www.sdn.sap.com/irj/scn/elearn?rid=/library/uuid/a09f7025-0629-2d10-d7ae-df006a51d1a8]
    Other good WPF resources to consult:
    http://www.redmondpie.com/incorporate-crystal-reports-in-a-c-wpf-application/
    http://www.sdn.sap.com/irj/scn/elearn?rid=/library/uuid/a09f7025-0629-2d10-d7ae-df006a51d1a8
    http://www.codeproject.com/Tips/74499/Crystal-Report-in-WPF.aspx
    Re: Crystal Reports for Visual Studio 2010 - WPF Viewer for .Net 4.0
    http://codegain.com/articles/crystalreports/howto/incorporate-crystal-reports-in-wpf-using-c-sharp.aspx
    CRVS2010 Beta - WPF Viewer, how to hide the GroupTree control?
    Re: CRVS2010 Beta - WPF Viewer, how to hide the GroupTree control?
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Null Pointer Exception in Stateless Session Beans(EJB 3.0)

    I am executing a simple HelloUser example i code session bean interface and implementing session bean class in the EJB project.
    package ejb3inaction.ejb;
    import javax.ejb.Remote;
    @Remote
    public interface HelloUser {                                       
    public void sayHello(String name);
    package ejb3inaction.ejb;
    import javax.ejb.Stateless;
    @Stateless
    public class HelloUserBean implements HelloUser {                  
    public void sayHello(String name) {
    System.out.println("Hello " + name + " welcome to EJB 3 In Action!");
    And in the client project i code this class and add JAR file of the EJB project.
    package ejb3inaction.example;
    import javax.ejb.EJB;
    import ejb3inaction.ejb.*;
    public class HelloUserClient {
    @EJB
    private static HelloUser helloUser;
         public static void main(String[] args) {
    helloUser.sayHello("Curious George");
    System.out.println("Invoked EJB successfully .. see server console for output");
    I am using netbeans 6.0(10 M) and Sun Application server 9.
    it gives NullPointer Exception at the following line...
    helloUser.sayHello("Curious George");
    how i can resolve this error.
    regards,
    deemy

    Well, helloUser is just a null reference, you haven't created an instance of HelloUser to use, hence the NPE

  • Dereferencing the NULL reference while saving a Survey

    While saving a survey first time, I am getting an error message "Dereferencing the NULL reference".
    More details as follows:
    Exception: Class CX_SY_REF_IS_INITIAL
    Program: CL_SVY_H_SVYDETAIL_IMPL=======CP
    Include: CL_SVY_H_SVYDETAIL_IMPL=======CM001
    ABAP Class: CL_SVY_H_SVYDETAIL_IMPL
    Method: DO_PREPARE_OUTPUT
    Line: 26 
    Long text: An attempt was made to execute a dynamic method callon an initial(NULL-) object reference. The reference must refer to an object.
    I opened the Survey creation page in crm ui, and filled in the ID, Application as Marketing and  selected CSS Style Sheet as CRM_SVY_OPP_WINLOSS.CSS
    I am very new to CRM module.
    Regards,
    Harsh

    Are you using internal CATT Server? If yes then you might need to turn on the CATT server again, see below:
    JTS based internal CATServer:
    Execute method SET_CATSERVER_JTS of class CL_SURVEY_CATSERVER. Leave parameter USER empty.
    ABAP based internal CATServer:
    Execute method SET_CATSERVER_ABAP of class CL_SURVEY_CATSERVER. Leave parameter USER empty.
    Cherrs,
    Ankur

  • GetUserRoles in viewobject throws null pointer exception

    Hello,
    I've set up security for our jsf-adf-bc4j application.
    I now want to get the user role in our viewobject.
    I use the following code :
    SessionImpl session = (SessionImpl) this.getDBTransaction().getSession();
    String[] roles = session.getUserRoles();
    for (String role : roles){
    System.out.println(role);
    This throws a null pointer exception at the"System.out.println(role);" line .
    The user has a role (I can read the role in the viewcontroller project)
    In the view object i can also get the session.getUserPrincipalName(). This works fine.
    Can anybody help me with this problem ?

    You define a local ArrayList here:public MonthlySchedule()
    ArrayList<Request> monthlyschedule= new ArrayList<Request>() ;
    }Just instanciate the instance variable.

  • Help with Null Pointer Exception

    Hi, I am working on a simple menu program. It compiles and works correctly except for one item. I am having a problem with Greying out a menu item...... Specifically, When I press the EDIT / OPTIONS / READONLY is supposed to Greyout the Save and SaveAs options. But, when I do that it displays a Null Pointer Exception error message in the command window.
    Your advice would be much appreciated!
    Now for the code
    /  FileName Menutest.java
    //  Sample Menu
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class MenuTest extends JFrame {
       private Action saveAction;
         private Action saveAsAction;
         private JCheckBoxMenuItem readOnlyItem;
       // set up GUI
       public MenuTest()
          super( "Menu Test" );
    //*   file menu and menu items
          // set up File menu and its menu items
          JMenu fileMenu = new JMenu( "File" );
          // set up New menu item
          JMenuItem newItem = fileMenu.add(new TestAction( "New" ));
          // set up Open menu item
          JMenuItem openItem = fileMenu.add(new TestAction( "Open" ));
              //  add seperator bar
              fileMenu.addSeparator();
          // set up Save menu item
          JMenuItem saveItem = fileMenu.add(new TestAction( "Save" ));
          // set up Save As menu item
          JMenuItem saveAsItem = fileMenu.add(new TestAction( "Save As" ));
              //  add seperator bar
              fileMenu.addSeparator();
              // set up Exit menu item
          JMenuItem exitItem = new JMenuItem( "Exit" );
          exitItem.setMnemonic( 'x' );
          fileMenu.add( exitItem );
          exitItem.addActionListener(
             new ActionListener() {  // anonymous inner class
                // terminate application when user clicks exitItem
                public void actionPerformed( ActionEvent event )
                   System.exit( 0 );
             }  // end anonymous inner class
          ); // end call to addActionListener
    //*   Edit menu and menu items
              // set up the Edit menu
              JMenu editMenu = new JMenu( "Edit" );
              //JMenuItem editMenu = new JMenu( "Edit" );
          // set up Cut menu item
          Action cutAction = new TestAction("Cut");
          cutAction.putValue(Action.SMALL_ICON, new ImageIcon("cut.gif"));
          // set up Copy menu item
          Action copyAction = new TestAction("Copy");
          copyAction.putValue(Action.SMALL_ICON, new ImageIcon("copy.gif") );
          // set up Paste menu item
          Action pasteAction = new TestAction("Paste");
          pasteAction.putValue(Action.SMALL_ICON, new ImageIcon("paste.gif") );
              editMenu.add(cutAction);
              editMenu.add(copyAction);
              editMenu.add(pasteAction);
          //  add seperator bar
              editMenu.addSeparator();
              // set up Options menu, and it submenus and items
              JMenu optionsMenu = new JMenu("Options");
              readOnlyItem = new JCheckBoxMenuItem("Read-only");
              readOnlyItem.addActionListener(
                   new ActionListener()
                   {  //  anonymous inner class
                        public void actionPerformed( ActionEvent event)
                          saveAction.setEnabled(!readOnlyItem.isSelected());
                          saveAsAction.setEnabled(!readOnlyItem.isSelected());
                }  // end anonymous inner class
              ); // end call to addActionListener
              optionsMenu.add(readOnlyItem);
              // add seperator bar
              optionsMenu.addSeparator();
              //  Work on Radio Buttons
              ButtonGroup textGroup = new ButtonGroup();
              JRadioButtonMenuItem insertItem = new JRadioButtonMenuItem("Insert");
              insertItem.setSelected(true);
              JRadioButtonMenuItem overTypeItem = new JRadioButtonMenuItem("Overtype");
              textGroup.add(insertItem);
              textGroup.add(overTypeItem);
              optionsMenu.add(insertItem);
              optionsMenu.add(overTypeItem);
              editMenu.add(optionsMenu);
    //*   Help menu and menu items
              // set up the Help menu
              JMenu helpMenu = new JMenu( "Help" );
              helpMenu.setMnemonic( 'H' );
          // set up index menu item
          JMenuItem indexItem = helpMenu.add(new TestAction( "Index" ));
          indexItem.setMnemonic( 'I' );
          helpMenu.add( indexItem );
              // set up About menu item
          JMenuItem aboutItem = new JMenuItem( "About" );
          aboutItem.setMnemonic( 'A' );
          helpMenu.add( aboutItem );
          aboutItem.addActionListener(
             new ActionListener() {  // anonymous inner class
                // display message dialog when user selects Open
                public void actionPerformed( ActionEvent event )
                   JOptionPane.showMessageDialog( MenuTest.this,
                      "This is MenuTest.java \nVersion 1.0 \nMarch 15, 2004",
                      "About", JOptionPane.PLAIN_MESSAGE );
             }  // end anonymous inner class
          ); // end call to addActionListener
          // create menu bar and attach it to MenuTest window
          JMenuBar bar = new JMenuBar();
          setJMenuBar( bar );
          bar.add( fileMenu );
              bar.add( editMenu );
              bar.add( helpMenu );
          setSize( 500, 200 );
          setVisible( true );
       } // end constructor
       public static void main( String args[] )
          MenuTest application = new MenuTest();
          application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
       // inner class to handle action events from menu items
       private class ItemHandler implements ActionListener {
          // process color and font selections
          public void actionPerformed( ActionEvent event )
           repaint();
          } // end method actionPerformed
       } // end class ItemHandler
       //  Prints to action name to System.out
      class TestAction extends AbstractAction
              public TestAction(String name) { super(name); }
          public void actionPerformed( ActionEvent event )
             System.out.println(getValue(Action.NAME) + " selected." );
       } // end class TestAction
    } // end class MenuTest

    alan, I've been trying to figure out a solution.
    You can initialize it like this
    private Action saveAction= new Action();
         private Action saveAsAction=new Action();
    THE ABOVE WILL NOT WORK.
    because Action is an interface. An interface does not have constructors. However, interface references are used for polymorphic purposes.
    Anyway, all you have to do is find some class that implemets Action interface.... I cant seem to find one. Or maybe this is not how its supposed to be done?
    Hopefully, someone can shed some light on this issue.
    FYI,
    http://java.sun.com/products/jfc/swingdoc-api-1.1/javax/swing/Action.html

  • Null pointer Exception with Custom EventQueue

    I created a simple class customEventQueue which is extended from EventQueue class and pushed it using
    Toolkit.getDefaultToolkit().getSystemEventQueue().push(customEventQueue);
    Now, whenever there are three modal dialogs on top of a frame and if I click on top dialog that closes all three dialog boxes, I get nullpointer exception in console. The custom event class does not have any method in it. It just extends from EventQueue.
    I checked it in different JRE and it happens only in JRE1.3.1.
    Has anybody tried the same thing with custom event queue? Any help is most welcome. Thanks...
    java.lang.NullPointerException
    at sun.awt.windows.WInputMethod.dispatchEvent(Unknown Source)
    at sun.awt.im.InputContext.dispatchEvent(Unknown Source)
    at sun.awt.im.InputMethodContext.dispatchEvent(Unknown Source)

    Hi Chandel me having the same problem
    java.lang.NullPointerException
    at sun.awt.windows.WInputMethod.dispatchEvent(Unknown Source)
    at sun.awt.im.InputContext.dispatchEvent(Unknown Source)
    at sun.awt.im.InputMethodContext.dispatchEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown
    Source)
    at
    java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Sour
    ce)
    at
    java.awt.DefaultKeyboardFocusManager.pumpApprovedKeyEvents(Unknown So
    urce)
    at
    java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Sour
    ce)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown
    Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.SequencedEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
    Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
    Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Th bigger problem is that i don't know what is causing this exception, cause the stack trace doesn't mention the line of code where the exception occurred.
    In earlier version of java we had pData null pointer exception. This bug manifests when the pull down menu doesn't fit completely into the frame's bounds and swing has to create a seaprate window for the pull-down.
    The problem is that WInputMethod caches a reference to peer and that that reference becomes stale when peer is destroyed and recreated.
    In this bug cached peer reference becomes stale as the Window for the menu is hidden (and its peer is destroyed) and shown again (with new peer this time).
    WInputMethod have a cached reference to the old peer but that old peer is not connected to the underlying native window used to display the menu.
    But it's been fixed. I want to know if our problem is in some way related to this pData bug.
    Thanx.

  • Af:tree Null Pointer Exception using af:switcher

    Hi,
    I've implemented a Tree (based on 3 linked SQL Query View Objects). The linked View Objects run ok in the Application Module tester...
    I wanted to customize the different levels of the tree so implemented a Switcher component on the Tree as follows (note I've limited the Tree to 2 levels):
    <af:tree value="#{bindings.listToDoAppsVO1.treeModel}" summary="ToDo List Tree"  var="node"
                                                                 id="pt_t8" contentDelivery="lazy"
                                                                 initiallyExpanded="true"
                                                                 styleClass="AFStretchWidth" inlineStyle="height:inherit;">
                                                            <f:facet name="nodeStamp">
                                                              <af:switcher facetName="#{node.hierType.structureDefName}" id="todo_switcher">
                                                                <!-- render the Application Node -->
                                                                <f:facet name="app_model.listToDoAppsVO">
                                                                  <!-- display the Application as the node name -->
                                                                  <af:outputText value="#{node.Appname}" id="ot_app">
                                                                  </af:outputText>
                                                                </f:facet>
                                                                <f:facet name="app_model.listToDoTypesVO">
                                                                  <!-- Create the node definition for the Report Type -->
                                                                  <af:commandImageLink id="pt_ot16"
                                                                                         text="#{node.Viewtype}"
                                                                                         icon="/pics/folder-icon.png"
                                                                                         action="callRouter"
                                                                                         actionListener="#{backingBeanScope.cognition3coltempBacking.toDoViewGoActionListener}"
                                                                                         />
                                                                </f:facet>
                                                              </af:switcher>
                                                            </f:facet>
                                                        </af:tree>However, when the page is run the Tree displays correctly initially, but as soon as a link is pressed I get a Null Pointer exception with the following Stack Trace info (top 30 or so lines):
    java.lang.NullPointerException
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.createAndNotifyDCE(JUCtrlValueBinding.java:327)
         at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.createAndNotifyDCE(JUCtrlHierNodeBinding.java:2646)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierNodeBinding.createAndNotifyDCE(FacesCtrlHierNodeBinding.java:137)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.notifyRefreshDCE(JUCtrlValueBinding.java:299)
         at oracle.jbo.uicli.binding.JUIteratorBinding.notifyRefreshDCE(JUIteratorBinding.java:497)
         at oracle.adf.model.binding.DCIteratorBinding.refreshControlAndNotifyDCE(DCIteratorBinding.java:705)
         at oracle.adf.model.binding.DCIteratorBinding.rangeRefreshed(DCIteratorBinding.java:914)
         at oracle.adf.model.binding.DCIteratorBinding.iteratorReset(DCIteratorBinding.java:1332)
         at oracle.jbo.common.RowSetHelper.fireMgmtIteratorReset(RowSetHelper.java:282)
         at oracle.jbo.server.ViewRowSetIteratorImpl.notifyIteratorReset(ViewRowSetIteratorImpl.java:3778)
         at oracle.jbo.server.ViewRowSetImpl.resetIterators(ViewRowSetImpl.java:4004)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1271)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:1413)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:1319)
         at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:1304)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:7119)
         at oracle.adf.model.bc4j.DCJboDataControl.executeIteratorBindingIfNeeded(DCJboDataControl.java:1366)
         at oracle.adf.model.binding.DCIteratorBinding.executeQueryIfNeeded(DCIteratorBinding.java:2219)
         at oracle.jbo.uicli.binding.JUCtrlHierBinding.getRootNodeBinding(JUCtrlHierBinding.java:92)
         at oracle.adfinternal.view.faces.model.binding.RowDataManager.getParent(RowDataManager.java:245)
         at oracle.adfinternal.view.faces.model.binding.RowDataManager.setRowIndex(RowDataManager.java:51)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.setRowIndex(FacesCtrlHierBinding.java:800)
         at org.apache.myfaces.trinidad.component.UIXCollection.setRowIndex(UIXCollection.java:530)
         at org.apache.myfaces.trinidad.component.UIXTree.__encodeBegin(UIXTree.java:488)
         at org.apache.myfaces.trinidad.component.UIXCollection.encodeBegin(UIXCollection.java:607)If I replace the tree with a simpler component (e.g Command Image link) I don't get the error.
    Any ideas please? I'm using JDeveloper 11.1.2.1.0 incidentally...
    Thanks.

    Hi Frank,
    Thanks for your reply. The Partial Submit worked up to a point - the expected navigation to the new view now works when the link is initially pressed. However, if the link is tried again the Null Pointer Exception occurs again.
    By the way, the Tree is on a Page Template, where there is another Tree that utilises an af:switcher - and the command link from this tree now fails with the same NPE error. I notice there are warnings for both trees in the Page Template View such that 'Reference "node.hierType" not found'. Not sure how relevant this is given that the Trees both display correctly initially.
    The Stack Trace is as follows (can't post the whole thing as it exceeds the 30000 char limit):
    <UIXInclude> <_warnUnpoppedContextChanges> ADF_FACES-10021:During the processing of the include component, the context change found did not match the current component. Expected oracle.adf.view.rich.component.fragment.UIXInclude$IncludeContextChange, but got UIXCollection.CollectionComponentChange[Component class: oracle.adf.view.rich.component.rich.data.RichTree, component ID: pt_t8].
    <FaceletViewHandlingStrategy> <handleRenderException> Error Rendering View[/app_todoTF/app_common_todo]
    java.lang.NullPointerException
         at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.findChildNode(JUCtrlHierNodeBinding.java:867)
         at oracle.jbo.uicli.binding.JUCtrlHierBinding.bringNodeToRangeKeyPath(JUCtrlHierBinding.java:788)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding.bringNodeToRangeKeyPath(FacesCtrlHierBinding.java:111)
         at oracle.adfinternal.view.faces.model.binding.RowDataManager.setRowKey(RowDataManager.java:130)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.setRowKey(FacesCtrlHierBinding.java:830)
         at org.apache.myfaces.trinidad.component.UIXCollection.setRowKey(UIXCollection.java:513)
         at oracle.adfinternal.view.faces.renderkit.rich.TreeRendererUtils._isMultiRootedTree(TreeRendererUtils.java:2507)
         at oracle.adfinternal.view.faces.renderkit.rich.TreeRendererUtils.addClientPropertyFlags(TreeRendererUtils.java:1915)
         at oracle.adfinternal.view.faces.renderkit.rich.TreeRenderer.addClientProperties(TreeRenderer.java:742)
         at oracle.adfinternal.view.faces.renderkit.rich.TreeRenderer.encodeAll(TreeRenderer.java:351)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at org.apache.myfaces.trinidad.component.UIXCollection.encodeEnd(UIXCollection.java:617)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelBoxRenderer._encodeAllChildren(PanelBoxRenderer.java:1518)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelBoxRenderer._renderContentRow(PanelBoxRenderer.java:1440)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelBoxRenderer.encodeAll(PanelBoxRenderer.java:381)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:447)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$1500(PanelGroupLayoutRenderer.java:30)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:734)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:637)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:318)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:283)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:360)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer.access$600(ShowDetailItemRenderer.java:37)
         at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer$ChildEncoderCallback.processComponent(ShowDetailItemRenderer.java:640)
         at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer$ChildEncoderCallback.processComponent(ShowDetailItemRenderer.java:613)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:318)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:283)
         at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer._encodeChildren(ShowDetailItemRenderer.java:550)
         at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer.encodeAll(ShowDetailItemRenderer.java:121)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:2194)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelAccordionRenderer._encodeNonScreenReaderDetailItem(PanelAccordionRenderer.java:1572)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelAccordionRenderer._encodeDetailItem(PanelAccordionRenderer.java:1638)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelAccordionRenderer.access$4900(PanelAccordionRenderer.java:58)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelAccordionRenderer$PanelEncoderCallback.processComponent(PanelAccordionRenderer.java:2775)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelAccordionRenderer$PanelEncoderCallback.processComponent(PanelAccordionRenderer.java:2719)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:318)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:283)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelAccordionRenderer.encodeAll(PanelAccordionRenderer.java:471)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeStartFacet(PanelStretchLayoutRenderer.java:942)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeVerticalPane(PanelStretchLayoutRenderer.java:1542)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeMiddlePanes(PanelStretchLayoutRenderer.java:350)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeAll(PanelStretchLayoutRenderer.java:316)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:2194)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer._renderPane(PanelSplitterRenderer.java:1593)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer.encodeAll(PanelSplitterRenderer.java:263)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeCenterFacet(PanelStretchLayoutRenderer.java:879)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeCenterPane(PanelStretchLayoutRenderer.java:1294)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeMiddlePanes(PanelStretchLayoutRenderer.java:351)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeAll(PanelStretchLayoutRenderer.java:316)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:2194)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer._renderPane(PanelSplitterRenderer.java:1593)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer.encodeAll(PanelSplitterRenderer.java:263)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
         at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
         at oracle.adfinternal.view.faces.renderkit.rich.PageTemplateRenderer.encodeAll(PageTemplateRenderer.java:68)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
         at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
         at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:274)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
         at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
         at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1277)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at oracle.adfinternal.view.faces.context.PartialViewContextImpl._processRender(PartialViewContextImpl.java:321)
         at oracle.adfinternal.view.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:152)
         at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:974)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1652)
         at oracle.adfinternal.view.faces.component.AdfViewRoot.encodeAll(AdfViewRoot.java:91)
         at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:399)
         at org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ChangeApplyingVDLWrapper.renderView(ViewDeclarationLanguageFactoryImpl.java:350)
         at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
         at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
         at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:165)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:1027)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:334)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:232)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:122)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    <LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase RENDER_RESPONSE 6
    java.lang.NullPointerException
    etc...Thanks.

  • Really frustrating Null Pointer Exception

    Hi I had the day off and was bored so I decided to start work on a poker game. Today I just started making a deck of cards and drawing a random card from it. However it isn't working as I get a very annoying null pointer exception which I don't understand. Anyway I will post my code:
    public class DeckOfCards
         public static void main(String args[])
              Deck daDeck = new Deck();
              Card[] drawnCards = new Card[10];
              for (int i=0; i < 10; ++i)
                   drawnCards[i] = daDeck.DrawCard();
                   System.out.println(drawnCards.getTitle());
    import java.util.*;
    public class Deck
         Suit Hearts;
         Suit Diamonds;
         Suit Spades;
         Suit Clubs;
         public void Deck()
              Hearts = new Suit("Hearts");
              Diamonds = new Suit("Diamonds");
              Spades = new Suit("Spades");
              Clubs = new Suit("Clubs");
         public Card DrawCard()
              System.out.println("Drawing card...");
              Random generator = new Random();
              Card card = null;
              System.out.println("Card variable inited");
              while (card == null)
                   System.out.println("Bleep");
                   switch (generator.nextInt(4))
                        case 0:
                             System.out.println("0");
                             return Hearts.getAvailableCard();
                        case 1:
                             System.out.println("1");
                             return Diamonds.getAvailableCard();
                        case 2:
                             System.out.println("2");
                             return Spades.getAvailableCard();
                        case 3:
                             System.out.println("3");
                             return Clubs.getAvailableCard();
                        default:
                             System.out.println("none");                    
              System.out.println("Exited while loop");
              return card;
    import java.util.*;
    public class Suit
         Card[] cards = new Card[13];
         public Suit(String suit_)
              cards[0] = new Card("Two", suit_);
              cards[1] = new Card("Three", suit_);
              cards[2] = new Card("Four", suit_);
              cards[3] = new Card("Five", suit_);
              cards[4] = new Card("Six", suit_);
              cards[5] = new Card("Seven", suit_);
              cards[6] = new Card("Eight", suit_);
              cards[7] = new Card("Nine", suit_);
              cards[8] = new Card("Ten", suit_);
              cards[9] = new Card("Jack", suit_);
              cards[10] = new Card("Queen", suit_);
              cards[11] = new Card("King", suit_);
              cards[12] = new Card("Ace", suit_);
         public Card getAvailableCard()
              System.out.println("Getting an available card...");
              Random generator = new Random();
              Card card = new Card();
              int randomNo = generator.nextInt(13);
              System.out.println(randomNo);
              if (cards[randomNo].isAvailable())
                   return cards[randomNo];
              return card;
    public class Card
         String strValue;
         String suitName;
         int value;
         int suit;
         boolean available = true;
         public Card()
              strValue = "Out";
              suitName = "cards";
         public Card(String strValue_, String suitName_)
              strValue = strValue_;
              suitName = suitName_;
         public String getTitle()
              String title = strValue + " of " + suitName;
              return title;
         public void setAvailable(boolean available_)
              available = available_;
         public boolean isAvailable()
              return available;
    What the program is meant to do is create a deck of cards, then pick ten cards, randomly picking a suit and card in that suit. If the card has already been drawn ( not available ) then the DrawCard() method should repick a suit and card and try again. The program may be doing something differently to what I have said and may be a bit messy just because I have messed around with things trying to understand why I am getting the exception. This is the exception:
    Exception in thread "main" java.lang.NullPointerException
    at Deck.DrawCard(Deck.java:34)
    at DeckOfCards.main(DeckOfCards.java:13)
    The program doesn't even make it to the first line of the getAvailableCard() method in the Suit Class.
    So all I am asking is can anyone see why I am getting the null pointer exception and what action could I take to fix it. Thankyou to anyone who has read this.

    Figure out what's null.
    Print out cards and then cards[randomNo].
    If those aren't null, then you need to look more closely at the erorr message and put in print statements to find out what is.
    Whatever turns out to be null, you'll need to trace back and figure out why.
    If it's the array, and the array is a member variable, then you need to know that reference member variables are initilaized to null.
    If the array isn't null (because you did cards = new Card[something]) but cards[randomNo] is null, then it's because you didn't do this: for (int ix = 0; ix < cards.length; ix++) {
        cards[ix] = new Card(...);
    }

  • Null Pointer Exception with iterator

    Hi,
    I'm trying to use an iterator on a collection bound to a jsf page fragment through datacontrol (data is retrieved from a web service).
    Everything works fine except when this collection is null; I'm then getting a null pointer exception.
    Is there an equivalent of <af:table emptytext="">? Or maybe, is there somewhere where I can configure my datacontrol to always return an empty collection instead of null?
    Thanks.
    Edit: my mistake; I made an error in the binding, which was pointing to another iterator already used.
    Edited by: 965573 on 16 oct. 2012 02:17

    Hi,
    You can try not to render the table when the length of the Collection is zero. This can be done by a JSTL function "length" available at:
    http://java.sun.com/jsp/jstl/functions
    Ex:#{fn:length(bindings.Collection)>0}"
    Thanks,

  • Error: Dereferencing of the NULL reference

    Dear Friends,
    one of our user is running a report on web bex  and he is getting following error.
    com.sap.ip.bi.base.application.exceptions.AbortMessageRuntimeException:
    Termination message sent ABEND RS_EXCEPTION (000): Dereferencing of the NULL reference 
    MSGV1: Dereferencing of the NULL reference
    But when we run this with our user we are not getting any error.
    if we run this report using RSRT usin user's user id it is not giving any error.
    only genrating error when we try to run using Web Bex .
    Any help hightly Appicated.
    Malik

    Thanks friends,
    i already check the given sap note but that note is for support pack till17 and we have already 19 support level.
    thats why this is not the solution.
    second i check it publishing. its working fine with all the users except 3 of our users. i dont know why the error is
    comming with them only.
    and i also check the url  no specific variable values.
    any other idea.
    regards
    Naeem

Maybe you are looking for

  • RoboHelp for Word 8.0 - can't open a pdf file from help topic

    running RoboHelp for Word 8.0 on a Windows 7 machine. I produce WinHelp for one of our clients. I just converted an old online help system from RoboHelp 7 to RoboHelp 8. one of my topics has a button to launch a pdf file {button Transport Feature Cha

  • HP Deskjet 710c printer don't work on a Mac Mini

    I have a Mac Mini with OSX 10.9 but my HP Deskjet 710c printer don't work. I install the HP driver package from Apple but I don't see my printer in the list. Who can help me out? Thanks.

  • Text to speech apps?

    hi all, are there any universal text to speech apps that have more voices than the mac?

  • CS5 Hangs on Package

    Hello, I have started to have this problem since recently upgrading to CS5.  7.0.4 on OSX 10.6.7.  Never had an issue with CS4 and packaging.  It is exactly as listed in other posts in this forum, at the end of the package, it hangs, CPU goes to 100%

  • How do I recover Firefox tabs?

    I always click out of Firefox by hitting the box to save tabs from this session. I am a very visual person and having those tabs restored vastly helps me with my next work session. Two days ago I clicked out, and when I came back on, Firefox went to