You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by "Kirchev, Lazar" <l....@sap.com> on 2011/04/21 13:53:11 UTC

Exception when starting gogo

Hello,

I am using Gogo 0.8.0 and I run it with Equinox. I noticed that when Gogo starts, an exception is printed before the Gogo prompt becomes available. The exception is caused by the execution of the default gosh_profile script in org.apache.felix.gogo.shell bundle. Particularly the fragment ${.context} bundle 0 in addcommand system ((${.context} bundle 0) loadclass java.lang.System) is not evaluated correctly. The evaluation tries to call BundleContext.getBundle(String location) with argument 0, instead of BundleContext.getBundle(long id). The evaluation returns null, because there is no bundle with such location and the whole evaluation fails with the exception bundleresource://3.fwk25675100/gosh_profile: ERROR: java.lang.RuntimeException: Command name evaluates to null: ${.context} bundle 0.

Any workaround for this? However, it is not a big problem, since the shell is fully operational after that.

Regards,
Lazar



Re: Exception when starting gogo

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 4/21/11 11:15, Derek Baum wrote:
> On 21 April 2011 15:57, Richard S. Hall<he...@ungoverned.org>  wrote:
>
>> On 4/21/11 9:00, Derek Baum wrote:
>>
>>>   I tripped across this yesterday.
>>>
>>>   I've explained the problem in this jira:
>>>
>>>   https://issues.apache.org/jira/browse/FELIX-2927
>>>
>>>   The work-around is to replace
>>>
>>>   bundle 0
>>>
>>>   with
>>>
>>>   (bundles) 0
>>>
>> I suppose you could also do:
>>
>>     bundle "System Bundle"
>>
>> Right?
>>
>> ->  richard
>>
> Not unless "System Bundle" happens to be the location of the bundle:
>
>
>     public Bundle getBundle( String location )
>
> Parameter location - The location of the bundle to retrieve.

"System Bundle" is the standard location of the system bundle...it is in 
o.o.f.Constants.

-> richard

> Returns - the bundle with the specified location.
>
> A Bundle object or null if the location does not match any installed bundle.
>
> Since: 1.6
>
>
>
> Derek
>
>
>
>
>>
>>>   the former attempts to invoke getBundle(long) but actually invokes
>>>   getBundle(String)
>>>
>>>   the latter invokes getBundles() and then returns the first element.
>>>
>>>
>>>
>>>
>>>
>>>   On 21 April 2011 12:53, Kirchev, Lazar<l....@sap.com>  wrote:
>>>
>>>> Hello,
>>>>
>>>> I am using Gogo 0.8.0 and I run it with Equinox. I noticed that
>>>> when Gogo starts, an exception is printed before the Gogo prompt
>>>> becomes available. The exception is caused by the execution of the
>>>> default gosh_profile script in org.apache.felix.gogo.shell bundle.
>>>> Particularly the fragment ${.context} bundle 0 in addcommand system
>>>> ((${.context} bundle 0) loadclass java.lang.System) is not
>>>> evaluated correctly. The evaluation tries to call
>>>> BundleContext.getBundle(String location) with argument 0, instead
>>>> of BundleContext.getBundle(long id). The evaluation returns null,
>>>> because there is no bundle with such location and the whole
>>>> evaluation fails with the exception
>>>> bundleresource://3.fwk25675100/gosh_profile: ERROR:
>>>> java.lang.RuntimeException: Command name evaluates to null:
>>>> ${.context} bundle 0.
>>>>
>>>> Any workaround for this? However, it is not a big problem, since
>>>> the shell is fully operational after that.
>>>>
>>>> Regards, Lazar
>>>>
>>>>
>>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Exception when starting gogo

Posted by Derek Baum <de...@paremus.com>.
On 21 April 2011 15:57, Richard S. Hall <he...@ungoverned.org> wrote:

> On 4/21/11 9:00, Derek Baum wrote:
>
>>  I tripped across this yesterday.
>>
>>  I've explained the problem in this jira:
>>
>>  https://issues.apache.org/jira/browse/FELIX-2927
>>
>>  The work-around is to replace
>>
>>  bundle 0
>>
>>  with
>>
>>  (bundles) 0
>>
>
> I suppose you could also do:
>
>    bundle "System Bundle"
>
> Right?
>
> -> richard
>

Not unless "System Bundle" happens to be the location of the bundle:


   public Bundle getBundle( String location )

Parameter location - The location of the bundle to retrieve.

Returns - the bundle with the specified location.

A Bundle object or null if the location does not match any installed bundle.

Since: 1.6



Derek




>
>
>>  the former attempts to invoke getBundle(long) but actually invokes
>>  getBundle(String)
>>
>>  the latter invokes getBundles() and then returns the first element.
>>
>>
>>
>>
>>
>>  On 21 April 2011 12:53, Kirchev, Lazar <l....@sap.com> wrote:
>>
>> > Hello,
>> >
>> > I am using Gogo 0.8.0 and I run it with Equinox. I noticed that
>> > when Gogo starts, an exception is printed before the Gogo prompt
>> > becomes available. The exception is caused by the execution of the
>> > default gosh_profile script in org.apache.felix.gogo.shell bundle.
>> > Particularly the fragment ${.context} bundle 0 in addcommand system
>> > ((${.context} bundle 0) loadclass java.lang.System) is not
>> > evaluated correctly. The evaluation tries to call
>> > BundleContext.getBundle(String location) with argument 0, instead
>> > of BundleContext.getBundle(long id). The evaluation returns null,
>> > because there is no bundle with such location and the whole
>> > evaluation fails with the exception
>> > bundleresource://3.fwk25675100/gosh_profile: ERROR:
>> > java.lang.RuntimeException: Command name evaluates to null:
>> > ${.context} bundle 0.
>> >
>> > Any workaround for this? However, it is not a big problem, since
>> > the shell is fully operational after that.
>> >
>> > Regards, Lazar
>> >
>> >
>> >
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Exception when starting gogo

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 4/21/11 9:00, Derek Baum wrote:
>  I tripped across this yesterday.
>
>  I've explained the problem in this jira:
>
>  https://issues.apache.org/jira/browse/FELIX-2927
>
>  The work-around is to replace
>
>  bundle 0
>
>  with
>
>  (bundles) 0

I suppose you could also do:

     bundle "System Bundle"

Right?

-> richard

>
>  the former attempts to invoke getBundle(long) but actually invokes
>  getBundle(String)
>
>  the latter invokes getBundles() and then returns the first element.
>
>
>
>
>
>  On 21 April 2011 12:53, Kirchev, Lazar <l....@sap.com> wrote:
>
> > Hello,
> >
> > I am using Gogo 0.8.0 and I run it with Equinox. I noticed that
> > when Gogo starts, an exception is printed before the Gogo prompt
> > becomes available. The exception is caused by the execution of the
> > default gosh_profile script in org.apache.felix.gogo.shell bundle.
> > Particularly the fragment ${.context} bundle 0 in addcommand system
> > ((${.context} bundle 0) loadclass java.lang.System) is not
> > evaluated correctly. The evaluation tries to call
> > BundleContext.getBundle(String location) with argument 0, instead
> > of BundleContext.getBundle(long id). The evaluation returns null,
> > because there is no bundle with such location and the whole
> > evaluation fails with the exception
> > bundleresource://3.fwk25675100/gosh_profile: ERROR:
> > java.lang.RuntimeException: Command name evaluates to null:
> > ${.context} bundle 0.
> >
> > Any workaround for this? However, it is not a big problem, since
> > the shell is fully operational after that.
> >
> > Regards, Lazar
> >
> >
> >
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


RE: Exception when starting gogo

Posted by "Kirchev, Lazar" <l....@sap.com>.
Thanks Derek. Then I will probably replace the default gosh_profile.

-----Original Message-----
From: Derek Baum [mailto:derek.baum@paremus.com] 
Sent: Thursday, April 21, 2011 4:01 PM
To: users@felix.apache.org
Subject: Re: Exception when starting gogo

I tripped across this yesterday.

I've explained the problem in this jira:

https://issues.apache.org/jira/browse/FELIX-2927

The work-around is to replace

bundle 0

with

(bundles) 0

the former attempts to invoke getBundle(long) but actually invokes
getBundle(String)

the latter invokes getBundles() and then returns the first element.





On 21 April 2011 12:53, Kirchev, Lazar <l....@sap.com> wrote:

> Hello,
>
> I am using Gogo 0.8.0 and I run it with Equinox. I noticed that when Gogo
> starts, an exception is printed before the Gogo prompt becomes available.
> The exception is caused by the execution of the default gosh_profile script
> in org.apache.felix.gogo.shell bundle. Particularly the fragment ${.context}
> bundle 0 in addcommand system ((${.context} bundle 0) loadclass
> java.lang.System) is not evaluated correctly. The evaluation tries to call
> BundleContext.getBundle(String location) with argument 0, instead of
> BundleContext.getBundle(long id). The evaluation returns null, because there
> is no bundle with such location and the whole evaluation fails with the
> exception bundleresource://3.fwk25675100/gosh_profile: ERROR:
> java.lang.RuntimeException: Command name evaluates to null: ${.context}
> bundle 0.
>
> Any workaround for this? However, it is not a big problem, since the shell
> is fully operational after that.
>
> Regards,
> Lazar
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Exception when starting gogo

Posted by Derek Baum <de...@paremus.com>.
I tripped across this yesterday.

I've explained the problem in this jira:

https://issues.apache.org/jira/browse/FELIX-2927

The work-around is to replace

bundle 0

with

(bundles) 0

the former attempts to invoke getBundle(long) but actually invokes
getBundle(String)

the latter invokes getBundles() and then returns the first element.





On 21 April 2011 12:53, Kirchev, Lazar <l....@sap.com> wrote:

> Hello,
>
> I am using Gogo 0.8.0 and I run it with Equinox. I noticed that when Gogo
> starts, an exception is printed before the Gogo prompt becomes available.
> The exception is caused by the execution of the default gosh_profile script
> in org.apache.felix.gogo.shell bundle. Particularly the fragment ${.context}
> bundle 0 in addcommand system ((${.context} bundle 0) loadclass
> java.lang.System) is not evaluated correctly. The evaluation tries to call
> BundleContext.getBundle(String location) with argument 0, instead of
> BundleContext.getBundle(long id). The evaluation returns null, because there
> is no bundle with such location and the whole evaluation fails with the
> exception bundleresource://3.fwk25675100/gosh_profile: ERROR:
> java.lang.RuntimeException: Command name evaluates to null: ${.context}
> bundle 0.
>
> Any workaround for this? However, it is not a big problem, since the shell
> is fully operational after that.
>
> Regards,
> Lazar
>
>
>