This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes Reading from .txt file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Reading from .txt file" Watch "Reading from .txt file" New topic
Author

Reading from .txt file

Andy Beller
Greenhorn

Joined: Aug 30, 2004
Posts: 3
Hallo
I have to move a few webapplications from tomcat to weblogic 8.1. This webapplications have to deployed on different Systems and are writing text-files into the root-directory of the webapplications.
My problem is that I have no real file-structure in weblogic(the files inside the war can't not be accessed for writing). Is there a way to deploy the webapp as expanded structure. I don't like to make changes for every system and set full path-infos in the webapplication.

tank you for every suggestion
Sachin Dangi
Greenhorn

Joined: Aug 31, 2003
Posts: 17
I have couple of suggestions.

1. You can define a parameter in a .properties file which will have the absolute path of your text file.

2. Yes, you can deploy a war file in exploded form in WLS81. Extract the contents of war file to any folder and then you can deploy it using weblogic console. Weblogic considers any folder which contains WEB-INF folder[along with deployment descriptors] as web application.
[ August 30, 2004: Message edited by: sachin ]
Andy Beller
Greenhorn

Joined: Aug 30, 2004
Posts: 3
thank you sachin
the problem is that I don't know the path to webapplications in all Environnments and Systems Unix and Windows. So the application today finds the realPath to the webapplication. next problem I don't have access to productiv environnment that makes it difficult to expand war files in production. Is there no possibility to change the server-settings to automaticly expand the war-file during deployment like it is whithin Tomcat?
Sachin Dangi
Greenhorn

Joined: Aug 31, 2003
Posts: 17
Andy,
i am still not clear with your problem.

usually on deployment weblogic extracts the contents of ear file in
/{DOMAIN_NAME}/{SERVER}/.wlnotdelete folder.

i think you should not face any problem if you create a text file from a web application on the server machine.

refer to the code given below for creating new file from a test servlet.


the output is :
it creates the text file at the root of the domain directory.

eg. home/bea8/user_projects/domains/testdomain/logs/test.txt
[ September 01, 2004: Message edited by: sachin ]
Andy Beller
Greenhorn

Joined: Aug 30, 2004
Posts: 3
Hi sachin
my problem is that I have to migrate 30 webapplication from tomcat to weblogic. I thougth there should be a way not to change the source in every of these applications. All these applications are writing files to the context-root and you can have a look on these text-files over the internet to see what's going on. In Tomcat during deployment the war-file is extracted and you have then accessable filestructure.

Seems that I have to do a solution like the one you suggested. thanks for your help
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reading from .txt file
 
Similar Threads
servlet hot deployment in weblogic7.0
WebSphere 4.0
Hot Deployment in Wenblogic 6.1
deploying a servlet
WebSphere 4.0