0 Replies Latest reply on Jun 3, 2005 12:46 PM by Bryan Lee

    PLEASE HELP! WAR's can't hot redeploy

    Bryan Lee Newbie

      Hello JBoss fellows,

      I have followed the http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration to setup class loading isolations for my WAR deployments, and now I have a separate class loader for each of my WAR's, classes with same package and class name won't conflict ones in different WAR's, just like the way I want it.

      my web.xml looks like

      <?xml version="1.0" encoding="UTF-8"?>
      
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
      <web-app>
       <servlet>
       <servlet-name>ServletName</servlet-name>
       <servlet-class>ServletClass</servlet-class>
       </servlet>
      
       <servlet-mapping>
       <servlet-name>ServletName</servlet-name>
       <url-pattern>/servlet/ServletName</url-pattern>
       </servlet-mapping>
      </web-app>
      


      and here's the simple jboss-web.xml for vhost and classloading config.
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN"
       "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">
      <jboss-web>
       <virtual-host>www.domain.com</virtual-host>
       <context-root>/</context-root>
       <class-loading>
       <loader-repository>dot.com:loader=deployment1.war</loader-repository>
       </class-loading>
      </jboss-web>
      


      So, it's class loading isolation without lib override. I don't have any libraries in the web-inf/lib dir anyways.

      HERE IS THE PROBLEM:

      When I hot redeploy by touch web.xml, I get this in the console:

      09:30:47,210 INFO [HostConfig] restartContext()
      09:30:47,210 INFO [Context] Reloading this Context has started
      09:30:50,272 WARN [HostConfig] Error during context restart
      java.lang.NullPointerException
       at org.jboss.web.tomcat.tc5.WebCtxLoader.start(WebCtxLoader.java:109)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4231)
       at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3043)
       at org.apache.catalina.startup.HostConfig.restartContext(HostConfig.java:873)
       at org.apache.catalina.startup.HostConfig.checkContextLastModified(HostConfig.java:759)
       at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1085)
       at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:327)
       at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
       at org.apache.catalina.core.StandardHost.backgroundProcess(StandardHost.java:800)
       at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1619)
       at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1628)
       at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1608)
       at java.lang.Thread.run(Thread.java:595)
      


      Now if i try to access any page or servlet from a browser in this war, nothing will come up, as the IE flag keeps waving forever. I do NOT get the "page cannot be displayed", or 400/500 http error codes.

      I have to shutdown the entire JBoss in order for the WAR to be running again. I simply can't do this all the time as it brings down other working WAR's, and I am in the process of developing the failed-to-hot-redeploy WAR and need to constantly hot-redeploy. I can hot-redeploy if I remove classloading isolation by removing the entire <class-loading> tag in jboss-web.xml but I DO need to enable this feature......

      Could some experienced JBoss gurus please point me to the right direction so I can hot-redeploy with classloading isolation?

      My Platform info:

      windows xp pro with sp2, jdk5, jboss 4.01 sp1 (zion)


      Thank you all very much for reading my post, and have a wonderful day :)[/url]