Thanks for the analysis, Ivan! I'm working on a fix using your findings.
~Lincoln
On Tue, Mar 6, 2012 at 6:55 PM, Ivan St. Ivanov <ivan.st.ivanov(a)gmail.com>wrote:
Here are my finding before I go to sleep (shared them in forge irc
channel
as well):
ConfigurationAdapter has two constructors: empty and with two parameters.
The empty doesn't do anything, while the other takes a delegate as one of
its parameters.
Whenever a project is not active, the empty constructor is invoked. While
when the project is active (no matter whether it has local configuration or
not), the other constructor is called and the configuration adapter gets a
delegate.
Lines 78/79 of ConfiguraionImpl take care of setting the delegate in case
of active project. maybe some kind of this may be inserted at line 107 and
remove current lines 108 and 109?
...and change line 106 to if (config == null) // not config != null
Maybe something like a default adapter can be created for such cases (non
active project)
On Wed, Mar 7, 2012 at 1:02 AM, Ivan St. Ivanov <ivan.st.ivanov(a)gmail.com>wrote:
> Please ignore my last comment
>
> On Wed, Mar 7, 2012 at 12:35 AM, Ivan St. Ivanov <
> ivan.st.ivanov(a)gmail.com> wrote:
>
>> When I run a debugger, the only difference that I saw was that the
>> ConfigurationAdapter constructor is called inside a project, while this is
>> not the case outside the project. I think I got lost in the CDI...
>>
>>
>> On Wed, Mar 7, 2012 at 12:04 AM, Lincoln Baxter, III <
>> lincolnbaxter(a)gmail.com> wrote:
>>
>>> Same problem on Linux. Looks like this is a larger issue.
>>>
>>>
>>> On Tue, Mar 6, 2012 at 4:24 PM, Ivan St. Ivanov <
>>> ivan.st.ivanov(a)gmail.com> wrote:
>>>
>>>> I got the same problem when I executed the command. However, it worked
>>>> when run in the context of a project.
>>>>
>>>> Now looking for the reason why the configuration API behaves like that
>>>>
>>>>
>>>> On Tue, Mar 6, 2012 at 3:44 PM, Lincoln Baxter, III <
>>>> lincolnbaxter(a)gmail.com> wrote:
>>>>
>>>>> Richard,
>>>>>
>>>>> What happens if you create an empty ~/.forge/config.xml file?
>>>>>
>>>>> ~Lincoln
>>>>>
>>>>>
>>>>> On Tue, Mar 6, 2012 at 8:37 AM, Lincoln Baxter, III <
>>>>> lincolnbaxter(a)gmail.com> wrote:
>>>>>
>>>>>> Ok, thanks Ivan. If that's the case, this seems like a bug we
can
>>>>>> fix by automatically creating the config.xml file if none exists.
It should
>>>>>> be doing that already, which is surprising to me.
>>>>>>
>>>>>> ~Lincoln
>>>>>>
>>>>>>
>>>>>> On Tue, Mar 6, 2012 at 3:52 AM, Ivan St. Ivanov <
>>>>>> ivan.st.ivanov(a)gmail.com> wrote:
>>>>>>
>>>>>>> Hmmm, that seems to be in the code that checks in the user
>>>>>>> configuration whether you have a proxy installed. Maybe:
>>>>>>>
>>>>>>> Configuration proxyConfig =
>>>>>>> configuration.getScopedConfiguration(
>>>>>>> ConfigurationScope.USER);
>>>>>>>
>>>>>>> doesn't work when you don't have config.xml in your
~/.forge
>>>>>>> directory.
>>>>>>>
>>>>>>> I'll check this when I go home this evening! :-)
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Ivan
>>>>>>>
>>>>>>> On Tue, Mar 6, 2012 at 8:12 AM, Richard Kennard <
>>>>>>> richard(a)kennardconsulting.com> wrote:
>>>>>>>
>>>>>>>> It was a clean install. I had already deleted ~/.forge
>>>>>>>>
>>>>>>>> On 6/03/2012 5:07 PM, Lincoln Baxter, III wrote:
>>>>>>>> > Hmm.. it looks like something is blowing up in the
>>>>>>>> configuration. This is not expected.
>>>>>>>> >
>>>>>>>> > Caused by: java.lang.IllegalStateException
>>>>>>>> > at
>>>>>>>>
org.jboss.forge.shell.env.ScopedConfigurationAdapter.getScopedConfiguration(ScopedConfigurationAdapter.java:74)
>>>>>>>> > at
>>>>>>>>
org.jboss.forge.shell.env.ConfigurationAdapter.getScopedConfiguration(ConfigurationAdapter.java:59)
>>>>>>>> > ... 45 more
>>>>>>>> >
>>>>>>>> > Do you have any plugins installed? What happens when
you delete
>>>>>>>> your ~/.forge/* ?
>>>>>>>> >
>>>>>>>> > ~Lincoln
>>>>>>>> >
>>>>>>>> >
>>>>>>>> > On Mon, Mar 5, 2012 at 7:15 PM, Richard Kennard
<
>>>>>>>> richard(a)kennardconsulting.com <mailto:
>>>>>>>> richard(a)kennardconsulting.com>> wrote:
>>>>>>>> >
>>>>>>>> > Hi guys,
>>>>>>>> >
>>>>>>>> > On Windows, under a clean install, I see the
stack below.
>>>>>>>> It's fine if I first create a new-project. Is this
expected behaviour?
>>>>>>>> >
>>>>>>>> > ---
>>>>>>>> >
>>>>>>>> > Microsoft Windows [Version 6.1.7601]
>>>>>>>> > Copyright (c) 2009 Microsoft Corporation. All
rights
>>>>>>>> reserved.
>>>>>>>> >
>>>>>>>> > C:\Users\Richard>z:
>>>>>>>> >
>>>>>>>> > Z:\>cd forge-distribution-1.0.0.Final
>>>>>>>> >
>>>>>>>> > Z:\forge-distribution-1.0.0.Final>bin\forge
>>>>>>>> > _____
>>>>>>>> > | ___|__ _ __ __ _ ___
>>>>>>>> > | |_ / _ \| `__/ _` |/ _ \ \\
>>>>>>>> > | _| (_) | | | (_| | __/ //
>>>>>>>> > |_| \___/|_| \__, |\___|
>>>>>>>> > |___/
>>>>>>>> >
>>>>>>>> > Windows? Really? Okay...
>>>>>>>> >
>>>>>>>> > [no project] forge-distribution-1.0.0.Final $
set VERBOSE
>>>>>>>> true
>>>>>>>> > set VERBOSE true
>>>>>>>> > [no project] forge-distribution-1.0.0.Final $
>>>>>>>> > [no project] forge-distribution-1.0.0.Final $
forge
>>>>>>>> git-plugin
git://github.com/forge/scaffold-aerogear.git
>>>>>>>> >
<
http://github.com/forge/scaffold-aerogear.git>
>>>>>>>> > ***ERROR*** [forge git-plugin] null
>>>>>>>> >
org.jboss.forge.shell.exceptions.CommandExecutionException
>>>>>>>> > at
>>>>>>>>
org.jboss.forge.shell.command.Execution.perform(Execution.java:153)
>>>>>>>> > at
>>>>>>>>
org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:125)
>>>>>>>> > at
>>>>>>>>
org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:63)
>>>>>>>> > at
>>>>>>>>
org.jboss.forge.shell.ShellImpl$ExecutorThread.run(ShellImpl.java:829)
>>>>>>>> > at
>>>>>>>>
org.jboss.forge.shell.ShellImpl.execute(ShellImpl.java:852)
>>>>>>>> > at
>>>>>>>>
org.jboss.forge.shell.ShellImpl.doShell(ShellImpl.java:642)
>>>>>>>> > 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.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: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: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:120)
>>>>>>>> > at
java.lang.Thread.run(Thread.java:662)
>>>>>>>> > Caused by:
java.lang.reflect.InvocationTargetException
>>>>>>>> > 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.forge.shell.command.Execution.perform(Execution.java:149)
>>>>>>>> > ... 31 more
>>>>>>>> > Caused by:
java.lang.reflect.InvocationTargetException
>>>>>>>> > 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.solder.unwraps.UnwrapsInvocationHandler.invoke(UnwrapsInvocationHandler.java:82)
>>>>>>>> > at
>>>>>>>>
org.javassist.tmp.java.lang.Object_$$_javassist_0.getScopedConfiguration(Object_$$_javassist_0.java)
>>>>>>>> > at
>>>>>>>>
org.jboss.forge.shell.plugins.builtin.ForgePlugin.getProxySettings(ForgePlugin.java:190)
>>>>>>>> > at
>>>>>>>>
org.jboss.forge.shell.plugins.builtin.ForgePlugin.prepareProxyForJGit(ForgePlugin.java:472)
>>>>>>>> > at
>>>>>>>>
org.jboss.forge.shell.plugins.builtin.ForgePlugin.installFromGit(ForgePlugin.java:405)
>>>>>>>> > ... 36 more
>>>>>>>> > Caused by: java.lang.IllegalStateException
>>>>>>>> > at
>>>>>>>>
org.jboss.forge.shell.env.ScopedConfigurationAdapter.getScopedConfiguration(ScopedConfigurationAdapter.java:74)
>>>>>>>> > at
>>>>>>>>
org.jboss.forge.shell.env.ConfigurationAdapter.getScopedConfiguration(ConfigurationAdapter.java:59)
>>>>>>>> > ... 45 more
>>>>>>>> > [no project] forge-distribution-1.0.0.Final $
>>>>>>>> > _______________________________________________
>>>>>>>> > forge-dev mailing list
>>>>>>>> > forge-dev(a)lists.jboss.org
<mailto:forge-dev@lists.jboss.org>
>>>>>>>> >
https://lists.jboss.org/mailman/listinfo/forge-dev
>>>>>>>> >
>>>>>>>> >
>>>>>>>> >
>>>>>>>> >
>>>>>>>> > --
>>>>>>>> > Lincoln Baxter, III
>>>>>>>> >
http://ocpsoft.com
>>>>>>>> >
http://scrumshark.com
>>>>>>>> > "Keep it Simple"
>>>>>>>> >
>>>>>>>> >
>>>>>>>> > _______________________________________________
>>>>>>>> > forge-dev mailing list
>>>>>>>> > forge-dev(a)lists.jboss.org
>>>>>>>> >
https://lists.jboss.org/mailman/listinfo/forge-dev
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> forge-dev mailing list
>>>>>>>> forge-dev(a)lists.jboss.org
>>>>>>>>
https://lists.jboss.org/mailman/listinfo/forge-dev
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> forge-dev mailing list
>>>>>>> forge-dev(a)lists.jboss.org
>>>>>>>
https://lists.jboss.org/mailman/listinfo/forge-dev
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Lincoln Baxter, III
>>>>>>
http://ocpsoft.com
>>>>>>
http://scrumshark.com
>>>>>> "Keep it Simple"
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Lincoln Baxter, III
>>>>>
http://ocpsoft.com
>>>>>
http://scrumshark.com
>>>>> "Keep it Simple"
>>>>>
>>>>> _______________________________________________
>>>>> forge-dev mailing list
>>>>> forge-dev(a)lists.jboss.org
>>>>>
https://lists.jboss.org/mailman/listinfo/forge-dev
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> forge-dev mailing list
>>>> forge-dev(a)lists.jboss.org
>>>>
https://lists.jboss.org/mailman/listinfo/forge-dev
>>>>
>>>>
>>>
>>>
>>> --
>>> Lincoln Baxter, III
>>>
http://ocpsoft.com
>>>
http://scrumshark.com
>>> "Keep it Simple"
>>>
>>> _______________________________________________
>>> forge-dev mailing list
>>> forge-dev(a)lists.jboss.org
>>>
https://lists.jboss.org/mailman/listinfo/forge-dev
>>>
>>>
>>
>
_______________________________________________
forge-dev mailing list
forge-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev