Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
jai
Contributor
Posts: 41
Registered: ‎10-12-2015

Use of third party jar in GMSC plugin.

Hi Team,

 

I am working on shape file superimpose on GMSC viewer by using GeoTools library in java plugin.

We are able to achieve this in smart client using Storage feature = context.createTemporaryDataStorage('LayerName',styleid).

 

Issue is, it works fine when i debug/run from eclipse but when i try to run the GMSC.JNLP directly it gives error:

 

 

 

Feb 11, 2016 10:42:28 AM org.geotools.data.DataAccessFinder getDataStore
WARNING: Problem asking Directory of spatial files (shapefiles) if it can process request:java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
at org.geotools.data.shapefile.ShapefileDataStoreFactory.canProcess(ShapefileDataStoreFactory.java:232)
at org.geotools.data.shapefile.ShapefileDirectoryFactory.canProcess(ShapefileDirectoryFactory.java:50)
at org.geotools.data.DataAccessFinder.getDataStore(DataAccessFinder.java:109)
at org.geotools.data.DataStoreFinder.getDataStore(DataStoreFinder.java:89)
at com.data.shapefile.ShapeFileReader.readShapeFile(ShapeFileReader.java:53)
at com.data.shapefile.ShapeFileHandlePlugin.OpenFileBrowser(ShapeFileHandlePlugin.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.intergraph.tools.utils.disptach.ActionDispatcher$EventRecord.run(ActionDispatcher.java:354)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.SecurityException: class "com.vividsolutions.jts.geom.Point"'s signer information does not match signer information of other classes in the same packageat java.lang.ClassLoader.checkCerts(Unknown Source)
at java.lang.ClassLoader.preDefineClass(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.geotools.data.DataUtilities.<clinit>(DataUtilities.java:240)
... 14 more
Feb 11, 2016 10:42:28 AM org.geotools.data.DataAccessFinder getDataStore
WARNING: Problem asking Shapefile if it can process request:java.lang.NoClassDefFoundError: Could not initialize class org.geotools.data.DataUtilities
java.lang.NoClassDefFoundError: Could not initialize class org.geotools.data.DataUtilities
at org.geotools.data.shapefile.ShapefileDataStoreFactory.canProcess(ShapefileDataStoreFactory.java:232)
at org.geotools.data.DataAccessFinder.getDataStore(DataAccessFinder.java:109)
at org.geotools.data.DataStoreFinder.getDataStore(DataStoreFinder.java:89)
at com.data.shapefile.ShapeFileReader.readShapeFile(ShapeFileReader.java:53)
at com.data.shapefile.ShapeFileHandlePlugin.OpenFileBrowser(ShapeFileHandlePlugin.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.intergraph.tools.utils.disptach.ActionDispatcher$EventRecord.run(ActionDispatcher.java:354)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.IllegalArgumentException: name is null or invalid
at com.intergraph.tools.utils.Assertion.throwObjectNotValidMessage(Assertion.java:564)
at com.intergraph.tools.utils.Assertion.assertNotNull(Assertion.java:131)
at com.intergraph.web.core.data.feature.Feature.<init>(Feature.java:194)
at com.intergraph.web.core.warehouse.featurestorage.StorageFeature.<init>(StorageFeature.java:43)
at com.intergraph.web.core.warehouse.featurestorage.StorageFactory.createTemporaryStorage(StorageFactory.java:64)
at com.intergraph.web.core.warehouse.FeatureWarehouse.getTemporaryStorage(FeatureWarehouse.java:239)
at com.intergraph.web.core.kernel.plugin.PluginContext.createTemporaryDataStorage(PluginContext.java:159)
at com.data.shapefile.ShapeFileHandlePlugin.getStorage(ShapeFileHandlePlugin.java:138)
at com.data.shapefile.ShapeFileHandlePlugin.OpenFileBrowser(ShapeFileHandlePlugin.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.intergraph.tools.utils.disptach.ActionDispatcher$EventRecord.run(ActionDispatcher.java:354)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

 

We have included all related GeoTools jar into our plugin JNLP and placed jar physically with JNLP file.

<resources>
		<j2se version="1.8.0_25+" />
		<property name="jnlp.packEnabled" value="true" />
		<jar href="ShapeFileUpload.jar"/>
		<jar href="commons-pool-1.5.4.jar"/>
		<jar href="gdal-1.8.1.jar"/>
		<jar href="gt-api-13.5.jar"/>
		<jar href="gt-data-13.5.jar"/>
		<jar href="gt-epsg-extension-13.5.jar"/>
		<jar href="gt-main-13.5.jar"/>
		<jar href="gt-metadata-13.5.jar"/>
		<jar href="gt-opengis-13.5.jar"/>
		<jar href="gt-referencing-13.5.jar"/>
		<jar href="gt-shapefile-13.5.jar"/>
		<jar href="jai_core-1.1.3.jar"/>
		<jar href="jdom-1.1.3.jar"/>
		<jar href="jgridshift-1.0.jar"/>
		<jar href="jsr-275-1.0-beta-2.jar"/>
		<jar href="jts-1.13.jar"/>
		<jar href="vecmath-1.3.2.jar"/>
	</resources>

Any help on how to use third party jar in our JNLP plugin will be of great help.

 

Thanks,

Jai Ram Gaur

 

Occasional Contributor
Posts: 9
Registered: ‎01-15-2016

Re: Use of third party jar in GMSC plugin.

Hi Jai,

 

You will need to digitally sign each of the libraries you need for your jar ( Even 3rd party ones ) with the same signature you used for signing your own jar.

 

You also need to make sure that all files are packed in pack.gz format.

 

Once the files are signed and added to the jnlp file everything ought to work.

 

Thanks,

John

jai
Contributor
Posts: 41
Registered: ‎10-12-2015

Re: Use of third party jar in GMSC plugin.

Hi John,

 

 

I have tried signing and packing third party jar as pack.gz as i am doing for customized jar but still getting error like

com.sun.deploy.net.JARSigningException: Could not verify signing in resource: http://in-g-jgaur/GMSC/plugins/ShapeFileUpload.jar.pack.gz
	at com.sun.deploy.security.JarVerifier.authenticateJarEntry(Unknown Source)
	at com.sun.deploy.security.EnhancedJarVerifier.validate(Unknown Source)
	at com.sun.deploy.cache.CacheEntry.processJar(Unknown Source)
	at com.sun.deploy.cache.CacheEntry.access$2100(Unknown Source)
	at com.sun.deploy.cache.CacheEntry$7.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.deploy.cache.CacheEntry.writeFileToDisk(Unknown Source)
	at com.sun.deploy.cache.CacheEntry.writeFileToDisk(Unknown Source)
	at com.sun.deploy.cache.Cache.downloadResourceToTempFile(Unknown Source)
	at com.sun.deploy.cache.Cache.downloadResourceToCache(Unknown Source)
	at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
	at com.sun.deploy.net.DownloadEngine.downloadResource(Unknown Source)
	at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
	at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
	at com.sun.javaws.LaunchDownload$DownloadTask.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

This new error comes only when i pack the jars else old error comes.

 

Thanks,

Jai Ram Gaur

Occasional Contributor
Posts: 9
Registered: ‎01-15-2016

Re: Use of third party jar in GMSC plugin.

Hi Jai

 

Below is the script I use to sign, pack and verify our jar.

 

Do you have a jnlp file for your jar file?

 

Cheers

John

 

 

 

pack200 -r IngrGMSmartClientExtensions.jar

jarsigner -keystore ../INGRGTSTOREOCT2016 -storepass PASSWORD -keypass PASSWORD IngrGMSmartClientExtensions.jar codesigncert

jarsigner -verify IngrGMSmartClientExtensions.jar -verbose

pack200 --segment-limit=-1  IngrGMSmartClientExtensions.jar.pack.gz IngrGMSmartClientExtensions.jar

unpack200 IngrGMSmartClientExtensions.jar.pack.gz IngrGMSmartClientExtensions.validate.jar

jarsigner -verify IngrGMSmartClientExtensions.validate.jar -verbose -certs

 

Highlighted
jai
Contributor
Posts: 41
Registered: ‎10-12-2015

Re: Use of third party jar in GMSC plugin.

Hi John,

 

I have tried everything you mentioned, still no luck. Now this is the last requirement of my current project i need to achieve. It has become bottle neck for the project. It will be highly apreciable if you can help me in resolving this issue.

 

I have tried last solution for resolving this issue as

  1. unzip all third party jars.
  2. Removed all manifest files and maven folder.
  3. Copy all class file along with there package structure in one directory.
  4. Included above as class folder to our jar solution.

It still gives the same error.

 

Thanks,

Jai Ram Gaur

 

 

Technical Evangelist
Posts: 148
Registered: ‎10-20-2015

Re: Use of third party jar in GMSC plugin.

which GMSC version do you use?

jai
Contributor
Posts: 41
Registered: ‎10-12-2015

Re: Use of third party jar in GMSC plugin.

Hi Shruda,

 

I am working on GMSC 2015 with SP1 (Smart Client V15.0.1.0_20150616.1).

 

Thanks and Regards,

 

Jai Ram Gaur

Technical Evangelist
Posts: 148
Registered: ‎10-20-2015

Re: Use of third party jar in GMSC plugin.

Please upgrade to V16 to get GMSC working with JTS.

 

Best Regards,

Steve

jai
Contributor
Posts: 41
Registered: ‎10-12-2015

Re: Use of third party jar in GMSC plugin.

Hi Shruda,

 

It's seems to be working on GMSC16, that's good news but i have to give solution on GMSC15.

 

Is there any specific jar of V16, which i can use in V15 to resolve this?

 

Thanks and Regrads,

Jai Ram Gaur

Technical Evangelist
Posts: 148
Registered: ‎10-20-2015

Re: Use of third party jar in GMSC plugin.

No, you can't replace a V15 jar with one of V16.