Hi, I am facing a problem with security. I am trying to write an XML file through an (
java)
EJB bean .Compiling is no problem.It is giving an access control exception at run time.The code and exception details are as follows.hope you can please help me out.
CODE:
---------------------
filePath = "c:\\j2sdkee1.2.1\\public_html\\";
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance ();
DocumentBuilder builder = factory.newDocumentBuilder ();
TransformerFactory tFactory = TransformerFactory.newInstance ();
Transformer transformer = tFactory.newTransformer ();
ByteArrayInputStream byt = new ByteArrayInputStream (contractLineStr.toString().getBytes ());
Document document = builder.parse (byt);
DOMSource source = new DOMSource (document);
File file = new File (filePath);
if (file.exists ())
file.delete ();
StreamResult result = new StreamResult (new FileOutputStream(filePath));
transformer.transform (source, result);
The Exception i am getting is
-----------------------------
java.security.AccessControlException:
access denied (java.io.FilePermission c:\j2sdkee1.2.1\public_html\CO301214.xml write)
bye
madhu g