[Gvsig_english] [ gvSIG 2.0 extension development ]DALDependencies problem

Jorge Piera Llodrá jpiera at prodevelop.es
Wed Aug 4 10:15:16 CEST 2010


Hi.

You are getting a NullPointerException in the line 131 of the DalLibrary 
class:

130: MetadataManager manager = MetadataLocator.getMetadataManager();
131: if( manager.getDefinition(DataStore.METADATA_DEFINITION_NAME)==null 
)....

It means that the MetedataManager has been not registered. To register a 
MetadatadaManager, add this dependency to your pom.xml file:

<dependency>
	<groupId>org.gvsig</groupId>
	<artifactId>org.gvsig.metadata</artifactId>
	<version>2.0-SNAPSHOT</version>
	<classifier>simple</classifier>
	<scope>test</scope>
</dependency>


Execute the mvn eclipse:eclipse, refresh the eclipse and try to execute 
the test other time. If you have done it, it means that the metadata 
library is not initialized for any reason. When you execute the test, 
you will see on the standar output the list of libraries that your 
execution has found. e.g:

Found 25 libraries:
     org.gvsig.metadata.MetadataLibrary (api)
     org.gvsig.metadata.simple.SimpleMetadataLibrary (impl)
     org.cresques.ProjectionLibrary (api)
     org.cresques.impl.CresquesCtsLibrary (impl)
    .....

Could you please check if 
org.gvsig.metadata.simple.SimpleMetadataLibrary is found?

Regards,
Jorge.


On 08/04/2010 09:42 AM, luca bianconi wrote:
> Hi Jorge,
>
> I've tried again and I can't fix it. Maybe I'm wrong with something 
> else. :'(
> Thanks a lot anyway,
> Luca
>
> 2010/8/4 Jorge Piera Llodrá <jpiera at prodevelop.es 
> <mailto:jpiera at prodevelop.es>>
>
>     Hello Luca.
>
>     You also have to add the dependency for the org.gvsig.metadata
>     library. But if you adds this dependency and you tries to compile,
>     you will get a new error because DAL needs more dependences in run
>     time. Joaquin send you a link with an example of a pom that shows
>     the dependences of DAL in run time of a concrete project. Just add
>     some of them (you don't need org.gvsig.fmap.dal.file) and try again.
>
>     Regards,
>     Jorge.
>
>     [1]https://forge.osor.eu/plugins/scmsvn/viewcvs.php/org.gvsig.landregistryviewer/trunk/org.gvsig.landregistryviewer/pom.xml?root=gvsig-fortuneco&view=markup  <https://forge.osor.eu/plugins/scmsvn/viewcvs.php/org.gvsig.landregistryviewer/trunk/org.gvsig.landregistryviewer/pom.xml?root=gvsig-fortuneco&view=markup>
>          
>
>
>          
>
>
>         Hi both,
>
>         sorry again.
>         I've added such dependency but apparently I can't make it working.
>
>         In order to understand the origin of my problem I've gone
>         through two different steps.
>         I describe them as far as probably for you it's a trivial
>         problem and if I describe the approach more precisely maybe
>         you can understand where I'm wrong:
>
>         - I've created the simplest plugin with the plugin creation
>         wizard from the last bin of gvSig 2.0 .
>           The structure is like that:
>             *   org.gvsig.sqliteext
>                 + lib.api
>                 + lib.impl
>             *   org.gvsig.sqliteext.app.extension
>         - I've added a maven project called
>         org.gvsig.sqliteext.sqlite.prov to the first project (ie
>         org.gvsig.sqliteext)
>           Now I've a structure like this one:
>           *   org.gvsig.sqliteext
>                 + lib.api
>                 + lib.impl
>                 + sqlite.prov (it containes within src/main just a
>         class in its package called as maven default App.java)
>             *   org.gvsig.sqliteext.app.extension
>
>         - I've added just a class variable (DataManager manager;) to
>         App.js, referred to org.gvsig.fmap.dal, into sqlite.prov and
>         I've added the proper (?) dependency [1] into sqlite.prov
>         pom.xml and everything compiles apparently alright.
>
>         BUT :
>
>         - I've added the same variable into the
>         SqliteExtDefaultImplLibrary.js within the lib.impl project and
>         I've got an error [2] because I have not included the
>         dependency for org.gvsig.fmap.dal.
>
>         IF:
>
>         - I've added the same dependency [1] working for the class
>         described above but I've got an error [3] during the test phase.
>
>         So, what I guess it is, as Joaquin has suggested before, maybe
>         I'm missing something for the dependencies during the test phase.
>         In that case could anyone help me in understanding that point ?
>         I mean: what kind of dependency I should add for making my
>         sample code working ?
>
>         I've seen many of them are described in documentation [4] but
>         I still can't understand how they work.
>
>         Best regards and thanks in advance for your precious help,
>         Luca
>
>
>         [1] <dependency>
>         <groupId>org.gvsig</groupId>
>         <artifactId>org.gvsig.fmap.dal</artifactId>
>         <version>2.0-SNAPSHOT</version>
>         </dependency>
>
>
>
>         [2]      [INFO]
>         ------------------------------------------------------------------------
>         [ERROR] BUILD FAILURE
>         [INFO]
>         ------------------------------------------------------------------------
>         [INFO] Compilation failure
>
>         /home/luca/workspace2/org.gvsig.sqliteext/org.gvsig.sqliteext.lib/org.gvsig.sqliteext.lib.impl/src/main/java/org/gvsig/sqliteext/impl/SqliteExtDefaultImplLibrary.java:[24,25]
>         package org.gvsig.fmap.dal does not exist
>
>         /home/luca/workspace2/org.gvsig.sqliteext/org.gvsig.sqliteext.lib/org.gvsig.sqliteext.lib.impl/src/main/java/org/gvsig/sqliteext/impl/SqliteExtDefaultImplLibrary.java:[37,1]
>         cannot find symbol
>         symbol  : class DataManager
>         location: class
>         org.gvsig.sqliteext.impl.SqliteExtDefaultImplLibrary
>
>
>         [3]      HERE ONE OF SURFIRE REPORTS:
>
>         -------------------------------------------------------------------------------
>         Test set: org.gvsig.sqliteext.impl.DefaultSqliteExtServiceTest
>         -------------------------------------------------------------------------------
>         Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time
>         elapsed: 0.116 sec <<< FAILURE!
>         testSqliteExtServiceMessage(org.gvsig.sqliteext.impl.DefaultSqliteExtServiceTest) 
>         Time elapsed: 0.009 sec <<< ERROR!
>         java.lang.NullPointerException
>             at
>         org.gvsig.fmap.dal.DALLibrary.registerDataStoreMetadataDefinition(DALLibrary.java:131)
>             at
>         org.gvsig.fmap.dal.DALLibrary.doPostInitialize(DALLibrary.java:81)
>             at
>         org.gvsig.tools.library.AbstractLibrary.postInitialize(AbstractLibrary.java:143)
>             at
>         org.gvsig.tools.library.AbstractLibrariesInitializer.initializeLibraries(AbstractLibrariesInitializer.java:132)
>             at
>         org.gvsig.tools.library.AbstractLibrariesInitializer.postInitialize(AbstractLibrariesInitializer.java:94)
>             at
>         org.gvsig.tools.library.AbstractLibrariesInitializer.postInitialize(AbstractLibrariesInitializer.java:84)
>             at
>         org.gvsig.tools.library.AbstractLibrariesInitializer.fullInitialize(AbstractLibrariesInitializer.java:100)
>             at
>         org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase.setUp(AbstractLibraryAutoInitTestCase.java:55)
>             at junit.framework.TestCase.runBare(TestCase.java:125)
>             at junit.framework.TestResult$1.protect(TestResult.java:106)
>             at
>         junit.framework.TestResult.runProtected(TestResult.java:124)
>             at junit.framework.TestResult.run(TestResult.java:109)
>             at junit.framework.TestCase.run(TestCase.java:118)
>             at junit.framework.TestSuite.runTest(TestSuite.java:208)
>             at junit.framework.TestSuite.run(TestSuite.java:203)
>             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.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
>             at
>         org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>             at
>         org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>             at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>             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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
>             at
>         org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
>
>         testSqliteExtServiceDate(org.gvsig.sqliteext.impl.DefaultSqliteExtServiceTest) 
>         Time elapsed: 0.019 sec <<< ERROR!
>         java.lang.NullPointerException
>             at
>         org.gvsig.fmap.dal.DALLibrary.registerDataStoreMetadataDefinition(DALLibrary.java:131)
>             at
>         org.gvsig.fmap.dal.DALLibrary.doPostInitialize(DALLibrary.java:81)
>             at
>         org.gvsig.tools.library.AbstractLibrary.postInitialize(AbstractLibrary.java:143)
>             at
>         org.gvsig.tools.library.AbstractLibrariesInitializer.initializeLibraries(AbstractLibrariesInitializer.java:132)
>             at
>         org.gvsig.tools.library.AbstractLibrariesInitializer.postInitialize(AbstractLibrariesInitializer.java:94)
>             at
>         org.gvsig.tools.library.AbstractLibrariesInitializer.postInitialize(AbstractLibrariesInitializer.java:84)
>             at
>         org.gvsig.tools.library.AbstractLibrariesInitializer.fullInitialize(AbstractLibrariesInitializer.java:100)
>             at
>         org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase.setUp(AbstractLibraryAutoInitTestCase.java:55)
>             at junit.framework.TestCase.runBare(TestCase.java:125)
>             at junit.framework.TestResult$1.protect(TestResult.java:106)
>             at
>         junit.framework.TestResult.runProtected(TestResult.java:124)
>             at junit.framework.TestResult.run(TestResult.java:109)
>             at junit.framework.TestCase.run(TestCase.java:118)
>             at junit.framework.TestSuite.runTest(TestSuite.java:208)
>             at junit.framework.TestSuite.run(TestSuite.java:203)
>             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.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
>             at
>         org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>             at
>         org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>             at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>             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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
>             at
>         org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
>
>         testSqliteExtServiceManager(org.gvsig.sqliteext.impl.DefaultSqliteExtServiceTest) 
>         Time elapsed: 0.052 sec <<< ERROR!
>         java.lang.NullPointerException
>             at
>         org.gvsig.fmap.dal.DALLibrary.registerDataStoreMetadataDefinition(DALLibrary.java:131)
>             at
>         org.gvsig.fmap.dal.DALLibrary.doPostInitialize(DALLibrary.java:81)
>             at
>         org.gvsig.tools.library.AbstractLibrary.postInitialize(AbstractLibrary.java:143)
>             at
>         org.gvsig.tools.library.AbstractLibrariesInitializer.initializeLibraries(AbstractLibrariesInitializer.java:132)
>             at
>         org.gvsig.tools.library.AbstractLibrariesInitializer.postInitialize(AbstractLibrariesInitializer.java:94)
>             at
>         org.gvsig.tools.library.AbstractLibrariesInitializer.postInitialize(AbstractLibrariesInitializer.java:84)
>             at
>         org.gvsig.tools.library.AbstractLibrariesInitializer.fullInitialize(AbstractLibrariesInitializer.java:100)
>             at
>         org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase.setUp(AbstractLibraryAutoInitTestCase.java:55)
>             at junit.framework.TestCase.runBare(TestCase.java:125)
>             at junit.framework.TestResult$1.protect(TestResult.java:106)
>             at
>         junit.framework.TestResult.runProtected(TestResult.java:124)
>             at junit.framework.TestResult.run(TestResult.java:109)
>             at junit.framework.TestCase.run(TestCase.java:118)
>             at junit.framework.TestSuite.runTest(TestSuite.java:208)
>             at junit.framework.TestSuite.run(TestSuite.java:203)
>             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.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
>             at
>         org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>             at
>         org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>             at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>             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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
>             at
>         org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
>
>
>
>
>         [4]
>         http://jornadas.gvsig.org/projects/gvsig-desktop/docs/devel/org.gvsig.fmap.dal/2.0.0/binarios/view?set_language=en
>
>
>
>
>
>
>         2010/8/3 Jorge Piera Llodrá <jpiera at prodevelop.es
>         <mailto:jpiera at prodevelop.es>>
>
>             Hello.
>
>             You don't have any implementation of the ICRSFactory in
>             run time while you are executing your test. Just add to
>             your pom next dependence:
>
>
>             <dependency>
>             <groupId>org.gvsig</groupId>
>             <artifactId>org.gvsig.projection</artifactId>
>
>             <version>2.0-SNAPSHOT</version>
>             <classifier>cresques-impl</classifier>
>             <scope>test</scope>
>             </dependency>
>
>             And try again.
>
>             Regards,
>             Jorge.
>
>
>
>             On 08/02/2010 05:35 PM, luca bianconi wrote:
>
>                 Hi both,
>
>                 I've tried to enjoy of both your suggestions but I
>                 still can't compile it. :-(
>
>                 I've tried to adapt the pom of the project suggested
>                 by Joaquin [1] but I've got a new error.
>                 I get it from 
>                 /home/luca/workspace2/org.gvsig.myprov/org.gvsig.myprov.lib/org.gvsig.myprov.lib.impl/target/surefire-reports
>                 as suggested by Jorge :
>
>                 /testMyProvServiceMessage(org.gvsig.myprov.impl.DefaultMyProvServiceTest) 
>                 Time elapsed: 0.024 sec <<< ERROR!
>                 An instance of ICRSFactory has not been registered in
>                 the CRSFactory
>                     at
>                 org.gvsig.tools.exception.BaseRuntimeException.<init>(BaseRuntimeException.java:73)
>                     at
>                 org.cresques.CRSFactoryNotRegisteredException.<init>(CRSFactoryNotRegisteredException.java:46)
>                     at
>                 org.cresques.ProjectionLibrary.doPostInitialize(ProjectionLibrary.java:45)
>                     at
>                 org.gvsig.tools.library.AbstractLibrary.postInitialize(AbstractLibrary.java:143)
>                     at
>                 org.gvsig.tools.library.AbstractLibrariesInitializer.initializeLibraries(AbstractLibrariesInitializer.java:132)
>                     at
>                 org.gvsig.tools.library.AbstractLibrariesInitializer.postInitialize(AbstractLibrariesInitializer.java:94)
>                     at
>                 org.gvsig.tools.library.AbstractLibrariesInitializer.postInitialize(AbstractLibrariesInitializer.java:84)
>                     at
>                 org.gvsig.tools.library.AbstractLibrariesInitializer.fullInitialize(AbstractLibrariesInitializer.java:100)
>                     at
>                 org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase.setUp(AbstractLibraryAutoInitTestCase.java:55)
>                     at junit.framework.TestCase.runBare(TestCase.java:125)
>
>
>                 /
>                 Does it make any sense to you ? I felt quite discouraged.
>                 If anyone has enough patience to help me I could put
>                 it on
>                 https://svn.forge.osor.eu/svn/gvsig-sandbox/gvsig-sqlite/trunk/TestCode/ExtensionsTests
>                 . Probably it's a trivial thing for you but it's
>                 driving me crazy and making me loosing lots of time.
>
>                 Thanks both for your precious help,
>                 Luca
>
>                 [1]
>                 https://forge.osor.eu/plugins/scmsvn/viewcvs.php/org.gvsig.landregistryviewer/trunk/org.gvsig.landregistryviewer/pom.xml?root=gvsig-fortuneco&view=markup
>                 <https://forge.osor.eu/plugins/scmsvn/viewcvs.php/org.gvsig.landregistryviewer/trunk/org.gvsig.landregistryviewer/pom.xml?root=gvsig-fortuneco&view=markup>
>
>
>                 _______________________________________________
>                 Gvsig_internacional mailing list
>                 Gvsig_internacional at listserv.gva.es
>                 <mailto:Gvsig_internacional at listserv.gva.es>
>                 http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>
>
>
>
>             -- 
>             Jorge Piera Llodrá
>             gvSIG Development Team
>             PRODEVELOP
>             Plaza Don Juan de Villarrasa, 14 - 5
>             46001 Valencia
>             Tel: +34 963510612
>             Fax: +34 963510908
>             e-mail:jpiera at prodevelop.es  <mailto:jpiera at prodevelop.es>
>             http://www.prodevelop.es http://www.gvsig.org
>
>
>             _______________________________________________
>             Gvsig_internacional mailing list
>             Gvsig_internacional at listserv.gva.es
>             <mailto:Gvsig_internacional at listserv.gva.es>
>             http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>
>
>
>         _______________________________________________
>         Gvsig_internacional mailing list
>         Gvsig_internacional at listserv.gva.es  <mailto:Gvsig_internacional at listserv.gva.es>
>         http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>            
>
>
>
>     -- 
>     Jorge Piera Llodrá
>     gvSIG Development Team
>     PRODEVELOP
>     Plaza Don Juan de Villarrasa, 14 - 5
>     46001 Valencia
>     Tel: +34 963510612
>     Fax: +34 963510908
>     e-mail:jpiera at prodevelop.es  <mailto:jpiera at prodevelop.es>
>     http://www.prodevelop.es
>     http://www.gvsig.org
>          
>
>
>     _______________________________________________
>     Gvsig_internacional mailing list
>     Gvsig_internacional at listserv.gva.es
>     <mailto:Gvsig_internacional at listserv.gva.es>
>     http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>
>
>
> _______________________________________________
> Gvsig_internacional mailing list
> Gvsig_internacional at listserv.gva.es
> http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>    


-- 
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: jpiera at prodevelop.es
http://www.prodevelop.es
http://www.gvsig.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.gva.es/pipermail/gvsig_internacional/attachments/20100804/923ccced/attachment.htm 


More information about the Gvsig_internacional mailing list