Illarion Kovalchuk
Illarion Kovalchuk

Reputation: 5894

How to access resources in external jar file using spring?

I have a spring project which uses different libraries, packed as multiple jars. One of them (jar) has xml files, as resources.

What I'm trying to do, is to inject this resources to castor marshaller, like here:

<bean id="marshaller" class="org.springframework.oxm.castor.CastorMarshaller">

    <property name="mappingLocations">
        <list>
            <value>classpath*:/mapping*.xml</value>
        </list>
    </property>

</bean>

It doesn't work, and the array of resources is empty.

What am I doing wrong?

Upvotes: 0

Views: 1883

Answers (1)

Jigar Joshi
Jigar Joshi

Reputation: 240860

Make it:

<value>classpath:mapping*.xml</value>

Provided that, mapping*.xml file is there directly on classpath (root of external jar which is directly under classpath)

Upvotes: 1

Related Questions