1 Reply Latest reply on Mar 11, 2005 3:46 PM by jma24

    Can a text file be used as a resource?

    jma24

      Short question: what types of resources can you define using a a <resource-ref> tag? All the examples I see are SQL examples, where someone defines a datasource used as a reference. I want a text file to be used by a web application that uses EJB's, but I can't find any examples of how to do that.

      More detail: I am a grad student in an EJB class. So naturally, I have very little experience with them. But I am doing a project wherein I use some text files to populate some data into the database. This was no problem as I was developing the beans, since the text files were available in the same directory as my build.xml that contained the ANT targets for my test cases. I would call an ANT target from the command line, it would fire up a Session Bean that connected through a remote interface into the JBoss container, send it the text files, and away we went. Now that everything works, I want to use it as a web app. And here I have a problem. I can include the text files in the ear, but when I call my application through the web app, it has no idea where to find the text files.

      Any advice?

        • 1. Re: Can a text file be used as a resource?
          jma24

          Well, thanks anyway. If I include the text files in the jar, that makes them available at the context level. So I can access them with a URL.

          Still curious about whether the only thing you can define as a resource is some sort of data source...