Hi,

just a thought here but instead of "hosting" the xsds yourself through http://mySrv/geoserver/www (unless you have made changes to the xsd files) leave the original/official URIs in all your GS config files and then copy-paste the $GEOSERVER_DATA_DIR/app-schema-cache with all its contents from your DEV instance to your PRE environment (and make sure Tomcat has restarted aswell afterwards). Because unless you've changed the namespace imports in the inspire xsds the schema parsing will still be looking for schemas in the original location (excerpt from http://inspire.ec.europa.eu/schemas/ps/4.0/ProtectedSites.xsd):

<schema xmlns="http://www.w3.org/2001/XMLSchema";
    xmlns:base="http://inspire.ec.europa.eu/schemas/base/3.3";
    xmlns:gmd="http://www.isotc211.org/2005/gmd";
    xmlns:gml="http://www.opengis.net/gml/3.2";
    xmlns:gn="http://inspire.ec.europa.eu/schemas/gn/4.0";
xmlns:ps="http://inspire.ec.europa.eu/schemas/ps/4.0"; elementFormDefault="qualified" targetNamespace="http://inspire.ec.europa.eu/schemas/ps/4.0"; version="4.0"> <import namespace="http://inspire.ec.europa.eu/schemas/base/3.3"; schemaLocation="http://inspire.ec.europa.eu/schemas/base/3.3/BaseTypes.xsd"/> <import namespace="http://inspire.ec.europa.eu/schemas/gn/4.0"; schemaLocation="http://inspire.ec.europa.eu/schemas/gn/4.0/GeographicalNames.xsd"/> <import namespace="http://www.isotc211.org/2005/gmd"; schemaLocation="http://schemas.opengis.net/iso/19139/20070417/gmd/gmd.xsd"/> <import namespace="http://www.opengis.net/gml/3.2"; schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>

    ...etc...

And another thought - are you sure you can connect from the pre machine to your oracle db? If I had a penny for every time I ran into this issue ... :)

All the best,
Tõnis


On 12.07.19 11:34, ljacedo wrote:
Hello,

Im migrating data from one Geoserver (DEV) to another Geoserver (PRE) both
geoserver runs over tomcat 7. The difference between these two environment
is the Geoserver_PRE does not have access to internet so all schema links
were downloaded to local folder on server.

If somebody could help with this problem?
datastore.xml:
<dataStore>
   <id>DataStoreInfoImpl-2c4aa0ee:16020fa6fe6:-7fff</id>
   <name>ProtectedSite</name>
   <description>INSPIRE ProtectedSite</description>
   <type>Application Schema DataAccess</type>
   <enabled>true</enabled>
   <workspace>
     <id>WorkspaceInfoImpl--138ca4e9:1679897f1ee:-7ffe</id>
   </workspace>
   <connectionParameters>
     <entry key="dbtype">bd_oracle</entry>
     <entry
key="url">file:/serveis/dades/pre/gis/workspaces/ps/ProtectedSite/ProtectedSite_appschema.xml</entry>
     <entry key="namespace">http://mySrv/geoserver/www/schemas/ps/4.0</entry>
   </connectionParameters>
   <__default>false</__default>
</dataStore>

ProtectedSite_appschema.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<appschema:AppSchemaDataAccess xmlns:ns2="http://www.opengis.net/ogc";
xmlns:appschema="http://www.geotools.org/app-schema";>
        <namespaces>
                <Namespace>
                        <prefix>ps</prefix>
                        <uri>http://mySrv/geoserver/www/schemas/ps/4.0</uri>
                </Namespace>
                <Namespace>
                        <prefix>gml</prefix>
                        <uri>http://mySrv/geoserver/www/gml/3.2.1</uri>
                </Namespace>
                <Namespace>
                        <prefix>base</prefix>
                        <uri>http://mySrv/geoserver/www/schemas/base/3.3</uri>
                </Namespace>
                <Namespace>
                        <prefix>base2</prefix>
                        <uri>http://mySrv/geoserver/www/schemas/base2/2.0</uri>
                </Namespace>
                <Namespace>
                        <prefix>gmd</prefix>
                        
<uri>http://mySrv/geoserver/www/iso/19139/20070417/gmd</uri>
                </Namespace>
                <Namespace>
                        <prefix>xsi</prefix>
                        <uri>http://mySrv/geoserver/www/2001</uri>
                </Namespace>
                <Namespace>
                        <prefix>xlink</prefix>
                        <uri>http://mySrv/geoserver/www/xlink</uri>
                </Namespace>
                <Namespace>
                        <prefix>gco</prefix>
                        
<uri>http://mySrv/geoserver/www/iso/19139/20070417/gco</uri>
                </Namespace>
                <Namespace>
                        <prefix>gn</prefix>
                        <uri>http://mySrv/geoserver/www/schemas/gn/4.0</uri>
                </Namespace>
        </namespaces>
        <includedTypes/>
        <sourceDataStores>
                <DataStore>
                        <id>bd_oracle</id>
                        <parameters>
                                <Parameter>
                                        <name>dbtype</name>
                                        <value>Oracle</value>
                                </Parameter>
                                <Parameter>
                                        <name>host</name>
                                        <value>mySrvOra</value>
                                </Parameter>
                                <Parameter>
                                        <name>port</name>
                                        <value>myPort</value>
                                </Parameter>
                                <Parameter>
                                        <name>database</name>
                                        <value>MyDDBB</value>
                                </Parameter>
                                <Parameter>
                                        <name>user</name>
                                        <value>myUser</value>
                                </Parameter>
                                <Parameter>
                                        <name>passwd</name>
                                        <value>myPsswd</value>
                                </Parameter>
                        </parameters>
                </DataStore>
        </sourceDataStores>
        <targetTypes>
                <FeatureType>
                        <schemaUri>
                 http://mySrv/geoserver/www/schemas/ps/4.0/ProtectedSites.xsd
             </schemaUri>
                </FeatureType>
        </targetTypes>
        <typeMappings>
                <FeatureTypeMapping>
                        <mappingName>ProtectedSite_STORE</mappingName>
                        <sourceDataStore>bd_oracle</sourceDataStore>
                        <sourceType>PROTECTEDSITE_PS</sourceType>
                        <targetElement>ps:ProtectedSite</targetElement>
                        <attributeMappings>               
                                
                                
                                <AttributeMapping>
                                
<targetAttribute>ps:inspireID/base:Identifier/base:localId</targetAttribute>
                                        <encodeIfEmpty>true</encodeIfEmpty>
                                        <sourceExpression>
                                                <OCQL>ID_LOCALID</OCQL>
                                        </sourceExpression>
                                </AttributeMapping>
                                <AttributeMapping>
                                
<targetAttribute>ps:inspireID/base:Identifier/base:namespace</targetAttribute>
                                        <encodeIfEmpty>true</encodeIfEmpty>
                                        <sourceExpression>
                                                <OCQL>ID_NAMESPACE</OCQL>
                                        </sourceExpression>
                                </AttributeMapping>
                                <AttributeMapping>
                                
<targetAttribute>ps:inspireID/base:Identifier/base:versionId</targetAttribute>
                                        <encodeIfEmpty>true</encodeIfEmpty>
                                        <sourceExpression>
                                                <OCQL>ID_VERSIONID</OCQL>
                                        </sourceExpression>
                                        <ClientProperty>
                         <name>xsi:nil</name>
                         <value>if_then_else(isNull(ID_VERSIONID), 'true',
Expression.NIL)</value>
                     </ClientProperty>
                     <ClientProperty>
                         <name>nilReason</name>
                         <value>if_then_else(isNull(ID_VERSIONID),
'http://inspire.ec.europa.eu/codelist/VoidReasonValue/Unknown',
Expression.NIL)</value>
                                        </ClientProperty>
                                </AttributeMapping>
                                
                                <AttributeMapping>
                                        
<targetAttribute>ps:geometry</targetAttribute>
                                        <encodeIfEmpty>true</encodeIfEmpty>
                                        <sourceExpression>
                                                <OCQL>SHAPE</OCQL>
                                        </sourceExpression>
                                </AttributeMapping>
                                
                                
                                
                                <AttributeMapping>
                                        
<targetAttribute>ps:siteName</targetAttribute>
                                        <encodeIfEmpty>true</encodeIfEmpty>
                                        <sourceExpression>
                                                <OCQL>SITENAME</OCQL>
                                        </sourceExpression>
                                </AttributeMapping>
                                <AttributeMapping>
                                
<targetAttribute>ps:siteName/gn:GeographicalName/gn:language</targetAttribute>
                                        <encodeIfEmpty>false</encodeIfEmpty>
                                        <sourceExpression>
                                                <OCQL>if_then_else(isNull(SITENAME), 
Expression.NIL, 'cat')</OCQL>
                                        </sourceExpression>
                                </AttributeMapping>
                                <AttributeMapping>
                                
<targetAttribute>ps:siteName/gn:GeographicalName/gn:nativeness</targetAttribute>
                                        <sourceExpression>
                                                
<OCQL>if_then_else(isNull(SITENAME), Expression.NIL,
'http://inspire.ec.europa.eu/codelist/VoidReasonValue/Unpopulated')</OCQL>
                                        </sourceExpression>
                                        <encodeIfEmpty>false</encodeIfEmpty>
                                </AttributeMapping>
                                <AttributeMapping>
                                
<targetAttribute>ps:siteName/gn:GeographicalName/gn:nameStatus</targetAttribute>
                                        <sourceExpression>
                                                
<OCQL>if_then_else(isNull(SITENAME), Expression.NIL,
'http://inspire.ec.europa.eu/codelist/VoidReasonValue/Unpopulated')</OCQL>
                                        </sourceExpression>
                                        <encodeIfEmpty>false</encodeIfEmpty>
                                </AttributeMapping>
                                <AttributeMapping>
                                
<targetAttribute>ps:siteName/gn:GeographicalName/gn:sourceOfName</targetAttribute>
                                        <sourceExpression>
                                                
<OCQL>if_then_else(isNull(SITENAME), Expression.NIL,
'http://inspire.ec.europa.eu/codelist/VoidReasonValue/Unpopulated')</OCQL>
                                        </sourceExpression>
                                        <encodeIfEmpty>false</encodeIfEmpty>
                                </AttributeMapping>
                                <AttributeMapping>
                                
<targetAttribute>ps:siteName/gn:GeographicalName/gn:pronunciation</targetAttribute>
                                        <sourceExpression>
                                                
<OCQL>if_then_else(isNull(SITENAME), Expression.NIL,
'http://inspire.ec.europa.eu/codelist/VoidReasonValue/Unpopulated')</OCQL>
                                        </sourceExpression>
                                        <encodeIfEmpty>false</encodeIfEmpty>
                                </AttributeMapping>
                                <AttributeMapping>
                                
<targetAttribute>ps:siteName/gn:GeographicalName/gn:spelling/gn:SpellingOfName/gn:script</targetAttribute>
                                        <sourceExpression>
                                                <OCQL>if_then_else(isNull(SITENAME), 
Expression.NIL, 'Latn')</OCQL>
                                        </sourceExpression>
                                </AttributeMapping>
                                <AttributeMapping>
                                
<targetAttribute>ps:siteName/gn:GeographicalName/gn:spelling/gn:SpellingOfName/gn:text</targetAttribute>
                                        <sourceExpression>
                                                <OCQL>SITENAME</OCQL>
                                        </sourceExpression>
                                </AttributeMapping>
                                
                                
                                <AttributeMapping>
                                        
<targetAttribute>ps:siteProtectionClassification</targetAttribute>
                                        <encodeIfEmpty>true</encodeIfEmpty>
                                        <sourceExpression>
                                                
<OCQL>SITEPROTECTIONCLASSIFICATION</OCQL>
                                        </sourceExpression>
                                </AttributeMapping>
                                
                                <AttributeMapping>
                                        
<targetAttribute>ps:legalFoundationDate</targetAttribute>
                                        <encodeIfEmpty>true</encodeIfEmpty>
                                        <sourceExpression>
                                                <OCQL>LEGALFOUNDATIONDATE</OCQL>
                                        </sourceExpression>
                                </AttributeMapping>
                                
                                <AttributeMapping>
                                
<targetAttribute>ps:siteDesignation/ps:DesignationType/ps:designationScheme</targetAttribute>
                                        <sourceExpression>
                                                
<OCQL>if_then_else(isNull(SITEDESIGNATION), Expression.NIL,
'http://inspire.ec.europa.eu/codelist/VoidReasonValue/Unknown')</OCQL>
                                        </sourceExpression>
                                        <encodeIfEmpty>true</encodeIfEmpty>
                                </AttributeMapping>
                                <AttributeMapping>
                                
<targetAttribute>ps:siteDesignation/ps:DesignationType/ps:designation</targetAttribute>
                                        <sourceExpression>
                                                
<OCQL>if_then_else(isNull(SITEDESIGNATION), Expression.NIL,
'http://inspire.ec.europa.eu/codelist/VoidReasonValue/Unknown')</OCQL>
                                        </sourceExpression>
                                        <encodeIfEmpty>true</encodeIfEmpty>
                                </AttributeMapping>
                                <AttributeMapping>
                                
<targetAttribute>ps:siteDesignation/ps:DesignationType/ps:percentageUnderDesignation</targetAttribute>
                                        <sourceExpression>
                                                
<OCQL>if_then_else(isNull(SITEDESIGNATION), Expression.NIL,
'http://inspire.ec.europa.eu/codelist/VoidReasonValue/Unknown')</OCQL>
                                        </sourceExpression>
                                        <encodeIfEmpty>true</encodeIfEmpty>
                                </AttributeMapping>
                                
                                
                                <AttributeMapping>
                                        
<targetAttribute>ps:legalFoundationDocument</targetAttribute>
                                        <sourceExpression>
                                                
<OCQL>if_then_else(isNull(LEGALFOUNDATIONDOCUMENT), Expression.NIL,
'http://inspire.ec.europa.eu/codelist/VoidReasonValue/Unpopulated')</OCQL>
                                        </sourceExpression>
                                        <encodeIfEmpty>true</encodeIfEmpty>
                                </AttributeMapping>
                                <AttributeMapping>
                                
<targetAttribute>ps:legalFoundationDocument/gmd:CI_Citation/gmd:title/gco:CharacterString</targetAttribute>
                                        <sourceExpression>
                                                
<OCQL>if_then_else(isNull(LEGALFOUNDATIONDOCUMENT), Expression.NIL,
'http://inspire.ec.europa.eu/codelist/VoidReasonValue/Unpopulated')</OCQL>
                                        </sourceExpression>
                                </AttributeMapping>
                                <AttributeMapping>
                                
<targetAttribute>ps:legalFoundationDocument/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date</targetAttribute>
                                        <encodeIfEmpty>true</encodeIfEmpty>
                                        <sourceExpression>
                                                
<OCQL>if_then_else(isNull(LEGALFOUNDATIONDOCUMENT), Expression.NIL,
'http://inspire.ec.europa.eu/codelist/VoidReasonValue/Unpopulated')</OCQL>
                                        </sourceExpression>
                                </AttributeMapping>
                        </attributeMappings>
                </FeatureTypeMapping>
        </typeMappings>
</appschema:AppSchemaDataAccess>

Geoserver log:
2019-07-12 08:07:00,348 WARN [org.geoserver] - Ignoring store directory
'styles'
2019-07-12 08:07:00,355 INFO [org.geoserver] - Loaded store 'ProtectedSite',
enabled
2019-07-12 08:07:00,355 INFO [org.geoserver] - Loaded data store
'ProtectedSite'
2019-07-12 08:07:00,356 WARN [org.geoserver] - Error connecting to
'ProtectedSite'. Disabling.
2019-07-12 08:07:00,356 INFO [org.geoserver] -
java.io.IOException
        at 
org.geoserver.catalog.ResourcePool.getDataStore(ResourcePool.java:586)
        at
org.geoserver.catalog.impl.DataStoreInfoImpl.getDataStore(DataStoreInfoImpl.java:37)
        at
org.geoserver.config.GeoServerLoader.readCatalog(GeoServerLoader.java:355)
        at
org.geoserver.config.GeoServerLoader.readCatalog(GeoServerLoader.java:226)
        at
org.geoserver.config.DefaultGeoServerLoader.loadCatalog(DefaultGeoServerLoader.java:46)
        at org.geoserver.config.GeoServerLoader.reload(GeoServerLoader.java:210)
        at
org.geoserver.config.GeoServerLoaderProxy.reload(GeoServerLoaderProxy.java:65)
        at 
org.geoserver.config.impl.GeoServerImpl.reload(GeoServerImpl.java:434)
Caused by: java.lang.NullPointerException: Could not acquire data access
'ProtectedSite'
        at 
org.geoserver.catalog.ResourcePool.getDataStore(ResourcePool.java:560)
        ... 115 more
2019-07-12 08:07:00,362 INFO [org.geoserver] - Loaded feature type
'ProtectedSite', enabled
2019-07-12 08:07:00,363 INFO [org.geoserver] - Loaded feature type
'ProtectedSite'
2019-07-12 08:07:00,366 WARN [org.geoserver] - Failed to load layer for
feature type 'ProtectedSite'
com.thoughtworks.xstream.converters.ConversionException: null : null
---- Debugging information ----
cause-exception     : java.lang.NullPointerException
cause-message       : null
class               : java.util.LinkedHashSet
required-type       : java.util.LinkedHashSet
converter-type      :
org.geoserver.config.util.XStreamPersister$ReferenceCollectionConverter
line number         : 11
class[1]            : org.geoserver.catalog.impl.LayerInfoImpl
converter-type[1]   :
org.geoserver.config.util.XStreamPersister$LayerInfoConverter
version             : null
-------------------------------
        at
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
        at
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)




--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html


_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


--
@tkardi



_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to