FYI - This is how it should look when you reproduce the problem. What&#39;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. <br>
<br>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.<br>
<br>-------------------------------------------------------<br> T E S T S<br>-------------------------------------------------------<br>Running org.example.AddonDependencyTest<br>Starting addon(s) [dependency:main]<br>Nov 1, 2012 7:12:23 PM org.jboss.weld.bootstrap.WeldBootstrap &lt;clinit&gt;<br>
INFO: WELD-000900 2.0.0 (Alpha3)<br>Nov 1, 2012 7:12:24 PM org.jboss.weld.bootstrap.WeldBootstrap startContainer<br>INFO: WELD-000101 Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.<br>
Nov 1, 2012 7:12:24 PM org.jboss.weld.interceptor.util.InterceptionTypeRegistry &lt;clinit&gt;<br>WARNING: Class &#39;javax.ejb.PostActivate&#39; not found, interception based on it is not enabled<br>Nov 1, 2012 7:12:24 PM org.jboss.weld.interceptor.util.InterceptionTypeRegistry &lt;clinit&gt;<br>
WARNING: Class &#39;javax.ejb.PrePassivate&#39; not found, interception based on it is not enabled<br>Starting container [dependency:main]<br>Services loaded from addon module [dependency:main] - [class org.example.published.PublishedService]<br>
Starting addon(s) [919307ca-cd39-46a6-a641-ff50055f6db2:main]<br>Nov 1, 2012 7:12:27 PM org.jboss.weld.bootstrap.WeldBootstrap startContainer<br>INFO: WELD-000101 Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.<br>
Starting container [919307ca-cd39-46a6-a641-ff50055f6db2:main]<br>2012-11-01 19:12:27.558:INFO:oejs.Server:jetty-8.1.5.v20120716<br>2012-11-01 19:12:27.622:INFO:oejs.AbstractConnector:Started <a href="http://SelectChannelConnector@127.0.0.1:4141">SelectChannelConnector@127.0.0.1:4141</a><br>
Remote test server started.<br>Exception in thread &quot;919307ca-cd39-46a6-a641-ff50055f6db2:main&quot; org.jboss.forge.container.exception.ContainerException: [Thread - 919307ca-cd39-46a6-a641-ff50055f6db2:main] Error invoking Task within ClassLoader [ModuleClassLoader for Module &quot;919307ca-cd39-46a6-a641-ff50055f6db2:main&quot; from AddonModuleLoader]<br>
    at org.jboss.forge.container.util.ClassLoaders.executeIn(ClassLoaders.java:33)<br>    at org.jboss.forge.container.AddonRunnable.run(AddonRunnable.java:41)<br>    at java.lang.Thread.run(Thread.java:680)<br>Caused by: java.lang.NullPointerException<br>
    at org.example.consuming.ConsumingService.getMessage(ConsumingService.java:25)<br>    at org.example.consuming.ConsumingService.postStartup(ConsumingService.java:20)<br>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>    at java.lang.reflect.Method.invoke(Method.java:597)<br>
    at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:267)<br>    at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)<br>    at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)<br>
    at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263)<br>    at org.jboss.weld.annotated.runtime.InvokableAnnotatedMethod.invokeOnInstance(InvokableAnnotatedMethod.java:82)<br>    at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:97)<br>
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:259)<br>    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:246)<br>    at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:221)<br>
    at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:225)<br>    at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:129)<br>    at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:97)<br>
    at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:77)<br>    at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:70)<br>    at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:625)<br>
    at org.jboss.forge.container.ContainerControlImpl.start(ContainerControlImpl.java:54)<br>    at org.jboss.forge.container.ContainerControlImpl.bootstrap(ContainerControlImpl.java:37)<br>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>    at java.lang.reflect.Method.invoke(Method.java:597)<br>
    at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:267)<br>    at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)<br>    at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)<br>
    at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263)<br>    at org.jboss.weld.annotated.runtime.InvokableAnnotatedMethod.invokeOnInstance(InvokableAnnotatedMethod.java:82)<br>    at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:97)<br>
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:259)<br>    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:246)<br>    at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:221)<br>
    at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:225)<br>    at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:129)<br>    at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:97)<br>
    at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:77)<br>    at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:70)<br>    at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:625)<br>
    at org.jboss.forge.container.AddonRunnable$1.call(AddonRunnable.java:57)<br>    at org.jboss.forge.container.util.ClassLoaders.executeIn(ClassLoaders.java:29)<br>    ... 2 more<br>Stopping addon(s) [919307ca-cd39-46a6-a641-ff50055f6db2:main]<br>
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 8.032 sec &lt;&lt;&lt; FAILURE!<br><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 1, 2012 at 3:51 PM, Lincoln Baxter, III <span dir="ltr">&lt;<a href="mailto:lincolnbaxter@gmail.com" target="_blank">lincolnbaxter@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey Everyone!<br><br>I&#39;ve been working on Forge 2.0, and it looks like I&#39;ve hit a very strange problem that I am having difficulty solving. It involves Surefire Maven Plugin and the Forge Arquillian tests.<br>
<br>The tests work fine in eclipse, because Eclipse launches using a real java classpath, however...<br>
<br>Because of how Surefire handles <a href="http://maven.apache.org/plugins/maven-surefire-plugin/examples/class-loading.html" target="_blank">classloading</a>, Forge is not properly finding classes, booting weld, and loading addons. I&#39;ve gotten close to a solution a few times, but I&#39;ve not been able to find the exact concoction that gets things working.<br clear="all">

<br>Anyone have experience with this feel like taking a look?<br><br>Just check out the Forge 2.0 branch from <a href="https://github.com/forge/core" target="_blank">https://github.com/forge/core</a>, first <b>cd</b> 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.<br>

<br>Thanks!<span class="HOEnZb"><font color="#888888"><br><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>&quot;Simpler is better.&quot;<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>&quot;Simpler is better.&quot;<br>
</div>