[Pljava-dev] emailing with pl/java

Roberts, Jon Jon.Roberts at asurion.com
Mon May 5 20:00:51 UTC 2008


I read online someone else was having this problem with 1.6 so I removed
my JDK and installed 1.5.  I have it working now.  It might have been a
mismatch between the JRE too.  1.5 is OK for me for now.


Jon


> -----Original Message-----
> From: Lucas Madar [mailto:lucas at mcsnw.com]
> Sent: Monday, May 05, 2008 1:02 PM
> To: Roberts, Jon
> Cc: pljava-dev at pgfoundry.org
> Subject: Re: [Pljava-dev] emailing with pl/java
> 
> Roberts, Jon wrote:
> > CREATE OR REPLACE FUNCTION control.fn_smtp(p_smtp_server varchar,
p_to
> > varchar, p_from varchar, p_subject varchar, p_body varchar) returns
> > varchar as
> > 'smtp.send(java.lang.String, java.lang.String, java.lang.String,
> > java.lang.String, java.lang.String)'
> >   LANGUAGE 'java';
> >
> > It returns: "ERROR: IOException while sending message"
> >
> > What gives?  Why doesn't this work in pl/java but works just fine
from
> > the command line?
> >
> I believe the security of the 'java' language is probably getting in
> your way. It doesn't allow you to open files, so it probably doesn't
> allow you to open socket connections, either. Try using the 'javau'
> language, which has no security checks:
> 
> e.g. CREATE OR REPLACE FUNCTION control.fn_smtp ... LANGUAGE 'javau';
> 
> Good luck,
> Lucas



More information about the Pljava-dev mailing list