I like to read xml files from a EJB, and I'd like to put these files in the ear file.
Where do I have to put the xml files?
Your question is not clear. Whether u want to put xml file in .ear while making ear file or u want it by program.
Now I'm reading the xml files from the file system with an absolut path (c:\external\xml\Program.xml).
But I want all the xml files in my package structure.
If I make a package call com.enterprise.ejb.resources and put all the files here, how do I have to reference to this files?
I hope my question is more clear now.
There are lots of ways by which you can achieve what you want to do. you can put all your xmls in thier own jar say in: com.myproject.xml in the jar file xmlfiles.jar. Ear it up with the other jars that contain the ejbs and then use the class loader to read the xmls from thier packages. note that depending on your classloader (i.e. app server classloading) you may need to add xmlfiles.jar to the manifest of anyother jar that uses it inside the Ear.
Hope this helps.
I want to package my xml files in the ejb jar file
Is this 'legal' from a J2EE perspective - I thought it ws against the standard to access files like this?
No problem, as long as you don't do the file I/O under a TX context.
And how do you make this access?