On 5/16/07, Benamin <[EMAIL PROTECTED]> wrote:
Ok, I got it to build. My next problem comes when I deploy my SA. I'm
getting a null pointer exception in my invokeIdentityService method that I
call from poll method. Any ideas? Thanks.
private boolean invokeIdentityService() throws MessagingException {
ComponentContext ctx =
getServiceUnit().getComponent().getComponentContext();
QName identityService = new QName("NSR:NSRService", "service");
InOut identityExchange = exchangeFactory.createInOutExchange();
configureTarget("Identity Service", identityExchange, ctx,
null, identityService, "soap", "");
NormalizedMessage in = identityExchange.createMessage();
in.setContent(new StringSource("<hello>Testing</hello>"));
identityExchange.setInMessage(in);
sendSync(identityExchange);
NormalizedMessage out = identityExchange.getOutMessage();
boolean login = false;
if (out != null) {
//login = support.parseIdentityOutMessage(out.getContent());
} else {
// TODO: how should we handle faults
}
done(identityExchange);
return login;
}
public void configureTarget(String serviceDesc, MessageExchange
exchange, ComponentContext context, QName _interface, QName service,
String endpoint, String uri) throws MessagingException {
if (_interface == null && service == null && uri == null) {
throw new MessagingException(serviceDesc + ": interface,
service or uri should be specified");
}
if (_interface != null) {
exchange.setInterfaceName(_interface);
}
if (service != null) {
exchange.setService(service);
if (endpoint != null) {
ServiceEndpoint se = context.getEndpoint(service,
endpoint);
exchange.setEndpoint(se);
}
}
}
ERROR - MyComponent - Caught exception while polling:
java.lang.NullPointerException
java.lang.NullPointerException
at
org.apache.servicemix.common.endpoints.SimpleEndpoint.sendSync(SimpleEndpoint.java:71)
at
org.apache.servicemix.samples.serviceManagerAssembly.MyEndpoint.invokeIdentityService(MyEndpoint.java:289)
at
org.apache.servicemix.samples.serviceManagerAssembly.MyEndpoint.poll(MyEndpoint.java:274)
at
I'm not sure, but I'm guessing that these are your classes above.
Where are lines 289 and 274 exactly?
Bruce
--
perl -e 'print unpack("u30","D0G)[EMAIL
PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/