Hey Stuart,

I have a favor to ask regarding Weld/JBM. If you have a few seconds, could you take a look at something for me? The steps to reproduce this problem are in the issue (and this email thread,) but I'm pretty much at a loss to why this isn't working. We're getting that lovely sun.reflect.annotation.
TypeNotPresentExceptionProxy again, this time on a class that is in a resource root of the same module, but doesn't seem to be found.

I'd love to hear your thoughts.

https://issues.jboss.org/browse/FORGE-427

Thanks,
Lincoln

On Tue, Dec 20, 2011 at 9:33 PM, Lincoln Baxter, III <lincolnbaxter@gmail.com> wrote:
I take that back. I'll have to do more digging. After adding log4j to the module.xml, I receive the same error that you did.


On Tue, Dec 20, 2011 at 9:31 PM, Lincoln Baxter, III <lincolnbaxter@gmail.com> wrote:
Ok well, once I turned on logging I was able to figure out the root cause, but I don't know exactly why yet. I'm assuming that the stack trace is fairly obvious. The question is. "What is the correct way to resolve it?"

Side note: I really need to add a logging toggle in Forge itself, but it would need to go into the launcher, just haven't gotten around to it yet. Currently, one needs to edit the build to enable logging *gulp* (Search for "LOGGING") in the source and you'll see what I mean :/ That might be my tomorrow (in addition to working on this.) I'm going to be cutting a Beta5 very soon because of some issues in the recent Beta4.

Dec 20, 2011 9:25:43 PM org.jboss.weld.util.ServiceLoader prepareInstance
WARNING: Could not instantiate service class org.switchyard.component.bean.SwitchYardCDIServiceDiscovery
java.lang.NoClassDefFoundError: org/apache/log4j/Logger
    at org.switchyard.component.bean.SwitchYardCDIServiceDiscovery.<clinit>(SwitchYardCDIServiceDiscovery.java:59)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at org.jboss.weld.util.ServiceLoader.prepareInstance(ServiceLoader.java:273)
    at org.jboss.weld.util.ServiceLoader.loadService(ServiceLoader.java:238)
    at org.jboss.weld.util.ServiceLoader.loadServiceFile(ServiceLoader.java:194)
    at org.jboss.weld.util.ServiceLoader.reload(ServiceLoader.java:157)
    at org.jboss.weld.util.ServiceLoader.iterator(ServiceLoader.java:346)
    at org.jboss.weld.bootstrap.ExtensionBeanDeployer.addExtensions(ExtensionBeanDeployer.java:93)
    at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBootstrap.java:340)
    at org.jboss.weld.environment.se.Weld.initialize(Weld.java:91)
    at org.jboss.forge.shell.Bootstrap$1.run(Bootstrap.java:90)
    at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger from [Module "org.switchyard.switchyard-forge-plugin:0.3.0.Final" from local module loader @6de1dadb (roots: /Users/lbaxter/dev/forge/modules,/Users/lbaxter/.forge/plugins)]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103)
    ... 15 more



On Tue, Dec 20, 2011 at 5:50 PM, Tom Cunningham <tcunning@redhat.com> wrote:

Here's the steps to reproduce (there's quite a few, sorry for that, we
should have this down to two in the next release) :

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
Answer (y) 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 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"/>

forge





On 12/20/2011 12:44 PM, Lincoln Baxter wrote:
> Hey Tom,
>
> (cc'ing dev list)
>
> I'm not exactly sure why this is happening. As long as the plugins are distributed as a single module, all resource-roots in that module should have classloader visibility between one another. They should also prefer their local classes over classes in other classloaders if there is duplication.
>
> Where can I try this out?
>
> ~Lincoln
>
> ----- Original Message -----
> From: "Tom Cunningham"<tcunning@redhat.com>
> To: "Lincoln Baxter"<lbaxter@redhat.com>
> Sent: Saturday, December 17, 2011 1:24:57 AM
> Subject: Weird error again....
>
> Lincoln,
>
> I'm seeing a weird error on SNAPSHOT again that I think I've seen
> before.      We managed to remove the shading and got our plugins to
> work with 1.0.0-Beta3, but when I go to SNAPSHOT I'm seeing the
> exception at the bottom of this email when it tries to find
> "org.switchyard.tools.forge.plugin.SwitchYardFacet".     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 the 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@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
>       _____
>

_______________________________________________
forge-dev mailing list
forge-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev



--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"



--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"



--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"