2 Replies Latest reply: Dec 4, 2007 2:48 AM by 843844 RSS

    Problem with load-on-startup on dynamic testing

    843844
      I am using Sun Java System Application Sever 8.2
      while deploying my application i am getting the following exceptions


      [#|2007-12-03T12:12:31.165+0530|SEVERE|sun-appserver-pe8.2|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[]StandardWrapper.Throwable
      java.lang.NullPointerException
           at com.sun.enterprise.appverification.tools.InstrumentLoggerImpl.doInstrumentForWeb(InstrumentLoggerImpl.java:117)
           at com.sun.web.server.J2EEInstanceListener.handleAfterEvent(J2EEInstanceListener.java:182)
           at com.sun.web.server.J2EEInstanceListener.instanceEvent(J2EEInstanceListener.java:74)
           at org.apache.catalina.util.InstanceSupport.fireInstanceEvent(InstanceSupport.java:244)
           at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1123)
           at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:931)
           at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4183)
           at org.apache.catalina.core.StandardContext.start(StandardContext.java:4536)
           at com.sun.enterprise.web.WebModule.start(WebModule.java:241)
           at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:827)
           at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:125)
           at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:147)
           at java.security.AccessController.doPrivileged(Native Method)
           at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:809)
           at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:646)
           at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1331)
           at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1040)
           at com.sun.enterprise.web.WebContainer.loadJ2EEApplicationWebModules(WebContainer.java:967)
           at com.sun.enterprise.server.TomcatApplicationLoader.load(TomcatApplicationLoader.java:104)
           at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:229)
           at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:164)
           at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:499)
           at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:872)
           at com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:856)
           at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:424)
           at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:139)
           at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:288)
           at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:155)
           at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:258)
           at com.sun.enterprise.deployment.phasing.StartPhase.runPhase(StartPhase.java:87)
           at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:71)
           at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:639)
           at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:361)
           at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:396)
           at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:702)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:324)
           at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:305)
           at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:360)
           at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
           at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
           at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
           at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
           at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:324)
           at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:54)
           at $Proxy1.invoke(Unknown Source)
           at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:272)
           at com.sun.enterprise.deployment.client.DeploymentClientUtils.startApplication(DeploymentClientUtils.java:119)
           at com.sun.enterprise.deployment.client.DeployAction.run(DeployAction.java:450)
           at java.lang.Thread.run(Thread.java:534)
      |#]

      [#|2007-12-03T12:12:31.165+0530|SEVERE|sun-appserver-pe8.2|javax.enterprise.system.container.web|_ThreadID=14;|WEB0123: WebModule [ePOMS:default-war.war] failed to deploy and has been disabled: [java.lang.NullPointerException].|#]


      The exceptions are related to App server and i am unable to access my application. But once i comment the load-on-startup my application is getting deployed. But labels are not getting loaded because of the comment on load-on-startup. Its a must that i have to use load-on-startup for the servlet and i have to get rid of this error.


      Kindly provide me a solution whether this is related to the app server or my application.


      Thanks,
      Lovelin
        • 1. Re: Problem with load-on-startup on dynamic testing
          843844
          Hi,

          There could have been a bug in AVK 1.4 which got addressed in AVK 5. So, you may like to try your application with AVK5 (java.sun.com/j2ee/avk/)

          Thanks,
          Bhavani.
          • 2. Re: Problem with load-on-startup on dynamic testing
            843844
            finally i found the solution.

            Actually the problem was with my servletConfig in init method.
            it was throwing NullPointerException.

            My code was modified as follows,

            Original code:

            public class TestServlet implements Servlet{
            {
            public static ServletContext servletContext;
            public static ServletConfig servletConfig;

            public void init(ServletConfig config) throws ServletException
            {
                 servletConfig = Config;
                 servletContext = Config.getServletContext();
            -----some code---
            }
            }

            modified to :


            public class TestServlet extends HttpServlet{
            {
            public static ServletContext servletContext;
            public static ServletConfig servletConfig;

            public void init() throws ServletException
            {
                 servletConfig = getServletConfig();
                 servletContext = getServletContext();
            -----some code---
            }
            }


            My Application started working. But i donno why sun server is alone was giving this exceptions whereas we didnt find any problem with Weblogic and Oc4j.


            Thanks,
            Lovelin Prabhakar.