I can't seem to find a good solution for this issue; that happens only
when running from an ant script. Looks like, when we try to shutdown
the thread pool executor in the destroy method of
ThreadPoolWorkManager, there is a security check and the
RuntimePermission to modifyThread is not set, thus the stack trace we
are seeing.

For some reason, trying to set the java.security.AllPermission in the
ant java task started causing classpath issues [1]

The only way I was able to make things work better was to  change the
code in ThreadPoolWorkManager destroy method like below, but I guess
this might give us other side effects...

    @Destroy
    public void destroy() {
        AccessController.doPrivileged(new PrivilegedAction() {
            public Object run() {
                try {
                    executor.shutdown();
                } catch(Exception ex) {
                    //ignore
                }
                return null;
            }
        });
    }


Any ideas would be appreciated...

[1] http://marc.info/?l=ant-user&m=119982919309601&w=2

On Jan 7, 2008 1:24 PM, Simon Laws <[EMAIL PROTECTED]> wrote:
>
> On Jan 7, 2008 8:33 PM, Luciano Resende <[EMAIL PROTECTED]> wrote:
>
> > I can look into this, and provide ant script support for the bpel sample.
> >
> > On Jan 7, 2008 12:19 PM, Simon Laws <[EMAIL PROTECTED]> wrote:
> > >
> > > On Jan 7, 2008 7:19 PM, Raymond Feng <[EMAIL PROTECTED]> wrote:
> > >
> > > > Hi, Simon.
> > > >
> > > > It seems that you replied to the wrong thread :-).
> > > >
> > > > By reading the stack trace, the exception is from Java2 security. Do
> > you
> > > > have the J2 security turned on?
> > > >
> > > > Thanks,
> > > > Raymond
> > > >
> > > > ----- Original Message -----
> > > > From: "Simon Laws" <[EMAIL PROTECTED]>
> > > > To: <tuscany-dev@ws.apache.org>
> > > > Sent: Monday, January 07, 2008 10:05 AM
> > > > Subject: Re: A question on webservice binding
> > > >
> > > >
> > > > >> I have helloworld-bpel running now in the distribution but still
> > two
> > > > > issues with it
> > > > >
> > > > > 1/ It won't run from the jar maven makes you have to ant compile
> > before
> > > > > you
> > > > > run it
> > > > > 2/ It throws an exception on shutdown....
> > > > >
> > > > >     [java] Status: RESPONSE
> > > > >     [java] Response: <?xml version="1.0" encoding="UTF-8"?>
> > > > >     [java] <message><TestPart><hello xmlns="
> > > > > http://tuscany.apache.org/implement
> > > > > ation/bpel/example/helloworld.wsdl">Hello
> > > > > World</hello></TestPart></message>
> > > > >     [java] Hello World
> > > > >     [java] Stopping BPELHelloWorldComponent
> > > > >     [java] INFO - GeronimoLog.info(79) | BPEL Server Stopped.
> > > > >     [java] Stopped !!!
> > > > >     [java] java.security.AccessControlException: Access denied (
> > > > > java.lang.Runti
> > > > > mePermission modifyThread)
> > > > >     [java]     at java.security.AccessController.checkPermission
> > > > > (AccessControll
> > > > > er.java:104)
> > > > >     [java]     at java.util.concurrent.ThreadPoolExecutor.shutdown
> > > > > (ThreadPoolEx
> > > > > ecutor.java:908)
> > > > >     [java]     at
> > > > > org.apache.tuscany.sca.core.work.ThreadPoolWorkManager.destro
> > > > > y(ThreadPoolWorkManager.java:216)
> > > > >     [java]     at
> > > > > org.apache.tuscany.sca.core.work.Jsr237WorkScheduler.destroy(
> > > > > Jsr237WorkScheduler.java:97)
> > > > >     [java]     at
> > > > > org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntime.
> > > > > stop(ReallySmallRuntime.java:187)
> > > > >     [java]     at
> > > > > org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.cl
> > > > > ose(DefaultSCADomain.java:264)
> > > > >     [java]     at helloworld.BPELClient.main(BPELClient.java:39)
> > > > >     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0
> > (Native
> > > > > Method)
> > > > >
> > > > > Am going to be offline for a while but if there is anyone familiar
> > with
> > > > > the
> > > > > helloworld-bpel sample that could shed some light on this that would
> > be
> > > > > splendid.
> > > > >
> > > > > Regards
> > > > >
> > > > > Simon
> > > > >
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > > Ooops. So I did. Sorry about that folks.
> > >
> > > I went back to the README and note that we aren't supporting ant files
> > for
> > > this sample so maybe I should be trying to get it to work anyhow.
> > >
> > > Simon
> > >
> >
> >
> >
> > --
> > Luciano Resende
> > Apache Tuscany Committer
> > http://people.apache.org/~lresende <http://people.apache.org/%7Elresende>
> > http://lresende.blogspot.com/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> > Great, thanks Luciano.
>
> Simon
>



-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to