You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by James Montagne IV <ki...@gmail.com> on 2010/02/02 19:47:50 UTC

Re: PDFBox under partial trust

It is not specific to a newer version of windows.  In fact my environment is
server 2003.  The group who will be hosting the code wants our application
to run under Medium trust which basically restricts which resources the code
has access to.  "Partial Trust" means anything that isn't Full trust.

After some reading, it appears that the newer versions of IKVM have added
experimental support for partial trust.  So rebuilding the pdfbox DLL using
the newer version of IKVM may solve my problem.  Before I dive into that, I
was wondering if there was any guidance online about building the pdfbox
dll.  So far I just found something on the site saying it was best not to
try and build your own.  Any information anyone could provide would be
extremely useful.

On Mon, Jan 25, 2010 at 5:04 PM, Daniel Wilson <
williamstonconsulting@gmail.com> wrote:

> Sorry, I don't understand the "partial trust" issue.  I've been away from
> Windows administration for a few years now.
>
> Is that specific to Windows Vista / 2008?  Or am I misunderstanding
> entirely?
>
> As far as the creation of the .Net code for PDFBox, IKVM handles that.  If
> there are compiler settings associated with it, you might check what the
> corresponding IKVM switches are.
>
> Daniel
>
> On Mon, Jan 25, 2010 at 4:15 PM, James Montagne IV <kingjiv@gmail.com
> >wrote:
>
> > Hi,
> >
> > I am attempting to PDFBox in a partially trusted environment.  When I
> > attempt to call PDDocument.load I recieve the following:
> >
> > [SecurityException: That assembly does not allow partially trusted
> > callers.]
> >   at org.apache.pdfbox.pdfparser.PDFParser.__<clinit>()
> >   at org.apache.pdfbox.pdmodel.PDDocument.load(InputStream input,
> > RandomAccess scratchFile)
> >   at org.apache.pdfbox.pdmodel.PDDocument.load(InputStream input)
> >
> > Is it possible to somehow use PDFBox without needing to give the assembly
> > full trust?
> >
>

Re: PDFBox under partial trust

Posted by James <ki...@gmail.com>.
It was with the latest version of IKVM, but I actually wound up building it
all piece by piece using ikvmc.  It was tedious but worked eventually.

I haven't managed to completely narrow it down yet.  I know it happens when
I call PDDocument.load and from the stack trace I can see it happens in
org.apache.pdfbox.pdfparser.PDFParser.  But the exception doesn't actually
tell which assembly it is trying to use that is causing the issue.


On Wed, Feb 3, 2010 at 11:23 AM, Daniel Wilson <
williamstonconsulting@gmail.com> wrote:

> I saw on the IKVM thread that you had indeed done the IKVM build of PDFBox.
>
> Is that using the very latest IKVM?  If so, would you be willing to share
> the changes to the build script?
>
> As far as the partial trust goes, does anything give you any indication
> what
> it is that's preventing it?  Some particular Java library in use perhaps?
>
> Thanks
>
> Daniel
>
> On Tue, Feb 2, 2010 at 6:45 PM, Daniel Wilson <
>  williamstonconsulting@gmail.com> wrote:
>
> > https://issues.apache.org/jira/browse/PDFBOX-535
> >
> > I built the DLL set using IKVM and placed it at the URL above.  As noted
> > there, I simply did an ant Build.NET ... after setting up my .snk file
> and
> > telling the build script where to find it.
> >
> > Setting up the IKVM stuff is not as hard as it sounds.
> >
> > Daniel
> >
> >
> > On Tue, Feb 2, 2010 at 1:47 PM, James Montagne IV <kingjiv@gmail.com
> >wrote:
> >
> >> It is not specific to a newer version of windows.  In fact my
> environment
> >> is
> >> server 2003.  The group who will be hosting the code wants our
> application
> >> to run under Medium trust which basically restricts which resources the
> >> code
> >> has access to.  "Partial Trust" means anything that isn't Full trust.
> >>
> >> After some reading, it appears that the newer versions of IKVM have
> added
> >> experimental support for partial trust.  So rebuilding the pdfbox DLL
> >> using
> >> the newer version of IKVM may solve my problem.  Before I dive into
> that,
> >> I
> >> was wondering if there was any guidance online about building the pdfbox
> >> dll.  So far I just found something on the site saying it was best not
> to
> >> try and build your own.  Any information anyone could provide would be
> >> extremely useful.
> >>
> >> On Mon, Jan 25, 2010 at 5:04 PM, Daniel Wilson <
> >> williamstonconsulting@gmail.com> wrote:
> >>
> >> > Sorry, I don't understand the "partial trust" issue.  I've been away
> >> from
> >> > Windows administration for a few years now.
> >> >
> >> > Is that specific to Windows Vista / 2008?  Or am I misunderstanding
> >> > entirely?
> >> >
> >> > As far as the creation of the .Net code for PDFBox, IKVM handles that.
> >>  If
> >> > there are compiler settings associated with it, you might check what
> the
> >> > corresponding IKVM switches are.
> >> >
> >> > Daniel
> >> >
> >> > On Mon, Jan 25, 2010 at 4:15 PM, James Montagne IV <kingjiv@gmail.com
> >> > >wrote:
> >> >
> >> > > Hi,
> >> > >
> >> > > I am attempting to PDFBox in a partially trusted environment.  When
> I
> >> > > attempt to call PDDocument.load I recieve the following:
> >> > >
> >> > > [SecurityException: That assembly does not allow partially trusted
> >> > > callers.]
> >> > >   at org.apache.pdfbox.pdfparser.PDFParser.__<clinit>()
> >> > >   at org.apache.pdfbox.pdmodel.PDDocument.load(InputStream input,
> >> > > RandomAccess scratchFile)
> >> > >   at org.apache.pdfbox.pdmodel.PDDocument.load(InputStream input)
> >> > >
> >> > > Is it possible to somehow use PDFBox without needing to give the
> >> assembly
> >> > > full trust?
> >> > >
> >> >
> >>
> >
> >
>

Re: PDFBox under partial trust

Posted by Daniel Wilson <wi...@gmail.com>.
I saw on the IKVM thread that you had indeed done the IKVM build of PDFBox.

Is that using the very latest IKVM?  If so, would you be willing to share
the changes to the build script?

As far as the partial trust goes, does anything give you any indication what
it is that's preventing it?  Some particular Java library in use perhaps?

Thanks

Daniel

On Tue, Feb 2, 2010 at 6:45 PM, Daniel Wilson <
williamstonconsulting@gmail.com> wrote:

> https://issues.apache.org/jira/browse/PDFBOX-535
>
> I built the DLL set using IKVM and placed it at the URL above.  As noted
> there, I simply did an ant Build.NET ... after setting up my .snk file and
> telling the build script where to find it.
>
> Setting up the IKVM stuff is not as hard as it sounds.
>
> Daniel
>
>
> On Tue, Feb 2, 2010 at 1:47 PM, James Montagne IV <ki...@gmail.com>wrote:
>
>> It is not specific to a newer version of windows.  In fact my environment
>> is
>> server 2003.  The group who will be hosting the code wants our application
>> to run under Medium trust which basically restricts which resources the
>> code
>> has access to.  "Partial Trust" means anything that isn't Full trust.
>>
>> After some reading, it appears that the newer versions of IKVM have added
>> experimental support for partial trust.  So rebuilding the pdfbox DLL
>> using
>> the newer version of IKVM may solve my problem.  Before I dive into that,
>> I
>> was wondering if there was any guidance online about building the pdfbox
>> dll.  So far I just found something on the site saying it was best not to
>> try and build your own.  Any information anyone could provide would be
>> extremely useful.
>>
>> On Mon, Jan 25, 2010 at 5:04 PM, Daniel Wilson <
>> williamstonconsulting@gmail.com> wrote:
>>
>> > Sorry, I don't understand the "partial trust" issue.  I've been away
>> from
>> > Windows administration for a few years now.
>> >
>> > Is that specific to Windows Vista / 2008?  Or am I misunderstanding
>> > entirely?
>> >
>> > As far as the creation of the .Net code for PDFBox, IKVM handles that.
>>  If
>> > there are compiler settings associated with it, you might check what the
>> > corresponding IKVM switches are.
>> >
>> > Daniel
>> >
>> > On Mon, Jan 25, 2010 at 4:15 PM, James Montagne IV <kingjiv@gmail.com
>> > >wrote:
>> >
>> > > Hi,
>> > >
>> > > I am attempting to PDFBox in a partially trusted environment.  When I
>> > > attempt to call PDDocument.load I recieve the following:
>> > >
>> > > [SecurityException: That assembly does not allow partially trusted
>> > > callers.]
>> > >   at org.apache.pdfbox.pdfparser.PDFParser.__<clinit>()
>> > >   at org.apache.pdfbox.pdmodel.PDDocument.load(InputStream input,
>> > > RandomAccess scratchFile)
>> > >   at org.apache.pdfbox.pdmodel.PDDocument.load(InputStream input)
>> > >
>> > > Is it possible to somehow use PDFBox without needing to give the
>> assembly
>> > > full trust?
>> > >
>> >
>>
>
>

Re: PDFBox under partial trust

Posted by Daniel Wilson <wi...@gmail.com>.
https://issues.apache.org/jira/browse/PDFBOX-535

I built the DLL set using IKVM and placed it at the URL above.  As noted
there, I simply did an ant Build.NET ... after setting up my .snk file and
telling the build script where to find it.

Setting up the IKVM stuff is not as hard as it sounds.

Daniel

On Tue, Feb 2, 2010 at 1:47 PM, James Montagne IV <ki...@gmail.com> wrote:

> It is not specific to a newer version of windows.  In fact my environment
> is
> server 2003.  The group who will be hosting the code wants our application
> to run under Medium trust which basically restricts which resources the
> code
> has access to.  "Partial Trust" means anything that isn't Full trust.
>
> After some reading, it appears that the newer versions of IKVM have added
> experimental support for partial trust.  So rebuilding the pdfbox DLL using
> the newer version of IKVM may solve my problem.  Before I dive into that, I
> was wondering if there was any guidance online about building the pdfbox
> dll.  So far I just found something on the site saying it was best not to
> try and build your own.  Any information anyone could provide would be
> extremely useful.
>
> On Mon, Jan 25, 2010 at 5:04 PM, Daniel Wilson <
> williamstonconsulting@gmail.com> wrote:
>
> > Sorry, I don't understand the "partial trust" issue.  I've been away from
> > Windows administration for a few years now.
> >
> > Is that specific to Windows Vista / 2008?  Or am I misunderstanding
> > entirely?
> >
> > As far as the creation of the .Net code for PDFBox, IKVM handles that.
>  If
> > there are compiler settings associated with it, you might check what the
> > corresponding IKVM switches are.
> >
> > Daniel
> >
> > On Mon, Jan 25, 2010 at 4:15 PM, James Montagne IV <kingjiv@gmail.com
> > >wrote:
> >
> > > Hi,
> > >
> > > I am attempting to PDFBox in a partially trusted environment.  When I
> > > attempt to call PDDocument.load I recieve the following:
> > >
> > > [SecurityException: That assembly does not allow partially trusted
> > > callers.]
> > >   at org.apache.pdfbox.pdfparser.PDFParser.__<clinit>()
> > >   at org.apache.pdfbox.pdmodel.PDDocument.load(InputStream input,
> > > RandomAccess scratchFile)
> > >   at org.apache.pdfbox.pdmodel.PDDocument.load(InputStream input)
> > >
> > > Is it possible to somehow use PDFBox without needing to give the
> assembly
> > > full trust?
> > >
> >
>