<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
JBoss AS 7 with OSGi and JMS
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/marquies">marquies</a> in <i>Beginner's Corner</i> - <a href="https://community.jboss.org/message/747886#747886">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi all!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>What I want to do: I would like to build an OSGi bundle whichs connects to a JMS queue, all in JBoss AS.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>What I have done: I tried and compiled the quickstarts helloworld-osgi and helloworld-jms, both successfull. Then I mixed them, I copied the JMS code to the OSGi bundle changed the pom. It compiles, the bundle is build, but the installation in jboss failed:  <span style="text-decoration: underline;">missing requirement [Module[jboss-as-helloworld-osgi:7.1.1.Final]] package; (package=javax.jms)</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I guessed that JBoss AS provides javax.jms, doesn't it?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code">01:57:08,777 INFO  [org.jboss.as.server] (management-handler-thread - 14) JBAS018562: Redeployed "jboss-as-helloworld-osgi-7.1.1.Final.jar"
01:57:08,778 INFO  [org.jboss.as.server] (management-handler-thread - 14) JBAS018565: Replaced deployment "jboss-as-helloworld-osgi-7.1.1.Final.jar" with deployment "jboss-as-helloworld-osgi-7.1.1.Final.jar"
01:57:08,777 ERROR [org.jboss.as.osgi] (MSC service thread 1-4) JBAS011900: Cannot start bundle: jboss-as-helloworld-osgi:7.1.1.Final: org.osgi.framework.BundleException: Cannot resolve bundle: jboss-as-helloworld-osgi:7.1.1.Final
        at org.jboss.osgi.framework.internal.HostBundleState.startInternal(HostBundleState.java:212) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]
        at org.jboss.osgi.framework.internal.AbstractBundleState.start(AbstractBundleState.java:494) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]
        at org.jboss.as.osgi.deployment.BundleStartTracker$1.processService(BundleStartTracker.java:144) [jboss-as-osgi-service-7.1.1.Final.jar:7.1.1.Final]
        at org.jboss.as.osgi.deployment.BundleStartTracker$1.transition(BundleStartTracker.java:119) [jboss-as-osgi-service-7.1.1.Final.jar:7.1.1.Final]
        at org.jboss.msc.service.ServiceControllerImpl.invokeListener(ServiceControllerImpl.java:1416) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
        at org.jboss.msc.service.ServiceControllerImpl.access$2700(ServiceControllerImpl.java:49) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
        at org.jboss.msc.service.ServiceControllerImpl$ListenerTask.run(ServiceControllerImpl.java:1954) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_33]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_33]
        at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_33]
01:57:08,779 ERROR [jboss-as-helloworld-osgi] (Thread-79) FrameworkEvent ERROR: org.apache.felix.log.LogException: org.osgi.framework.BundleException: Cannot resolve bundle resModule: [jboss-as-helloworld-osgi:7.1.1.Final]
        at org.jboss.osgi.framework.internal.ResolverPlugin.resolve(ResolverPlugin.java:157)
        at org.jboss.osgi.framework.internal.AbstractBundleState.ensureResolved(AbstractBundleState.java:551)
        at org.jboss.osgi.framework.internal.HostBundleState.startInternal(HostBundleState.java:211)
        at org.jboss.osgi.framework.internal.AbstractBundleState.start(AbstractBundleState.java:494)
        at org.jboss.as.osgi.deployment.BundleStartTracker$1.processService(BundleStartTracker.java:144)
        at org.jboss.as.osgi.deployment.BundleStartTracker$1.transition(BundleStartTracker.java:119)
        at org.jboss.msc.service.ServiceControllerImpl.invokeListener(ServiceControllerImpl.java:1416)
        at org.jboss.msc.service.ServiceControllerImpl.access$2700(ServiceControllerImpl.java:49)
        at org.jboss.msc.service.ServiceControllerImpl$ListenerTask.run(ServiceControllerImpl.java:1954)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_33]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_33]
        at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_33]
Caused by: org.apache.felix.log.LogException: org.jboss.osgi.resolver.XResolverException: Unable to resolve Module[jboss-as-helloworld-osgi:7.1.1.Final]: missing requirement [Module[jboss-as-helloworld-osgi:7.1.1.Final]] package; (package=javax.jms)
        at org.jboss.osgi.resolver.felix.FelixResolver.resolveInternal(FelixResolver.java:117)
        at org.jboss.osgi.resolver.spi.AbstractResolver.resolve(AbstractResolver.java:149)
        at org.jboss.osgi.framework.internal.ResolverPlugin.resolve(ResolverPlugin.java:155)
        ... 11 more
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Generated MANIFEST.MF</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code">Manifest-Version: 1.0
Built-By: breucking
Build-Jdk: 1.6.0_33
Bundle-Version: 7.1.1.Final
Tool: Bnd-1.15.0
Bundle-Name: jboss-as-helloworld-osgi
Bnd-LastModified: 1342140094712
Bundle-Activator: org.jboss.as.quickstarts.helloworld.osgi.Activator
Created-By: Apache Maven Bundle Plugin
Bundle-ManifestVersion: 2
Bundle-SymbolicName: jboss-as-helloworld-osgi
Import-Package: javax.jms,javax.naming,org.osgi.framework;version="[1.
5,2)"
</code></pre></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/747886#747886">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Beginner's Corner at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>