首页 / 浏览问题 / WebGIS / 问题详情
IServer扩展开发时,要加配置文件,要如何写,老是启动服务时报错
5EXP 2021年12月23日
2021-12-23 15:22:35 - ERROR - 启动服务失败。  
com.thoughtworks.xstream.security.ForbiddenClassException: Student
    at com.thoughtworks.xstream.security.NoTypePermission.allows(NoTypePermission.java:26)
    at com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:74)
    at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
    at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:47)
    at com.thoughtworks.xstream.core.util.HierarchicalStreams.readClassType(HierarchicalStreams.java:31)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:133)
    at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1487)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1467)
    at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1338)
    at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1329)
    at com.supermap.services.util.XMLTransformUtils.fromNode(SourceFile:142)
    at com.supermap.server.config.impl.ComponentSettingParser.a(SourceFile:100)
    at com.supermap.server.config.impl.ComponentSettingParser.parse(SourceFile:80)
    at com.supermap.server.config.impl.ServiceConfigParser.c(SourceFile:131)
    at com.supermap.server.config.impl.ServiceConfigParser.parse(SourceFile:51)
    at com.supermap.server.config.impl.XMLConfigImpl.b(SourceFile:734)
    at com.supermap.server.config.impl.XMLConfigImpl.<init>(SourceFile:173)
    at com.supermap.server.config.impl.ConfigFactory.newInstance(SourceFile:22)
    at com.supermap.server.host.webapp.handlers.BasicHandler.p(SourceFile:849)
    at com.supermap.server.host.webapp.handlers.BasicHandler.r(SourceFile:877)
    at com.supermap.server.host.webapp.handlers.BasicHandler.n(SourceFile:707)
    at com.supermap.server.host.webapp.handlers.BasicHandler.a(SourceFile:629)
    at com.supermap.server.host.webapp.handlers.BasicHandler.init(SourceFile:183)
    at com.supermap.server.host.webapp.ApplicationFilter.a(SourceFile:214)
    at com.supermap.server.host.webapp.ApplicationFilter.a(SourceFile:80)
    at com.supermap.server.host.webapp.ApplicationFilter$1.call(SourceFile:123)
    at com.supermap.server.host.webapp.ApplicationFilter$1.call(SourceFile:120)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.supermap.services.util.DelegatingErrorHandlingCallable$ReflectInvoker.a(SourceFile:177)
    at com.supermap.services.util.DelegatingErrorHandlingCallable.invokeQuietly(SourceFile:102)
    at com.supermap.server.host.webapp.ApplicationFilter.init(SourceFile:158)
    at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:283)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:264)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4546)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5191)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1125)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1859)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
2021-12-23 15:32:05 - INFO - iServer的home目录为:D:\Code\CS\Work\SuperMap\supermap-iserver\supermap-iserver-10.0.1-win64-zip\webapps\iserver\  
2021-12-23 15:32:05 - INFO - iServer的ContextPath为:/iserver  
2021-12-23 15:32:05 - INFO - iServer的配置文件路径为:D:\Code\CS\Work\SuperMap\supermap-iserver\supermap-iserver-10.0.1-win64-zip\webapps\iserver\WEB-INF  
2021-12-23 15:32:07 - INFO - com.supermap.services.rest.encoders.BigDataJsonDecoderResolver  
2021-12-23 15:32:08 - ERROR - 启动服务失败。  

在iserver-services.xml中这样配置,老是出现上面的问题

        <component name="Temperature" class="TemperatureImpl" providers="" interfaceNames="rest">
            <config class="Student">
               <Name>天下无双</Name>
               <Age>13</Age>
               <Sex>男</Sex>
           </config>
       </component>

1个回答

请问您做的这个扩展是为了实现什么功能?建议您参考我们的帮助文档“扩展iServer”模块来验证。

您上述的问题可能是您的扩展模块写的不对。

2,248EXP 2021年12月24日
...