Alexandre Soares
Alexandre Soares

Reputation: 43

Jaxb2Marchaller loading/validating classes on application deploy taking too much time

I'm facing a problem on my project that is the time that Jaxb2Marshaller takes to validate/parse all classes genereated by XJC on deploy time. In my context configuration I have the following configuration:

<bean id="jaxbMarshallerOpe" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
    <property name="contextPaths">
        <list>
            <value>com.src.integration.generated.pojo.client</value>
            <value>com.src.integration.generated.pojo.product</value>
            <value>com.src.integration.generated.pojo.company</value>
        </list>
    </property>
    <property name="marshallerProperties">
        <map>
            <entry key="jaxb.encoding" value="UTF-8" />
        </map>
    </property>
</bean>

Inside of each directory mapped on my context file, we have several classes that Jaxb2Marchaller executes the validation/parsing in deploy time that is causing a problem with an SLA for deploy that we have. My question is, how can I make this validation occurs after the deploy? Or do I have another approach for this situation so I can reduce the deploy time and still have my services working?

Upvotes: 1

Views: 202

Answers (1)

Arjen Poutsma
Arjen Poutsma

Reputation: 1256

You might want to try the lazy-init flag of the Jaxb2Marshaller.

Upvotes: 1

Related Questions