opengeospatial / ets-wms13-nsg

0 stars 0 forks source link

Update of dependency ets-wms13-dgiwg to v0.5 leads to error #29

Closed dstenger closed 1 year ago

dstenger commented 2 years ago

Describe the bug When dependency ets-wms13-dgiwg is updated to v0.5, following error occurs when starting TEAM Engine stand-alone and executing the test suite via Web Browser Interface:

Test tns:Main type Mandatory default result Passed (s0001)

Assertion: The test subject satisfies all applicable constraints.

Form d77e46_1:
   wms-vector=no
   wms-uri=https://cite.deegree.org/deegree-webservices-3.4.30/services/wms130?service=WMS&request=GetCapabilities

Form 48f0aebb/d1e18_1:
   submit=yes

Error in call to extension function {public java.lang.Object com.occamlab.te.TECore.callFunction(net.sf.saxon.expr.XPathContext,java.lang.String,java.lang.String,net.sf.saxon.om.NodeInfo) throws java.lang.Exception}: Exception in extension function net.sf.saxon.s9api.SaxonApiException: Error in call to extension function {public static java.lang.String de.latlon.ets.wms13.core.util.interactive.InteractiveTestUtils.retrieveGetFeatureInfoRequest(java.lang.String)}: Exception in extension function java.lang.LinkageError: ClassCastException: attempting to castjar:file:/usr/local/tomcat/lib/jsr311-api-1.1.1.jar!/javax/ws/rs/ext/RuntimeDelegate.classtojar:file:/usr/local/tomcat/webapps/teamengine/WEB-INF/lib/jsr311-api-1.1.1.jar!/javax/ws/rs/ext/RuntimeDelegate.class
Result: Failed

Following error occurs when starting TEAM Engine with teamengine-docker project:

...
INFO: validateJarFile(/usr/local/tomcat/webapps/te2/WEB-INF/lib/tomcat-servlet-api-7.0.69.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
Aug 26, 2022 4:52:06 PM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/te2]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1018)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:994)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1296)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2038)
    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:750)
Caused by: java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    com/sun/jersey/server/impl/container/servlet/JerseyServletContainerInitializer.addServletWithApplication(Ljavax/servlet/ServletContext;Ljava/lang/Class;Ljava/util/Set;)V @34: invokespecial
  Reason:
    Type 'com/sun/jersey/server/impl/application/DeferredResourceConfig' (current frame, stack[2]) is not assignable to 'javax/ws/rs/core/Application'
  Current Frame:
    bci: @34
    flags: { }
    locals: { 'com/sun/jersey/server/impl/container/servlet/JerseyServletContainerInitializer', 'javax/servlet/ServletContext', 'java/lang/Class', 'java/util/Set', 'javax/ws/rs/ApplicationPath' }
    stack: { uninitialized 17, uninitialized 17, 'com/sun/jersey/server/impl/application/DeferredResourceConfig' }
  Bytecode:
    0x0000000: 2c13 0036 b600 37c0 0036 3a04 1904 c600
    0x0000010: 9fbb 0022 59bb 0038 592c 2a2d b700 21b7
    0x0000020: 0039 b700 253a 052a 1904 b700 3a3a 062a
    0x0000030: 2b19 06b7 003b 9a00 4c2b 2cb6 000a 1905
    0x0000040: b900 2703 0004 bd00 1b59 0319 0653 b900
    0x0000050: 3c02 0057 b200 2abb 002b 59b7 002c 1232
    0x0000060: b600 2e2c b600 0ab6 002e 123d b600 2e19
    0x0000070: 06b6 002e 123e b600 2eb6 0030 b600 35a7
    0x0000080: 002e b200 2abb 002b 59b7 002c 123f b600
    0x0000090: 2e2c b600 0ab6 002e 123d b600 2e19 06b6
    0x00000a0: 002e 1240 b600 2eb6 0030 b600 31b1     
  Stackmap Table:
    append_frame(@130,Object[#155],Object[#147],Object[#156])
    chop_frame(@173,2)

    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at org.apache.catalina.startup.WebappServiceLoader.loadServices(WebappServiceLoader.java:197)
    at org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:158)
    at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1579)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1273)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:388)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5606)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    ... 10 more

Aug 26, 2022 4:52:06 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory /usr/local/tomcat/webapps/te2
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/te2]]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1022)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:994)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1296)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2038)
    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:750)
...

Expected behavior Dependency ets-wms13-dgiwg shall be updated to the latest version without breaking the test suite/ TEAM Engine.

dstenger commented 1 year ago

Most likely, dependency jsr311-api-1.1.1.jar causes the problem.

dstenger commented 1 year ago

When the dependency is excluded in the Maven pom

...
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>ets-wms13-dgiwg</artifactId>
      <version>0.5</version>
      <exclusions>
        <exclusion>
          <artifactId>jsr311-api</artifactId>
          <groupId>javax.ws.rs</groupId>
        </exclusion>
      </exclusions>
    </dependency>
...

the error does not occur anymore.

dstenger commented 1 year ago

Open question is why ets-wms13-dgiwg introduces this dependency: https://github.com/opengeospatial/ets-wms13-dgiwg/blob/master/pom.xml The dependency is excluded in deps.xml: https://github.com/opengeospatial/ets-wms13-dgiwg/blob/master/src/assembly/deps.xml Same must be done for this test suite to solve the problem.

dstenger commented 1 year ago

Pull request was created: https://github.com/opengeospatial/ets-wms13-nsg/pull/31 Both tests, stand-alone with this repo and with teamengine-docker project, were successful. The documented errors do not occur anymore.