[forge-dev] Updates AS7 Plugin

Lincoln Baxter, III lincolnbaxter at gmail.com
Tue Apr 30 00:38:13 EDT 2013


I was thinking about this. Since Facets are inherently ProjectScoped,
there's no point to use ProjectScoped on your class. Just make it
@Dependent and you should be fine. If you need to share this object outside
of the Facet, then I would create an accessor (getter) for it on the Facet,
and make it available that way.

You can always do something like:
@Inject @Current Project project;

and then
project.getFacet(AS7Facet.class).getProjectConfiguration().

WDYT?




On Mon, Apr 29, 2013 at 6:06 PM, James R. Perkins <jperkins at redhat.com>wrote:

>  My guess is it's an issue using an @ProjectScoped injection point,
> https://github.com/forge/plugin-jboss-as/blob/master/src/main/java/org/jboss/as/forge/ProjectConfiguration.java
> .
>
> What is the best way to check that a valid ProjectConfiguration was
> injected or am I just doing this wrong?
>
>
> On 04/28/2013 12:23 PM, Lincoln Baxter, III wrote:
>
> I should have provided a full stack trace. Silly me!
>
>  [no project] Desktop $ new-project --named example2
>  ? Use [/Users/lb3/Desktop/example2] as project directory? [Y/n]
> Wrote /Users/lb3/Desktop/example2
> Wrote /Users/lb3/Desktop/example2/pom.xml
> Wrote /Users/lb3/Desktop/example2/src/main/java
> Wrote /Users/lb3/Desktop/example2/src/test/java
> Wrote /Users/lb3/Desktop/example2/src/main/resources
> Wrote /Users/lb3/Desktop/example2/src/test/resources
> ***ERROR*** Exception encountered: (type "set VERBOSE false" to disable
> stack traces)
> org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active
> contexts for scope type org.jboss.forge.shell.project.ProjectScoped
>  at
> org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:667)
>  at
> org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:77)
>  at
> org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:87)
>  at
> org.jboss.as.forge.ProjectConfiguration$Proxy$_$$_WeldClientProxy.getJbossHome(ProjectConfiguration$Proxy$_$$_WeldClientProxy.java)
>  at org.jboss.as.forge.AS7ServerFacet.isInstalled(AS7ServerFacet.java:92)
>  at
> org.jboss.forge.project.BaseProject.registerFacet(BaseProject.java:153)
>  at
> org.jboss.forge.project.services.ProjectFactory.registerSingleFacet(ProjectFactory.java:208)
>  at
> org.jboss.forge.project.services.ProjectFactory.registerSingleFacet(ProjectFactory.java:186)
>  at
> org.jboss.forge.project.services.ProjectFactory.registerFacets(ProjectFactory.java:178)
>  at
> org.jboss.forge.project.services.ProjectFactory.createProject(ProjectFactory.java:146)
>  at
> org.jboss.forge.shell.plugins.builtin.NewProjectPlugin.create(NewProjectPlugin.java:205)
>  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)
>
>
> On Sun, Apr 28, 2013 at 3:21 PM, Lincoln Baxter, III <
> lincolnbaxter at gmail.com> wrote:
>
>> If that's the case, then just use the `protected Project` or `public
>> getProject()` in the Facet instead! :D
>>
>>
>> On Sun, Apr 28, 2013 at 11:33 AM, George Gastaldi <ggastald at redhat.com>wrote:
>>
>>>  Check if you're not using @Inject Project project; inside a facet. I
>>> get this error by doing this.
>>>
>>> Em 28/04/2013, às 11:20, "Lincoln Baxter, III" <lincolnbaxter at gmail.com>
>>> escreveu:
>>>
>>>    Hey James,
>>>
>>>  I've had a chance to try this out, and it seems like your plugin
>>> changes introduce a scenario where `new-project` fails:
>>>
>>>
>>> [no project] Desktop $ new-project --named example
>>>  ? Use [/Users/lb3/Desktop/example] as project directory? [Y/n]
>>> Wrote /Users/lb3/Desktop/example
>>> Wrote /Users/lb3/Desktop/example/pom.xml
>>> Wrote /Users/lb3/Desktop/example/src/main/java
>>> Wrote /Users/lb3/Desktop/example/src/test/java
>>> Wrote /Users/lb3/Desktop/example/src/main/resources
>>> Wrote /Users/lb3/Desktop/example/src/test/resources
>>> ***ERROR*** Exception encountered: WELD-001303 No active contexts for
>>> scope type org.jboss.forge.shell.project.ProjectScoped (type "set VERBOSE
>>> true" to enable stack traces)
>>> [no project] Desktop $ cd example/
>>> [generated-pom] example $ ls
>>> [generated-pom] example $ project
>>>  name: generated-pom
>>>  groupId:  org.jboss.forge.generated
>>>  final artifact:  generated-pom-1.0.0-SNAPSHOT.jar
>>>  packaging:  jar
>>>  dir:  /Users/lb3/Desktop/example
>>> [generated-pom] example $
>>>
>>>
>>>
>>> On Tue, Apr 23, 2013 at 5:44 PM, James R. Perkins <jperkins at redhat.com>wrote:
>>>
>>>>  Just bumping this to see if anyone had a chance to review it.
>>>>
>>>>
>>>> On 04/04/2013 07:23 PM, Lincoln Baxter, III wrote:
>>>>
>>>> Hey James! I'll take a look when I'm back from this trip, but I'm sure
>>>> it's great :)
>>>>
>>>>
>>>> On Thu, Apr 4, 2013 at 8:52 PM, James R. Perkins <jperkins at redhat.com>wrote:
>>>>
>>>>>  Hello All,
>>>>> I've spent some time the past 2 weeks attempting to clean up the AS7
>>>>> plugin. The goal was to clear up the confusing prompts and fix bugs with
>>>>> the initial approach.
>>>>>
>>>>> I also added a couple new commands:
>>>>> - override: This command allows you to override the hostname and port
>>>>> for managing servers listening on different hostnames or ports.
>>>>> - print-console: This option prints the console output captured if the
>>>>> server was started with the as7 start command.
>>>>>
>>>>> I will follow up with a PR documenting the plugin better.
>>>>>
>>>>> If anyone feels like reviewing and/or testing the plugin to make sure
>>>>> it makes sense I would greatly appreciate it. The PR is located here
>>>>> https://github.com/forge/plugin-jboss-as/pull/8.
>>>>>
>>>>> --
>>>>> James R. Perkins
>>>>> JBoss by Red Hat
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> forge-dev mailing list
>>>>> forge-dev at lists.jboss.org
>>>>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Lincoln Baxter, III
>>>> http://ocpsoft.org
>>>> "Simpler is better."
>>>>
>>>>
>>>> _______________________________________________
>>>> forge-dev mailing listforge-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/forge-dev
>>>>
>>>>
>>>> --
>>>> James R. Perkins
>>>> JBoss by Red Hat
>>>>
>>>>
>>>> _______________________________________________
>>>> forge-dev mailing list
>>>> forge-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>>>
>>>
>>>
>>>
>>>  --
>>> 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
>>>
>>>
>>> _______________________________________________
>>> forge-dev mailing list
>>> forge-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>>
>>
>>
>>
>>  --
>> Lincoln Baxter, III
>> http://ocpsoft.org
>> "Simpler is better."
>>
>
>
>
>  --
> Lincoln Baxter, III
> http://ocpsoft.org
> "Simpler is better."
>
>
> _______________________________________________
> forge-dev mailing listforge-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/forge-dev
>
>
> --
> James R. Perkins
> JBoss by Red Hat
>
>
> _______________________________________________
> forge-dev mailing list
> forge-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-dev
>



-- 
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-dev/attachments/20130430/5d5190ac/attachment-0001.html 


More information about the forge-dev mailing list