4 Replies Latest reply on Jan 2, 2006 2:15 PM by Fabrice Clari

    Problem Deploying WAR File

    Shiung Yong Newbie

      Hi all,
      I'm trying to deploy a .war file which contains JSPs in a subdirectory. When I move the JSPs into the root directory of the war, everything works fine. However, when I put them into a subdirectorycalled "temp" and modify web.xml appropriately, I get the following error:

      10:41:50,711 ERROR [Tomcat5] Problem in init
      java.lang.StringIndexOutOfBoundsException: String index out of range: 0
      at java.lang.String.charAt(String.java:558)
      at org.jboss.util.file.JarUtils.unjar(JarUtils.java:258)
      at org.jboss.web.AbstractWebContainer.init(AbstractWebContainer.java:296)
      at org.jboss.deployment.MainDeployer.init(MainDeployer.java:828)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:765)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
      at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy8.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:325)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:501)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:215)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:194)
      10:41:50,712 ERROR [MainDeployer] Could not initialise deployment: file:/home/user2/jboss-4.0.2/server/all/deploy/test.war
      org.jboss.deployment.DeploymentException: String index out of range: 0; - nested throwable: (java.lang.StringIndexOutOfBoundsException: String index out of range: 0)
      at org.jboss.web.AbstractWebContainer.init(AbstractWebContainer.java:346)
      at org.jboss.deployment.MainDeployer.init(MainDeployer.java:828)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:765)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
      at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy8.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:325)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:501)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:215)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:194)
      Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
      at java.lang.String.charAt(String.java:558)
      at org.jboss.util.file.JarUtils.unjar(JarUtils.java:258)
      at org.jboss.web.AbstractWebContainer.init(AbstractWebContainer.java:296)
      ... 21 more

      The modification to web.xml looks like:


      <servlet-name>tempName</servlet-name>
      <jsp-file>/temp/index.jsp</jsp-file>


      <servlet-mapping>
      <servlet-name>tempName</servlet-name>
      <url-pattern>/temp/index.jsp</url-pattern>
      </servlet-mapping>

      index.jsp is a simply dummy page that prints "Hello". I did a forum search but wasn't able to find the answer to this, and according to the .war file documentation, everything I did was right. Can anyone please help me with this problem? I'm probably missing a very small detail somewhere. Thanks!