[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Re:Can ActiveMQ be used together with OSGI?

To add to that: JMS is provided in the ActiveMQ distribution, specifically in the geronimo-jms_1.1_spec-1.0.jar file in the /lib directory.  So check that the bundle that contains ActiveMQ is exporting the javax.jms package.  Or, if the bundle where your code lives contains the ActiveMQ libraries directly, check that this jar file is on your bundle's classpath.


On 21/06/07, Stuart McCulloch <stuart.mcculloch@xxxxxxxxxx> wrote:
also, FYI - javax.jms is a J2EE API package which won't be in the base JDK, but is provided
by various J2EE implementations and the J2EE JDK... perhaps your Eclipse installation has
a plugin / feature that provides this package?

On 21/06/07, Stuart McCulloch < stuart.mcculloch@xxxxxxxxxx> wrote:
On 21/06/07, Wang Zhu <transitwang@xxxxxxxxx> wrote:
But I have import those things in my program:
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Session;
import javax.jms.DeliveryMode;
import javax.jms.MessageProducer;
import javax.jms.TextMessage;
import org.apache.activemq.ActiveMQConnection;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.util.IndentPrinter;

There is a difference between imports at the Java language level, and imports between OSGi bundles.
For example, I may have a private internal class that uses another class - in this case I may need to
import it using a normal Java import (such as import com.example.MyClassImpl). But if both classes
are internal to the OSGi bundle then I don't need to mention them, or their packages, in the import or
export package instructions.

Think of Import-Package and Export-Package as describing wires between OSGi bundles - internally
your code will use Java-level imports, but as a bundle it needs to describe what classes it can share
with other bundles and what classes it needs from other bundles (or the framework).

If your bundle doesn't contain the javax.jms.* classes then they either need to come from the system
classpath, or another bundle.

    ( ps. you might want to look at the Bnd tool, which can produce OSGi metadata
      for you just by analyzing your classfiles - see http://www.aqute.biz/Code/Bnd )

hope this makes things a bit clearer...

Computer School,Northwestern Polytechnical University

equinox-dev mailing list

Cheers, Stuart

Cheers, Stuart

equinox-dev mailing list