5 Replies Latest reply on May 18, 2013 10:06 AM by Lincoln Baxter III

    Problems accessing MavenCoreFacet in a utils class (external project)

    Newbie

      Hello,

       

      Question:

      Does anyone know why the code works fine when everything is in one project and not when I have the code in a project which the plugin project depends on ?

       

      Context:

      I have made some plugins, which works great when I place all code in one project, but fails when I moved some code to a utils project (when that code uses the MavenCoreFacet .class)

       

      I refactored my plugins proejct into several projects (one for each plugin and one for util classes used by all).

      I now get a problem when calling a util class function from a plugin, when the util class uses the MavenCoreFacet class, otherwise everything works great.

       

       

      Tried this:

      I have tried to add the following dependency to both the plugin project and the utils project, but I get the same error:

      <dependency>

                <groupId>org.jboss.forge</groupId>

                <artifactId>forge-maven-api</artifactId>

                <scope>provided</scope>

      </dependency>

       

       

      Error logs

      I get the following errors, the first one when running the command and the second one when I run the same command but with "set VERBOSE true".

       

      ***ERROR*** Exception encountered: org.jboss.forge.maven.MavenCoreFacet from [Module "se.miman.forge.plugin.camel.camel-

      forge-plugin-impl.dependencies:1.0.0-SNAPSHOT-d82baf7e-096d-4185-a068-4e6d2a9a4876" from local module loader @94265ae (r

      oots: C:\Dev\tools\jboss\forge-distribution-1.2.3.Final\modules,C:\Users\Mikael\.forge\plugins,D:\code\test)] (type "set

      VERBOSE true" to enable stack traces)

       

       

      Verbose

       

      java.lang.NoClassDefFoundError: org/jboss/forge/maven/MavenCoreFacet

              at se.miman.forge.plugin.util.NazgulPrjUtil.getParentProjectId(NazgulPrjUtil.java:43)

              at se.miman.forge.plugin.camel.facet.CamelWebPrjFacet.configureProject(CamelWebPrjFacet.java:109)

              at se.miman.forge.plugin.camel.facet.CamelWebPrjFacet.install(CamelWebPrjFacet.java:73)

              at org.jboss.forge.project.BaseProject.performInstallation(BaseProject.java:240)

              at org.jboss.forge.project.BaseProject.installFacet(BaseProject.java:166)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              at java.lang.reflect.Method.invoke(Method.java:601)

              at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:48)

              at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125)

              at org.jboss.weld.proxies.Project$-1946286523$Proxy$_$$_WeldClientProxy.installFacet(Project$-1946286523$Proxy$_

      $$_WeldClientProxy.java)

              at org.jboss.forge.shell.project.FacetInstallationHandler.performInstallation(FacetInstallationHandler.java:105)

       

       

              at org.jboss.forge.shell.project.FacetInstallationHandler.install(FacetInstallationHandler.java:81)

              at org.jboss.forge.shell.project.FacetInstallationHandler.installRequest(FacetInstallationHandler.java:59)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              at java.lang.reflect.Method.invoke(Method.java:601)

              at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)

              at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)

              at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)

              at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)

              at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)

              at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)

              at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)

       

       

              at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:282)

              at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265)

              at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234)

              at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:635)

              at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:628)

              at org.jboss.weld.event.EventImpl.fire(EventImpl.java:75)

              at se.miman.forge.plugin.camel.CamelWebPlugin.setup(CamelWebPlugin.java:54)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              at java.lang.reflect.Method.invoke(Method.java:601)

              at org.jboss.forge.shell.command.Execution.perform(Execution.java:141)

              at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:109)

              at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:47)

              at org.jboss.forge.shell.command.fshparser.FSHRuntime.shell(FSHRuntime.java:117)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              at java.lang.reflect.Method.invoke(Method.java:601)

              at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:1104)

              at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:987)

              at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:3

      44)

              at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:

      143)

              at org.mvel2.optimizers.dynamic.DynamicOptimizer.optimizeAccessor(DynamicOptimizer.java:67)

              at org.mvel2.ast.ASTNode.optimize(ASTNode.java:159)

              at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:115)

              at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)

              at org.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:123)

              at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:119)

              at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:113)

              at org.mvel2.ast.Function.call(Function.java:157)

              at org.mvel2.PropertyAccessor.getMethod(PropertyAccessor.java:885)

              at org.mvel2.PropertyAccessor.getNormal(PropertyAccessor.java:181)

              at org.mvel2.PropertyAccessor.get(PropertyAccessor.java:147)

              at org.mvel2.PropertyAccessor.get(PropertyAccessor.java:127)

              at org.mvel2.ast.ASTNode.getReducedValue(ASTNode.java:187)

              at org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:106)

              at org.mvel2.MVELInterpretedRuntime.parse(MVELInterpretedRuntime.java:49)

              at org.mvel2.MVEL.eval(MVEL.java:185)

              at org.jboss.forge.shell.command.fshparser.Parse.executeScript(Parse.java:138)

              at org.jboss.forge.shell.command.fshparser.AutoReducingQueue.reduce(AutoReducingQueue.java:84)

              at org.jboss.forge.shell.command.fshparser.AutoReducingQueue.peek(AutoReducingQueue.java:75)

              at org.jboss.forge.shell.command.fshparser.AutoReducingQueue$1.next(AutoReducingQueue.java:171)

              at org.jboss.forge.shell.command.fshparser.AutoReducingQueue$1.next(AutoReducingQueue.java:159)

              at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:78)

              at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:47)

              at org.jboss.forge.shell.ShellImpl$ExecutorThread.run(ShellImpl.java:789)

              at org.jboss.forge.shell.ShellImpl.execute(ShellImpl.java:812)

              at org.jboss.forge.shell.ShellImpl.execute(ShellImpl.java:931)

              at org.jboss.forge.shell.ShellImpl$Proxy$_$$_WeldClientProxy.execute(ShellImpl$Proxy$_$$_WeldClientProxy.java)

              at org.jboss.forge.shell.plugins.builtin.RunPlugin.run(RunPlugin.java:46)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              at java.lang.reflect.Method.invoke(Method.java:601)

              at org.jboss.forge.shell.command.Execution.perform(Execution.java:141)

              at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:109)

              at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:47)

              at org.jboss.forge.shell.ShellImpl$ExecutorThread.run(ShellImpl.java:789)

              at org.jboss.forge.shell.ShellImpl.execute(ShellImpl.java:812)

              at org.jboss.forge.shell.ShellImpl.doShell(ShellImpl.java:602)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              at java.lang.reflect.Method.invoke(Method.java:601)

              at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:48)

              at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125)

              at org.jboss.forge.shell.ShellImpl$Proxy$_$$_WeldClientProxy.doShell(ShellImpl$Proxy$_$$_WeldClientProxy.java)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              at java.lang.reflect.Method.invoke(Method.java:601)

              at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)

              at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)

              at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)

              at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)

              at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)

              at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)

              at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)

       

       

              at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:282)

              at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265)

              at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234)

              at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:635)

              at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:622)

              at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:616)

              at org.jboss.forge.shell.Bootstrap$1.run(Bootstrap.java:172)

              at java.lang.Thread.run(Thread.java:722)