I wrote my first osgi code in STS. It is the "Hello world". (Start plug-in project, from hello world template) I started the JBoss AS 7.1.1 from STS and use the "Mark as Deployable" from right-click menu.

at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]

at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]

at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]

at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]

at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:132) [jboss-modules.jar:1.1.1.GA]

at org.jboss.osgi.framework.internal.HostBundleRevision.loadClass(HostBundleRevision.java:114) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]

at org.jboss.osgi.framework.internal.AbstractBundleState.loadClass(AbstractBundleState.java:415) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]

at org.jboss.osgi.framework.internal.HostBundleState.loadClass(HostBundleState.java:151) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]

at org.jboss.osgi.framework.internal.HostBundleState.transitionToActive(HostBundleState.java:294) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]

... 10 more

Then I run the "Unmark as deployable".

After it I made an export from the prject (Deployable plug-ins and fragments). I opened the JBoss AS console and on the Deployment page I add the exported package. Enabled it, and on OSGI Baundle pages I started it. And it "run" correctly.