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?
-
Read xml file from an EJB (8 messages)
- Posted by: Ruben Galiana
- Posted on: September 20 2002 06:17 EDT
Threaded Messages (8)
- Read xml file from an EJB by PThakur Thakur on September 20 2002 08:12 EDT
- Read xml file from an EJB by Ruben Galiana on September 20 2002 10:00 EDT
- Read xml file from an EJB by Ahmed Talaat on September 20 2002 09:19 EDT
- Read xml file from an EJB by Ruben Galiana on September 20 2002 10:01 EDT
-
Read xml file from an EJB by Ahmed Talaat on September 20 2002 10:31 EDT
-
Read xml file from an EJB by Web Master on September 20 2002 06:38 EDT
- Read xml file from an EJB by Eric Ma on September 20 2002 10:58 EDT
- Read xml file from an EJB by Ruben Galiana on September 23 2002 02:10 EDT
-
Read xml file from an EJB by Web Master on September 20 2002 06:38 EDT
-
Read xml file from an EJB by Ahmed Talaat on September 20 2002 10:31 EDT
- Read xml file from an EJB by Ruben Galiana on September 20 2002 10:01 EDT
-
Read xml file from an EJB[ Go to top ]
- Posted by: PThakur Thakur
- Posted on: September 20 2002 08:12 EDT
- in response to Ruben Galiana
Hi
Your question is not clear. Whether u want to put xml file in .ear while making ear file or u want it by program.
Pankaj -
Read xml file from an EJB[ Go to top ]
- Posted by: Ruben Galiana
- Posted on: September 20 2002 10:00 EDT
- in response to PThakur Thakur
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. -
Read xml file from an EJB[ Go to top ]
- Posted by: Ahmed Talaat
- Posted on: September 20 2002 09:19 EDT
- in response to Ruben Galiana
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.
Cheers,
AT
-
Read xml file from an EJB[ Go to top ]
- Posted by: Ruben Galiana
- Posted on: September 20 2002 10:01 EDT
- in response to Ahmed Talaat
I want to package my xml files in the ejb jar file -
Read xml file from an EJB[ Go to top ]
- Posted by: Ahmed Talaat
- Posted on: September 20 2002 10:31 EDT
- in response to Ruben Galiana
getClass().getClassLoader().getResourceAsStream("com/myresources/xml/myfile.xml"); -
Read xml file from an EJB[ Go to top ]
- Posted by: Web Master
- Posted on: September 20 2002 18:38 EDT
- in response to Ahmed Talaat
Is this 'legal' from a J2EE perspective - I thought it ws against the standard to access files like this? -
Read xml file from an EJB[ Go to top ]
- Posted by: Eric Ma
- Posted on: September 20 2002 22:58 EDT
- in response to Web Master
No problem, as long as you don't do the file I/O under a TX context. -
Read xml file from an EJB[ Go to top ]
- Posted by: Ruben Galiana
- Posted on: September 23 2002 02:10 EDT
- in response to Web Master
And how do you make this access?