英文:
Error in GetCapabilities WMS 1.3.0 geoserver, how to solve?
问题
Error in GetCapabilities WMS 1.3.0 geoserver.
此处存在错误:WMS 1.3.0 geoserver 的 GetCapabilities 中出现错误。
This page contains the following errors:
此页面包含以下错误:
error on line 6869 at column 17: XML declaration allowed only at the start of the document
在第6869行第17列出现错误:XML声明只允许在文档的开头。
Below is a rendering of the page up to the first error.
以下是页面在第一个错误之前的呈现。
I want to add data from geoserver to CesiumJs through wms.
我想通过WMS将数据从geoserver添加到CesiumJs中。
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.IllegalAccessError: superclass access check failed: class org.marlin.pisces.MarlinRenderingEngine (in unnamed module @0x4c04c9c4) cannot access class sun.java2d.pipe.RenderingEngine (in module java.desktop) because module java.desktop does not export sun.java2d.pipe to unnamed module @0x4c04c9c4 [in thread "qtp674483268-24"]
由于:java.lang.ExceptionInInitializerError 引发异常:java.lang.IllegalAccessError 异常:超类访问检查失败:类 org.marlin.pisces.MarlinRenderingEngine(在未命名模块 @0x4c04c9c4 中)无法访问类 sun.java2d.pipe.RenderingEngine(在模块 java.desktop 中)因为模块 java.desktop 没有将 sun.java2d.pipe 导出到未命名模块 @0x4c04c9c4 [在线程 "qtp674483268-24" 中]
at java.base/java.lang.Class.forName0(Native Method)
在 java.base/java.lang.Class.forName0(本地方法)
at java.base/java.lang.Class.forName(Class.java:375)
在 java.base/java.lang.Class.forName(Class.java:375)
at java.desktop/sun.java2d.pipe.RenderingEngine.getInstance(RenderingEngine.java:129)
在 java.desktop/sun.java2d.pipe.RenderingEngine.getInstance(RenderingEngine.java:129)
at java.desktop/sun.java2d.pipe.LoopPipe.
在 java.desktop/sun.java2d.pipe.LoopPipe.
at java.desktop/sun.java2d.SurfaceData.
在 java.desktop/sun.java2d.SurfaceData.
at java.desktop/sun.awt.windows.WToolkit.initIDs(Native Method)
在 java.desktop/sun.awt.windows.WToolkit.initIDs(本地方法)
at java.desktop/sun.awt.windows.WToolkit.
在 java.desktop/sun.awt.windows.WToolkit.
at java.desktop/sun.awt.Win32GraphicsEnvironment.
在 java.desktop/sun.awt.Win32GraphicsEnvironment.
at java.desktop/sun.awt.PlatformGraphicsInfo.createGE(PlatformGraphicsInfo.java:34)
在 java.desktop/sun.awt.PlatformGraphicsInfo.createGE(PlatformGraphicsInfo.java:34)
at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:93)
在 java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:93)
at java.desktop/java.awt.GraphicsEnvironment$LocalGE.
在 java.desktop/java.awt.GraphicsEnvironment$LocalGE.
at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:106)
在 java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:106)
at java.desktop/java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1182)
在 java.desktop/java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1182)
at org.geoserver.wms.map.ImageUtils.prepareTransparency(ImageUtils.java:162)
在 org.geoserver.wms.map.ImageUtils.prepareTransparency(ImageUtils.java:162)
at org.geoserver.wms.legendgraphic.BufferedImageLegendGraphicBuilder.renderRules(BufferedImageLegendGraphicBuilder.java:327)
在 org.geoserver.wms.legendgraphic.BufferedImageLegendGraphicBuilder.renderRules(BufferedImageLegendGraphicBuilder.java:327)
at org.geoserver.wms.legendgraphic.BufferedImageLegendGraphicBuilder.buildLegendGraphic(BufferedImageLegendGraphicBuilder.java:265)
在 org.geoserver.wms.legendgraphic.BufferedImageLegendGraphicBuilder.buildLegendGraphic(BufferedImageLegendGraphicBuilder.java:265)
at org.geoserver.wms.legendgraphic.BufferedImageLegendGraphicBuilder.buildLegendGraphic(BufferedImageLegendGraphicBuilder.java:77)
在 org.geoserver.wms.legendgraphic.BufferedImageLegendGraphicBuilder.buildLegendGraphic(BufferedImageLegendGraphicBuilder.java:77)
at org.geoserver.wms.legendgraphic.PNGLegendOutputFormat.produceLegendGraphic(PNGLegendOutputFormat.java:41)
在 org.geoserver.wms.legendgraphic.PNGLegendOutputFormat.produceLegendGraphic(PNGLegendOutputFormat.java:41)
at org.geoserver.wms.legendgraphic.PNGLegendOutputFormat.produceLegendGraphic(PNGLegendOutputFormat.java:21)
在 org.geoserver.wms.legendgraphic.PNGLegendOutputFormat.produceLegendGraphic(PNGLegendOutputFormat.java:21)
at org.geoserver.wms.capabilities.LegendSampleImpl.createNewSample(LegendSampleImpl.java:178)
在 org.geoserver.wms.capabilities.LegendSampleImpl.createNewSample(LegendSampleImpl.java:178)
at org.geoserver.wms.capabilities.LegendSampleImpl.getLegendURLSize(LegendSampleImpl.java:156)
在 org.geoserver.wms.capabilities.LegendSampleImpl.getLegendURLSize(LegendSampleImpl.java:156)
at org.geoserver.wms.capabilities.Capabilities_1_3_0_Transformer$Capabilities_1_3_0_Translator.handleLegendURL(Capabilities_1_3_0_Transformer.java:1661)
在 org.geoserver.wms.capabilities.Capabilities_1_3_0_Transformer$Capabilities_1_3_0_Translator.handleLegendURL(Capabilities_1_3_0_Transformer.java:1661)
at org.geoserver.wms.capabilities.Capabilities_1_3_0_Transformer$Capabilities_1_3_0_Translator.handleLayerStyles(Capabilities_1_3_0_Transformer.java:1281)
在 org.geoserver.wms.capabilities.Capabilities_1_3_0_Transformer$Capabilities
英文:
Error in GetCapabilities WMS 1.3.0 geoserver.
This page contains the following errors:
error on line 6869 at column 17: XML declaration allowed only at the start of the document
Below is a rendering of the page up to the first error.
I want to add data from geoserver to CesiumJs through wms.
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.IllegalAccessError: superclass access check failed: class org.marlin.pisces.MarlinRenderingEngine (in unnamed module @0x4c04c9c4) cannot access class sun.java2d.pipe.RenderingEngine (in module java.desktop) because module java.desktop does not export sun.java2d.pipe to unnamed module @0x4c04c9c4 [in thread "qtp674483268-24"]
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at java.desktop/sun.java2d.pipe.RenderingEngine.getInstance(RenderingEngine.java:129)
at java.desktop/sun.java2d.pipe.LoopPipe.<clinit>(LoopPipe.java:49)
at java.desktop/sun.java2d.SurfaceData.<clinit>(SurfaceData.java:450)
at java.desktop/sun.awt.windows.WToolkit.initIDs(Native Method)
at java.desktop/sun.awt.windows.WToolkit.<clinit>(WToolkit.java:195)
at java.desktop/sun.awt.Win32GraphicsEnvironment.<clinit>(Win32GraphicsEnvironment.java:60)
at java.desktop/sun.awt.PlatformGraphicsInfo.createGE(PlatformGraphicsInfo.java:34)
at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:93)
at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironment.java:84)
at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:106)
at java.desktop/java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1182)
at org.geoserver.wms.map.ImageUtils.prepareTransparency(ImageUtils.java:162)
at org.geoserver.wms.legendgraphic.BufferedImageLegendGraphicBuilder.renderRules(BufferedImageLegendGraphicBuilder.java:327)
at org.geoserver.wms.legendgraphic.BufferedImageLegendGraphicBuilder.buildLegendGraphic(BufferedImageLegendGraphicBuilder.java:265)
at org.geoserver.wms.legendgraphic.BufferedImageLegendGraphicBuilder.buildLegendGraphic(BufferedImageLegendGraphicBuilder.java:77)
at org.geoserver.wms.legendgraphic.PNGLegendOutputFormat.produceLegendGraphic(PNGLegendOutputFormat.java:41)
at org.geoserver.wms.legendgraphic.PNGLegendOutputFormat.produceLegendGraphic(PNGLegendOutputFormat.java:21)
at org.geoserver.wms.capabilities.LegendSampleImpl.createNewSample(LegendSampleImpl.java:178)
at org.geoserver.wms.capabilities.LegendSampleImpl.getLegendURLSize(LegendSampleImpl.java:156)
at org.geoserver.wms.capabilities.Capabilities_1_3_0_Transformer$Capabilities_1_3_0_Translator.handleLegendURL(Capabilities_1_3_0_Transformer.java:1661)
at org.geoserver.wms.capabilities.Capabilities_1_3_0_Transformer$Capabilities_1_3_0_Translator.handleLayerStyles(Capabilities_1_3_0_Transformer.java:1281)
at org.geoserver.wms.capabilities.Capabilities_1_3_0_Transformer$Capabilities_1_3_0_Translator.handleLayer(Capabilities_1_3_0_Transformer.java:1220)
at org.geoserver.wms.capabilities.Capabilities_1_3_0_Transformer$Capabilities_1_3_0_Translator.handleLayerGroup(Capabilities_1_3_0_Transformer.java:1563)
at org.geoserver.wms.capabilities.Capabilities_1_3_0_Transformer$Capabilities_1_3_0_Translator.handleLayerGroups(Capabilities_1_3_0_Transformer.java:1419)
at org.geoserver.wms.capabilities.Capabilities_1_3_0_Transformer$Capabilities_1_3_0_Translator.handleLayers(Capabilities_1_3_0_Transformer.java:834)
at org.geoserver.wms.capabilities.Capabilities_1_3_0_Transformer$Capabilities_1_3_0_Translator.handleCapability(Capabilities_1_3_0_Transformer.java:626)
at org.geoserver.wms.capabilities.Capabilities_1_3_0_Transformer$Capabilities_1_3_0_Translator.encode(Capabilities_1_3_0_Transformer.java:331)
at org.geotools.xml.transform.TransformerBase$XMLReaderSupport.parse(TransformerBase.java:1054)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485)
at org.geotools.xml.transform.TransformerBase$Task.run(TransformerBase.java:287)
at org.geotools.xml.transform.TransformerBase.transform(TransformerBase.java:121)
at org.geotools.xml.transform.TransformerBase.transform(TransformerBase.java:103)
at org.geoserver.wms.capabilities.Capabilities_1_3_0_Response.write(Capabilities_1_3_0_Response.java:43)
at org.geoserver.config.CapabilitiesCacheHeadersCallback$RevalidateTagResponse.write(CapabilitiesCacheHeadersCallback.java:138)
at org.geoserver.ows.Dispatcher.response(Dispatcher.java:1018)
at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:272)
... 112 more
答案1
得分: 0
当你使用Java 17时,有一个位于webapps/geoserver/WEB-INF/lib目录下的文件叫做marlin-0.9.3.jar。完整路径是webapps/geoserver/WEB-INF/lib/marlin-0.9.3.jar。删除marlin-0.9.3.jar,你的问题将会解决。更多信息可以在这里找到:https://docs.geoserver.org/latest/en/user/production/java.html#running-on-java-17
英文:
The thing is that, when you use Java 17 there is file in webapps/geoserver/WEB-INF/lib called marlin-0.9.3.jar . Full path is webapps/geoserver/WEB-INF/lib called marlin-0.9.3.jar. Delete marlin-0.9.3.jar and your problem will be solved. More information you can find here https://docs.geoserver.org/latest/en/user/production/java.html#running-on-java-17
答案2
得分: 0
我遇到了这个问题。我使用的是MacOS。解决方法是安装并使用Java 11。我曾尝试过版本17(正如文档建议的),以及19,但是Java 11解决了问题。
步骤:
- 查找您当前的Java版本
/usr/libexec/java_home -V
以及系统上可用的版本。它会类似于:
) /usr/Libexec/java_home -V
匹配的Java虚拟机(3):
19.0.1(arm64)“Oracle Corporation” - “Java SE 19.0.1” /Library/Java/JavaVirtualMachines/jdk-19. jdk/Contents/Home
17.0.8(arm64)“Amazon.com Inc.” - “Amazon Corretto 17” /Users/jason/Library/Java/JavaVirtualMachines/corretto-17.0.8/Contents/Home
15.0.10(arm64)“Azul Systems, Inc.” - “Zulu 15.46.17” /Users/jason/Library/Java/JavaVirtualMachines/azul-15.0.10/Contents/Home
‘/Library/Java/JavaVirtualMachines/jdk-19. jdk/Contents/Home
-
注意我缺少Java 11选项。安装Java 11。这里是我下载Java 11的地方。
-
安装完成后,运行
/usr/libexec/java_home -V
,您应该看到类似于:
) /usr/Libexec/java_home -V
匹配的Java虚拟机(4):
19.0.1(arm64)“Oracle Corporatior - “Java SE 19.0.1” /Library/Java/JavavirtualMachines/jdk-19.jdk/Contents/Home
17.0.8(arm64)“Amazon.com Inc.” - “Amazon Corretto 17” /Users/jason/Library/Java/JavaVirtualMachines/corretto-17.0.8/Contents/Home
15.0.10(arm64)“Azul Systems, Inc.” - “Zulu 15.46.17” /Users/jason/Library/Java/JavaVirtualMachines/azul-15.0.10/Contents/Home
11.0.19(arm64)“Oracle Corporation” - “Java SE 11.0.19” /Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk-19.jdk/Contents/Home
- 然后打开您的
~/.bash_profile
,~/.zshrc
或您用来设置环境变量的文件,添加一行导出您的JAVA_HOME
。
vim ~/.zshrc
- 确保检查并确保您没有已经导出
JAVA_HOME
。
如果已经导出了,将其更改为Java 11。如果没有导出,添加以下新行:
export JAVA_HOME="$(/usr/libexec/java_home -v 11)"
-
保存并退出您的
~/.zshrc
。 -
要么关闭当前终端窗口并打开另一个,要么使用
source ~/.zshrc
来运行更新的导出。 -
使用
java --version
检查您的Java版本。
) java --version
java 11.0.19 2023-04-18 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1949-LTS-224)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.19+9-LTS-224, mixed mode)
- 重新启动您的GeoServer。
英文:
I ran into this problem. I'm on a Macos. The solution ended up being to install and use Java 11. I had tried version 17 (which the documentation suggests) and 19, but Java 11 did the trick.
Steps:
- Find your current version
/usr/libexec/java_home -V
and what versions are available on your system. It will look something like:
) /usr/Libexec/java_home -V
Matching Java Virtual Machines (3):
19.0.1 (arm64) “Oracle Corporation” - “Java SE 19.0.1" /Library/Java/JavaVirtualMachines/jdk-19. jdk/Contents/Home
17.0.8 (arm64) “Amazon.com Inc.” - “Amazon Corretto 17" /Users/jason/Library/Java/JavaVirtualMachines/corretto-17.0.8/Contents/Home
15.0.10 (arm64) “Azul Systems, Inc." - "Zulu 15.46.17" /Users/jason/Library/Java/JavaVirtualMachines/azul-15.0.10/Contents/Home
‘/Library/Java/JavaVirtualMachines/jdk-19. jdk/Contents/Home
-
Note that I was missing a Java 11 option. Install Java 11. Here's where I downloaded Java 11.
-
Once installed, run
/usr/libexec/java_home -V
and you should see something like:
) /usr/Libexec/java_home -V
Matching Java Virtual Machines (4):
19.0.1 (arm64) “Oracle Corporatior - “Java SE 19.0.1" /Library/Java/JavavirtualMachines/jdk-19.jdk/Contents/Home
17.0.8 (arm64) “Amazon.com Inc.” - “Amazon Corretto 17" /Users/jason/Library/Java/JavaVirtualMachines/corretto-17.0.8/Contents/Home
15.0.10 (arm64) “Azul Systems, Inc." - "Zulu 15.46.17" /Users/jason/Library/Java/JavaVirtualMachines/azul-15.0.10/Contents/Home
11.0.19 (arm64) “Oracle Corporation” - "Java SE 11.0.19" /Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk-19.jdk/Contents/Home
- Then open your
~/.bash_profile
,~/.zshrc
, or whatever you use to set environment variables and add a line to export yourJAVA_HOME
.
vim ~/.zshrc
- Be sure to check and see that you are not already exporting
JAVA_HOME
.
If you are, change it to Java 11. If you are not, add the following new line:
export JAVA_HOME="$(/usr/libexec/java_home -v 11)"
- Save and exit your
~/.zshrc
. - Either close the current terminal window and open another, or use
source ~/.zshrc
to run the updated export. - Check your java version with
java --version
) java --version
java 11.0.19 2023-04-18 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1949-LTS-224)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.19+9-LTS-224, mixed mode)
- Restart your geoserver.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论