[jboss-user] [Beginner's Corner] - Re: JBoss as 6.0.0 final - Error when deploying war

Ales Justin do-not-reply at jboss.com
Fri Jan 21 00:55:53 EST 2011


Ales Justin [http://community.jboss.org/people/alesj] created the discussion

"Re: JBoss as 6.0.0 final - Error when deploying war"

To view the discussion, visit: http://community.jboss.org/message/582256#582256

--------------------------------------------------------------
Adding this deployer does the trick for me:

/**
 * Filter on Javassist' MethodHandler and ProxyObject.
 *
 * @author <a href="mailto: mailto:ales.justin at jboss.org ales.justin at 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
[http://community.jboss.org/message/582256#582256]

Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110121/853224a4/attachment.html 


More information about the jboss-user mailing list