Setting either 'contextPath', 'classesToBeBound',or 'packagesToScan' is required

Asked on March 29, 2015
I am making Spring OXM application with JAXB, while running I am getting exception as below.

Caused by: java.lang.IllegalArgumentException: Setting either 'contextPath', 'classesToBeBound', or 'packagesToScan' is required
at org.springframework.oxm.jaxb.Jaxb2Marshaller.afterPropertiesSet(
... 32 more

Replied on March 29, 2015
You are missing either  'contextPath', 'classesToBeBound', or 'packagesToScan'. You can fix the error using any of it.

Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();

Write Answer

©2024 | Privacy Policy | Contact Us