Hi Jody and Mark,

I have tried using the SWT method, the problem is the same, although there
is no error popping up this time http://screencast.com/t/0LcE3MgpLay
Thing is, when i use this code in a standalone project, it works, but not
in this project with the servlet. Apparently it dies when reaching this
line SwtMapFrame.showMap(context);

If you do have any more ideas that will be a huge help for me.


On Tue, Mar 25, 2014 at 11:23 AM, <
geotools-gt2-users-requ...@lists.sourceforge.net> wrote:

> Send GeoTools-GT2-Users mailing list submissions to
>         geotools-gt2-users@lists.sourceforge.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> or, via email, send a message with subject or body 'help' to
>         geotools-gt2-users-requ...@lists.sourceforge.net
>
> You can reach the person managing the list at
>         geotools-gt2-users-ow...@lists.sourceforge.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of GeoTools-GT2-Users digest..."
>
>
> Today's Topics:
>
>    1. Re: Shape file does not load when handled in contextDestroyed
>       of a servlet (Mark Prins)
>    2. Re: Shape file does not load when handled in contextDestroyed
>       of a servlet (Jody Garnett)
>    3. Fwd: Shape file does not load when handled in
>       contextDestroyed of a servlet (Elena Pop)
>    4. Re: Fwd: Shape file does not load when handled in
>       contextDestroyed of a servlet (Jody Garnett)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 24 Mar 2014 21:51:11 +0100
> From: Mark Prins <mc.pr...@gmail.com>
> Subject: Re: [Geotools-gt2-users] Shape file does not load when
>         handled in contextDestroyed of a servlet
> To: geotools-gt2-users <geotools-gt2-users@lists.sourceforge.net>
> Message-ID:
>         <CANvR4jFBsUm4T81Go-5BF5-e=
> i7useeashnugnp3wa6v275...@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> 2014-03-24 17:43 GMT+01:00 Elena Pop <elena0...@gmail.com>:
> > Hello,
> >
> > I am working on a project that requires me to pass data from a client to
> > eclipse and for that i am using a servlet. But i will need to display the
> > points passed on a shape file.
> >
> > I am handling  the shape file loading in the contextDestroyed method,
> > however when i try to display it i get an error that looks like this and
> the
> > server does not stop :
> >
> >  Exception in thread "AWT-Windows" java.lang.IllegalStateException:
> Shutdown
> > in progress
> >     at
> > java.lang.ApplicationShutdownHooks.add(ApplicationShutdownHooks.java:66)
> >     at java.lang.Runtime.addShutdownHook(Runtime.java:211)
> >     at sun.awt.windows.WToolkit$2.run(WToolkit.java:279)
> >     at java.security.AccessController.doPrivileged(Native Method)
> >     at sun.awt.windows.WToolkit.registerShutdownHook(WToolkit.java:264)
> >     at sun.awt.windows.WToolkit.run(WToolkit.java:290)
> >     at java.lang.Thread.run(Thread.java:744)
> >
> > After some debugging i found out that the error comes from this line
> > JMapFrame.showMap(map);
> > Could you please give me a hand to understand where is the problem?
>
> without your code I'm just guessing here, however I would note the
> following:
> 1. the servlet api states "All servlets and filters will have been
> destroyed before any ServletContextListeners are notified of context
> destruction." as part of the contract for void
> contextDestroyed(ServletContextEvent sce) basically this means the
> servlet(s) can no longer do any work for you as it has been shut down
> 2. it seems strange to me to run AWT/GUI code as part of a non-gui
> (servlet) environment
>
> Mark
>
>
>
> --
> Disclaimer;
> This message is just a reflection of what I thought at the time of
> sending. The message may contain information that is not intended for
> you or that you don't understand.
>
>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 25 Mar 2014 09:58:52 +1100
> From: Jody Garnett <jody.garn...@gmail.com>
> Subject: Re: [Geotools-gt2-users] Shape file does not load when
>         handled in contextDestroyed of a servlet
> To: Elena Pop <elena0...@gmail.com>
> Cc: "geotools geotools-gt2-users@lists. sourceforge. net"
>         <geotools-gt2-users@lists.sourceforge.net>
> Message-ID:
>         <CAOhbgAnri3KUT63-P7r-d2=
> 0fnmnp29dbgbyhmfudak6us1...@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> I am a bit confused about your use case? Eclipse and servlet? Are they in
> the same process ...
>
> For the uDig app (based on eclipse rich client platform) we use geotools to
> draw - but we need to be sure to run AWT in "headless" mode - so that SWT
> can control graphics (rather than AWT).
>
> Jody Garnett
>
>
> On Tue, Mar 25, 2014 at 3:43 AM, Elena Pop <elena0...@gmail.com> wrote:
>
> > Hello,
> >
> > I am working on a project that requires me to pass data from a client to
> > eclipse and for that i am using a servlet. But i will need to display the
> > points passed on a shape file.
> >
> > I am handling  the shape file loading in the contextDestroyed method,
> > however when i try to display it i get an error that looks like this and
> > the server does not stop :
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > *Exception in thread "AWT-Windows" java.lang.IllegalStateException:
> > Shutdown in progress     at
> > java.lang.ApplicationShutdownHooks.add(ApplicationShutdownHooks.java:66)
> > at java.lang.Runtime.addShutdownHook(Runtime.java:211)    at
> > sun.awt.windows.WToolkit$2.run(WToolkit.java:279)    at
> > java.security.AccessController.doPrivileged(Native Method)     at
> > sun.awt.windows.WToolkit.registerShutdownHook(WToolkit.java:264)    at
> > sun.awt.windows.WToolkit.run(WToolkit.java:290)    at
> > java.lang.Thread.run(Thread.java:744)*
> > After some debugging i found out that the error comes from this line
> > *JMapFrame.showMap(map);*
> > Could you please give me a hand to understand where is the problem?
> >
> >
> >
> ------------------------------------------------------------------------------
> > Learn Graph Databases - Download FREE O'Reilly Book
> > "Graph Databases" is the definitive new guide to graph databases and
> their
> > applications. Written by three acclaimed leaders in the field,
> > this first edition is now available. Download your free book today!
> > http://p.sf.net/sfu/13534_NeoTech
> > _______________________________________________
> > GeoTools-GT2-Users mailing list
> > GeoTools-GT2-Users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 3
> Date: Tue, 25 Mar 2014 11:07:49 +0100
> From: Elena Pop <elena0...@gmail.com>
> Subject: [Geotools-gt2-users] Fwd: Shape file does not load when
>         handled in contextDestroyed of a servlet
> To: geotools-gt2-users@lists.sourceforge.net
> Message-ID:
>         <
> caoix5opub9xtbioowyveuc7qsrqoro6pakradqptxowrxoh...@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Jody,
>
> Thank you for your reply!
> So basically yes, i am using eclipse and servlet in the same process. Let
> me give you more details. I am sending the geographical coordinates from
> javascript to eclipse using an ajax call to the configured servlet in
> eclipse. That means i get the data in the doPost method of the servlet
> class and then in order to process the data, i am using the
> ServletContextListener's class contextDestroyed method .
>
> I hope i did not confuse you too much. Hang in there, more details are
> coming :)
>
> In the contextDestroyed method i am calling a function that handles the
> shape file processing. This function is pretty simple, it's the basic load
> of the shape file  http://screencast.com/t/gNHFueN39aZK that ends with
> showMap call.
> That one call is throwing the AWT exception which does not allow the system
> to turn back in the contextDestroyed  method in order to properly destroy
> the context of the servlet.
>
> Here are some screenshots:
> - servlet class with the doPost method http://screencast.com/t/wusuTNaN
> - the contextDestroyed method with the call to the shapefile function
> http://screencast.com/t/itffMXMFS
> - the function used to handle the shapefile loading
> http://screencast.com/t/5v6yQP6aW
>
> I might be using a too complicated way to set this up, but i am a beginner
> so bear with me.
>
>
> On Mon, Mar 24, 2014 at 11:58 PM, Jody Garnett <jody.garn...@gmail.com
> >wrote:
>
> > I am a bit confused about your use case? Eclipse and servlet? Are they in
> > the same process ...
> >
> > For the uDig app (based on eclipse rich client platform) we use geotools
> > to draw - but we need to be sure to run AWT in "headless" mode - so that
> > SWT can control graphics (rather than AWT).
> >
> > Jody Garnett
> >
> >
> > On Tue, Mar 25, 2014 at 3:43 AM, Elena Pop <elena0...@gmail.com> wrote:
> >
> >> Hello,
> >>
> >> I am working on a project that requires me to pass data from a client to
> >> eclipse and for that i am using a servlet. But i will need to display
> the
> >> points passed on a shape file.
> >>
> >> I am handling  the shape file loading in the contextDestroyed method,
> >> however when i try to display it i get an error that looks like this and
> >> the server does not stop :
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> *Exception in thread "AWT-Windows" java.lang.IllegalStateException:
> >> Shutdown in progress     at
> >> java.lang.ApplicationShutdownHooks.add(ApplicationShutdownHooks.java:66)
> >> at java.lang.Runtime.addShutdownHook(Runtime.java:211)    at
> >> sun.awt.windows.WToolkit$2.run(WToolkit.java:279)    at
> >> java.security.AccessController.doPrivileged(Native Method)     at
> >> sun.awt.windows.WToolkit.registerShutdownHook(WToolkit.java:264)    at
> >> sun.awt.windows.WToolkit.run(WToolkit.java:290)    at
> >> java.lang.Thread.run(Thread.java:744)*
> >> After some debugging i found out that the error comes from this line
> >> *JMapFrame.showMap(map);*
> >> Could you please give me a hand to understand where is the problem?
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Learn Graph Databases - Download FREE O'Reilly Book
> >> "Graph Databases" is the definitive new guide to graph databases and
> their
> >> applications. Written by three acclaimed leaders in the field,
> >> this first edition is now available. Download your free book today!
> >> http://p.sf.net/sfu/13534_NeoTech
> >> _______________________________________________
> >> GeoTools-GT2-Users mailing list
> >> GeoTools-GT2-Users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> >>
> >>
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 4
> Date: Tue, 25 Mar 2014 21:23:08 +1100
> From: Jody Garnett <jody.garn...@gmail.com>
> Subject: Re: [Geotools-gt2-users] Fwd: Shape file does not load when
>         handled in contextDestroyed of a servlet
> To: Elena Pop <elena0...@gmail.com>
> Cc: "geotools geotools-gt2-users@lists. sourceforge. net"
>         <geotools-gt2-users@lists.sourceforge.net>
> Message-ID:
>         <CAOhbgAkiJe=MGwyq1Y2iMXmhYK8aPMEiR=
> jvujimgbs1ew4...@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> See my original message about using SWT and AWT. It looks like you are
> trying to use JMapFrame.
>
> This is a long way of saying that SWT (i.e. Eclipse) and AWT cannot both be
> used at the same time.
>
> You can have a look at the gt-swt module for an SWT alternative, or look at
> the SWT / AWT bridge.
>
>
> Jody Garnett
>
>
> On Tue, Mar 25, 2014 at 9:07 PM, Elena Pop <elena0...@gmail.com> wrote:
>
> >
> > Hi Jody,
> >
> > Thank you for your reply!
> > So basically yes, i am using eclipse and servlet in the same process. Let
> > me give you more details. I am sending the geographical coordinates from
> > javascript to eclipse using an ajax call to the configured servlet in
> > eclipse. That means i get the data in the doPost method of the servlet
> > class and then in order to process the data, i am using the
> > ServletContextListener's class contextDestroyed method .
> >
> > I hope i did not confuse you too much. Hang in there, more details are
> > coming :)
> >
> > In the contextDestroyed method i am calling a function that handles the
> > shape file processing. This function is pretty simple, it's the basic
> load
> > of the shape file  http://screencast.com/t/gNHFueN39aZK that ends with
> > showMap call.
> > That one call is throwing the AWT exception which does not allow the
> > system to turn back in the contextDestroyed  method in order to properly
> > destroy the context of the servlet.
> >
> > Here are some screenshots:
> > - servlet class with the doPost method http://screencast.com/t/wusuTNaN
> > - the contextDestroyed method with the call to the shapefile function
> > http://screencast.com/t/itffMXMFS
> > - the function used to handle the shapefile loading
> > http://screencast.com/t/5v6yQP6aW
> >
> > I might be using a too complicated way to set this up, but i am a
> beginner
> > so bear with me.
> >
> >
> > On Mon, Mar 24, 2014 at 11:58 PM, Jody Garnett <jody.garn...@gmail.com
> >wrote:
> >
> >> I am a bit confused about your use case? Eclipse and servlet? Are they
> in
> >> the same process ...
> >>
> >>  For the uDig app (based on eclipse rich client platform) we use
> >> geotools to draw - but we need to be sure to run AWT in "headless" mode
> -
> >> so that SWT can control graphics (rather than AWT).
> >>
> >> Jody Garnett
> >>
> >>
> >> On Tue, Mar 25, 2014 at 3:43 AM, Elena Pop <elena0...@gmail.com> wrote:
> >>
> >>> Hello,
> >>>
> >>> I am working on a project that requires me to pass data from a client
> to
> >>> eclipse and for that i am using a servlet. But i will need to display
> the
> >>> points passed on a shape file.
> >>>
> >>> I am handling  the shape file loading in the contextDestroyed method,
> >>> however when i try to display it i get an error that looks like this
> and
> >>> the server does not stop :
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> *Exception in thread "AWT-Windows" java.lang.IllegalStateException:
> >>> Shutdown in progress     at
> >>>
> java.lang.ApplicationShutdownHooks.add(ApplicationShutdownHooks.java:66)
> >>> at java.lang.Runtime.addShutdownHook(Runtime.java:211)    at
> >>> sun.awt.windows.WToolkit$2.run(WToolkit.java:279)    at
> >>> java.security.AccessController.doPrivileged(Native Method)     at
> >>> sun.awt.windows.WToolkit.registerShutdownHook(WToolkit.java:264)    at
> >>> sun.awt.windows.WToolkit.run(WToolkit.java:290)    at
> >>> java.lang.Thread.run(Thread.java:744)*
> >>> After some debugging i found out that the error comes from this line
> >>> *JMapFrame.showMap(map);*
> >>> Could you please give me a hand to understand where is the problem?
> >>>
> >>>
> >>>
> ------------------------------------------------------------------------------
> >>> Learn Graph Databases - Download FREE O'Reilly Book
> >>> "Graph Databases" is the definitive new guide to graph databases and
> >>> their
> >>> applications. Written by three acclaimed leaders in the field,
> >>> this first edition is now available. Download your free book today!
> >>> http://p.sf.net/sfu/13534_NeoTech
> >>> _______________________________________________
> >>> GeoTools-GT2-Users mailing list
> >>> GeoTools-GT2-Users@lists.sourceforge.net
> >>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> >>>
> >>>
> >>
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Learn Graph Databases - Download FREE O'Reilly Book
> > "Graph Databases" is the definitive new guide to graph databases and
> their
> > applications. Written by three acclaimed leaders in the field,
> > this first edition is now available. Download your free book today!
> > http://p.sf.net/sfu/13534_NeoTech
> > _______________________________________________
> > GeoTools-GT2-Users mailing list
> > GeoTools-GT2-Users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech
>
> ------------------------------
>
> _______________________________________________
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
> End of GeoTools-GT2-Users Digest, Vol 94, Issue 13
> **************************************************
>
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to