Hi,
My comment inline.
On 2010-3-13, at 上午5:00, smontico wrote:
Hi,
I create my example following the cxf-wsdl-first-osgi-package
example and i
could deploy the se and bc bundles correctly into servicemix, both
of them
were active and started...
The problem appears when i try to consume a service that is exposed
from
another bundle and inject the service reference into the pojo that
implement
the endpoint.
I have two problems:
1) When i create the osgi packaging using maven it throws a compile
error,
because the SE bundle doesn't have the class interface i'm consuming
and
referencing in the pojo implementation.
I create the interface class into that bundle in order to remove the
error
but i don't know if its the correct thing to do....
It's ok, but more osgi way is install api interface in one bundle and
all other bundles which need use such interface just import the
interface packages in maven-bundle-plugin.
2) I create the two bundles correctly but the se bundle is active
but not
started.
I put the following configuration into the beans.xml of the SE
bundle, is
that correct?
----------
beans.xml:
----------
<cxfse:endpoint>
<cxfse:pojo>
<bean
class="com.crs.sag.service.GeographicReferenceTypeImpl">
<property name="bussinesService"
ref="osgibattaBusiness"></property>
</bean>
</cxfse:pojo>
</cxfse:endpoint>
<bean class="org.apache.servicemix.common.osgi.EndpointExporter" />
<osgi:reference id="osgibattaBusiness" cardinality="1..1"
interface="com.crs.uy.business.IBattaBusiness">
</osgi:reference>
Two questions:
1. how you expose osgibattaBusiness osgi service from other bundle,
through spring-dm/blueprint or programmatically? Could you also post
the details for that bundle? Is that bundle started correctly?
2. Do you get any exception when you start cxf se endpoint bundle?
you can use osgi:start your_cxf_se_bundle_id
You can find the log from $SMX_HOME/data/log/servicemix.log or
karaf.log(log name depend on if you use latest snapshot)
Freeman
-------------------
Pojo implementation
-------------------
@WebService(name = "ValidateLocationService", targetNamespace =
"http://com/crs/sag/service" , endpointInterface =
"com.crs.sag.service.GeographicReferenceType")
public class GeographicReferenceTypeImpl implements
GeographicReferenceType{
private IBattaBusiness bussinesService;
public IBattaBusiness getBussinesService() {
return bussinesService;
}
public void setBussinesService(IBattaBusiness bussinesService) {
this.bussinesService = bussinesService;
}
public ValidateLocationRSParam validateLocation(
ValidateLocationRQParam validateLocationRQ) {
System
.out.println("validateLocationRQ.getHeaderRQ().getSession().getId()
= " + validateLocationRQ.getHeaderRQ().getSession().getId());
ValidateLocationRSParam validateRS = new
ValidateLocationRSParam();
HeaderRS headerRS = new HeaderRS();
HeaderRS.Session session = new HeaderRS.Session();
session.setId("66666666666");
headerRS.setSession(session);
validateRS.setHeaderRS(headerRS);
try {
this.bussinesService.executeService(null);
} catch (Exception e) {
e.printStackTrace();
}
return validateRS;
}
Thanks in advance, Santiago.
--
View this message in context:
http://old.nabble.com/OSGI-Reference-injection-to-cxfse-endpoint-Problem-tp27882759p27882759.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
--
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com