Part of the problem is org.jboss.forge.container.modules.providers.RuntimeClasspathSpec, it does not seem to be picking up all the URLs, because it is looking at the system class loader and not the surefire class loader. You are going to have to modify it to be aware of class loader hieracies. You also need to make sure that this class is initialized with the surefire class loader, so you probably need some kind of static init(ClassLoader) method.

Hope this helps, I have a plane to board.

Stuart


On Fri, Nov 2, 2012 at 8:10 PM, Stuart Douglas <stuart.w.douglas@gmail.com> wrote:
For some reason arquillan cannot see javax.inject.Inject, and this is what is causing your problems. 

in org.jboss.arquillian.testenricher.cdi.CDIInjectionEnricher#enrich the check for isClassPresent to see if @Inject is available on the class path is failing. This is most likely due to a problem with the module definition.

I am not sure if I will have time to work out a fix before my plane leaves.  

Stuart


On Fri, Nov 2, 2012 at 12:20 PM, Lincoln Baxter, III <lincolnbaxter@gmail.com> wrote:
Re-copying lost cc's. Sorry about that.



On Thu, Nov 1, 2012 at 9:20 PM, Lincoln Baxter, III <lincolnbaxter@gmail.com> wrote:
Ah thanks. Correct you are, that would be a problem :) Can you work around this for now by removing the FAR plugin from the reactor build? I'll check in the change in a moment.



On Thu, Nov 1, 2012 at 9:18 PM, Stuart Douglas <stuart.w.douglas@gmail.com> wrote:
Basically far-maven-plugin has a dep on the parent, however the parent has a dep on far-maven-plugin.

It will work fine if you already have the parent in your local repo.

[INFO] Scanning for projects...
Downloading: http://snapshots.repository.codehaus.org/org/jboss/forge/far-maven-plugin/maven-metadata.xml
Downloading: https://repository.jboss.org/nexus/content/repositories/snapshots/org/jboss/forge/far-maven-plugin/maven-metadata.xml
Downloading: http://twdata-m2-repository.googlecode.com/svn/org/jboss/forge/far-maven-plugin/maven-metadata.xml
Downloading: https://repository.jboss.org/nexus/content/groups/public-jboss/org/jboss/forge/far-maven-plugin/maven-metadata.xml
Downloading: http://repo1.maven.org/maven2/org/jboss/forge/far-maven-plugin/maven-metadata.xml
Downloading: http://snapshots.repository.codehaus.org/org/jboss/forge/forge-parent/2.0.0-SNAPSHOT/maven-metadata.xml
Downloading: http://twdata-m2-repository.googlecode.com/svn/org/jboss/forge/forge-parent/2.0.0-SNAPSHOT/maven-metadata.xml
Downloading: https://repository.jboss.org/nexus/content/groups/public-jboss/org/jboss/forge/forge-parent/2.0.0-SNAPSHOT/maven-metadata.xml
Downloading: https://repository.jboss.org/nexus/content/repositories/snapshots/org/jboss/forge/forge-parent/2.0.0-SNAPSHOT/maven-metadata.xml
Downloading: http://snapshots.repository.codehaus.org/org/jboss/forge/forge-parent/2.0.0-SNAPSHOT/forge-parent-2.0.0-SNAPSHOT.pom
Downloading: http://twdata-m2-repository.googlecode.com/svn/org/jboss/forge/forge-parent/2.0.0-SNAPSHOT/forge-parent-2.0.0-SNAPSHOT.pom
Downloading: https://repository.jboss.org/nexus/content/groups/public-jboss/org/jboss/forge/forge-parent/2.0.0-SNAPSHOT/forge-parent-2.0.0-SNAPSHOT.pom
Downloading: https://repository.jboss.org/nexus/content/repositories/snapshots/org/jboss/forge/forge-parent/2.0.0-SNAPSHOT/forge-parent-2.0.0-SNAPSHOT.pom
[ERROR] The build could not read 2 projects -> [Help 1]
[ERROR]
[ERROR]   The project org.jboss.forge:forge-example-plugin:2.0.0-SNAPSHOT (/Users/stuartdouglas/workspace/forge/forge-example-plugin/pom.xml) has 2 errors
[ERROR]     Unresolveable build extension: Error resolving version for plugin 'org.jboss.forge:far-maven-plugin' from the repositories [local (/Users/stuartdouglas/.m2/repository), codehaus-plugins-snapshots (http://snapshots.repository.codehaus.org/), twdata-m2-repository (http://twdata-m2-repository.googlecode.com/svn/), jboss-public-repository-group (https://repository.jboss.org/nexus/content/groups/public-jboss/), jboss-snapshots-repository-group (https://repository.jboss.org/nexus/content/repositories/snapshots/), central (http://repo1.maven.org/maven2)]: Plugin not found in any plugin repository -> [Help 2]
[ERROR]     Unknown packaging: far @ line 12, column 15
[ERROR]
[ERROR]   The project org.jboss.forge:forge-otherexample-plugin:2.0.0-SNAPSHOT (/Users/stuartdouglas/workspace/forge/forge-otherexample-plugin/pom.xml) has 2 errors
[ERROR]     Unresolveable build extension: Plugin org.jboss.forge:far-maven-plugin:2.0.0-SNAPSHOT or one of its dependencies could not be resolved: Failed to collect dependencies for org.jboss.forge:far-maven-plugin:jar:2.0.0-SNAPSHOT (): Failed to read artifact descriptor for org.jboss.forge:far-maven-plugin:jar:2.0.0-SNAPSHOT: Failure to find org.jboss.forge:forge-parent:pom:2.0.0-SNAPSHOT in http://snapshots.repository.codehaus.org/ was cached in the local repository, resolution will not be reattempted until the update interval of codehaus-plugins-snapshots has elapsed or updates are forced -> [Help 3]
[ERROR]     Unknown packaging: far @ line 11, column 15
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginVersionResolutionException
[ERROR] [Help 3] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException



Lincoln Baxter, III wrote:
Could you copy the error in here? I believe you just need to build the
far-maven-plugin/ project first.


On Thu, Nov 1, 2012 at 9:01 PM, Stuart Douglas
<stuart.w.douglas@gmail.com <mailto:stuart.w.douglas@gmail.com>> wrote:

    It looks like you have circular dependencies in that branch that
    means it is not buildable with a clean maven repository (remove all
    org.jboss.forge artifacts from your local repo and you should see
    what I mean).



    Stuart

    Lincoln Baxter, III wrote:

        FYI - This is how it should look when you reproduce the problem.
        What's
        happening in this case is that Forge is starting up just fine in the
        test, but for some reason the ContainerServiceExtension is not
        intercepting the service classes deployed in one of the addons.

        This makes me think that the system classloader is being scanned
        properly, but that there is a subtle problem with the module
        structure
        defined by AddonModuleLoader that is preventing these classes
        from being
        scanned. Either that, or the ModularURLScanner class requires
        modifications to work within the Surefire environment.

        ------------------------------__-------------------------

           T E S T S
        ------------------------------__-------------------------
        Running org.example.__AddonDependencyTest
        Starting addon(s) [dependency:main]
        Nov 1, 2012 7:12:23 PM org.jboss.weld.bootstrap.__WeldBootstrap

        <clinit>
        INFO: WELD-000900 2.0.0 (Alpha3)
        Nov 1, 2012 7:12:24 PM org.jboss.weld.bootstrap.__WeldBootstrap

        startContainer
        INFO: WELD-000101 Transactional services not available. Injection of
        @Inject UserTransaction not available. Transactional observers
        will be
        invoked synchronously.
        Nov 1, 2012 7:12:24 PM
        org.jboss.weld.interceptor.__util.InterceptionTypeRegistry <clinit>

        WARNING: Class 'javax.ejb.PostActivate' not found, interception
        based on
        it is not enabled
        Nov 1, 2012 7:12:24 PM
        org.jboss.weld.interceptor.__util.InterceptionTypeRegistry <clinit>

        WARNING: Class 'javax.ejb.PrePassivate' not found, interception
        based on
        it is not enabled
        Starting container [dependency:main]
        Services loaded from addon module [dependency:main] - [class
        org.example.published.__PublishedService]
        Starting addon(s) [919307ca-cd39-46a6-a641-__ff50055f6db2:main]
        Nov 1, 2012 7:12:27 PM org.jboss.weld.bootstrap.__WeldBootstrap

        startContainer
        INFO: WELD-000101 Transactional services not available. Injection of
        @Inject UserTransaction not available. Transactional observers
        will be
        invoked synchronously.
        Starting container [919307ca-cd39-46a6-a641-__ff50055f6db2:main]
        2012-11-01 19:12:27.558:INFO:oejs.Server:__jetty-8.1.5.v20120716
        2012-11-01 19:12:27.622:INFO:oejs.__AbstractConnector:Started
        SelectChannelConnector@127.0.__0.1:4141
        <http://SelectChannelConnector@127.0.0.1:4141>
        <http://__SelectChannelConnector@127.0.__0.1:4141

        <http://SelectChannelConnector@127.0.0.1:4141>>

        Remote test server started.
        Exception in thread "919307ca-cd39-46a6-a641-__ff50055f6db2:main"
        org.jboss.forge.container.__exception.ContainerException: [Thread -
        919307ca-cd39-46a6-a641-__ff50055f6db2:main] Error invoking Task

        within
        ClassLoader [ModuleClassLoader for Module
        "919307ca-cd39-46a6-a641-__ff50055f6db2:main" from
        AddonModuleLoader]
              at
        org.jboss.forge.container.__util.ClassLoaders.executeIn(__ClassLoaders.java:33)
              at
        org.jboss.forge.container.__AddonRunnable.run(__AddonRunnable.java:41)
              at java.lang.Thread.run(Thread.__java:680)
        Caused by: java.lang.NullPointerException
              at
        org.example.consuming.__ConsumingService.getMessage(__ConsumingService.java:25)
              at
        org.example.consuming.__ConsumingService.postStartup(__ConsumingService.java:20)
              at sun.reflect.__NativeMethodAccessorImpl.__invoke0(Native
        Method)
              at
        sun.reflect.__NativeMethodAccessorImpl.__invoke(__NativeMethodAccessorImpl.java:__39)
              at
        sun.reflect.__DelegatingMethodAccessorImpl.__invoke(__DelegatingMethodAccessorImpl.__java:25)
              at java.lang.reflect.Method.__invoke(Method.java:597)
              at
        org.jboss.weld.util.__reflection.SecureReflections$__13.work(SecureReflections.__java:267)
              at
        org.jboss.weld.util.__reflection.__SecureReflectionAccess.run(__SecureReflectionAccess.java:__52)
              at
        org.jboss.weld.util.__reflection.__SecureReflectionAccess.__runAsInvocation(__SecureReflectionAccess.java:__137)
              at
        org.jboss.weld.util.__reflection.SecureReflections.__invoke(SecureReflections.java:__263)
              at
        org.jboss.weld.annotated.__runtime.__InvokableAnnotatedMethod.__invokeOnInstance(__InvokableAnnotatedMethod.java:__82)
              at
        org.jboss.weld.injection.__MethodInjectionPoint.__invokeOnInstanceWithSpecialVal__ue(MethodInjectionPoint.java:__97)
              at
        org.jboss.weld.event.__ObserverMethodImpl.sendEvent(__ObserverMethodImpl.java:259)
              at
        org.jboss.weld.event.__ObserverMethodImpl.sendEvent(__ObserverMethodImpl.java:246)
              at
        org.jboss.weld.event.__ObserverMethodImpl.notify(__ObserverMethodImpl.java:221)
              at
        org.jboss.weld.event.__ObserverMethodImpl.notify(__ObserverMethodImpl.java:225)
              at
        org.jboss.weld.event.__ObserverNotifier.__notifyObserver(__ObserverNotifier.java:129)
              at
        org.jboss.weld.event.__ObserverNotifier.__notifyObservers(__ObserverNotifier.java:97)
              at
        org.jboss.weld.event.__ObserverNotifier.fireEvent(__ObserverNotifier.java:77)
              at
        org.jboss.weld.event.__ObserverNotifier.fireEvent(__ObserverNotifier.java:70)
              at
        org.jboss.weld.manager.__BeanManagerImpl.fireEvent(__BeanManagerImpl.java:625)
              at
        org.jboss.forge.container.__ContainerControlImpl.start(__ContainerControlImpl.java:54)
              at
        org.jboss.forge.container.__ContainerControlImpl.__bootstrap(__ContainerControlImpl.java:37)
              at sun.reflect.__NativeMethodAccessorImpl.__invoke0(Native
        Method)
              at
        sun.reflect.__NativeMethodAccessorImpl.__invoke(__NativeMethodAccessorImpl.java:__39)
              at
        sun.reflect.__DelegatingMethodAccessorImpl.__invoke(__DelegatingMethodAccessorImpl.__java:25)
              at java.lang.reflect.Method.__invoke(Method.java:597)
              at
        org.jboss.weld.util.__reflection.SecureReflections$__13.work(SecureReflections.__java:267)
              at
        org.jboss.weld.util.__reflection.__SecureReflectionAccess.run(__SecureReflectionAccess.java:__52)
              at
        org.jboss.weld.util.__reflection.__SecureReflectionAccess.__runAsInvocation(__SecureReflectionAccess.java:__137)
              at
        org.jboss.weld.util.__reflection.SecureReflections.__invoke(SecureReflections.java:__263)
              at
        org.jboss.weld.annotated.__runtime.__InvokableAnnotatedMethod.__invokeOnInstance(__InvokableAnnotatedMethod.java:__82)
              at
        org.jboss.weld.injection.__MethodInjectionPoint.__invokeOnInstanceWithSpecialVal__ue(MethodInjectionPoint.java:__97)
              at
        org.jboss.weld.event.__ObserverMethodImpl.sendEvent(__ObserverMethodImpl.java:259)
              at
        org.jboss.weld.event.__ObserverMethodImpl.sendEvent(__ObserverMethodImpl.java:246)
              at
        org.jboss.weld.event.__ObserverMethodImpl.notify(__ObserverMethodImpl.java:221)
              at
        org.jboss.weld.event.__ObserverMethodImpl.notify(__ObserverMethodImpl.java:225)
              at
        org.jboss.weld.event.__ObserverNotifier.__notifyObserver(__ObserverNotifier.java:129)
              at
        org.jboss.weld.event.__ObserverNotifier.__notifyObservers(__ObserverNotifier.java:97)
              at
        org.jboss.weld.event.__ObserverNotifier.fireEvent(__ObserverNotifier.java:77)
              at
        org.jboss.weld.event.__ObserverNotifier.fireEvent(__ObserverNotifier.java:70)
              at
        org.jboss.weld.manager.__BeanManagerImpl.fireEvent(__BeanManagerImpl.java:625)
              at
        org.jboss.forge.container.__AddonRunnable$1.call(__AddonRunnable.java:57)
              at
        org.jboss.forge.container.__util.ClassLoaders.executeIn(__ClassLoaders.java:29)
              ... 2 more
        Stopping addon(s) [919307ca-cd39-46a6-a641-__ff50055f6db2:main]

        Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed:
        8.032
        sec <<< FAILURE!



        On Thu, Nov 1, 2012 at 3:51 PM, Lincoln Baxter, III
        <lincolnbaxter@gmail.com <mailto:lincolnbaxter@gmail.com>
        <mailto:lincolnbaxter@gmail.__com

        <mailto:lincolnbaxter@gmail.com>>> wrote:

             Hey Everyone!

             I've been working on Forge 2.0, and it looks like I've hit
        a very
             strange problem that I am having difficulty solving. It
        involves
             Surefire Maven Plugin and the Forge Arquillian tests.

             The tests work fine in eclipse, because Eclipse launches
        using a
             real java classpath, however...

             Because of how Surefire handles classloading
        <http://maven.apache.org/__plugins/maven-surefire-plugin/__examples/class-loading.html

        <http://maven.apache.org/plugins/maven-surefire-plugin/examples/class-loading.html>>,

             Forge is not properly finding classes, booting weld, and
        loading
             addons. I've gotten close to a solution a few times, but
        I've not
             been able to find the exact concoction that gets things
        working.

             Anyone have experience with this feel like taking a look?

             Just check out the Forge 2.0 branch from
        https://github.com/forge/core, first *cd* into the maven-far-plugin

             directory, install it with `mvn clean install`, then return
        to the
             main directory and run `mvn clean install`, you should then
        see the
             failures I am describing.

             Thanks!

             --
             Lincoln Baxter, III
        http://ocpsoft.org
        "Simpler is better."




        --
        Lincoln Baxter, III
        http://ocpsoft.org
        "Simpler is better."




--
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."



--
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."



--
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."