This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!

Jim Burns

Greenhorn
+ Follow
since May 30, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jim Burns

Peter,
I think the reason that this is not allowed is so you can't compromise the running of the container by writing huge files to the server.
Perhaps this could be overcome by providing a servlet that writes to a file and calling the servlet from the Enterprise JavaBean.
Cheers,

Originally posted by peter brews:
I am new to ejb and I came to know that usage of the java.io package is forbidden in the spec but in my method implemented in ejb bean i need to write to a external file.And a shell script is then executed which reads this file and does furhter processing.Is there some other way to achive this result ans will there be problems if I use the following code.Any suggestion in this matter is highly apprecaited. Following is the piece of code.. from my method <html> <body>


try
{
PrintWriter pw=new PrintWriter(new BufferedWriter(new FileWriter(new File("c:\\testdata.txt"))));
pw.print("aaaaaa");
pw.print("bbbbbbbbbbbbbbbb");
pw.prnt(name);
pw.print(seqid);
pw.close();
}
catch(IOException e)
{
e.getMessage();
}
and then i am using following piece of code to run shell script from that method in ejb
try
{
String command = "sh /export/home//submitData.sh " + currentfile ;
Process p = Runtime.getRuntime().exec(command);
}
catch(Exception e)
{}

</body> </html> Thanks, peter