File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes including xml file in .ear file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "including xml file in .ear file" Watch "including xml file in .ear file" New topic

including xml file in .ear file

Raj Kumar Bindal
Ranch Hand

Joined: Apr 15, 2006
Posts: 418
I am preparing .ear file of a java file through servicegen script and in that i am using service tag to add my java class which i need to call from my web service ,but in one of those files,i want to read data from xml file but i am not able to add my own xml file in the ear file.I am including java files other that required web sevice file through javaClassComponents tag.Kindly tell me how i can add my xml file in the ear file.
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

I havent used the servicegen task, just had a look at it on the BEA site. Even though you cant add those xmls to the ear file through the servicegen task, you can still write a ant task which does this for you. That ant task can take the ear file, generated by servicegen task, as an input, unzip it and add the xml file and then zip it back to ear. There are ant tasks which allow you to zip/unzip archives and add contents to the archives.

[My Blog] [JavaRanch Journal]
I agree. Here's the link:
subject: including xml file in .ear file
It's not a secret anymore!