Uploaded image for project: 'apiman (API Management)'
  1. apiman (API Management)
  2. APIMAN-1232

Custom Error and Failure writers plugins fails if packaged in single war.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 1.3.0.Final, 1.2.x
    • 1.2.8.Final
    • Plugin
    • None
    • Hide

      1) Define custom plugin implementations each for `IPolicyErrorWriter` and `IPolicyFailureWriter` with single `plugin.json`

      2) Run the `maven install` to create single war containing both the plugin implementations.

      3) Define them in the apiman.properties as below.

       apiman-gateway.writers.policy-failure=plugin:org.custom.plugin:apiman-custom:0.0.1-SNAPSHOT/io.apiman.plugins.PolicyFailureWriter
      apiman-gateway.writers.error=plugin:org.custom.plugin:apiman-custom:0.0.1-SNAPSHOT/io.apiman.plugins.PolicyErrorWriter
      
      

      4) Restart the wildfly.

      Show
      1) Define custom plugin implementations each for `IPolicyErrorWriter` and `IPolicyFailureWriter` with single `plugin.json` 2) Run the `maven install` to create single war containing both the plugin implementations. 3) Define them in the apiman.properties as below. apiman-gateway.writers.policy-failure=plugin:org.custom.plugin:apiman-custom:0.0.1-SNAPSHOT/io.apiman.plugins.PolicyFailureWriter apiman-gateway.writers.error=plugin:org.custom.plugin:apiman-custom:0.0.1-SNAPSHOT/io.apiman.plugins.PolicyErrorWriter 4) Restart the wildfly.

      I have both custom error and failure plugin implementations that would like to put it in single war and deploy them. However It looks like there is a problem if we declare both error and failure writers together inside the same war.

      If I remove the reference to one of the plugin from apiman.properties, it works.

      *apiman.properties *

       apiman-gateway.writers.policy-failure=plugin:org.custom.plugin:apiman-custom:0.0.1-SNAPSHOT/io.apiman.plugins.PolicyFailureWriter
      apiman-gateway.writers.error=plugin:org.custom.plugin:apiman-custom:0.0.1-SNAPSHOT/io.apiman.plugins.PolicyErrorWriter
      
      17:40:40,689 ERROR [stderr] (default task-13) java.lang.IllegalStateException: zip file closed
      17:40:40,690 ERROR [stderr] (default task-13)   at java.util.zip.ZipFile.ensureOpen(ZipFile.java:669
      )
      17:40:40,691 ERROR [stderr] (default task-13)   at java.util.zip.ZipFile.getEntry(ZipFile.java:309)
      17:40:40,691 ERROR [stderr] (default task-13)   at io.apiman.common.plugin.PluginClassLoader.findCla
      ssContent(PluginClassLoader.java:202)
      17:40:40,691 ERROR [stderr] (default task-13)   at io.apiman.common.plugin.PluginClassLoader.findCla
      ss(PluginClassLoader.java:178)
      17:40:40,692 ERROR [stderr] (default task-13)   at java.lang.ClassLoader.loadClass(ClassLoader.java:
      424)
      17:40:40,693 ERROR [stderr] (default task-13)   at java.lang.ClassLoader.loadClass(ClassLoader.java:
      357)
      17:40:40,693 ERROR [stderr] (default task-13)   at com.fasterxml.jackson.module.jaxb.JaxbAnnotationI
      ntrospector.findAutoDetectVisibility(JaxbAnnotationIntrospector.java:533)
      17:40:40,694 ERROR [stderr] (default task-13)   at com.fasterxml.jackson.databind.introspect.Annotat
      ionIntrospectorPair.findAutoDetectVisibility(AnnotationIntrospectorPair.java:198)
      17:40:40,694 ERROR [stderr] (default task-13)   at com.fasterxml.jackson.databind.introspect.POJOPro
      pertiesCollector.<init>(POJOPropertiesCollector.java:126)
      

        1. stacktrace.log
          15 kB
          Balu Sadhasivam

              ewittman@redhat.com Eric Wittmann
              sbalu27 Balu Sadhasivam (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: