4 Replies Latest reply on Apr 15, 2006 11:37 AM by Jye Tucker

    NullPointerException

    x x Newbie

      I try to run ma first eam application. I took the sample application, have it minimal changed. Here are my config files:

      web.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
       version="2.4">
      
       <!-- Seam -->
      
       <listener>
       <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
       </listener>
      
       <!-- MyFaces -->
      
       <listener>
       <listener-class>
       org.apache.myfaces.webapp.StartupServletContextListener
       </listener-class>
       </listener>
      
       <context-param>
       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
       <param-value>client</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>
      
       <!-- Faces Servlet Mapping -->
       <servlet-mapping>
       <servlet-name>Faces Servlet</servlet-name>
       <url-pattern>*.seam</url-pattern>
       </servlet-mapping>
      
       <session-config>
       <session-timeout>
       30
       </session-timeout>
       </session-config>
       <welcome-file-list>
       <welcome-file>
       index.jsp
       </welcome-file>
       </welcome-file-list>
      </web-app>
      



      faces-config:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <!DOCTYPE faces-config
      PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
       "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
      <faces-config>
      
       <navigation-rule>
       <navigation-case>
       <from-outcome>success</from-outcome>
       <to-view-id>/registriert.jsp</to-view-id>
       </navigation-case>
       </navigation-rule>
      
       <!-- A phase listener is needed by all Seam applications -->
      
       <lifecycle>
       <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
       </lifecycle>
      
      </faces-config>
      
      



      If I try to get any resource from the application, with URL-Pattern "*.seam", I get a NullPointerException:

      java.lang.NullPointerException
       at org.jboss.seam.contexts.PageContext.getCurrentReadableMap(PageContext.java:62)
       at org.jboss.seam.contexts.PageContext.get(PageContext.java:52)
       at org.jboss.seam.contexts.Contexts.lookupInStatefulContexts(Contexts.java:125)
       at org.jboss.seam.Component.getInstance(Component.java:1026)
       at org.jboss.seam.Component.getInstance(Component.java:1016)
       at org.jboss.seam.contexts.Lifecycle.resumeConversation(Lifecycle.java:272)
       at org.jboss.seam.jsf.SeamPhaseListener.restoreAnyConversationContext(SeamPhaseListener.java:140)
       at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:95)
       at org.apache.myfaces.lifecycle.LifecycleImpl.informPhaseListenersAfter(LifecycleImpl.java:536)
       at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:164)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
       at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
       at java.lang.Thread.run(Thread.java:595)