明天的明天 永远的永远 未知的一切 我与你一起承担 ??

是非成败转头空 青山依旧在 几度夕阳红 。。。
  博客园  :: 首页  :: 管理

文章目录

    前言
    一、下载war包
    二、下载安装JDK
    三、配置环境变量
        1、JAVA_HOME
        2、UGO_HOME
        3、LD_LIBRARY_PATH
        4、CLASSPATH
        5、PATH
        6、SUPERMAP_ROOT
        7、生效
    四、下载Tomcat
        注意:
    五、部署成功
    总结


前言

SuperMap iServer 10i(2021) 的 war 包可部署在多种操作系统下的多种中间件中,以下将介绍在Linux上部署,中间件采用的是tomcat。
使用 war 包部署 SuperMap iServer 10i(2021) 时,需要先安装 JRE/JDK、SuperMap iObjects Java 10i(2021),并进行环境变量的配置。若使用32 bit 的 JRE/JDK,则需要使用32 bit 的 SuperMap iObjects Java;若使用64 bit 的 JRE/JDK,则需要使用64 bit 的 SuperMap iObjects Java。

一、下载war包

超图官网下载iserver-war包

 

 

下载后放到Linux系统,通过命令

unzip xxxxx.zip

解压war包,解压后的目录如下:

 

再通过命令,解压包support_linux_x64.tar.gz

tar -vxzf support_linux_x64.tar.gz

 

二、下载安装JDK

JDK版本不建议采用过高或过低的版本,推荐1.8.x,这里以1.8.0_11为例
下载地址https://pan.baidu.com/s/1fSbe2AFxaXWLWWY2h28w4g
提取码:m7ln
三、配置环境变量

在系统的 profile 文件(默认路径为:/etc/profile)中设置
1、JAVA_HOME

export JAVA_HOME=/JDK 的目录

参考配置:

 

Windows配置:

 

2、UGO_HOME

export UGO_HOME=/SuperMap iObjects Java 的安装目录

iserver-war包有内置的Java组件,因此不需要再下载SuperMap iObjects Java产品
参考配置:

Windows:

 

3、LD_LIBRARY_PATH

export LD_LIBRARY_PATH=$UGO_HOME/bin:$LD_LIBRARY_PATH

参考配置:

Windows:

LD_LIBRARY_PATH=%UGO_HOME%\bin:%LD_LIBRARY_PATH%

4、CLASSPATH

export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar

参考配置:

CLASSPATH 中当前目录“.”不能丢

Windows:

.:%JAVA_HOME%\lib:%JAVA_HOME%\lib\tools.jar:%JAVA_HOME%\lib\dt.jar

 

5、PATH

将 jdk 安装目录下的 bin 目录以及,jidk下边的jre的bin目录增加到PATH变量中
参考配置:

 

Windows:

%UGO_HOME%\bin

 

6、SUPERMAP_ROOT

设置 SUPERMAP_ROOT 环境变量,使其指向字体库 fonts 文件夹的父目录
在此目录下/supermap-iserver-10.2.1-war/support_linux_x64/fonts

 

总的配置如下:

 

7、生效

执行 source /etc/profile 命令,使上述设置生效。

 

注意:

  • linux 下用冒号 “:” 来分隔路径;
  • $PATH / $CLASSPATH / $JAVA_HOME 是用来引用原来的环境变量的值;
  • export 是把这六个变量导出为全局变量;
  • 大小写必须严格区分。

 

WDXT 2023/06/28 9:47:33
Windows下就是这几个地方

Windows下就是这几个地方> path加到用户变量,就不用重启;系统变量则需要重启
1:JAVA_HOME
2:JRE_HOME
3:UGO_HOME
4:将UGO_HOME的bin放在了系统Path

方法二:Tomcat通过setenv.bat指定jdk和jre(相对路径)

Tomcat通过setenv.bat指定jdk和jre(相对路径)
1.在Tomcat的bin目录下,创建一个名为setenv.bat的文件。
2.编辑setenv.bat,内容如下:

set "JAVA_HOME=E:\Program Files\jdk1.8"
set "CLASSPATH=%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar"
 
set "GRADLE_HOME=%cd%\gradle"
set "PATH=%JAVA_HOME%\bin;%GRADLE_HOME%\bin;%PATH%"
 
set "JETTY_HOME=E:\Program Files\jetty-distribution-9.2.7.v20150116"
 
rem change dist dir
rem set "BUILD_DIST=D:\svn-repos\dev-novatar\2-framework\CODE\novatar\build\dist"
 
@echo JAVA_HOME : %JAVA_HOME%

 
set "UGO_HOME=D:\SuperMap_iServer_support_win_x64\objectsjava"
 
set "PATH=%JAVA_HOME%\bin;%GRADLE_HOME%\bin;%UGO_HOME%\bin;%PATH%"
 

 



四、下载Tomcat

tomcat版本不建议使用过低或者过高的版本,推荐8.5.xx
这里以8.5.77为例,下载地址https://pan.baidu.com/s/14ktFXASSElFWLpw1DXZpEw
提取码:alb2
启动 Tomcat,把 war 包放入如下目录:【Tomcat 根目录】\webapps,Tomcat 就可以将 war 包发布为 Web 服务。例如启动 Tomcat,把 iserver.war 放入 webapps 目录,就完成了 SuperMap iServer 核心功能的启动。访问 http://<server>:<port>/iserver/services,就能获取 SuperMap iServer 所有可用服务的列表。使用 iserver#help.war 将帮助文档发布为在线形式后,访问的 URI 为:http://<server>:<port>/iserver/help。使用 iserver#iClient.war 将 iClient 发布为在线服务后,访问的 URI 为:http://:/iserver/iClient。

注意:

按照上述操作完成之后,启动tomcat,可能会出现tomcat启动成功,但是iserver启动失败,并报以下错:

 

是由于tomcat和iserver本身的jar包冲突导致
解决办法:
将非war包中的conf/catalina.properties替换到,tomcat中间件的相同路径下,替换之后文件配置如下:

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# List of comma-separated packages that start with or equal this string
# will cause a security exception to be thrown when
# passed to checkPackageAccess unless the
# corresponding RuntimePermission ("accessClassInPackage."+package) has
# been granted.
package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.jasper.,org.apache.tomcat.
#
# List of comma-separated packages that start with or equal this string
# will cause a security exception to be thrown when
# passed to checkPackageDefinition unless the
# corresponding RuntimePermission ("defineClassInPackage."+package) has
# been granted.
#
# by default, no packages are restricted for definition, and none of
# the class loaders supplied with the JDK call checkPackageDefinition.
#
package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,\
org.apache.jasper.,org.apache.naming.,org.apache.tomcat.

#
#
# List of comma-separated paths defining the contents of the "common"
# classloader. Prefixes should be used to define what is the repository type.
# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute.
# If left as blank,the JVM system loader will be used as Catalina's "common"
# loader.
# Examples:
#     "foo": Add this folder as a class repository
#     "foo/*.jar": Add all the JARs of the specified folder as class
#                  repositories
#     "foo/bar.jar": Add bar.jar as a class repository
#
# Note: Values are enclosed in double quotes ("...") in case either the
#       ${catalina.base} path or the ${catalina.home} path contains a comma.
#       Because double quotes are used for quoting, the double quote character
#       may not appear in a path.
common.loader="${catalina.base}/lib","${catalina.base}/lib/*.jar","${catalina.home}/lib","${catalina.home}/lib/*.jar"

#
# List of comma-separated paths defining the contents of the "server"
# classloader. Prefixes should be used to define what is the repository type.
# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute.
# If left as blank, the "common" loader will be used as Catalina's "server"
# loader.
# Examples:
#     "foo": Add this folder as a class repository
#     "foo/*.jar": Add all the JARs of the specified folder as class
#                  repositories
#     "foo/bar.jar": Add bar.jar as a class repository
#
# Note: Values may be enclosed in double quotes ("...") in case either the
#       ${catalina.base} path or the ${catalina.home} path contains a comma.
#       Because double quotes are used for quoting, the double quote character
#       may not appear in a path.
server.loader=

#
# List of comma-separated paths defining the contents of the "shared"
# classloader. Prefixes should be used to define what is the repository type.
# Path may be relative to the CATALINA_BASE path or absolute. If left as blank,
# the "common" loader will be used as Catalina's "shared" loader.
# Examples:
#     "foo": Add this folder as a class repository
#     "foo/*.jar": Add all the JARs of the specified folder as class
#                  repositories
#     "foo/bar.jar": Add bar.jar as a class repository
# Please note that for single jars, e.g. bar.jar, you need the URL form
# starting with file:.
#
# Note: Values may be enclosed in double quotes ("...") in case either the
#       ${catalina.base} path or the ${catalina.home} path contains a comma.
#       Because double quotes are used for quoting, the double quote character
#       may not appear in a path.
shared.loader=

# Default list of JAR files that should not be scanned using the JarScanner
# functionality. This is typically used to scan JARs for configuration
# information. JARs that do not contain such information may be excluded from
# the scan to speed up the scanning process. This is the default list. JARs on
# this list are excluded from all scans. The list must be a comma separated list
# of JAR file names.
# The list of JARs to skip may be over-ridden at a Context level for individual
# scan types by configuring a JarScanner with a nested JarScanFilter.
# The JARs listed below include:
# - Tomcat Bootstrap JARs
# - Tomcat API JARs
# - Catalina JARs
# - Jasper JARs
# - Tomcat JARs
# - Common non-Tomcat JARs
# - Test JARs (JUnit, Cobertura and dependencies)
tomcat.util.scan.StandardJarScanFilter.jarsToSkip=*.jar

# Default list of JAR files that should be scanned that overrides the default
# jarsToSkip list above. This is typically used to include a specific JAR that
# has been excluded by a broad file name pattern in the jarsToSkip list.
# The list of JARs to scan may be over-ridden at a Context level for individual
# scan types by configuring a JarScanner with a nested JarScanFilter.
tomcat.util.scan.StandardJarScanFilter.jarsToScan=\
log4j-taglib*.jar,\
log4j-web*.jar,\
log4javascript*.jar,\
slf4j-taglib*.jar,\
*adminui*.jar,\
*webui*.jar,\
*vue*.jar,\
*axios*.jar,\
*webjar*.jar,\
*swagger-ui*.jar

# String cache configuration.
tomcat.util.buf.StringCache.byte.enabled=true
#tomcat.util.buf.StringCache.char.enabled=true
#tomcat.util.buf.StringCache.trainThreshold=500000
#tomcat.util.buf.StringCache.cacheSize=5000

# This system property is deprecated. Use the relaxedPathChars relaxedQueryChars
# attributes of the Connector instead. These attributes permit a wider range of
# characters to be configured as valid.
# Allow for changes to HTTP request validation
# WARNING: Using this option may expose the server to CVE-2016-6816
#tomcat.util.http.parser.HttpParser.requestTargetAllow=|{}

# \u5904\u7406Url\u4E2D\u5305\u542B%2F\u65F6\uFF0C\u8BF7\u6C42\u88AB\u62D2\u7EDD\u8BBF\u95EE
org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true

 

五、部署成功

至此就部署结束了!

 

总结

  1. 当遇到jar包冲突时,替换catalina.properties文件
  2. JDK和tomcat版本使用过低或者过高会出现问题
  3. 环境变量的配置参照上述配置,切忌少配、误配
  4. 如果部署失败可以查看tomcat的logs日志,根据日志查看报错