Hi all,
I am new to servicemix. I am using SMX 3.3 in a standalone mode. I have
written some SUs for a few of the available components like servicemix-file
and servicemix-bean and they work fine.
Now I want to write my own service engine and deploy a SU for it. My test
code for the SE is very simple. The actual code for the transform method
doesn't seem to matter, I have tried several variations.
/**
* @org.apache.xbean.XBean element = "driver"
*/
public class MASDriver extends TransformComponentSupport {
private static final Logger log = Logger.getLogger(MASDriver.class);
public MASDriver() {
super();
log.info("MASDriver called");
}
public MASDriver(QName service, String endpoint) {
super(service, endpoint);
log.info("MASDriver service endpoint called");
}
@Override
protected boolean transform(MessageExchange me, NormalizedMessage in,
NormalizedMessage out) throws MessagingException {
int total = 10000;
Random rand = new Random();
log.info("Start generating messages: " +
System.currentTimeMillis());
for (int i = 0; i < total; i++) {
StringSource source = new
StringSource(String.valueOf(rand.nextDouble() + i + 1));
out.setContent(source);
InOnly outExchange =
getExchangeFactory().createInOnlyExchange();
outExchange.setInMessage(out);
getDeliveryChannel().sendSync(outExchange);
outExchange.setStatus(ExchangeStatus.DONE);
}
log.info("End generating messages:: " +
System.currentTimeMillis());
return false;
}
}
I have no errors when I install and start this SE in servicemix.
Next, I created an SU for it, which contains only an xbean.xml file...
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:myse="http://asi.org/config/1.0" xmlns:asi="asi">
<myse:driver service="asi:driver"
endpoint="endpoint" >
</myse:driver>
</beans>
When I deploy this service-unit into SMX, it gives me this error.
DEBUG - DeploymentService - Unpack service unit archive
D:\DEV\serviceMix\apache-servicemix-3.3\data\smx\service-assemblies\asi-mas\version_2\install\driver-su.zip
to D:\DEV\serviceMix\ap
ache-servicemix-3.3\data\smx\service-assemblies\asi-mas\version_2\sus\masdriver-se\driver-su
[Fatal Error] :1:1: Content is not allowed in prolog.
There is no other exception or error in the log, but the result is that my
endpoint is not activated. What am I missing?
Thanks for any help or tips to solving this problem.
--
View this message in context:
http://www.nabble.com/Problem-deploying-Service-Unit-for-a-custom-component-tp22109295p22109295.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.