Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Adding a feature to a layer won't result in an EventType.EDIT_EVENT

Hi,
thanks! Now it works. I added your plugin to our own application and programmatically open the projectExplorer ViewPart (which is normally not shown in our application) to execute your action. And ... same problems. No events. But I also discovered why: In the plugin.xml of net.refractions.udig.project I removed the WrapFeatureStore interceptor. With the WrapFeatureStore interceptor I get the events in your map / layer but I have exceptions in our application. The reason why I removed this interceptor:
 
In UDIGFeatureStore.setTransactionInternal() in the command
Transaction transaction = ((EditManager)layer.getMap().getEditManager()).getTransaction();
layer.getMap() returns NULL.
In LayerImpl.getMapInternal() the command
ContextModel context = getContextModel(); returns NULL, since in getContextModel() the eContainer is NULL.
The eContainer is NULL in my Map object. In the Map object which is created by your action it is not NULL.
 
The eContainer is an EMF object and I have never worked with EMF, it's all quite new for me.
 
Do you have an idea why this eContainer is never set in our map object? Where is this object set normally? What situation could avoid that it is set correctly?
 
thanks again and greetings from germany,
 
tony roth

 
-----udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx schrieb: -----


Hi I didn't give very good instructions that's probably the problem.  What you needed to do is import the plugin into your workspace.  So Import>Existing Project.  Then choose the import project from archive (I can't remember the exact name of the option).  Once in your workspace you have to add the plugin to the Run Configuration.  Then (hopefully) it will work.

Jesse




On 18-Dec-07, at 7:42 AM, tony.roth@xxxxxx wrote:

Thanks for your help and for your plugin. The code is as ours except we don't use the intercepter extension for adding a listener: We do it directly where we create the layer.
Our problem: we weren't able to run your plugin. We added it to a new rc12sdk copy, started udig and the action was / is in the context menu (so, we know that the plugin is accepted) but when activating the action we get a classnotfoundexception.
Somehow I feel like a complete novice but I recompiled your plugin, created a jar file and so on but neither me nor a colleague got it fixed. The bundle is found and used but the classes cannot be found. The same with your plugin for Piebe de Vries.
Perhaps I should wait till 2008 and then start again with all this stuff :-)
!ENTRY org.eclipse.osgi 2 0 2007-12-18 16:30:09.984
!MESSAGE The activator scraps.Activator for bundle scraps is invalid
!STACK 0
org.osgi.framework.BundleException: The activator scraps.Activator for bundle scraps is invalid
 at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:141)
 at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:970)
 at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
 at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
 at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400)
 at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:234)
 at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1269)
 at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:160)
 at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:788)
 at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
 at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:51)
 at net.refractions.udig.ui.operations.OpAction.getOperation(OpAction.java:115)
 at net.refractions.udig.ui.operations.OpAction$RunJob.run(OpAction.java:193)
 at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.ClassNotFoundException: scraps.Activator
 at java.net.URLClassLoader$1.run(Unknown Source)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(Unknown Source)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:429)
 at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369)
 at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357)
 at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:289)
 at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:227)
 at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:134)
 ... 13 more
Root exception:
java.lang.ClassNotFoundException: scraps.Activator
 at java.net.URLClassLoader$1.run(Unknown Source)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(Unknown Source)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:429)
 at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369)
 at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357)
 at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:289)
 at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:227)
 at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:134)
 at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:970)
 at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
 at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
 at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400)
 at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:234)
 at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1269)
 at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:160)
 at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:788)
 at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
 at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:51)
 at net.refractions.udig.ui.operations.OpAction.getOperation(OpAction.java:115)
 at net.refractions.udig.ui.operations.OpAction$RunJob.run(OpAction.java:193)
 at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!ENTRY net.refractions.udig.ui 1 0 2007-12-18 16:30:10.015
!MESSAGE
!STACK 0
java.lang.NullPointerException
 at net.refractions.udig.ui.operations.OpAction$RunJob.run(OpAction.java:194)
 at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

 
-----udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx schrieb: -----



So same goes for you tony.  I've attached a zip file with a plugin that contains an operations that can be run if you right click on a project.  It will create a Map using the code you gave me.  When I add polygons to the layer using the polygon tool it works just fine and the other extension in the plugin reports each event just fine.

If you can modify the plugin so it shows your error please do so and I'll fix the bug.


Jesse

On 17-Dec-07, at 4:45 AM, tony.roth@xxxxxx wrote:

// we never save a project or reuse it.
Project udigProject = ProjectPlugin.getPlugin().getProjectRegistry().getDefaultProject();
Map map = ProjectFactory.eINSTANCE.createMap(udigProject,"myMap",new ArrayList<Layer>());
..
// creating temporary resource / layer with:
CatalogPlugin.getDefault().getLocalCatalog().createTemporaryResource(myFeatureType);
...
map.sendCommandSync(BasicCommandFactory.getInstance().createAddManyLayers(layerList));

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

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

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


Back to the top