JBoss Community

Re: JBoss as 6.0.0 final - Error when deploying war

created by Ales Justin in Beginner's Corner - View the full discussion

Adding this deployer does the trick for me:

 

/**

* Filter on Javassist' MethodHandler and ProxyObject.

*

* @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a>

*/

public class ExcludeAppJavassistDeployer extends WeldAwareMetadataDeployer<ClassLoadingMetaData>

{

   private String PO = ClassLoaderUtils.classNameToPath(ProxyObject.class);

   private String MH = ClassLoaderUtils.classNameToPath(MethodHandler.class);

   private ClassFilter excludeFilter;

 

   public ExcludeAppJavassistDeployer()

   {

      super(ClassLoadingMetaData.class, true);

      setStage(DeploymentStages.PRE_DESCRIBE);

      excludeFilter = new ClassFilter()

      {

         public boolean matchesClassName(String className)

         {

            return (ProxyObject.class.getName().equals(className) || MethodHandler.class.getName().equals(className));

         }

 

         public boolean matchesResourcePath(String resourcePath)

         {

            return (PO.equals(resourcePath) || MH.equals(resourcePath));

         }

 

         public boolean matchesPackageName(String packageName)

         {

            return false;

         }

      };

   }

 

   protected void internalDeploy(VFSDeploymentUnit unit, ClassLoadingMetaData deployment, Collection<VirtualFile> wbXml) throws DeploymentException

   {

      String excludedPackages = deployment.getExcludedPackages();

      if (excludedPackages != null)

         return; // we have explicit set of package excludes

 

      ClassFilter excluded = deployment.getExcluded();

      if (excluded == null)

      {

         deployment.setExcluded(excludeFilter);

      }

      else

      {

         deployment.setExcluded(new CombiningClassFilter(false, new ClassFilter[]{excluded, excludeFilter}));

      }

   }

}

Reply to this message by going to Community

Start a new discussion in Beginner's Corner at Community