Hi,
This should be fixed in the gogo.shell bundle on the trunk.
The problem is probably due to your framework starting from a previous
cached state, where bundle 1 is some fragment. gosh_profile used to use
bundle 1 to load java.lang.System, due to FELIX-2335 (which is now fixed).
Here are the lines from gosh_profile:
14:# FELIX-2335 prevents the use of (bundle 0) loadclass
15:addcommand system ((bundle 1) loadclass java.lang.System)
You can actually fix this yourself, by providing a local gosh_profile:
$ java -jar bin/felix.jar
_______________
Welcome to Apache Felix Gogo
g! lb
START LEVEL 1
ID|State |Level|Name
0|Active | 0|System Bundle (3.0.1)
1|Active | 1|Apache Felix Bundle Repository (1.6.2)
2|Active | 1|Apache Felix Gogo Command (0.6.0)
3|Active | 1|Apache Felix Gogo Runtime (0.6.0)
4|Active | 1|Apache Felix Gogo Shell (0.6.0)
// extract the current gosh_profile from the shell bundle
g! cat ((bundle 4) getresource /gosh_profile) | tac gosh_profile
g! exit 0
$ mkdir etc
$ mv gosh_profile etc
// now edit etc/gosh_profile and change line 15 to use bundle 0
// Note: when you startup now, you won't see the welcome message,
// as this is produced by:
31:# print welcome message
32:try {
33: cat ($0 resolve motd)
34:}
Where $0 is the URI to the script. You can put your own motd in the etc
directory if you want.
BTW, you don't have to create a Felix project in Eclipse in order to launch
Felix.
I just create a Java Application launch configuration and specify:
- Main: Main class=org.apache.felix.main.Main
- Arguments: Working
directory=/Users/derek/Downloads/felix-framework-3.0.1
- Classpath: External
JAR=/Users/derek/Downloads/felix-framework-3.0.1/bin/felix.jar
Hope this helps,
Derek
2010/6/26 LongkerDandy <[email protected]>
> Hi
>
> I just upgrade to felix 3.01 from 2.x.
> With 2.x, I follow this guide to configure felix indise eclipse:
> http://felix.apache.org/site/integrating-felix-with-eclipse.html
>
> Felix 3.01 has use Gogo shell, and the same configuration does not work.
> Under command line, it seems runs well.
> Start from Eclipse give me a exception:
>
> bundle://8.0:1/gosh_profile:15.20: ClassNotFoundException: Fragments cannot
> load classes.
> java.lang.ClassNotFoundException: Fragments cannot load classes.
> at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1623)
> 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)
>
> And the gogo shell is not usable.
>
> Any hint would be thankful.
>
> Thanks
> LongkerDandy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>