Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] uDig export problem

On 09/12/2010, at 1:30 AM, Łukasz Stawicki wrote:

Hi all

I have a big problem exporting my application to standalone version using 'Export - Eclipse product' option from Eclipse and running it.

So to confirm you a xxxxx.product file and you are exporting as with the custom app tutorial. Can you export the custom app as described in the tutorial just to check that it works properly with Eclipse 3.6? (ie the problem may not be you; perhaps we need to change something now that we are using eclipse 3.6.1).

I finally managed to export everything ... almost. ICO files etc still are bad, but this is not a problem now. The problem is when I try to run my custom application, it crashes and I get

!MESSAGE Plug-in "net.refractions.udig.style.sld" was unable to instantiate class "net.refractions.udig.style.sld.editor.OpenStyleEditorAction".
!STACK 0
java.lang.NoClassDefFoundError: net/refractions/udig/project/ILayer
   at java.lang.Class.getDeclaredConstructors0(Native Method)
.....
Caused by: java.lang.ClassNotFoundException: net.refractions.udig.project.ILayer
   at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)
.....

errors.

That usually indicates a dependency problem; of some sort.

To check where the problem really is, I started to export a 'nude' udig without major problems.

Okay I think I understand.

It runs fine. As we have made some changes to basic uDig classes (necessary for our development) so I tried to export 'featured' uDig, i.e. net.refractions.* with our changes - and was not surprised observing that it crashes. We did not remove any class, and not broke any dependency chain insine net.refractions.udig.* packages - just added one or two and changed some methods. The only difference between original uDig and our version is that I have 5 projects imported inside my Eclipse. Can the produced jars be somehow different?

So when you export out your take on net.refractions.* it must have different version number; and that is preventing or confusing net.refractions.udig.sld when it goes looking for net.refractions.udig.project plugin.

I have checked manifest files inside *.jar and all the dependencies and exports that are required - are in place:

Plug-in "net.refractions.udig.style.sld":
Require-Bundle: org.eclipse.ui,org.eclipse.core.runtime,
net.refractions.udig.project,
...

Plug-in "net.refractions.udig.project":
Export-Package: net.refractions.udig.project,
net.refractions.udig.project.command,
...

I have no idea why net.refractions.udig.style.sld plugin cannot see classes from net.refractions.udig.project - I have not touched anything concerning building, dependencies, etc
Any help would be appreciated.

During the build process some version number stuff is forced down to be specific (perhaps even with build number). You have some control over how this is done. 

Can you compare the manifest of the resulting plugins and see if they are changed from what you see in the original source code.

Ideas:
- perhaps relax net.refractions.udig.style.sld to depend on a range over version numbers; so it will still see your modified net.refractions.udig.* plugins?
- perhaps look at using a fragment to try and formally change the classes you have trouble with? (that is what the mechanism is there for - any classes you provided will take the place of what was provided in the origional plugin). [1][2]
- finally you may want to submit your changes back to the udig project; we are open for a reason :-)
- depending on what you needed to do; you may of been able to use an "adapterfactory" to add additional interfaces (and thus methods) to existing udig classes. This is the most clean way to extend existing classes; without modifying the original code

Jody

Jody
regards

Lukasz
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


Back to the top