I am struggling with an Spring-WS with JMS example. I set the Spring-WS and JMS wiring as per the Spring recommendations. But I kept getting following error. I dont know how to
I had the same error, but only running my Spring Web Service integration tests.
The problem was that I setup the Jaxb2Marshaller
with a different configuration if compared with Jaxb2Marshaller
inside the test. I was not using the same Bean for the application and test.
My Jaxb2Marshaller
with the application running is:
private Jaxb2Marshaller marshaller() {
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setContextPath("com.company.application");
marshaller.setMtomEnabled(true);
return marshaller;
}
But on my tests, I was using:
@Before
public void init() throws Exception {
marshaller.setPackagesToScan(ClassUtils.getPackageName(Order.class));
marshaller.afterPropertiesSet();
}
To make the test work, I just defined the two missing properties:
@Before
public void init() throws Exception {
marshaller.setPackagesToScan(ClassUtils.getPackageName(Order.class));
marshaller.afterPropertiesSet();
marshaller.setContextPath("com.company.application");
marshaller.setMtomEnabled(true);
}