Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-753

Trim/Normalize extra whitespace surrounding classnames in beans.xml deployment descriptor

XMLWordPrintable

    • Hide

      In any test case employing beans.xml to specify interceptors or decorators add additional whitespace around the classname

      Show
      In any test case employing beans.xml to specify interceptors or decorators add additional whitespace around the classname

      Interceptors, Decorators and Alternatives could have class elements and a user may add additional whitespace while specifying the classname as shown below:
      <interceptors>
      <class>
      test.beans.TransactionInterceptor</class>
      </interceptors>

      Today the BeansXml parser implementation does not trim the extraneous whitespace around the classname as pass them as such ("\n test.beans.TransactionInterceptor" to the container's classloader(Thread context classloader) in DefaultResourceLoader. Since most classloaders' implementation of loadClass() doesn't trim the classnames, it results in a ClassNotFoundException.

      Caused by: java.lang.ClassNotFoundException:
      test.beans.TransactionInterceptor
      at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1518)
      at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1368)
      at org.jboss.weld.resources.DefaultResourceLoader.classForName(DefaultResourceLoader.java:52)

      It would be nice if the class element is normalized and stripped of any extraneous whitespace before asking the TCL to load the class.

              pmuiratbleepbleep Pete Muir (Inactive)
              sivakumart_jira Sivakumar Thyagarajan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: