You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/12/12 23:12:40 UTC

[GitHub] [pulsar] phreed opened a new pull request #5848: [Issue 5726] Added catch for NoClassDefFoundError wherever there was a ClassNotFoundException

phreed opened a new pull request #5848: [Issue 5726] Added catch for NoClassDefFoundError wherever there was a ClassNotFoundException
URL: https://github.com/apache/pulsar/pull/5848
 
 
   Fixes #5726 
   
   ### Motivation
   
   When running pulsar-io connectors and functions from the Intellij IDE some actions fail
   due to uncaught class-not-found throwables.
   The expectation being that the class is being dynamically loaded and only the ClassNotFoundException will occur if the class is not found.
   When the function is created or run with https://pulsar.apache.org/docs/en/functions-deploying/#local-run-mode this is indeed the case.
   When running under the control https://pulsar.apache.org/docs/en/functions-debug/#debug-with-localrun-mode as a gradle plugin the class may already be known and throw a NoClassDefFoundError.
   It seems to me that any time ClassNotFoundException is handled then NoClassDefFoundError should also be caught.
   
   ### Modifications
   
   Wherever there was a `catch (ClassNotFoundException ` I replaced it with 
   `catch (ClassNotFoundException | NoClassDefFoundError ` .
   There were multiple cases where the ClassNotFoundException were handled e.g. the jar loader failed so the nar loader was used to handle the jar loader's failure.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (no)
     - This is a fix that provides capabilities claimed in the current documentation.
   https://pulsar.apache.org/docs/en/functions-debug/#debug-with-localrun-mode
     
   This fix is needed to allow gradle plugins based on localrun (and its derivatives) to be constructed.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services