[forge-dev] Help needed
ggastald at redhat.com
ggastald at redhat.com
Fri Nov 9 08:24:55 EST 2012
Outstanding ! Congratulations Lincoln !
On 11/08/2012 08:02 PM, Lincoln Baxter, III wrote:
> So it turns out the only problem was that I was missing a few paths in
> the RuntimeClasspathSpec, which I only discovered when I started
> migrating it over to your suggestion of using the SystemDepSpec instead.
>
> I was missing javax/inject (lol) and net/sf/cglib/proxy, which would
> explain some of the very strange behavior... like injection points not
> being created for classes, etc. Strange that weld did not warn me... I
> will file an issue for that.
>
> If you want to see everything shiny and working, go ahead and pull
> down the latest and run a normal `mvn clean install` :)
>
> Thanks for your help!
> ~Lincoln
>
>
> On Fri, Nov 2, 2012 at 10:35 PM, Stuart Douglas
> <stuart.w.douglas at gmail.com <mailto:stuart.w.douglas at gmail.com>> wrote:
>
> Look like my last email was a bit premature. The actual problem
> seems to be that the way surefire boots is to create a jar, that
> is empty except for a MANIFEST.MF, this manifest has a Class-Path
> entry to all the classes on the class path.
>
> In order to do what you are currently doing you would need to do
> something nice and hackey like:
>
> RuntimeClasspathSpec.class.getClassLoader().getResources("")
>
> however, I don't actually see the point of RuntimeClassPathSpec,
> as you should be able to use system dependencies instead, from
> what I can see using DependencySpec.createSystemDependencySpec()
> will do exactly what you are after without resorting to any hacks.
>
> I am actually on my way to Vienna at the moment, for our AS team
> meeting in Brno. Just got off a 14 hour flight, and now have a 4
> hour layover followed by a 6 hour flight. The 10pm flight
> was definitely a mistake.
>
> Stuart
>
>
>
>
>
>
>
> On Sat, Nov 3, 2012 at 2:32 AM, Lincoln Baxter, III
> <lincolnbaxter at gmail.com <mailto:lincolnbaxter at gmail.com>> wrote:
>
> Well hey, that's good news :) I hope you have a good trip!
> Where are you headed?
>
> I'll take a look into these things, but I think you are right.
> I've been trying to modify the RuntimeClasspathSpec without
> success for a few days. You suggested an init(ClassLoader)
> method. How would I get a handle on the Surefire class loader
> and not the system class loader? Perhaps I could do this on
> the arquillian end where it starts up forge. I'll try playing
> with that.
>
> This is all so frustrating to debug because I have to start
> maven over, and over, and over...
>
> You continue to be hugely helpful :) A great mentor for the JVM!
>
> Thanks again,
> Lincoln
>
>
>
> On Fri, Nov 2, 2012 at 5:41 AM, Stuart Douglas
> <stuart.w.douglas at gmail.com
> <mailto:stuart.w.douglas at gmail.com>> wrote:
>
> 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 at gmail.com
> <mailto:stuart.w.douglas at 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 at gmail.com
> <mailto:lincolnbaxter at gmail.com>> wrote:
>
> Re-copying lost cc's. Sorry about that.
>
>
>
> On Thu, Nov 1, 2012 at 9:20 PM, Lincoln Baxter,
> III <lincolnbaxter at gmail.com
> <mailto:lincolnbaxter at 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 at gmail.com
> <mailto:stuart.w.douglas at 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)
> <http://repo1.maven.org/maven2%29>]:
> 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 at gmail.com
> <mailto:stuart.w.douglas at gmail.com>
> <mailto:stuart.w.douglas at gmail.com
> <mailto:stuart.w.douglas at 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 at 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 at gmail.com
> <mailto:lincolnbaxter at gmail.com>
> <mailto:lincolnbaxter at gmail.com
> <mailto:lincolnbaxter at gmail.com>>
> <mailto:lincolnbaxter at gmail.
> <mailto:lincolnbaxter at gmail.>__com
>
> <mailto:lincolnbaxter at gmail.com
> <mailto:lincolnbaxter at 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."
>
>
>
>
>
>
> --
> Lincoln Baxter, III
> http://ocpsoft.org
> "Simpler is better."
>
>
>
>
>
> --
> Lincoln Baxter, III
> http://ocpsoft.org
> "Simpler is better."
>
>
> _______________________________________________
> forge-dev mailing list
> forge-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-dev
--
*George Gastaldi* | /Senior Software Engineer/
JBoss Forge Team
Red Hat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-dev/attachments/20121109/e9dcc934/attachment-0001.html
More information about the forge-dev
mailing list