on 03-22-2007 3:55 PM
Hi,
We are using SAP Netweaver 04s JAVA system.
In our j2ee application we are trying to access shared resource(file), but ejb is giving exception. Our code is as follows:
File srcDir = new File("\machine_namefolder");
if(!srcDir.exists())
{throw new Exception("directory does not exist", srcSys);
}
It gives expection "FileNotFoundException".
The same j2ee application is working fine when deployed on IBM Websphere.
We trired to access same shared path from windows, it is also working.
Please help us. Thanks in advance.
--sagar
i solve it by own.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sagar,
EJBs are not allowed to access files and directories in the filesystem. See the <a href="http://java.sun.com/blueprints/qanda/ejb_tier/restrictions.html">EJB Restrictions</a>, and particularly <b>Why can't EJBs read and write files and directories in the filesystem? And why can't they access file descriptors?</b>
Cheers,
Vladimir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But then why is same thing working when i deploy my application in websphere.
and most importantly when i give a shared path of same machine where my application is deployed, it is still working. problem comes, when i give shared path of a different machine. It just dosent picks up the files.
I have to give shared path of a different machine because we have a Grid setup and we will have all our files shared in only one of the folders
thanks valdimir, but i couldnot find answer to my questions, that when i deploy the same application in websphere, it is able to access shared folders of any machine.
however when i deploy same j2ee ap[plication in NW WebAs, it can access shared folder of same machine <b>but cannot access shared folder of a different machine.</b>
As I said the answers are there, you just have to find and read them
<i>"Some Containers may allow the Deployer to grant more, or fewer, permissions to the enterprise bean instances than specified in Table 10. Support for this is not required by the EJB specification. Enterprise beans that rely on more or fewer permissions will not be portable across all EJB Containers."</i>
Thanks for immediate reply.
We solve the problem. Itz because of sap service user (<b><SAPID>adm</b>) who tries to access shared folders.
All Netweaver services on machine are under <SAPID>adm user.
To access the shared folder on remote machines, Netweaver services must be configured to run as a <b>domain account</b> , which account also present on remote machines.
We change the ownership of these services to domain account and restart the services. Now any shared folders are accessible from our application.
--sagar
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.