Home  >  Forum  >  Spring
Post New Query

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


joined on
June 15,2014
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(Jaxb2Marshaller.java:431)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1625)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1562)
... 32 more




joined on
November 18,2013
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();
jaxb2Marshaller.setPackagesToScan("com.test.bean");

Write Answer








Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us