Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-2951

StringIndexOutOfBoundsException in JavaUtils#getPackageName()

    Details

      Description

      Deploying a class with no package causes String index out of range: -1 because of:

      String fullName = clazz.getName();
      return fullName.substring(0, fullName.lastIndexOf("."));

      BTW, why do we have a project-specific JavaUtils... these functionalities must have been coded milion times and with such cases handled.

      http://commons.apache.org/lang/api-release/org/apache/commons/lang/ClassUtils.html#getPackageName%28java.lang.Class%29

      ---------------------------------------------------------------------------
      Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      at java.lang.String.substring(String.java:1937)
      at org.jboss.wsf.common.JavaUtils.getPackageName(JavaUtils.java:533)
      at org.jboss.ws.metadata.wsdl.WSDLUtils.getTypeNamespace(WSDLUtils.java:700)
      at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.processWebService(JAXWSWebServiceMetaDataBuilder.java:306)
      at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.buildWebServiceMetaData(JAXWSWebServiceMetaDataBuilder.java:104)
      at org.jboss.ws.metadata.builder.jaxws.JAXWSServerMetaDataBuilder.setupProviderOrWebService(JAXWSServerMetaDataBuilder.java:50)
      at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderJSE.buildMetaData(JAXWSMetaDataBuilderJSE.java:61)
      at org.jboss.wsf.stack.jbws.UnifiedMetaDataDeploymentAspect.start(UnifiedMetaDataDeploymentAspect.java:64)
      at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(DeploymentAspectManagerImpl.java:129)
      at org.jboss.wsf.container.jboss50.deployer.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:76)
      at org.jboss.wsf.container.jboss50.deployer.AbstractWebServiceDeployer.internalDeploy(AbstractWebServiceDeployer.java:60)
      at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
      at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
      ... 24 more

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                ropalka Richard Opalka
                Reporter:
                ozizka Ondrej Zizka
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: