Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Re: [Geotools-gt2-users] ClassLoader problems with GeoTools/RCP

Gary W. Lucas wrote:
> 
> Justin,
> 
> Basically, I used the "New Project" wizard and used the
> "Plug-in from existing JAR archives" option under the
> "Plug-in Development" folder.  I created a project which I called
> GeoToolsPlugin_2_3_0 and imported all the jars (un-checking
> the "unpack jars" option which turned out to be disastrous
> the first time I tried this).  This still didn't work (even when I
> played with
> the build path), but finally I went into the "Run->Run" menu dialog and
> spotted a tab labeled "Plus-Ins" which let me enable my new plug-in.
> After that, it worked.
> 
Yeah, when you add a new plugin to your workspace, I don't think it
necessarily gets included in the "runtime", so you have to enable it on
this tab. The "Add Plugin Dependencies" button can also be very useful
for debugging plugin dependencies, as this is often the reason why
plugins gets disabled at runtime.
> All of this strikes me as... well... fragile.  But it seems to be working.
> I'd like to really understand this topic before I commit too much energy
> to GeoTools and Eclipse.  Can anyone point me in the direction of
> a book or web site that explains this issue? More importantly,
> is this in keeping with the "best practices" of the GeoTools project
> or is there a preferred way to do it?
Unfortunately the learning curve for developing with Eclipse is pretty
steep. While the eclipse platform is very powerful once you get the hang
of it I think it ends up scaring a lot of people off. Lets ask the udig
guys if they can recommend any materials for you to get started.
> 
> Gary

-Justin
> 
> 
> 
> 
> At 11:34 AM 3/16/2007, you wrote:
>> Hi Gary,
>>
>> Yes the breakdown geotools modules wont map cleanly to eclipse rcp
>> plugins due to class loading issues. I believe there is some magic you
>> can pull off with "buddy classloading" but I have never tried it out.
>> The udig guys can comment on that.
>>
>> The udig approach is to have a single "libs" plugin which essentially
>> contains the entire geotools library in one plugin.  What is your plugin
>> structure?
>>
>> -Justin
>>
>> Gary Lucas wrote:
>> > I am attempting to use GeoTools to create and eclipse plug-in that
>> draws
>> > maps. I've had some luck writing conventional Java applications and
>> > decided to move forward a Rich Client Platform (RCP) implementation to
>> > take advantage of the better GUI support. Anyway, I've hit a roadblock.
>> >
>> > At the point in the program execution when I try to create my first
>> map,
>> > the program fails when calling a constructor for a class. The class
>> > loads a shape file and creates a map context.  A key point here is that
>> > the constructor itself is empty (it's just a stub for now) and the
>> > method that creates the map context is NEVER called. Even so, if the
>> > statement
>> >
>> >    MapContext  mapContext = DefaultMapContext();
>> >
>> > is called, the program fails. If the line is commented out, it
>> continues
>> > on... though of course there's little point in doing so since it will
>> > never be able to render a map.   A similar thing happens if I use
>> > DefaultMapLayer.  Interestingly enough, the program is able to include
>> > code open a shape file and create a ShapeFileDatastore.
>> >
>> > Clearly the problem has to do with the ClassLoader and Eclipse's notion
>> > of installing custom class loaders.  I am new to the RCP and plug-ins,
>> > so I don't really know how to proceed from here.
>> >
>> > I was wondering whether anyone had a solution for this problem. I know
>> > that the uDig folks must have worked it out, but I haven't found any
>> > relevant discussion in the archives for this mailing list.
>> >
>> > As I have said so many times before on this discussion group: thanks in
>> > advance for your help.
>> >
>> > Gary
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > ---
>> > Gary W. Lucas, Senior Software Engineer
>> > Sonalysts, Inc
>> > 215 Parkway North
>> > Waterford, CT 06320
>> > (860) 326-3682
>> >
>> >
>> >
>> > >
>> >
>> >
>> ------------------------------------------------------------------------
>> >
>> >
>> -------------------------------------------------------------------------
>> > Take Surveys. Earn Cash. Influence the Future of IT
>> > Join SourceForge.net's Techsay panel and you'll get the chance to
>> share your
>> > opinions on IT & business topics through brief surveys-and earn cash
>> >
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> >
>> > !DSPAM:4007,45fa8ed8230332051017194!
>> >
>> >
>> >
>> ------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > Geotools-gt2-users mailing list
>> > Geotools-gt2-users@xxxxxxxxxxxxxxxxxxxxx
>> > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>> >
>> >
>> > !DSPAM:4007,45fa8ed8230332051017194!
>>
>>
>> -- 
>> Justin Deoliveira
>> The Open Planning Project
>> http://topp.openplans.org
> 
> Gary W. Lucas
> Sonalysts, Inc.
> 215 Parkway North
> Waterford CT 06320, USA
> (860) 326-3682
> 
> 
> 
> !DSPAM:4007,45fac89f300861362196140!
> 


-- 
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org


Back to the top