-
Apr 8th, 2008, 03:56 AM
#1
Load Resource From EJB MessageDrivenBean
I try to load a Resource in a MessageDrivenBean EJB component.
I try to load an XSD file.
Using "ClassPathResource" the file is not found.
<bean id="xsdFile" class="java.lang.String">
<constructor-arg value="classpath:message.xsd" />
</bean>
Using FileSystemResource it's working but it's dirty. And it's no more in the jar file.
<bean id="xsdFile" class="java.lang.String">
<constructor-arg value="file:/pathtofile/message.xsd" />
</bean>
I will try to embedded this file in the JAR referenced in classpath. Is there other way to proceed ?
Thanks for any help.
-
Apr 8th, 2008, 05:11 AM
#2
It is generally not a good idea to load web resources from disk. Do you have a permissions issue? You probably need to package the .xsd in a jar file, stick the jar on the classpath, and make sure you have a manifest entry for the file.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules