[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] A problem while using OSGI together with ActiveMQ!

On 22/06/07, Wang Zhu <transitwang@xxxxxxxxx> wrote:
ActiveMQConnection.DEFAULT_PASSWORD and
ActiveMQConnection.DEFAULT_BROKER_URL are both defined in
org/apache/activemq/ActiveMQConnection,and I have import
this using "import org.apache.activemq.ActiveMQConnection
;" in my program.
If I run the codes below it works normally
public void start(BundleContext context) throws Exception {
  ServiceReference[] refs = context.getServiceReferences(
    ProducerService.class.getName (), "(ProducerPool=*)");
  String url = ActiveMQConnection.DEFAULT_BROKER_URL;
}

But if change the "String url =
ActiveMQConnection.DEFAULT_BROKER_URL;" above to "String
pwd = ActiveMQConnection.DEFAULT_PASSWORD;"
as below it does't work
public void start(BundleContext context) throws Exception {
  ServiceReference[] refs = context.getServiceReferences(
    ProducerService.class.getName(), "(ProducerPool=*)");
String pwd = ActiveMQConnection.DEFAULT_PASSWORD ;
}

And the error is:Bundle 39 is not active but resolved as showed below.


osgi> ss

Framework is launched.

id State       Bundle
0 ACTIVE      system.bundle_3.2.2.R32x_v20070118
1 ACTIVE      org.eclipse.osgi.services_3.1.100.v20060601
3 ACTIVE
org.eclipse.equinox.servlet.api_1.0.0.v20060601
33 ACTIVE
org.eclipse.equinox.http_1.0.2.R32x_v20061218
38 ACTIVE      OSGIProducer_1.0.0
39 RESOLVED    ProducerApp_1.0.0
40 ACTIVE      ProducerImplOne_1.0.0


I'm not sure why it works in one case but not the other...

can you send the OSGi headers for bundles 38, 39 and 40?
(ie. use the 'headers' command from the Equinox console)
also, try using 'diag' to show the missing constraints

finally try 'packages org.apache.activemq' to see which
bundle, if any, is exporting the activemq package.

When I tried to start bundle 39 error occurs.
osgi> start 39
org.osgi.framework.BundleException: Exception in
producerapp.Activator.start() of bundle ProducerApp.
 at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java
:1010)
 at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:966)
 at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:317)
 at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start
(AbstractBundle.java:256)
 at
org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:239)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke (Unknown
Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute
(FrameworkCommandInterpreter.java:145)
 at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:293)
 at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java
:278)
 at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:213)
 at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError:
org/apache/activemq/ActiveMQConnection
 at producerapp.Activator.start(Activator.java:50)
 at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:991)
 at java.security.AccessController.doPrivileged(Native
Method)
  at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:985)
 ... 13 more
Nested Exception:
java.lang.NoClassDefFoundError:
org/apache/activemq/ActiveMQConnection
 at producerapp.Activator.start(Activator.java:50)
 at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:991)
 at java.security.AccessController.doPrivileged(Native
Method)
 at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator
(BundleContextImpl.java:985)
 at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:966)
 at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:317)
  at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:256)
 at
org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:239)
 at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native
Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute
(FrameworkCommandInterpreter.java:145)
 at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:293)
 at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java
:278)
 at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:213)
 at java.lang.Thread.run(Unknown Source)
Nested Exception:
java.lang.NoClassDefFoundError:
org/apache/activemq/ActiveMQConnection
 at producerapp.Activator.start(Activator.java:50)
 at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:991)
 at java.security.AccessController.doPrivileged(Native
Method)
  at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:985)
 at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:966)
 at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker
(BundleHost.java:317)
 at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:256)
 at
org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java
:239)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
 at java.lang.reflect.Method.invoke (Unknown Source)
 at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:145)
 at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java
:293)
 at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:278)
 at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:213)
 at java.lang.Thread.run (Unknown Source)

Regards,
--
TransitWang/WangZhu
Computer School,Northwestern Polytechnical University
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev




--
Cheers, Stuart