[Gvsig_english] [ gvSIG 2.0 extension development ] DAL Dependencies problem

luca bianconi lc.bianconi at googlemail.com
Mon Aug 2 12:23:13 CEST 2010


Hi all,

I'm having some problems working with the basic example code in DAL
documentation [1].

I've built up a very simple plugin with the "plugin creation wizard" from
the last bin of gvSIG 2.0 .
I've got the 3 projects: <my plugin name>.lib.api, <my plugin
name>.lib.impl, <my plugin name>.app.extension .

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:

*import org.gvsig.fmap.dal.DALLocator;
import org.gvsig.fmap.dal.DataManager;

public class BaProv
{
   DataManager manager;

   public BaProv()
   {
       manager = DALLocator.getDataManager();
    }
}
*

I've added the dependency into the pom.xml to the *org.gvsig.fmap.dal* jar
and I've added it into the buildpath of the project as a variable
referencing to the M2 repository.
I paste the dependencies I've pasted here.

*<dependencies>
        <dependency>
            <groupId>org.gvsig</groupId>
            <artifactId>org.gvsig.fmap.dal</artifactId>
            <version>2.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.gvsig</groupId>
            <artifactId>org.gvsig.fmap.dal</artifactId>
            <version>2.0-SNAPSHOT</version>
            <classifier>spi</classifier>
        </dependency>
        <dependency>
            <groupId>org.gvsig</groupId>
            <artifactId>org.gvsig.fmap.geometry</artifactId>
            <version>2.0-SNAPSHOT</version>
            <classifier>operation</classifier>
        </dependency>
        <!--TEST-->
        <dependency>
            <groupId>org.gvsig</groupId>
            <artifactId>org.gvsig.fmap.dal</artifactId>
            <version>2.0-SNAPSHOT</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.gvsig</groupId>
            <artifactId>org.gvsig.fmap.dal</artifactId>
            <version>2.0-SNAPSHOT</version>
            <classifier>impl</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.gvsig</groupId>
            <artifactId>org.gvsig.fmap.geometry</artifactId>
            <version>2.0-SNAPSHOT</version>
            <classifier>impl</classifier>
            <scope>test</scope>
        </dependency>
    </dependencies>*



When I perform the mvn install I've got some errors I can't understand
during the tests' phase (I paste them here).


*-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.gvsig.myprovider.impl.DefaultMyProviderServiceTest
11:50:35,217 INFO  [impl.DefaultServiceLoader.postJDK16Load()]
  Using the java.util.ServiceLoader to load the interface
org.gvsig.tools.library.Library implementations
11:50:35,298 INFO  [library.AbstractLibrariesInitializer.logLibraries()]
  Found 10 libraries:
    org.gvsig.myprovider.impl.MyProviderDefaultImplLibrary (null)
    org.gvsig.myprovider.MyProviderLibrary (null)
    org.gvsig.fmap.dal.DALLibrary (api)
    org.gvsig.fmap.dal.store.memory.MemoryStoreLibrary (impl)
    org.gvsig.tools.ToolsLibrary (api)
    org.gvsig.tools.persistence.xml.XMLPersistenceLibrary (api)
    org.gvsig.metadata.MetadataLibrary (api)
    org.cresques.ProjectionLibrary (api)
    org.gvsig.fmap.geom.GeometryLibrary (api)
    org.gvsig.fmap.geom.operation.impl.DefaultGeometryOperationLibrary
(impl)

11:50:35,299 INFO  [impl.MyProviderDefaultImplLibrary.initialize()]
  Initializing library
'org.gvsig.myprovider.impl.MyProviderDefaultImplLibrary'.
11:50:35,310 INFO  [myprovider.MyProviderLibrary.initialize()]
  Initializing library 'org.gvsig.myprovider.MyProviderLibrary'.
11:50:35,310 INFO  [dal.DALLibrary.initialize()]
  Initializing library 'org.gvsig.fmap.dal.DALLibrary'.
11:50:35,311 INFO  [memory.MemoryStoreLibrary.initialize()]
  Initializing library 'org.gvsig.fmap.dal.store.memory.MemoryStoreLibrary'.
11:50:35,311 INFO  [tools.ToolsLibrary.initialize()]
  Initializing library 'org.gvsig.tools.ToolsLibrary'.
11:50:35,339 INFO  [xml.XMLPersistenceLibrary.initialize()]
  Initializing library
'org.gvsig.tools.persistence.xml.XMLPersistenceLibrary'.
11:50:35,371 INFO  [metadata.MetadataLibrary.initialize()]
  Initializing library 'org.gvsig.metadata.MetadataLibrary'.
11:50:35,375 INFO  [cresques.ProjectionLibrary.initialize()]
  Initializing library 'org.cresques.ProjectionLibrary'.
11:50:35,375 INFO  [geom.GeometryLibrary.initialize()]
  Initializing library 'org.gvsig.fmap.geom.GeometryLibrary'.
11:50:35,376 INFO  [impl.DefaultGeometryOperationLibrary.initialize()]
  Initializing library
'org.gvsig.fmap.geom.operation.impl.DefaultGeometryOperationLibrary'.
11:50:35,376 INFO  [impl.MyProviderDefaultImplLibrary.postInitialize()]
  PostInitializing library
'org.gvsig.myprovider.impl.MyProviderDefaultImplLibrary'.
11:50:35,376 INFO  [myprovider.MyProviderLibrary.postInitialize()]
  PostInitializing library 'org.gvsig.myprovider.MyProviderLibrary'.
11:50:35,377 INFO  [dal.DALLibrary.postInitialize()]
  PostInitializing library 'org.gvsig.fmap.dal.DALLibrary'.
11:50:35,380 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x1;subtype=null;name=Boolean;class=java.lang.Boolean;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToBoolean.
11:50:35,381 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x2;subtype=null;name=Byte;class=java.lang.Byte;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToByte.
11:50:35,383 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x3;subtype=null;name=Char;class=java.lang.Character;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToString.
11:50:35,384 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x4;subtype=null;name=Integer;class=java.lang.Integer;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToInt.
11:50:35,405 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x5;subtype=null;name=Long;class=java.lang.Long;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToLong.
11:50:35,406 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x6;subtype=null;name=Float;class=java.lang.Float;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToFloat.
11:50:35,407 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x7;subtype=null;name=Double;class=java.lang.Double;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToDouble.
11:50:35,408 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x8;subtype=null;name=String;class=java.lang.String;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToString.
11:50:35,414 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x9;subtype=Date;name=Date;class=java.util.Date;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToDate.
11:50:35,415 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0xA;subtype=Date;name=Time;class=java.util.Date;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToDate.
11:50:35,416 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0xB;subtype=Date;name=Timestamp;class=java.util.Date;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToDate.
11:50:35,416 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0xC;subtype=null;name=ByteArray;class=null;coercion=null.
11:50:35,431 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0xD;subtype=File;name=File;class=java.io.File;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToFile.
11:50:35,432 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0xE;subtype=Folder;name=Folder;class=java.io.File;coercion=org.gvsig.tools.dataTypes.impl.coercion.CoerceToFile.
11:50:35,432 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0xF;subtype=null;name=DynObject;class=org.gvsig.tools.dynobject.DynObject;coercion=null.
11:50:35,433 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x11;subtype=null;name=Array;class=null;coercion=null.
11:50:35,433 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x12;subtype=null;name=List;class=java.util.List;coercion=null.
11:50:35,434 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x13;subtype=null;name=Set;class=java.util.Set;coercion=null.
11:50:35,434 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x14;subtype=null;name=Map;class=java.util.Map;coercion=null.
11:50:35,435 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x20;subtype=null;name=Object;class=null;coercion=null.
11:50:35,436 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x22;subtype=Geometry;name=Geometry;class=org.gvsig.fmap.geom.Geometry;coercion=null.
11:50:35,465 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x21;subtype=CRS;name=CRS;class=org.cresques.cts.IProjection;coercion=null.
11:50:35,466 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x23;subtype=Envelope;name=Envelope;class=org.gvsig.fmap.geom.primitive.Envelope;coercion=null.
11:50:35,488 INFO  [impl.DefaultServiceLoader.postJDK16Load()]
  Using the java.util.ServiceLoader to load the interface
org.gvsig.tools.library.Library implementations
11:50:35,492 INFO  [library.AbstractLibrariesInitializer.logLibraries()]
  Found 10 libraries:
    org.gvsig.myprovider.impl.MyProviderDefaultImplLibrary (null)
    org.gvsig.myprovider.MyProviderLibrary (null)
    org.gvsig.fmap.dal.DALLibrary (api)
    org.gvsig.fmap.dal.store.memory.MemoryStoreLibrary (impl)
    org.gvsig.tools.ToolsLibrary (api)
    org.gvsig.tools.persistence.xml.XMLPersistenceLibrary (api)
    org.gvsig.metadata.MetadataLibrary (api)
    org.cresques.ProjectionLibrary (api)
    org.gvsig.fmap.geom.GeometryLibrary (api)
    org.gvsig.fmap.geom.operation.impl.DefaultGeometryOperationLibrary
(impl)

11:50:35,492 INFO  [dal.DALLibrary.postInitialize()]
  PostInitializing library 'org.gvsig.fmap.dal.DALLibrary'.
11:50:35,492 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x22;subtype=Geometry;name=Geometry;class=org.gvsig.fmap.geom.Geometry;coercion=null.
11:50:35,493 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x21;subtype=CRS;name=CRS;class=org.cresques.cts.IProjection;coercion=null.
11:50:35,493 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x23;subtype=Envelope;name=Envelope;class=org.gvsig.fmap.geom.primitive.Envelope;coercion=null.
11:50:35,496 INFO  [impl.DefaultServiceLoader.postJDK16Load()]
  Using the java.util.ServiceLoader to load the interface
org.gvsig.tools.library.Library implementations
11:50:35,501 INFO  [library.AbstractLibrariesInitializer.logLibraries()]
  Found 10 libraries:
    org.gvsig.myprovider.impl.MyProviderDefaultImplLibrary (null)
    org.gvsig.myprovider.MyProviderLibrary (null)
    org.gvsig.fmap.dal.DALLibrary (api)
    org.gvsig.fmap.dal.store.memory.MemoryStoreLibrary (impl)
    org.gvsig.tools.ToolsLibrary (api)
    org.gvsig.tools.persistence.xml.XMLPersistenceLibrary (api)
    org.gvsig.metadata.MetadataLibrary (api)
    org.cresques.ProjectionLibrary (api)
    org.gvsig.fmap.geom.GeometryLibrary (api)
    org.gvsig.fmap.geom.operation.impl.DefaultGeometryOperationLibrary
(impl)

11:50:35,502 INFO  [dal.DALLibrary.postInitialize()]
  PostInitializing library 'org.gvsig.fmap.dal.DALLibrary'.
11:50:35,502 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x22;subtype=Geometry;name=Geometry;class=org.gvsig.fmap.geom.Geometry;coercion=null.
11:50:35,503 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x21;subtype=CRS;name=CRS;class=org.cresques.cts.IProjection;coercion=null.
11:50:35,503 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x23;subtype=Envelope;name=Envelope;class=org.gvsig.fmap.geom.primitive.Envelope;coercion=null.
Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 0.624 sec
<<< FAILURE!
Running org.gvsig.myprovider.impl.DefaultMyProviderManagerTest
11:50:35,544 INFO  [impl.DefaultServiceLoader.postJDK16Load()]
  Using the java.util.ServiceLoader to load the interface
org.gvsig.tools.library.Library implementations
11:50:35,547 INFO  [library.AbstractLibrariesInitializer.logLibraries()]
  Found 10 libraries:
    org.gvsig.myprovider.impl.MyProviderDefaultImplLibrary (null)
    org.gvsig.myprovider.MyProviderLibrary (null)
    org.gvsig.fmap.dal.DALLibrary (api)
    org.gvsig.fmap.dal.store.memory.MemoryStoreLibrary (impl)
    org.gvsig.tools.ToolsLibrary (api)
    org.gvsig.tools.persistence.xml.XMLPersistenceLibrary (api)
    org.gvsig.metadata.MetadataLibrary (api)
    org.cresques.ProjectionLibrary (api)
    org.gvsig.fmap.geom.GeometryLibrary (api)
    org.gvsig.fmap.geom.operation.impl.DefaultGeometryOperationLibrary
(impl)

11:50:35,548 INFO  [dal.DALLibrary.postInitialize()]
  PostInitializing library 'org.gvsig.fmap.dal.DALLibrary'.
11:50:35,548 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x22;subtype=Geometry;name=Geometry;class=org.gvsig.fmap.geom.Geometry;coercion=null.
11:50:35,549 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x21;subtype=CRS;name=CRS;class=org.cresques.cts.IProjection;coercion=null.
11:50:35,550 DEBUG [impl.DefaultDataTypesManager.addtype()]
  Registered data type
type=0x23;subtype=Envelope;name=Envelope;class=org.gvsig.fmap.geom.primitive.Envelope;coercion=null.
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.031 sec
<<< FAILURE!

Results :

Tests in error:

testMyProviderServiceMessage(org.gvsig.myprovider.impl.DefaultMyProviderServiceTest)

testMyProviderServiceDate(org.gvsig.myprovider.impl.DefaultMyProviderServiceTest)

testMyProviderServiceManager(org.gvsig.myprovider.impl.DefaultMyProviderServiceTest)

testGetMyProviderService(org.gvsig.myprovider.impl.DefaultMyProviderManagerTest)

Tests run: 4, Failures: 0, Errors: 4, Skipped: 0

[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] There are test failures.

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.
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: There are test failures.

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.
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test
failures.

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.
    at
org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java:575)
    at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    ... 17 more
*



Could anyone help me ?

Thanks a lot in advance,
Luca


[1]
http://www.gvsig.org/web/projects/gvsig-desktop/docs/devel/org.gvsig.fmap.dal/2.0.0/featurestore/descripcion-general
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.gva.es/pipermail/gvsig_internacional/attachments/20100802/4a8e5953/attachment.htm 


More information about the Gvsig_internacional mailing list