I created java program in an OSGi plateform. The program implements
communication between a sever and client through web services using
cxf-dosgi-ri-singlebundle-distribution (1.2.0). Tutorial steps provided by
--- http://cxf.apache.org/distributed-osgi-greeter-demo-walkthrough.html
were followed to creat the link establishing the server client
relationship. The server bundle provides some services through the Internet
and a list of clients subscribed to the service as listeners. The server
notifies these listeners (clients) whenever an event occurs. The code below
is used to export the OSGI service as a web service. The service is
implemented by TransInUse(). Clients subscribe to this service as listeners.
Dictionary props = new Hashtable();
TransInUse inUse =new TransInUse();
props.put("service.exported.interfaces", "*");
props.put("service.exported.configs", "org.apache.cxf.ws");
props.put("org.apache.cxf.ws.address",
http://localhost:8080/translatorIsBeingUsed);
addExportedService(ITransInUse.class.getName(), inUse, props);
The service is imported by the following lines of code:
ITransInUse using = (ITransInUse) getImportedService(ITransInUse.
class.getName());
TransInUseListener listener = new TransInUseListener ();
using.addListener(listener);
The method in the listeners is called by the the following code:
ITransInUseListener is the interface which is implemented by the listeners.
public void translatorIsBeingUsed(){
for (Iterator i = listeners.iterator(); i.hasNext();)
((ITransInUseListener) i.next()).translatorIsBeingUsed();
}
However, when the server calls the method implemented by the listeners, I
get an error
Could someone please tell me what I am doing wrong here. Thanks
However, when the server calls the method implemented by the listeners, I
get an error message pasted below . Could someone please tell me what I am
doing wrong here. Thanks
Error message
INFO: Matching:
(&(objectClass=interfaceDef.ITransInUse)(!(endpoint.framework.uuid=d0c8db21-f4b2-4eaa-bd6a-d925d56c7214)))
against
{org.apache.cxf.ws.address=http://localhost:8080/translatorIsBeingUsed,
endpoint.id=http://localhost:8080/translatorIsBeingUsed,
endpoint.package.version.interfaceDef=0.0.0,
service.registration.timestamp=1306508916943,
service.imported.configs=[Ljava.lang.String;@1b72276, bundle.id=5,
service.imported=true,
endpoint.framework.uuid=d0c8db21-f4b2-4eaa-bd6a-d925d56c7214,
objectClass=[Ljava.lang.String;@2f7cfe,
service.intents=[Ljava.lang.String;@377e2a, endpoint.service.id=44,
bundle.version=1.0.0.qualifier}
retrieved intent map: IntentMap:
{addressing=org.apache.cxf.ws.policy.WSPolicyFeature@1d314cc,
logging=org.apache.cxf.feature.LoggingFeature@fa7181,
SOAP=org.apache.cxf.binding.soap.SoapBindingConfiguration@31d5e2,
SOAP.1_1=org.apache.cxf.binding.soap.SoapBindingConfiguration@31d5e2,
SOAP.1_2=org.apache.cxf.binding.soap.SoapBindingConfiguration@1d12614,
HTTP=PROVIDED}
this is the lsitener
this is the listlistener added
27-05-2011 17:08:43 org.apache.cxf.phase.PhaseInterceptorChain
doDefaultLogging
WARNING: Application
{http://interfaceDef/%7DITransInUse#%7Bhttp://interfaceDef/%7DaddListener
has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: translatorIsBeingUsed is not delegated.
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(
AbstractInvoker.java:155)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(
AbstractInvoker.java:121)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(
AbstractInvoker.java:75)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(
ServiceInvokerInterceptor.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.cxf.workqueue.SynchronousExecutor.execute(
SynchronousExecutor.java:37)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(
ServiceInvokerInterceptor.java:106)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
PhaseInterceptorChain.java:243)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(
ChainInitiationObserver.java:110)
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(
JettyHTTPDestination.java:312)
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(
JettyHTTPDestination.java:276)
at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(
JettyHTTPHandler.java:70)
at org.mortbay.jetty.handler.ContextHandler.handle(
ContextHandler.java:729)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(
ContextHandlerCollection.java:206)
at org.mortbay.jetty.handler.HandlerWrapper.handle(
HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(
Server.java:320)
at org.mortbay.jetty.HttpConnection.handleRequest(
HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(
HttpConnection.java:843)
at org.mortbay.jetty.HttpParser.parseNext(
HttpParser.java:647)
at org.mortbay.jetty.HttpParser.parseAvailable(
HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(
HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(
SelectChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(
QueuedThreadPool.java:488)
Caused by: java.lang.IllegalAccessError: translatorIsBeingUsed is not
delegated.
at org.apache.cxf.aegis.type.basic.InterfaceInvocationHandler.invoke(
InterfaceInvocationHandler.java:57)
at $Proxy33.translatorIsBeingUsed(Unknown Source)
at translationFunctions.TransInUse.addListener(
TransInUse.java:23)
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.apache.cxf.service.invoker.AbstractInvoker.performInvocation(
AbstractInvoker.java:173)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(
AbstractInvoker.java:89)
... 23 more
The translated word is being done
translatorIsBeingUsed
27-05-2011 17:08:44 org.apache.cxf.phase.PhaseInterceptorChain
doDefaultLogging
WARNING: Application
{http://interfaceDef/%7DITranslator#%7Bhttp://interfaceDef/%7DlanguageTransText
has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: translatorIsBeingUsed is not delegated.
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(
AbstractInvoker.java:155)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(
AbstractInvoker.java:121)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(
AbstractInvoker.java:75)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(
ServiceInvokerInterceptor.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.cxf.workqueue.SynchronousExecutor.execute(
SynchronousExecutor.java:37)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(
ServiceInvokerInterceptor.java:106)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
PhaseInterceptorChain.java:243)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(
ChainInitiationObserver.java:110)
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(
JettyHTTPDestination.java:312)
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(
JettyHTTPDestination.java:276)
at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(
JettyHTTPHandler.java:70)
at org.mortbay.jetty.handler.ContextHandler.handle(
ContextHandler.java:729)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(
ContextHandlerCollection.java:206)
at org.mortbay.jetty.handler.HandlerWrapper.handle(
HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(
Server.java:320)
at org.mortbay.jetty.HttpConnection.handleRequest(
HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(
HttpConnection.java:843)
at org.mortbay.jetty.HttpParser.parseNext(
HttpParser.java:647)
at org.mortbay.jetty.HttpParser.parseAvailable(
HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(
HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(
SelectChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(
QueuedThreadPool.java:488)
Caused by: java.lang.IllegalAccessError: translatorIsBeingUsed is not
delegated.
at org.apache.cxf.aegis.type.basic.InterfaceInvocationHandler.invoke(
InterfaceInvocationHandler.java:57)
at $Proxy33.translatorIsBeingUsed(Unknown Source)
at translationFunctions.TransInUse.translatorIsBeingUsed(
TransInUse.java:30)
at translationFunctions.LanguageTrans.languageTransText(
LanguageTrans.java:19)
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.apache.cxf.service.invoker.AbstractInvoker.performInvocation(
AbstractInvoker.java:173)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(
AbstractInvoker.java:89)
... 23 more
thanks
--
View this message in context:
http://cxf.547215.n5.nabble.com/Need-help-with-OSGi-plateform-code-for-client-server-communication-tp4439566p4439566.html
Sent from the cxf-user mailing list archive at Nabble.com.