• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading from .txt file

 
Andy Beller
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic