Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-427

Facet cannot find @RequiresFacet in another resource JAR

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • None
    • 1.1.0.Final
    • Forge Build, Plugin API
    • None
    • Hide
      • execute 'ant'
      • Answer that you would like to install the SwitchYard Forge plugin

      If you have FORGE_HOME set to forge-1.0.0.Beta4 or SNAPSHOT, it may
      error out on trying to write to the ~/.forge/plugins/installed.xml
      because JARs have moved around - in this case add the following line to
      installed.xml :

      <installed>
      <plugin name="org.switchyard.switchyard-forge-plugin" slot="0.3.0.Final"/>
      </installed>
      • Change FORGE_HOME to forge-1.0.0.Beta4/Beta5 or SNAPSHOT
      • Edit ~/.forge/plugins/org/switchyard/switchyard-forge-plugin/0.3.0.Final/module.xml
      • Change <module name="javax.enterprise.cdi-api"/> to <module name="javax.enterprise.api"/>
      • Change <module name="org.jboss.forge.shell-api"/> to <module name="org.jboss.forge.shell.api"/>
      • Add dependency to log4j (<module name="org.apache.log4j.Logger"/> I think)
      • forge
      Show
      Download http://downloads.jboss.org/switchyard/releases/v0.3/switchyard-installer-0.3.0.Final.zip unzip switchyard-installer-0.3.0.Final.zip cd switchyard-installer-0.3 unzip a jboss-as-7.0.2 somewhere to install into, give that location to the installer execute 'ant' Answer that you would like to install the SwitchYard Forge plugin If you have FORGE_HOME set to forge-1.0.0.Beta4 or SNAPSHOT, it may error out on trying to write to the ~/.forge/plugins/installed.xml because JARs have moved around - in this case add the following line to installed.xml : <installed> <plugin name= "org.switchyard.switchyard-forge-plugin" slot= "0.3.0.Final" /> </installed> Change FORGE_HOME to forge-1.0.0.Beta4/Beta5 or SNAPSHOT Edit ~/.forge/plugins/org/switchyard/switchyard-forge-plugin/0.3.0.Final/module.xml Change <module name="javax.enterprise.cdi-api"/> to <module name="javax.enterprise.api"/> Change <module name="org.jboss.forge.shell-api"/> to <module name="org.jboss.forge.shell.api"/> Add dependency to log4j (<module name="org.apache.log4j.Logger"/> I think) forge

    Description

      We've put a number of different plugins inside a common module, and SwitchYardFacet is in switchyard.forge-plugin-0.4.0-SNAPSHOT.jar. Can a facet in one of my other plugin JARs refer to that one? Do I need to go back to shading?

      Example - this Facet is in switchyard-camel-plugin-0.4.0-SNAPSHOT.jar but refers to SwitchYardFacet which is in another resource-root : switchyard-forge-plugin-0.4.0-SNAPSHOT.jar.

      import org.switchyard.tools.forge.plugin.SwitchYardFacet;
      
      /**
        * Forge facet for Camel bindings and services.
        */
      @Alias("switchyard.camel")
      @RequiresFacet({ DependencyFacet.class, PackagingFacet.class, 
      SwitchYardFacet.class })
      @RequiresPackagingType(PackagingType.JAR)
      public class CamelFacet extends AbstractFacet {
      ...
      }

      module.xml :

      <?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <module xmlns="urn:jboss:module:1.0" 
      name="org.switchyard.switchyard-forge-plugin" slot="0.4.0-SNAPSHOT">
      <resources>
      <!-- plugin dependencies that must be local to this module -->
      <resource-root path="switchyard-forge-common-0.4.0-SNAPSHOT.jar"/>
      <resource-root path="switchyard-component-common-rules-0.4.0-SNAPSHOT.jar"/>
      <!-- core and component plugins -->
      <resource-root path="switchyard-forge-plugin-0.4.0-SNAPSHOT.jar"/>
      <resource-root path="switchyard-forge-bean-plugin-0.4.0-SNAPSHOT.jar"/>
      <resource-root path="switchyard-forge-soap-plugin-0.4.0-SNAPSHOT.jar"/>
      <resource-root path="switchyard-forge-rules-plugin-0.4.0-SNAPSHOT.jar"/>
      <resource-root path="switchyard-forge-bpm-plugin-0.4.0-SNAPSHOT.jar"/>
      <resource-root path="switchyard-forge-camel-plugin-0.4.0-SNAPSHOT.jar"/>
      </resources>
      

      Error - the missing Type seems to be SwitchYardFacet :

      tcunning at localhost:tmp]$ forge
      Listening for transport dt_socket at address: 8787
      Plugin system disabled due to failure while loading one or more plugins; 
      try removing offending plugins with "forge remove-plugin <TAB>".
      com.google.common.collect.ComputationException: 
      java.lang.ArrayStoreException: 
      sun.reflect.annotation.TypeNotPresentExceptionProxy
           at 
      com.google.common.collect.ComputingConcurrentHashMap.compute(ComputingConcurrentHashMap.java:218)
           at 
      com.google.common.collect.ComputingConcurrentHashMap.apply(ComputingConcurrentHashMap.java:100)
           at 
      com.google.common.collect.MapMaker$ComputingMapAdapter.get(MapMaker.java:515)
           at 
      org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:183)
           at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:95)
           at 
      org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:134)
           at 
      org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:191)
           at 
      org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:368)
           at org.jboss.weld.environment.se.Weld.initialize(Weld.java:92)
           at org.jboss.forge.shell.Bootstrap$1.run(Bootstrap.java:87)
           at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.ArrayStoreException: 
      sun.reflect.annotation.TypeNotPresentExceptionProxy
           at 
      sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:653)
           at 
      sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:460)
           at 
      sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:286)
           at 
      sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)
           at 
      sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
           at 
      sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
           at java.lang.Class.initAnnotationsIfNecessary(Class.java:3070)
           at java.lang.Class.getAnnotations(Class.java:3050)
           at 
      org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:98)
           at 
      org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:54)
           at 
      org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:42)
           at 
      com.google.common.collect.ComputingConcurrentHashMap.compute(ComputingConcurrentHashMap.java:206)
           ... 10 more

      Attachments

        Activity

          People

            Unassigned Unassigned
            tcunning@redhat.com Thomas Cunningham
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: