On 9/23/10 10:09, [email protected] wrote:
Yes, I just got my command working in gogo a few minutes ago. Thanks for the help with that Richard!

I pointed out what was causing my problem because Derek Baum said that this particular error should not happen with Felix 3.0.2.

Yep, it doesn't seem like a bundle failing to resolve should cause such an error. Please, open up a JIRA issue to report the bug and attach a sample bundle. Thanks!

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

-> richard


-John

Quoting Michael Hess <[email protected]>:

Hi  John,

that fits what Richard S. Hall stated earlier.

>>>> However, the fact that you cannot resolve your bundle may be
legitimate,
>>>> since you are creating a command for the old Felix Shell service,
but it
>>>> looks like you are running the 3.0.x framework distribution that
now uses
>>>> Gogo.

Felix 3.0.x does not come with the shell service anymore.
Therefore the import cannot be resolved and you get the error.

Options:
- Either get Shell Service for 3.0.x (don't know if that exists)
- switch to GoGo which was put in place of the shell service

I think someone else also pointed out where to get information as to how
you can interact with Gogo.

bye, Michael

I believe I have isolated the problem. It does not seem to matter what
my code is. The problem is in the manifest. If I remove
"org.apache.felix.shell" from the Import-Package manifest entry, the
error goes away. If I put it back the error returns. For example,
changing this,

"Import-Package: org.osgi.framework,org.apache.felix.shell"

to this,

"Import-Package: org.osgi.framework"

makes the error go away. It does not seem to matter if I implement
service interfaces from that package. The import itself appears to
trigger the error.

I can provide a sample project which duplicates this on Felix 3.0.2 if
anyone is interested.

-John

Quoting Derek Baum <[email protected]>:

> Then that really is weird, as I downloaded 3.0.2 to test this before
my last
> reply.
>
> Derek
>
> On 22 September 2010 19:02, <[email protected]> wrote:
>
>> But I am using version 3.0.2 and I did download it from the main
site. I
>> didn't check it out from SVN and I didn't compile it myself.
>>
>> Quoting Derek Baum <[email protected]>:
>>
>>  I'm not sure why you are getting a CNFE for java.lang.System...that
seems
>>>>
>>> really odd.
>>>
>>> This would occur if you are using felix < 3.0 (e.g. 2.0.5) with gogo
0.6
>>> (i.e. compiled from SVN HEAD).
>>>
>>> This was because felix < 3.0.0 did not correctly boot delegate to
allow
>>> loading of java.lang.System from bundle 0 (
>>> https://issues.apache.org/jira/browse/FELIX-2335)
>>>
>>> gogo 0.6 worked around this by loading java.lang.System from bundle
1, but
>>> the SVN HEAD was fixed to load from bundle 0 (
>>> https://issues.apache.org/jira/browse/FELIX-2445).
>>>
>>> If you download the main felix 3.0.2 distribution, this problem
should go
>>> away.
>>>
>>> Derek
>>>
>>>
>>>
>>> On 22 September 2010 17:11, Richard S. Hall <[email protected]>
wrote:
>>>
>>>   I'm not sure why you are getting a CNFE for
java.lang.System...that
>>>> seems
>>>> really odd.
>>>>
>>>> However, the fact that you cannot resolve your bundle may be
legitimate,
>>>> since you are creating a command for the old Felix Shell service,
but it
>>>> looks like you are running the 3.0.x framework distribution that
now uses
>>>> Gogo.
>>>>
>>>> Gogo doesn't have a lot of documentation yet, but we do have some
>>>> rudimentary documentation on how to create commands for it. It is
>>>> actually
>>>> easier than the old approach:
>>>>
>>>>   http://felix.apache.org/site/rfc-147-overview.html
>>>>
>>>> You can also look at the source code for the Gogo Command bundle,
which
>>>> provides the best example:
>>>>
>>>>   http://svn.apache.org/repos/asf/felix/trunk/gogo/command/
>>>>
>>>> -> richard
>>>>
>>>>
>>>> On 9/22/10 11:50, [email protected] wrote:
>>>>
>>>>  I am in the process of learning OSGI and I am attempting to write
a
>>>>> simple
>>>>> felix shell command which tells me if a word is spelled correctly
or not
>>>>> (using the examples as a starting point) but I'm running into
problems.
>>>>> My
>>>>> manifest looks like this,
>>>>>
>>>>> Manifest-Version: 1.0
>>>>>
>>>>> Archiver-Version: Plexus Archiver
>>>>>
>>>>> Created-By: Apache Maven
>>>>>
>>>>> Built-By: jddunlap
>>>>>
>>>>> Build-Jdk: 1.6.0_13
>>>>>
>>>>> Bundle-Activator: tutorial.example2.Activator
>>>>>
>>>>> Bundle-Classpath: .
>>>>>
>>>>> Bundle-Description: A bundle that displays messages at startup and
whe
>>>>>
>>>>>  n service events occur
>>>>>
>>>>> Bundle-Name: Service listener example
>>>>>
>>>>> Bundle-Vendor: Apache Felix
>>>>>
>>>>> Bundle-Version: 1.0
>>>>>
>>>>> Import-Package:
org.apache.felix.shell;version="1.4.2",org.osgi.framew
>>>>>
>>>>>  ork
>>>>>
>>>>>
>>>>>
>>>>> I've tried tweaking the version numbers in the manifest in every
way I
>>>>> can
>>>>> think of but I continue to get the following error,
>>>>>
>>>>> ERROR: Error starting
>>>>>
>>>>>
file:/home/jddunlap/apache-felix/felix-framework-3.0.2/bundle/dictionary-service-1.0-SNAPSHOT.jar
>>>>> (org.osgi.framework.BundleException: Unresolved constraint in
bundle
>>>>> [1]:
>>>>> Unable to resolve 1.0: missing requirement [1.0] package;
>>>>> (&(package=org.apache.felix.shell)(version>=1.4.2)))
>>>>> org.osgi.framework.BundleException: Unresolved constraint in
bundle [1]:
>>>>> Unable to resolve 1.0: missing requirement [1.0] package;
>>>>> (&(package=org.apache.felix.shell)(version>=1.4.2))
>>>>>   at
org.apache.felix.framework.Felix.resolveBundle(Felix.java:3409)
>>>>> at org.apache.felix.framework.Felix.startBundle(Felix.java:1709)
>>>>>   at
>>>>>
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1143)
>>>>>   at
>>>>>
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>>>>   at java.lang.Thread.run(Thread.java:619)
>>>>> bundle://5.0:1/gosh_profile:15.20: ClassNotFoundException:
>>>>> java.lang.System
>>>>> java.lang.ClassNotFoundException: java.lang.System
>>>>>   at
org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1591)
>>>>>   at
>>>>>
org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:887)
>>>>>   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.apache.felix.gogo.runtime.Reflective.method(Reflective.java:136)
>>>>>   at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:465)
>>>>>   at
>>>>>
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:335)
>>>>>   at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
>>>>>   at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:184)
>>>>>   at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:121)
>>>>>   at org.apache.felix.gogo.runtime.Closure.eval(Closure.java:265)
>>>>>   at
>>>>>
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:307)
>>>>>   at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
>>>>>   at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:184)
>>>>>   at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:121)
>>>>>   at
>>>>>
>>>>>
org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:78)
>>>>>   at org.apache.felix.gogo.shell.Shell.source(Shell.java:186)
>>>>>   at org.apache.felix.gogo.shell.Shell.gosh(Shell.java:106)
>>>>>   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.apache.felix.gogo.runtime.Reflective.method(Reflective.java:136)
>>>>>   at
>>>>>
org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
>>>>>   at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:421)
>>>>>   at
>>>>>
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:335)
>>>>>   at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
>>>>>   at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:184)
>>>>>   at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:121)
>>>>>   at
>>>>>
>>>>>
org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:78)
>>>>>   at org.apache.felix.gogo.shell.Activator.run(Activator.java:72)
>>>>>   at java.lang.Thread.run(Thread.java:619)
>>>>> Caused by: org.osgi.framework.BundleException: Unresolved
constraint in
>>>>> bundle [1]: Unable to resolve 1.0: missing requirement [1.0]
package;
>>>>> (&(package=org.apache.felix.shell)(version>=1.4.2))
>>>>>   at
org.apache.felix.framework.Felix.resolveBundle(Felix.java:3409)
>>>>>   at
org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1584)
>>>>>   ... 33 more
>>>>>
>>>>> What am I doing wrong?
>>>>>
>>>>>
>>>>>
---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [email protected]
>>>>> For additional commands, e-mail: [email protected]
>>>>>
>>>>>
>>>>>
---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [email protected]
>>>> For additional commands, e-mail: [email protected]
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



The information included in this e-mail and any files transmitted with it is strictly confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please notify the sender immediately by e-mail and delete this e-mail as well as any attachment from your system. If you are not the intended recipient you are not authorized to use and/or copy this message and/or attachment and/or disclose the contents to any other person.




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to