1

SEVERE: Servlet.service() for servlet zkLoader threw exception java.lang.NullPointerException: Null

asked 2011-06-18 19:11:35 +0800

libeross gravatar image libeross
13 1

updated 2014-03-14 11:48:24 +0800

sitansu gravatar image sitansu
2254 13
http://java91.blogspot.in...

hi i need help im getting the following when i try to run zk spring project

SEVERE: Servlet.service() for servlet zkLoader threw exception
java.lang.NullPointerException: Null Pointer in Method Invocation
at bsh.Name.invokeMethod(Unknown Source)
    at bsh.BSHMethodInvocation.eval(Unknown Source)
    at bsh.BSHPrimaryExpression.eval(Unknown Source)
    at bsh.BSHPrimaryExpression.eval(Unknown Source)
    at bsh.BSHIfStatement.evaluateCondition(Unknown Source)
    at bsh.BSHIfStatement.eval(Unknown Source)
    at bsh.Interpreter.eval(Unknown Source)
    at bsh.Interpreter.eval(Unknown Source)
    at org.zkoss.zk.scripting.bsh.BSHInterpreter.exec(BSHInterpreter.java:119)
    at org.zkoss.zk.scripting.util.GenericInterpreter.interpret(GenericInterpreter.java:310)
    at org.zkoss.zk.ui.impl.PageImpl.interpret(PageImpl.java:796)
    at org.zkoss.zk.ui.impl.UiEngineImpl.execNonComponent(UiEngineImpl.java:753)
    at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:553)
    at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:498)
    at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:631)
    at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:587)
    at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:531)
    at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:498)
    at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:378)
    at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:299)
    at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:229)
    at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:165)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:112)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:109)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
    at java.lang.Thread.run(Thread.java:619)

my zk.xml
<?xml version="1.0" encoding="UTF-8"?>

<!--
    Created by ZK Studio
-->

<zk>
<device-config>
        <device-type>ajax</device-type>
        <timeout-uri>/login.zul</timeout-uri>
<!--
            An empty URL can cause the browser to reload the same URL
        -->
</device-config>        

<system-config>
    <disable-event-thread/>
</system-config>

</zk>

and web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
        id="WebApp_ID" 
        version="2.5">



    <display-name>recsPartilhados</display-name>

    <description>Spring+Zkoss  web application</description>



    <!--

        Location of the Log4J config file, for initialization and refresh checks.
        Applied by Log4jConfigListener.
    -->
    <context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>/WEB-INF/log/log4j.properties</param-value>
    </context-param>


    <!--
        - Location of the XML file that defines the root application context.
        - Applied by ContextLoaderServlet.
        -
        - "/WEB-INF/applicationContext-jpa.xml" for the JPA configuration,
        - "/WEB-INF/applicationContext-security.xml" for the spring security configuration,
        - /WEB-INF/applicationContext.xml for application beans configuration
    -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            /WEB-INF/applicationContext.xml
            /WEB-INF/applicationContext-security.xml
        </param-value>
    </context-param>

    <!--
        - Configures Log4J for this web app.
        - As this context specifies a context-param "log4jConfigLocation", its file path
        - is used to load the Log4J configuration, including periodic refresh checks.
        -
        - Would fall back to default Log4J initialization (non-refreshing) if no special
        - context-params are given.
        -
        - Exports a "web app root key", i.e. a system property that specifies the root
        - directory of this web app, for usage in log file paths.
        - This web app specifies "petclinic.root" (see log4j.properties file).
    -->
    <!-- Leave the listener commented-out if using JBoss -->
    <!--
    <listener>
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>
    -->

    <!--
        - Loads the root application context of this web app at startup,
        - by default from "/WEB-INF/applicationContext.xml".
        - Note that you need to fall back to Spring's ContextLoaderServlet for
        - J2EE servers that do not follow the Servlet 2.4 initialization order.
        -
        - Use WebApplicationContextUtils.getWebApplicationContext(servletContext)
        - to access it anywhere in the web application, outside of the framework.
        -
        - The root context is the parent of all servlet-specific contexts.
        - This means that its beans are automatically available in these child contexts,
        - both for getBean(name) calls and (external) bean references.
    -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

    </listener>

    <!--
      - Spring Security Filter Chains
      -->
    <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>

    <filter-mapping>
      <filter-name>springSecurityFilterChain</filter-name>
      <url-pattern>/*</url-pattern>
    </filter-mapping>



  <listener>
    <description>
    Used to cleanup when a session is destroyed</description>
    <display-name>
    ZK Session cleaner</display-name>
    <listener-class>org.zkoss.zk.ui.http.HttpSessionListener</listener-class>
  </listener>

  <servlet>
    <description>
    The servlet loads the DSP pages</description>
    <servlet-name>dspLoader</servlet-name>
    <servlet-class>
    org.zkoss.web.servlet.dsp.InterpreterServlet</servlet-class>
  </servlet>

  <servlet>
    <description>
    The ZK loader for ZUML pages</description>
    <servlet-name>zkLoader</servlet-name>
    <servlet-class>
    org.zkoss.zk.ui.http.DHtmlLayoutServlet</servlet-class>
    <init-param>
        <param-name>update-uri</param-name>
        <param-value>/zkau</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet>
    <description>
    The asynchronous update engine for ZK</description>
    <servlet-name>auEngine</servlet-name>
    <servlet-class>
    org.zkoss.zk.au.http.DHtmlUpdateServlet</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>dspLoader</servlet-name>
    <url-pattern>*.dsp</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>zkLoader</servlet-name>
    <url-pattern>*.zul</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>zkLoader</servlet-name>
    <url-pattern>*.zhtml</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>auEngine</servlet-name>
    <url-pattern>/zkau/*</url-pattern>
  </servlet-mapping>

  <session-config>  
    <!-- Default to 5 minute session timeouts -->  
    <session-timeout>15</session-timeout>  
  </session-config>

  <welcome-file-list>
    <welcome-file>login.zul</welcome-file>
  </welcome-file-list>

</web-app>
delete flag offensive retag edit

Comments

Could any one fix it? I am facing this issue.

javaenthu ( 2013-06-20 13:47:23 +0800 )edit

Did anyone have answer to this issue?

aheda ( 2014-03-14 10:19:14 +0800 )edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2011-06-18 19:11:35 +0800

Seen: 979 times

Last updated: Mar 14 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More