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
>
>
------------------------------------------------------------------------------
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