Results 1 to 2 of 2

Thread: Load Resource From EJB MessageDrivenBean

  1. #1

    Thumbs down 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.

  2. #2

    Default

    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
  •