It seems that you have a staled bundle which still references the renamed
class:
org.apache.tuscany.sca.binding.jms.policy.authentication.token.JMSTokenAuthenticationPolicyProviderFactory.
It was renamed to
org.apache.tuscany.sca.binding.jms.policy.authentication.token.provider.JMSTokenAuthenticationPolicyProviderFactory
to avoid split packages in tuscany-binding-jms and
tuscany-binding-jms-runtime.
It is a hard issue for jndi.property unless you package it in the code (from
JDK?) that uses it. OSGi doesn't allow the "default" package to exported. As a
result, now other bundles can see jndi.properties file in the root. Maybe you
will have to consider putting the properties in a file that can be located on
the classpath, or use system properties, to create the InitialContext.
http://java.sun.com/j2se/1.4.2/docs/guide/jndi/spec/jndi/jndi.6.html
From: Konradi, Philipp
Sent: Monday, October 05, 2009 10:31 AM
To: [email protected]
Subject: RE: Distributed calculator example with JMS binding
Hi Raymond,
your commits resolved one issue I had before when playing around with D-OSGi
and JMS bits.
Further I had to modify modules/binding-jms-runtime/META-INF/MANIFEST.MF to
export a package, which org.apache.tuscany.sca.extensibility.equinox was trying
to load and failed with NoClassDefFound Exception.
++ Export-Package:
org.apache.tuscany.sca.binding.jms.policy.authentication.token.provider;version="1.0.0"
Right now I face problems to make my OSGi application bundle recognize
jndi.property file located at bundle’s root. Any idea what I’m making wrong?
The JMS itests which use jndi.properties as well are run on plain JVM so never
faced such problem….
Regards,
Philipp
P.S: Just in case you need the stack trace of the exception mentioned above,
here it is:
SCHWERWIEGEND: org.apache.tuscany.sca.runtime.ActivationException:
org.apache.tuscany.sca.runtime.ActivationException:
java.lang.IllegalStateException: java.lang.ClassNotFoundException:
org.apache.tuscany.sca.binding.jms.policy.authentication.token.JMSTokenAuthenticationPolicyProviderFactory
java.lang.IllegalStateException:
org.apache.tuscany.sca.runtime.ActivationException:
org.apache.tuscany.sca.runtime.ActivationException:
java.lang.IllegalStateException: java.lang.ClassNotFoundException:
org.apache.tuscany.sca.binding.jms.policy.authentication.token.JMSTokenAuthenticationPolicyProviderFactory
at
org.apache.tuscany.sca.node.impl.NodeImpl.start(NodeImpl.java:152)
at
org.apache.tuscany.sca.node.osgi.impl.NodeManager.bundleStarted(NodeManager.java:117)
at
org.apache.tuscany.sca.node.osgi.impl.NodeManager.start(NodeManager.java:54)
at
org.apache.tuscany.sca.node.osgi.impl.NodeActivator.init(NodeActivator.java:51)
at
org.apache.tuscany.sca.node.osgi.impl.NodeActivator.start(NodeActivator.java:61)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:782)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:773)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:754)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:352)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:370)
at
org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1068)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:557)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:464)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:248)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:445)
at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:220)
at
org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:330)
Caused by: org.apache.tuscany.sca.runtime.ActivationException:
org.apache.tuscany.sca.runtime.ActivationException:
java.lang.IllegalStateException: java.lang.ClassNotFoundException:
org.apache.tuscany.sca.binding.jms.policy.authentication.token.JMSTokenAuthenticationPolicyProviderFactory
at
org.apache.tuscany.sca.core.assembly.impl.CompositeActivatorImpl.activate(CompositeActivatorImpl.java:112)
at
org.apache.tuscany.sca.node.impl.NodeImpl.start(NodeImpl.java:123)
... 17 more
Caused by: org.apache.tuscany.sca.runtime.ActivationException:
java.lang.IllegalStateException: java.lang.ClassNotFoundException:
org.apache.tuscany.sca.binding.jms.policy.authentication.token.JMSTokenAuthenticationPolicyProviderFactory
at
org.apache.tuscany.sca.core.assembly.impl.CompositeActivatorImpl.activateComponent(CompositeActivatorImpl.java:157)
at
org.apache.tuscany.sca.core.assembly.impl.CompositeActivatorImpl.activate(CompositeActivatorImpl.java:109)
... 18 more
Caused by: java.lang.IllegalStateException: java.lang.ClassNotFoundException:
org.apache.tuscany.sca.binding.jms.policy.authentication.token.JMSTokenAuthenticationPolicyProviderFactory
at
org.apache.tuscany.sca.provider.DefaultProviderFactoryExtensionPoint$LazyPolicyProviderFactory.getFactory(DefaultProviderFactoryExtensionPoint.java:346)
at
org.apache.tuscany.sca.provider.DefaultProviderFactoryExtensionPoint$LazyPolicyProviderFactory.createImplementationPolicyProvider(DefaultProviderFactoryExtensionPoint.java:353)
at
org.apache.tuscany.sca.core.assembly.impl.CompositeActivatorImpl.addImplementationProvider(CompositeActivatorImpl.java:206)
at
org.apache.tuscany.sca.core.assembly.impl.CompositeActivatorImpl.activateComponent(CompositeActivatorImpl.java:142)
... 19 more
Caused by: java.lang.ClassNotFoundException:
org.apache.tuscany.sca.binding.jms.policy.authentication.token.JMSTokenAuthenticationPolicyProviderFactory
at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:443)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:405)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:393)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:321)
at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:231)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1193)
at
org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer$ServiceDeclarationImpl.loadClass(EquinoxServiceDiscoverer.java:98)
at
org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer$ServiceDeclarationImpl.loadClass(EquinoxServiceDiscoverer.java:92)
at
org.apache.tuscany.sca.provider.DefaultProviderFactoryExtensionPoint$LazyPolicyProviderFactory.getFactory(DefaultProviderFactoryExtensionPoint.java:341)
... 22 more
04.10.2009 23:38:03
org.apache.tuscany.sca.osgi.service.remoteadmin.impl.RemoteControllerImpl added
WARNUNG: Service listner without a filter is skipped:
org.eclipse.equinox.internal.ds.scrmana...@7103af
From: Raymond Feng [mailto:[email protected]]
Sent: Monday, October 05, 2009 6:36 PM
To: [email protected]
Subject: Re: Distributed calculator example with JMS binding
Hi,
The JMS binding has been ported to 2.x and we haven't done much testing in the
OSGi environment. I checked in some changes during the weekend to bring up the
bundles under OSGi [1] but I didn't have chances to run any JMS scenarios.
Can you try the latest code to see what will happen?
[1] http://svn.apache.org/viewvc?rev=821681&view=rev
From: roshan joseph
Sent: Sunday, October 04, 2009 9:00 PM
To: [email protected]
Subject: Distributed calculator example with JMS binding
Hi,
I am trying to test the distributed osgi calculator example with the
jms binding in Tuscany SCA 2.0. I am using the existing calculator sample for
my test and changed the binding information from the RMI to JMS. Though both
bundles get started in the osgi, it seems the call does n’t go through. Can
someone help me?
What I am trying to do is use the add service alone for testing the
bundle composites are like shown below, I uses an external activemq broker for
testing.
My Calculator composite is:
<component name="CalculatorComponent">
< tuscany :implementation.osgi
bundleSymbolicName="calculator.dosgi" bundleVersion="1.0.0" />
<service name="CalculatorService">
<binding.ws
uri="http://localhost:8086/CalculatorService"/>
</service>
<reference name="addService">
< tuscany :binding.jms uri="jms:MyService"
jndiURL="tcp://localhost:61616">
<destination create="ifNotExist" jndiName="MyService"
type="queue"/>
</ tuscany :binding.jms>
</reference>
</component>
And my OperationsComposite which has the add service details is like
below:
<component name="OperationsComponent">
< tuscany :implementation.osgi
bundleSymbolicName="calculator.dosgi.operations" bundleVersion="1.0.0" />
<service name="AddService">
< tuscany :binding.jms
initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
jndiURL="tcp://localhost:61616"/>
</service>
</component>
I don’t see anything happening in the message queue MyService, neither a
message is send nor any connection established with the queue by the service
provider.
Thanks in advance for any help or suggestions.
Thanks & Regards
Roshan