1 Reply Latest reply on Oct 11, 2006 6:27 PM by thomas.diesler

    JSR 181 @HandlerChain annotation w/ custom loader repository

      Hallo everybody,

      I'm running jboss 4.0.4 GA w/ jbossws 1.0.3 GA and I'm encountering "Cannot process handler chain: resource://config/ServerHandlers.xml".

      It seems to be related w/ the custom loader-repository I'm using - the resource exists
      in the ejb-jar.

      http://jira.jboss.com/jira/browse/JBWS-996
      says "Absolute URLs using the resource protocol seem to work for a flat class loading model, but not for a custom loader repository in the .ear file."

      I've tried using a relative resource:config/ServerHandlers.xml does not work either.

      How does one make JSR-181 Security work with the ejb3 embedded in an .ear with
      a custom loader repository ?

      regards
      Andreas

        • 1. Re: JSR 181 @HandlerChain annotation w/ custom loader reposi
          thomas.diesler

          According to JSR181 the handler file can also be specified relative to the endpoint class. The logic we use is

           URL fileURL = null;
           String filename = anHandlerChain.file();
          
           // Try the filename as URL
           try
           {
           fileURL = new URL(filename);
           }
           catch (MalformedURLException ex)
           {
           // ignore
           }
          
           // Try the filename as File
           if (fileURL == null)
           {
           try
           {
           File file = new File(filename);
           if (file.exists())
           fileURL = file.toURL();
           }
           catch (MalformedURLException e)
           {
           // ignore
           }
           }
          
           // Try the filename as Resource
           if (fileURL == null)
           {
           fileURL = epMetaData.getResourceLoader().getResource(filename);
           }
          
           // Try the filename relative to class
           if (fileURL == null)
           {
           String packagePath = wsClass.getPackage().getName().replace('.', '/');
           fileURL = epMetaData.getClassLoader().getResource(packagePath + "/" + filename);
           }
          
           if (fileURL == null)
           throw new WSException("Cannot resolve URL to handler file: " + filename);
          


          relative to class is available from jbossws-1.0.4