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

Ales Justin do-not-reply at jboss.com
Thu Jan 20 23:51:30 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/582244#582244

--------------------------------------------------------------
What about is you add some deployer similar to this:

import java.util.Collection;

import org.jboss.classloader.plugins.ClassLoaderUtils;
import org.jboss.classloader.spi.filter.ClassFilter;
import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
import org.jboss.vfs.VirtualFile;

import javassist.util.proxy.MethodHandler;
import javassist.util.proxy.ProxyObject;

/**
 * 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);

   public ExcludeAppJavassistDeployer()
   {
      super(ClassLoadingMetaData.class, true);
   }

   protected void internalDeploy(VFSDeploymentUnit unit, ClassLoadingMetaData deployment, Collection<VirtualFile> wbXml) throws DeploymentException
   {
      ClassFilter excluded = deployment.getExcluded();
      String excludedPackages = deployment.getExcludedPackages();
      if (excluded == null && excludedPackages == null)
      {
         excluded = new ClassFilter()
         {
            public boolean matchesClassName(String className)
            {
               return (ProxyObject.class.getName().equals(className) || MethodHandler.class.getName().equals(className)) == false;
            }

            public boolean matchesResourcePath(String resourcePath)
            {
               return (PO.equals(resourcePath) || MH.equals(resourcePath)) == false;
            }

            public boolean matchesPackageName(String packageName)
            {
               return true;
            }
         };
         deployment.setExcluded(excluded);
      }
   }
}
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/582244#582244]

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/20110120/d2c02a2c/attachment-0001.html 


More information about the jboss-user mailing list