Hi all,<br><br>I'm having some problems working with the basic example code in DAL documentation [1].<br><br>I've built up a very simple plugin with the "plugin creation wizard" from the last bin of gvSIG 2.0 .<br>
I've got the 3 projects: <my plugin name>.lib.api, <my plugin name>.lib.impl, <my plugin name>.app.extension .<br><br>I've written a class, with test purposes only, within the <my plugin name>.lib.impl , performing just the first operation required by a DAL provider, like that: <br>
<br><div style="margin-left: 40px;"><i>import org.gvsig.fmap.dal.DALLocator;<br>import org.gvsig.fmap.dal.DataManager;<br><br>public class BaProv<br>{<br> DataManager manager;<br><br> public BaProv()<br> {<br> manager = DALLocator.getDataManager();<br>
}<br>}<br></i></div><br>I've added the dependency into the pom.xml to the <i>org.gvsig.fmap.dal</i> jar and I've added it into the buildpath of the project as a variable referencing to the M2 repository.<br>I paste the dependencies I've pasted here.<br>
<br><div style="margin-left: 40px;"><i><dependencies><br> <dependency><br> <groupId>org.gvsig</groupId><br> <artifactId>org.gvsig.fmap.dal</artifactId><br> <version>2.0-SNAPSHOT</version><br>
</dependency><br> <dependency><br> <groupId>org.gvsig</groupId><br> <artifactId>org.gvsig.fmap.dal</artifactId><br> <version>2.0-SNAPSHOT</version><br>
<classifier>spi</classifier><br> </dependency> <br> <dependency><br> <groupId>org.gvsig</groupId><br> <artifactId>org.gvsig.fmap.geometry</artifactId><br>
<version>2.0-SNAPSHOT</version><br> <classifier>operation</classifier><br> </dependency><br> <!--TEST--><br> <dependency><br> <groupId>org.gvsig</groupId><br>
<artifactId>org.gvsig.fmap.dal</artifactId><br> <version>2.0-SNAPSHOT</version><br> <classifier>tests</classifier><br> <scope>test</scope><br>
</dependency><br> <dependency><br> <groupId>org.gvsig</groupId><br> <artifactId>org.gvsig.fmap.dal</artifactId><br> <version>2.0-SNAPSHOT</version><br>
<classifier>impl</classifier><br> <scope>test</scope><br> </dependency><br> <dependency><br> <groupId>org.gvsig</groupId><br>
<artifactId>org.gvsig.fmap.geometry</artifactId><br> <version>2.0-SNAPSHOT</version><br> <classifier>impl</classifier><br> <scope>test</scope><br>
</dependency><br> </dependencies></i><br><br><br></div><br>When I perform the mvn install I've got some errors I can't understand during the tests' phase (I paste them here).<br><br><br>
<div style="margin-left: 40px;"><i>-------------------------------------------------------<br> T E S T S<br>-------------------------------------------------------<br>Running org.gvsig.myprovider.impl.DefaultMyProviderServiceTest<br>
11:50:35,217 INFO [impl.DefaultServiceLoader.postJDK16Load()]<br> Using the java.util.ServiceLoader to load the interface org.gvsig.tools.library.Library implementations<br>11:50:35,298 INFO [library.AbstractLibrariesInitializer.logLibraries()]<br>
Found 10 libraries:<br> org.gvsig.myprovider.impl.MyProviderDefaultImplLibrary (null)<br> org.gvsig.myprovider.MyProviderLibrary (null)<br> org.gvsig.fmap.dal.DALLibrary (api)<br> org.gvsig.fmap.dal.store.memory.MemoryStoreLibrary (impl)<br>
org.gvsig.tools.ToolsLibrary (api)<br> org.gvsig.tools.persistence.xml.XMLPersistenceLibrary (api)<br> org.gvsig.metadata.MetadataLibrary (api)<br> org.cresques.ProjectionLibrary (api)<br> org.gvsig.fmap.geom.GeometryLibrary (api)<br>
org.gvsig.fmap.geom.operation.impl.DefaultGeometryOperationLibrary (impl)<br><br>11:50:35,299 INFO [impl.MyProviderDefaultImplLibrary.initialize()]<br> Initializing library 'org.gvsig.myprovider.impl.MyProviderDefaultImplLibrary'.<br>
11:50:35,310 INFO [myprovider.MyProviderLibrary.initialize()]<br> Initializing library 'org.gvsig.myprovider.MyProviderLibrary'.<br>11:50:35,310 INFO [dal.DALLibrary.initialize()]<br> Initializing library 'org.gvsig.fmap.dal.DALLibrary'.<br>
11:50:35,311 INFO [memory.MemoryStoreLibrary.initialize()]<br> Initializing library 'org.gvsig.fmap.dal.store.memory.MemoryStoreLibrary'.<br>11:50:35,311 INFO [tools.ToolsLibrary.initialize()]<br> Initializing library 'org.gvsig.tools.ToolsLibrary'.<br>
11:50:35,339 INFO [xml.XMLPersistenceLibrary.initialize()]<br> Initializing library 'org.gvsig.tools.persistence.xml.XMLPersistenceLibrary'.<br>11:50:35,371 INFO [metadata.MetadataLibrary.initialize()]<br> Initializing library 'org.gvsig.metadata.MetadataLibrary'.<br>
11:50:35,375 INFO [cresques.ProjectionLibrary.initialize()]<br> Initializing library 'org.cresques.ProjectionLibrary'.<br>11:50:35,375 INFO [geom.GeometryLibrary.initialize()]<br> Initializing library 'org.gvsig.fmap.geom.GeometryLibrary'.<br>
11:50:35,376 INFO [impl.DefaultGeometryOperationLibrary.initialize()]<br> Initializing library 'org.gvsig.fmap.geom.operation.impl.DefaultGeometryOperationLibrary'.<br>11:50:35,376 INFO [impl.MyProviderDefaultImplLibrary.postInitialize()]<br>
PostInitializing library 'org.gvsig.myprovider.impl.MyProviderDefaultImplLibrary'.<br>11:50:35,376 INFO [myprovider.MyProviderLibrary.postInitialize()]<br> PostInitializing library 'org.gvsig.myprovider.MyProviderLibrary'.<br>
11:50:35,377 INFO [dal.DALLibrary.postInitialize()]<br> PostInitializing library 'org.gvsig.fmap.dal.DALLibrary'.<br>11:50:35,380 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0x1;subtype=null;name=Boolean;class=java.lang.Boolean;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToBoolean.<br>
11:50:35,381 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0x2;subtype=null;name=Byte;class=java.lang.Byte;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToByte.<br>11:50:35,383 DEBUG [impl.DefaultDataTypesManager.addtype()]<br>
Registered data type type=0x3;subtype=null;name=Char;class=java.lang.Character;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToString.<br>11:50:35,384 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0x4;subtype=null;name=Integer;class=java.lang.Integer;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToInt.<br>
11:50:35,405 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0x5;subtype=null;name=Long;class=java.lang.Long;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToLong.<br>11:50:35,406 DEBUG [impl.DefaultDataTypesManager.addtype()]<br>
Registered data type type=0x6;subtype=null;name=Float;class=java.lang.Float;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToFloat.<br>11:50:35,407 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0x7;subtype=null;name=Double;class=java.lang.Double;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToDouble.<br>
11:50:35,408 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0x8;subtype=null;name=String;class=java.lang.String;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToString.<br>11:50:35,414 DEBUG [impl.DefaultDataTypesManager.addtype()]<br>
Registered data type type=0x9;subtype=Date;name=Date;class=java.util.Date;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToDate.<br>11:50:35,415 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0xA;subtype=Date;name=Time;class=java.util.Date;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToDate.<br>
11:50:35,416 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0xB;subtype=Date;name=Timestamp;class=java.util.Date;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToDate.<br>11:50:35,416 DEBUG [impl.DefaultDataTypesManager.addtype()]<br>
Registered data type type=0xC;subtype=null;name=ByteArray;class=null;coercion=null.<br>11:50:35,431 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0xD;subtype=File;name=File;class=java.io.File;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToFile.<br>
11:50:35,432 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0xE;subtype=Folder;name=Folder;class=java.io.File;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToFile.<br>11:50:35,432 DEBUG [impl.DefaultDataTypesManager.addtype()]<br>
Registered data type type=0xF;subtype=null;name=DynObject;class=org.gvsig.tools.dynobject.DynObject;coercion=null.<br>11:50:35,433 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0x11;subtype=null;name=Array;class=null;coercion=null.<br>
11:50:35,433 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0x12;subtype=null;name=List;class=java.util.List;coercion=null.<br>11:50:35,434 DEBUG [impl.DefaultDataTypesManager.addtype()]<br>
Registered data type type=0x13;subtype=null;name=Set;class=java.util.Set;coercion=null.<br>11:50:35,434 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0x14;subtype=null;name=Map;class=java.util.Map;coercion=null.<br>
11:50:35,435 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0x20;subtype=null;name=Object;class=null;coercion=null.<br>11:50:35,436 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0x22;subtype=Geometry;name=Geometry;class=org.gvsig.fmap.geom.Geometry;coercion=null.<br>
11:50:35,465 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0x21;subtype=CRS;name=CRS;class=org.cresques.cts.IProjection;coercion=null.<br>11:50:35,466 DEBUG [impl.DefaultDataTypesManager.addtype()]<br>
Registered data type type=0x23;subtype=Envelope;name=Envelope;class=org.gvsig.fmap.geom.primitive.Envelope;coercion=null.<br>11:50:35,488 INFO [impl.DefaultServiceLoader.postJDK16Load()]<br> Using the java.util.ServiceLoader to load the interface org.gvsig.tools.library.Library implementations<br>
11:50:35,492 INFO [library.AbstractLibrariesInitializer.logLibraries()]<br> Found 10 libraries:<br> org.gvsig.myprovider.impl.MyProviderDefaultImplLibrary (null)<br> org.gvsig.myprovider.MyProviderLibrary (null)<br>
org.gvsig.fmap.dal.DALLibrary (api)<br> org.gvsig.fmap.dal.store.memory.MemoryStoreLibrary (impl)<br> org.gvsig.tools.ToolsLibrary (api)<br> org.gvsig.tools.persistence.xml.XMLPersistenceLibrary (api)<br> org.gvsig.metadata.MetadataLibrary (api)<br>
org.cresques.ProjectionLibrary (api)<br> org.gvsig.fmap.geom.GeometryLibrary (api)<br> org.gvsig.fmap.geom.operation.impl.DefaultGeometryOperationLibrary (impl)<br><br>11:50:35,492 INFO [dal.DALLibrary.postInitialize()]<br>
PostInitializing library 'org.gvsig.fmap.dal.DALLibrary'.<br>11:50:35,492 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0x22;subtype=Geometry;name=Geometry;class=org.gvsig.fmap.geom.Geometry;coercion=null.<br>
11:50:35,493 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0x21;subtype=CRS;name=CRS;class=org.cresques.cts.IProjection;coercion=null.<br>11:50:35,493 DEBUG [impl.DefaultDataTypesManager.addtype()]<br>
Registered data type type=0x23;subtype=Envelope;name=Envelope;class=org.gvsig.fmap.geom.primitive.Envelope;coercion=null.<br>11:50:35,496 INFO [impl.DefaultServiceLoader.postJDK16Load()]<br> Using the java.util.ServiceLoader to load the interface org.gvsig.tools.library.Library implementations<br>
11:50:35,501 INFO [library.AbstractLibrariesInitializer.logLibraries()]<br> Found 10 libraries:<br> org.gvsig.myprovider.impl.MyProviderDefaultImplLibrary (null)<br> org.gvsig.myprovider.MyProviderLibrary (null)<br>
org.gvsig.fmap.dal.DALLibrary (api)<br> org.gvsig.fmap.dal.store.memory.MemoryStoreLibrary (impl)<br> org.gvsig.tools.ToolsLibrary (api)<br> org.gvsig.tools.persistence.xml.XMLPersistenceLibrary (api)<br> org.gvsig.metadata.MetadataLibrary (api)<br>
org.cresques.ProjectionLibrary (api)<br> org.gvsig.fmap.geom.GeometryLibrary (api)<br> org.gvsig.fmap.geom.operation.impl.DefaultGeometryOperationLibrary (impl)<br><br>11:50:35,502 INFO [dal.DALLibrary.postInitialize()]<br>
PostInitializing library 'org.gvsig.fmap.dal.DALLibrary'.<br>11:50:35,502 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0x22;subtype=Geometry;name=Geometry;class=org.gvsig.fmap.geom.Geometry;coercion=null.<br>
11:50:35,503 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0x21;subtype=CRS;name=CRS;class=org.cresques.cts.IProjection;coercion=null.<br>11:50:35,503 DEBUG [impl.DefaultDataTypesManager.addtype()]<br>
Registered data type type=0x23;subtype=Envelope;name=Envelope;class=org.gvsig.fmap.geom.primitive.Envelope;coercion=null.<br>Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 0.624 sec <<< FAILURE!<br>
Running org.gvsig.myprovider.impl.DefaultMyProviderManagerTest<br>11:50:35,544 INFO [impl.DefaultServiceLoader.postJDK16Load()]<br> Using the java.util.ServiceLoader to load the interface org.gvsig.tools.library.Library implementations<br>
11:50:35,547 INFO [library.AbstractLibrariesInitializer.logLibraries()]<br> Found 10 libraries:<br> org.gvsig.myprovider.impl.MyProviderDefaultImplLibrary (null)<br> org.gvsig.myprovider.MyProviderLibrary (null)<br>
org.gvsig.fmap.dal.DALLibrary (api)<br> org.gvsig.fmap.dal.store.memory.MemoryStoreLibrary (impl)<br> org.gvsig.tools.ToolsLibrary (api)<br> org.gvsig.tools.persistence.xml.XMLPersistenceLibrary (api)<br> org.gvsig.metadata.MetadataLibrary (api)<br>
org.cresques.ProjectionLibrary (api)<br> org.gvsig.fmap.geom.GeometryLibrary (api)<br> org.gvsig.fmap.geom.operation.impl.DefaultGeometryOperationLibrary (impl)<br><br>11:50:35,548 INFO [dal.DALLibrary.postInitialize()]<br>
PostInitializing library 'org.gvsig.fmap.dal.DALLibrary'.<br>11:50:35,548 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0x22;subtype=Geometry;name=Geometry;class=org.gvsig.fmap.geom.Geometry;coercion=null.<br>
11:50:35,549 DEBUG [impl.DefaultDataTypesManager.addtype()]<br> Registered data type type=0x21;subtype=CRS;name=CRS;class=org.cresques.cts.IProjection;coercion=null.<br>11:50:35,550 DEBUG [impl.DefaultDataTypesManager.addtype()]<br>
Registered data type type=0x23;subtype=Envelope;name=Envelope;class=org.gvsig.fmap.geom.primitive.Envelope;coercion=null.<br>Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.031 sec <<< FAILURE!<br>
<br>Results :<br><br>Tests in error: <br> testMyProviderServiceMessage(org.gvsig.myprovider.impl.DefaultMyProviderServiceTest)<br> testMyProviderServiceDate(org.gvsig.myprovider.impl.DefaultMyProviderServiceTest)<br> testMyProviderServiceManager(org.gvsig.myprovider.impl.DefaultMyProviderServiceTest)<br>
testGetMyProviderService(org.gvsig.myprovider.impl.DefaultMyProviderManagerTest)<br><br>Tests run: 4, Failures: 0, Errors: 4, Skipped: 0<br><br>[INFO] ------------------------------------------------------------------------<br>
[ERROR] BUILD FAILURE<br>[INFO] ------------------------------------------------------------------------<br>[INFO] There are test failures.<br><br>Please refer to /home/luca/workspace2/org.gvsig.myprovider/org.gvsig.myprovider.lib/org.gvsig.myprovider.lib.impl/target/surefire-reports for the individual test results.<br>
[INFO] ------------------------------------------------------------------------<br>[INFO] Trace<br>org.apache.maven.BuildFailureException: There are test failures.<br><br>Please refer to /home/luca/workspace2/org.gvsig.myprovider/org.gvsig.myprovider.lib/org.gvsig.myprovider.lib.impl/target/surefire-reports for the individual test results.<br>
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715)<br> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)<br>
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)<br> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)<br>
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)<br> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)<br>
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)<br> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)<br> at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)<br> at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
at java.lang.reflect.Method.invoke(Method.java:597)<br> at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)<br> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)<br> at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)<br>
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)<br>Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.<br><br>Please refer to /home/luca/workspace2/org.gvsig.myprovider/org.gvsig.myprovider.lib/org.gvsig.myprovider.lib.impl/target/surefire-reports for the individual test results.<br>
at org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java:575)<br> at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)<br> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)<br>
... 17 more<br></i></div><br><br><br>Could anyone help me ?<br><br>Thanks a lot in advance,<br>Luca<br><br><br>[1] <a href="http://www.gvsig.org/web/projects/gvsig-desktop/docs/devel/org.gvsig.fmap.dal/2.0.0/featurestore/descripcion-general">http://www.gvsig.org/web/projects/gvsig-desktop/docs/devel/org.gvsig.fmap.dal/2.0.0/featurestore/descripcion-general</a><br>