<p>Hi Pawel,</p>
<p>I don't think this has anything to do with jcifs. Jcifs doesn't listen on 1024. In fact I don't think jcifs tries to listen on anything unless you try to use NetBIOS which you shouldn't be. </p>
<p>You really need a more complete stack trace so that you can see where it's originating.</p>
<p>Mike</p>
<div class="gmail_quote">On Apr 9, 2013 10:39 AM, "Paweł Matysiak" <<a href="mailto:pawel.jacek.matysiak@gmail.com">pawel.jacek.matysiak@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi,<div><br></div><div>I have run into pretty unique problem with jCIFS and I'd welcome any help.</div><div><br></div><div>While I would prefer not to go into details what are the underlying "business" decisions that put me into this position, I ended in situation in which "optimal" solution is as follows:</div>
<div><br></div><div>I need to connect and create (and fill) file on smb:// resource folder directly from Oracle database. To do this I created a relatively simple java class with public static method:</div><div>
<br></div><div><div> public static string createFile(String filename, Clob filecontent, String fileOut ) { </div><div> OutputStream out =null;</div><div> java.net.URL localURL;</div><div> InputStream content;</div>
<div> SmbFile toFile;</div><div> SmbFile newFile;</div><div> byte[] buf = new byte[4096];</div><div> try {</div><div> newFile = new SmbFile(fileOut);</div><div> toFile = new SmbFile( newFile, filename );</div>
<div> out = new SmbFileOutputStream(toFile);</div><div> content = filecontent.getAsciiStream();</div><div> </div><div> for(int len=-1;(len=content.read(buf))!=-1;){</div><div>
out.write(buf,0,len);</div><div> } </div><div> content.close();</div><div> out.close(); </div><div> } catch (Exception e) {</div><div> e.printStackTrace(); </div>
<div> return e.getMessage();</div><div> }</div><div> return filename;</div><div> }</div><div><br></div><div>I then deployed it and loaded into Oracle database (preceded by servlet.jar and jcifs.12 jar archive). It loaded. I then created a function that was mapped to the above method as well.</div>
<div><br></div><div>Then I tried to make a simple test run. It asked me for more privileges so I asked DBA for them and I was granted.</div><div><br></div><div>However now I'm stuck with:</div>
<div><br></div><div>the Permission (java.net.SocketPermission localhost:1024- listen,resolve) has not been granted to DATABASE_NAME. The PL/SQL to grant this is dbms_java.grant_permission( 'MY_USER', 'SYS:java.net.SocketPermission', 'localhost:1024-', 'listen,resolve' )<br>
</div><div><br></div><div>It's worth to note that when I check in USER_JAVA_POLICY I have following entries:</div><div><br></div><div>SYS<span style="white-space:pre-wrap"> </span>java.net.SocketPermission<span style="white-space:pre-wrap"> </span>*<span style="white-space:pre-wrap"> </span><span style="white-space:pre-wrap"> </span><span style="white-space:pre-wrap"> </span>*</div>
<div>SYS<span style="white-space:pre-wrap"> </span>java.net.SocketPermission<span style="white-space:pre-wrap"> </span>localhost:1024-<span style="white-space:pre-wrap"> </span>listen,resolve<br><br>at this moment I'm stuck. I have no ideas. <br>
<br>Any suggestion would be appreciated!</div><div><br></div><div>regards</div><div>Paweł</div></div></div>
</blockquote></div>