karatelabs / intellij-plugin

Karate IntelliJ Plugin
https://plugins.jetbrains.com/plugin/19232-karate
11 stars 4 forks source link

The plugin fails to add its internal jar when classpath is too long #20

Closed effiban closed 1 year ago

effiban commented 2 years ago

When running a Karate feature file, the Karate plugin will automatically prepend its internal jar karate.jar to the classpath. This seems to work well when the original classpath is short. However when the original classpath is long, this doesn't happen and then it fails with an error:

Error: Could not find or load main class com.intuit.karate.Main
Caused by: java.lang.ClassNotFoundException: com.intuit.karate.Main

The same happens even if IntelliJ prompts for shortening the classpath - the resulting argfile will still be invalid.

The length of the failing classpath in my case was ~20000 chars.

Reproduced on Ubuntu 20, on a Java Gradle project, with IntelliJ 2022.2.3 (Ultimate Edition).

ptrthomas commented 2 years ago

@effiban thanks for reporting this. is there a way you can help us replicate the classpath ? if these are all external JARs hopefully you can share a snippet of your dependencies. I'm wondering if this would be same for maven also

effiban commented 2 years ago

@ptrthomas - yes, most of them are external. Here is snippet of those:

/home/EffiB/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpclient/4.5.6/1afe5621985efe90a92d0fbc9be86271efbe796f/httpclient-4.5.6.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.4.10/acc54d9b28bdffe4bbde89ed2e4a1e86b5285e2b/httpcore-4.4.10.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.github.tomakehurst/wiremock-standalone/2.24.1/52c100df7c31c06e5209a77b85d4f695d40ba76a/wiremock-standalone-2.24.1.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.intuit.karate/karate-apache/0.9.3/4c7a9c0ece8b564a2aa7dca0d65c5340d433e0dd/karate-apache-0.9.3.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.intuit.karate/karate-junit4/0.9.3/c554d0e5aea0947a96b41cda3c46191c18a6a764/karate-junit4-0.9.3.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/net.masterthought/cucumber-reporting/3.8.0/3412fc79e6e48ca0c961180a302020e36aaea71a/cucumber-reporting-3.8.0.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/commons-logging/commons-logging/1.2/4bfc12adfe4842bf07b657f0369c4cb522955686/commons-logging-1.2.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/commons-codec/commons-codec/1.10/4b95f4897fa13f2cd904aee711aeafc0c5295cd8/commons-codec-1.10.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.bettercloud/vault-java-driver/4.0.0/e76e9935171b8da98f51a90e28caba526092734d/vault-java-driver-4.0.0.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.5/6c6c702c89bfff3cd9e80b04d668c5e190d588c6/commons-lang3-3.5.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.36/6c62681a2f655b49963a5983b8b0950a6120ae14/slf4j-api-1.7.36.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.springframework/spring-orm/4.3.0.RELEASE/4b84947c3d1528627b75611fb092b2de2477eaa9/spring-orm-4.3.0.RELEASE.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.springframework/spring-webmvc/4.3.0.RELEASE/f520c7aee723480697053040ffc087e7330f155d/spring-webmvc-4.3.0.RELEASE.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.springframework/spring-test/4.3.0.RELEASE/4247f0483fb8d39305fcb59c94f797e71b51f54a/spring-test-4.3.0.RELEASE.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.springframework.batch/spring-batch-core/3.0.7.RELEASE/b736f8c14550cdb1440e28bb6aa690a387a7aa57/spring-batch-core-3.0.7.RELEASE.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.springframework/spring-core/4.3.0.RELEASE/1a0c76ffd8d8345064669f6cf255ab46a9881c77/spring-core-4.3.0.RELEASE.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/io.dropwizard.metrics/metrics-graphite/3.1.0/fd006ed4c82874550c36416888e055a5ffd22b0b/metrics-graphite-3.1.0.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/io.dropwizard.metrics/metrics-core/3.1.0/40e16d596ca49964a88bbce2261e387895b3499e/metrics-core-3.1.0.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/net.sf.ehcache/ehcache-core/2.5.2/31cbafefbecb34a1081939230a5bc6f13a1c55db/ehcache-core-2.5.2.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/16.0.1/5fa98cd1a63c99a44dd8d3b77e4762b066a5d0c5/guava-16.0.1.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.aspectj/aspectjrt/1.8.7/c4b70e763194d274477da4da9b05ea913e877268/aspectjrt-1.8.7.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.aspectj/aspectjweaver/1.8.7/f753e78bbe484e58b3b4e5ce3cc1751e50d11f6c/aspectjweaver-1.8.7.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/2973d150c0dc1fefe998f834810d68f278ea58ec/junit-4.12.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.mockito/mockito-core/3.2.0/38157d5fab1b47814827773ca3dff01c60e31425/mockito-core-3.2.0.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-library/2.2/cf530c8a0bc993487c64e940ae639bb4a6104dc6/hamcrest-library-2.2.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.apache.tomcat/tomcat-jdbc/7.0.27/65532076f0571ad819427febe10c424a109877b8/tomcat-jdbc-7.0.27.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/commons-pool/commons-pool/1.5.4/75b6e20c596ed2945a259cea26d7fadd298398e6/commons-pool-1.5.4.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/joda-time/joda-time/2.9.7/6eb2e87ddb09e944bb88f06f19ba0638d4607ffd/joda-time-2.9.7.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/io.cucumber/gherkin/5.1.0/3bd9e582275159bbbec250199aa78b0a4cd6b5f1/gherkin-5.1.0.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.intuit.karate/karate-core/0.9.3/aab8b7ca31d11e19438512989457ff6ec98d634e/karate-core-0.9.3.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpmime/4.5.5/8281b24b8a493374cd2aa8a90c4156588f7dbcb6/httpmime-4.5.5.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-core/2.6/a7cb258b9c36f49c148834a3a35b53fe73c28777/log4j-core-2.6.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.6/1300b198716dccca49d1740cf6a737d083be0d06/log4j-api-2.6.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.9.1/716da1830a2043f18882fc036ec26eb32cbe5aff/jackson-databind-2.9.1.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.apache.velocity/velocity/1.7/2ceb567b8f3f21118ecdec129fe1271dbc09aa7a/velocity-1.7.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/velocity-tools/velocity-tools/1.4/4e1f4d507030a00959f4c0c7fcc60b3565617d08/velocity-tools-1.4.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/commons-io/commons-io/2.5/2852e6e05fbb95076fc091f6d1780f1f8fe35e0f/commons-io-2.5.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/net.lingala.zip4j/zip4j/1.3.2/4ba84e98ee017b74cb52f45962f929a221f3074c/zip4j-1.3.2.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.codehaus.plexus/plexus-utils/3.0.24/b4ac9780b37cb1b736eae9fbcef27609b7c911ef/plexus-utils-3.0.24.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.jsoup/jsoup/1.10.1/645f1ad2f6f4cbad1cde4c483eae71e4051be6ef/jsoup-1.10.1.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.googlecode.owasp-java-html-sanitizer/owasp-java-html-sanitizer/20160924.1/f025ce55755bcdb1cf049e4c271d193c5610e182/owasp-java-html-sanitizer-20160924.1.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.springframework/spring-jdbc/4.3.0.RELEASE/24aa5e7915eeccfe79fc33c31fdc4cf00dff4ff4/spring-jdbc-4.3.0.RELEASE.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.springframework/spring-tx/4.3.0.RELEASE/e09c03cf878a87e2d70b1610bdd045993b471844/spring-tx-4.3.0.RELEASE.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.springframework/spring-beans/4.3.0.RELEASE/38da647f047779b176a0e2841900abca0196aefb/spring-beans-4.3.0.RELEASE.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.springframework/spring-web/4.3.0.RELEASE/83e2849360f9e7324ebccbde7ba565f51aeb12b2/spring-web-4.3.0.RELEASE.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.springframework/spring-context/4.3.0.RELEASE/e4470480fe1dda889d61af7e51e1f49df0533513/spring-context-4.3.0.RELEASE.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.springframework/spring-aop/4.3.0.RELEASE/2a2dc09e3e09515afb77af63526d4c3e3004da14/spring-aop-4.3.0.RELEASE.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.springframework/spring-expression/4.3.0.RELEASE/f16ef8bbbbb990b980a98dfeacc166f01c0c51a2/spring-expression-4.3.0.RELEASE.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.springframework.batch/spring-batch-infrastructure/3.0.7.RELEASE/6fa6cc10e95b548c3aa0aaa4e77308b3189388c4/spring-batch-infrastructure-3.0.7.RELEASE.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.ibm.jbatch/com.ibm.jbatch-tck-spi/1.0/8ac869b0a60bff1a15eba0fb6398942410396938/com.ibm.jbatch-tck-spi-1.0.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.thoughtworks.xstream/xstream/1.4.7/bce3282142b63068260f021fcbe48b72e8d71a1a/xstream-1.4.7.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.codehaus.jettison/jettison/1.2/765a6181653f4b05c18c7a9e8f5c1f8269bf9b2/jettison-1.2.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.ryantenney.metrics/metrics-spring/3.0.3/976b143a4f63b83330a06b2f081e53cc35437ca0/metrics-spring-3.0.3.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/io.dropwizard.metrics/metrics-jvm/4.1.0/ee58436b02e46332bd67224102c4275bb3d8d2ed/metrics-jvm-4.1.0.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/io.dropwizard.metrics/metrics-healthchecks/3.1.0/475b277322856252b3e3d6b469140058c74dde0c/metrics-healthchecks-3.1.0.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/javax.annotation/javax.annotation-api/1.3.2/934c04d3cfef185a8008e7bf34331b79730a9d43/javax.annotation-api-1.3.2.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.jooq/jool/0.9.11/684765137add88083b778c58a8f3c25bb6675524/jool-0.9.11.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/io.micrometer/micrometer-registry-statsd/1.8.1/c8274a37f647651fc35c748fdbe49dc9bb4446fe/micrometer-registry-statsd-1.8.1.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/2.2/3f2bd07716a31c395e2837254f37f21f0f0ab24b/hamcrest-core-2.2.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy/1.10.3/db4e5b256de8945691b863e1b2150a6834e187e/byte-buddy-1.10.3.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy-agent/1.10.3/d7a2b692adb0f4e204fc52fc7da998b60d8483d/byte-buddy-agent-1.10.3.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.objenesis/objenesis/2.6/639033469776fd37c08358c6b92a4761feb2af4b/objenesis-2.6.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.apache.tomcat/tomcat-juli/7.0.27/20ce78c872139424b73ed24d242a84b5bbee7125/tomcat-juli-7.0.27.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/io.cucumber/gherkin-jvm-deps/1.0.4/ab5990bf8596b504ea6618fcf2e5192d4488440e/gherkin-jvm-deps-1.0.4.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.jayway.jsonpath/json-path/2.1.0/397bd8076ff9581ad2ebad787da45ba76ee39112/json-path-2.1.0.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/info.cukes/cucumber-java/1.2.5/2197dfa9cd7899ddce136a356994ac21f438f80/cucumber-java-1.2.5.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.24/13a9c0d6776483c3876e3ff9384f9bb55b17001b/snakeyaml-1.24.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/de.siegmar/fastcsv/1.0.3/356512f93d0ef5e682ccfac3608864686b45c11b/fastcsv-1.0.3.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/info.picocli/picocli/3.0.1/ed22a0e26d214540b4e189c58696f8b1ca409a1f/picocli-3.0.1.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.9.1/ff1e5697a6da7e7ae4132958d235411cef8a8c2c/jackson-annotations-2.9.1.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.9.1/60077fe98b11e4e7cf8af9b20609326a166d6ac4/jackson-core-2.9.1.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/commons-collections/commons-collections/3.2.1/761ea405b9b37ced573d2df0d1e3a4e0f9edc668/commons-collections-3.2.1.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/commons-lang/commons-lang/2.6/ce1edb914c94ebc388f086c6827e8bdeec71ac2/commons-lang-2.6.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.springframework.retry/spring-retry/1.1.0.RELEASE/f7e1ec1fd7c8fcaca490fd298c5b3fe711cb5ed9/spring-retry-1.1.0.RELEASE.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/javax.batch/javax.batch-api/1.0/65392d027a6eb369fd9fcd1b75cae150e25ac03c/javax.batch-api-1.0.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/xmlpull/xmlpull/1.1.3.1/2b8e230d2ab644e4ecaa94db7cdedbc40c805dfa/xmlpull-1.1.3.1.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/xpp3/xpp3_min/1.1.4c/19d4e90b43059058f6e056f794f0ea4030d60b86/xpp3_min-1.1.4c.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.springframework/spring-context-support/4.3.0.RELEASE/29b9271677c05d1dea3de688a0e144df960944bf/spring-context-support-4.3.0.RELEASE.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/io.dropwizard.metrics/metrics-annotation/3.1.0/64798afe3c86a17800ffe713ec6638dbcd61da8a/metrics-annotation-3.1.0.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/io.micrometer/micrometer-core/1.8.1/ce4042438c3ed2e156cc180fff3a67efd419c546/micrometer-core-1.8.1.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest/2.2/1820c0968dba3a11a1b30669bb1f01978a91dedc/hamcrest-2.2.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/net.minidev/json-smart/2.2/53200a9d80fff3106dc435de1350cdd20b757819/json-smart-2.2.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.hdrhistogram/HdrHistogram/2.1.12/6eb7552156e0d517ae80cc2247be1427c8d90452/HdrHistogram-2.1.12.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/net.minidev/accessors-smart/1.1/a527213f2fea112a04c9bdf0ec0264e34104cd08/accessors-smart-1.1.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm/5.0.3/dcc2193db20e19e1feca8b1240dbbc4e190824fa/asm-5.0.3.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.epam.reportportal/client-java/5.1.4/e23fc72b494fc5ee847cdd3bf129ec532e8679e3/client-java-5.1.4.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.epam.reportportal/commons-model/5.2.3/acb406369b667a58b1dfd5c2008149201938c87c/commons-model-5.2.3.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.9/122c7cee69b53ed4a7681c03d4ee4c0e2765da5/commons-lang3-3.9.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.hibernate/hibernate-entitymanager/3.6.10.Final/c74f1e1bf4fb6b8eaa7e501e6ccba9e055e52974/hibernate-entitymanager-3.6.10.Final.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.hibernate/hibernate-core/3.6.10.Final/6b36a1eef76cbccc2757f22a795b5e12ab56b3d5/hibernate-core-3.6.10.Final.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.aspectj/aspectjrt/1.9.2/aa6462d131f63569997e74ecd345359a7d22d1d3/aspectjrt-1.9.2.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.aspectj/aspectjweaver/1.9.2/d2502817521477faf0712c49a6ee2a5388787fc7/aspectjweaver-1.9.2.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.glassfish/javax.el/3.0.1-b09/2b59f1809e193aa942b8ed20efc673d9063e6a50/javax.el-3.0.1-b09.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.h2database/h2/1.3.163/978de63cea2f9f71c20217ef2e2054d621a940e8/h2-1.3.163.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/mysql/mysql-connector-java/5.1.35/b6ac941b7288376a7e8bc6490264bbd4427fb94e/mysql-connector-java-5.1.35.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.squareup.retrofit2/adapter-rxjava2/2.9.0/180ad7353dbf0480cabc215948b5a234e3692f0a/adapter-rxjava2-2.9.0.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/io.reactivex.rxjava2/rxjava/2.2.10/18e9edc67e0abaa03713eeb9ca2cb0e30c859de4/rxjava-2.2.10.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.2/25ea2e8b0c338a877313bd4672d3fe056ea78f0d/jsr305-3.0.2.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.squareup.retrofit2/converter-scalars/2.9.0/e9ee6f35fb7ba877a35519f9a8f55c648df820d4/converter-scalars-2.9.0.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.squareup.retrofit2/converter-jackson/2.9.0/19b4010914e747601e26f46c6a403044bbe0b2bf/converter-jackson-2.9.0.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.squareup.retrofit2/retrofit/2.9.0/d8fdfbd5da952141a665a403348b74538efc05ff/retrofit-2.9.0.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/logging-interceptor/3.14.9/7358b6fa1d6c1c8b8c01cb05acd74dbe6d680fb1/logging-interceptor-3.14.9.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/io.swagger/swagger-annotations/1.6.0/158dfa5430ff4b96a03e936a2ad1cb2f376a8c1a/swagger-annotations-1.6.0.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/javax.validation/validation-api/2.0.1.Final/cb855558e6271b1b32e716d24cb85c7f583ce09e/validation-api-2.0.1.Final.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.2.3/7c4f3c474fb2c041d8028740440937705ebb473a/logback-classic-1.2.3.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.hibernate.javax.persistence/hibernate-jpa-2.0-api/1.0.1.Final/3306a165afa81938fc3d8a0948e891de9f6b192b/hibernate-jpa-2.0-api-1.0.1.Final.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.javassist/javassist/3.26.0-GA/bb2890849968d8d8311ffba8c37b0ce16ce284dc/javassist-3.26.0-GA.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.hibernate/hibernate-commons-annotations/3.2.0.Final/ce990611448fc2865469e3b68d2fe76b050e3c4f/hibernate-commons-annotations-3.2.0.Final.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/dom4j/dom4j/1.6.1/5d3ccc056b6f056dbf0dddfdf43894b9065a8f94/dom4j-1.6.1.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/javax.transaction/jta/1.1/2ca09f0b36ca7d71b762e14ea2ff09d5eac57558/jta-1.1.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/antlr/antlr/2.7.6/cf4f67dae5df4f9932ae7810f4548ef3e14dd35e/antlr-2.7.6.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.hibernate.validator/hibernate-validator/6.0.17.Final/af73055fc4a103ab347c56e7da5a143d68a0170/hibernate-validator-6.0.17.Final.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.reactivestreams/reactive-streams/1.0.3/d9fb7a7926ffa635b3dcaa5049fb2bfa25b3e7d0/reactive-streams-1.0.3.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.14.9/3e6d101343c7ea687cd593e4990f73b25c878383/okhttp-3.14.9.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-core/1.2.3/864344400c3d4d92dfeb0a305dc87d953677c03c/logback-core-1.2.3.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.jboss.logging/jboss-logging/3.3.2.Final/3789d00e859632e6c6206adc0c71625559e6e3b0/jboss-logging-3.3.2.Final.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.fasterxml/classmate/1.3.4/3d5f48f10bbe4eb7bd862f10c0583be2e0053c6/classmate-1.3.4.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/com.squareup.okio/okio/1.17.2/78c7820b205002da4d2d137f6f312bd64b3d6049/okio-1.17.2.jar:/home/EffiB/.gradle/caches/modules-2/files-2.1/org.latencyutils/LatencyUtils/2.0.3/769c0b82cb2421c8256300e907298a9410a2a3d3/LatencyUtils-2.0.3.jar

ptrthomas commented 2 years ago

@effiban thanks ! can you share the gradle dependencies that results in this.

one suggestion, if you use the all classifier with the karate-core JAR, it may reduce the number of dependencies that karate pulls in, so I wonder if that is an acceptable workaround: https://github.com/karatelabs/karate/tree/develop#karate-core-fat-jar

ptrthomas commented 2 years ago

@effiban I mean a snippet of your gradle build file (if possible) so we can replicate this

effiban commented 2 years ago

@ptrthomas - it's a bit hard to provide a snippet since we have a tree of transitive deps which contain a combination of our deps and third-parties. I'll see if I can approximate it somehow. Regarding the fat jar, I'll need to investigate since we have our own wrapper library on top of the karate libs

effiban commented 2 years ago

As an aside, it seems to me we have plenty of redundant stuff in there :grin: but before we clean it up, it would be nice to know what the limit is (if possible).

jansorg commented 2 years ago

IntelliJ supports shortening of the classpath, see the details on https://www.jetbrains.com/help/idea/run-debug-configuration.html I'll check how to reuse this for Karate's own run configurations...

effiban commented 2 years ago

IntelliJ supports shortening of the classpath, see the details on https://www.jetbrains.com/help/idea/run-debug-configuration.html I'll check how to reuse this for Karate's own run configurations...

:+1: thanks

effiban commented 2 years ago

@ptrthomas @jansorg - I had trouble collecting and aggregating the defined dependencies from our gradle build files, so instead I simply converted the above into a "flattened" gradle dependencies block. Hope it helps (and works):

dependencies {
    testImplementation 'org.apache.httpcomponents:httpclient:4.5.6'
    testImplementation 'org.apache.httpcomponents:httpcore:4.4.10'
    testImplementation 'com.github.tomakehurst:wiremock-standalone:2.24.1'
    testImplementation 'com.intuit.karate:karate-apache:0.9.3'
    testImplementation 'com.intuit.karate:karate-junit4:0.9.3'
    testImplementation 'net.masterthought:cucumber-reporting:3.8.0'
    testImplementation 'commons-logging:commons-logging:1.2'
    testImplementation 'commons-codec:commons-codec:1.10'
    testImplementation 'com.bettercloud:vault-java-driver:4.0.0'
    testImplementation 'org.apache.commons:commons-lang3:3.5'
    testImplementation 'org.slf4j:slf4j-api:1.7.36'
    testImplementation 'org.springframework:spring-orm:4.3.0.RELEASE'
    testImplementation 'org.springframework:spring-webmvc:4.3.0.RELEASE'
    testImplementation 'org.springframework:spring-test:4.3.0.RELEASE'
    testImplementation 'org.springframework.batch:spring-batch-core:3.0.7.RELEASE'
    testImplementation 'org.springframework:spring-core:4.3.0.RELEASE'
    testImplementation 'io.dropwizard.metrics:metrics-graphite:3.1.0'
    testImplementation 'io.dropwizard.metrics:metrics-core:3.1.0'
    testImplementation 'net.sf.ehcache:ehcache-core:2.5.2'
    testImplementation 'com.google.guava:guava:16.0.1'
    testImplementation 'org.aspectj:aspectjrt:1.8.7'
    testImplementation 'org.aspectj:aspectjweaver:1.8.7'
    testImplementation 'junit:junit:4.12'
    testImplementation 'org.mockito:mockito-core:3.2.0'
    testImplementation 'org.hamcrest:hamcrest-library:2.2'
    testImplementation 'org.apache.tomcat:tomcat-jdbc:7.0.27'
    testImplementation 'commons-pool:commons-pool:1.5.4'
    testImplementation 'joda-time:joda-time:2.9.7'
    testImplementation 'io.cucumber:gherkin:5.1.0'
    testImplementation 'com.intuit.karate:karate-core:0.9.3'
    testImplementation 'org.apache.httpcomponents:httpmime:4.5.5'
    testImplementation 'org.apache.logging.log4j:log4j-core:2.6'
    testImplementation 'org.apache.logging.log4j:log4j-api:2.6'
    testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.9.1'
    testImplementation 'org.apache.velocity:velocity:1.7'
    testImplementation 'velocity-tools:velocity-tools:1.4'
    testImplementation 'commons-io:commons-io:2.5'
    testImplementation 'net.lingala.zip4j:zip4j:1.3.2'
    testImplementation 'org.codehaus.plexus:plexus-utils:3.0.24'
    testImplementation 'org.jsoup:jsoup:1.10.1'
    testImplementation 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20160924.1'
    testImplementation 'org.springframework:spring-jdbc:4.3.0.RELEASE'
    testImplementation 'org.springframework:spring-tx:4.3.0.RELEASE'
    testImplementation 'org.springframework:spring-beans:4.3.0.RELEASE'
    testImplementation 'org.springframework:spring-web:4.3.0.RELEASE'
    testImplementation 'org.springframework:spring-context:4.3.0.RELEASE'
    testImplementation 'org.springframework:spring-aop:4.3.0.RELEASE'
    testImplementation 'org.springframework:spring-expression:4.3.0.RELEASE'
    testImplementation 'org.springframework.batch:spring-batch-infrastructure:3.0.7.RELEASE'
    testImplementation 'com.ibm.jbatch:com.ibm.jbatch-tck-spi:1.0'
    testImplementation 'com.thoughtworks.xstream:xstream:1.4.7'
    testImplementation 'org.codehaus.jettison:jettison:1.2'
    testImplementation 'com.ryantenney.metrics:metrics-spring:3.0.3'
    testImplementation 'io.dropwizard.metrics:metrics-jvm:4.1.0'
    testImplementation 'io.dropwizard.metrics:metrics-healthchecks:3.1.0'
    testImplementation 'javax.annotation:javax.annotation-api:1.3.2'
    testImplementation 'org.jooq:jool:0.9.11'
    testImplementation 'io.micrometer:micrometer-registry-statsd:1.8.1'
    testImplementation 'org.hamcrest:hamcrest-core:2.2'
    testImplementation 'net.bytebuddy:byte-buddy:1.10.3'
    testImplementation 'net.bytebuddy:byte-buddy-agent:1.10.3'
    testImplementation 'org.objenesis:objenesis:2.6'
    testImplementation 'org.apache.tomcat:tomcat-juli:7.0.27'
    testImplementation 'io.cucumber:gherkin-jvm-deps:1.0.4'
    testImplementation 'com.jayway.jsonpath:json-path:2.1.0'
    testImplementation 'info.cukes:cucumber-java:1.2.5'
    testImplementation 'org.yaml:snakeyaml:1.24'
    testImplementation 'de.siegmar:fastcsv:1.0.3'
    testImplementation 'info.picocli:picocli:3.0.1'
    testImplementation 'com.fasterxml.jackson.core:jackson-annotations:2.9.1'
    testImplementation 'com.fasterxml.jackson.core:jackson-core:2.9.1'
    testImplementation 'commons-collections:commons-collections:3.2.1'
    testImplementation 'commons-lang:commons-lang:2.6'
    testImplementation 'org.springframework.retry:spring-retry:1.1.0.RELEASE'
    testImplementation 'javax.batch:javax.batch-api:1.0'
    testImplementation 'xmlpull:xmlpull:1.1.3.1'
    testImplementation 'xpp3:xpp3_min:1.1.4c'
    testImplementation 'org.springframework:spring-context-support:4.3.0.RELEASE'
    testImplementation 'io.dropwizard.metrics:metrics-annotation:3.1.0'
    testImplementation 'io.micrometer:micrometer-core:1.8.1'
    testImplementation 'org.hamcrest:hamcrest:2.2'
    testImplementation 'net.minidev:json-smart:2.2'
    testImplementation 'org.hdrhistogram:HdrHistogram:2.1.12'
    testImplementation 'net.minidev:accessors-smart:1.1'
    testImplementation 'org.ow2.asm:asm:5.0.3'
    testImplementation 'com.epam.reportportal:client-java:5.1.4'
    testImplementation 'com.epam.reportportal:commons-model:5.2.3'
    testImplementation 'org.apache.commons:commons-lang3:3.9'
    testImplementation 'org.hibernate:hibernate-entitymanager:3.6.10.Final'
    testImplementation 'org.hibernate:hibernate-core:3.6.10.Final'
    testImplementation 'org.aspectj:aspectjrt:1.9.2'
    testImplementation 'org.aspectj:aspectjweaver:1.9.2'
    testImplementation 'org.glassfish:javax.el:3.0.1-b09'
    testImplementation 'com.h2database:h2:1.3.163'
    testImplementation 'mysql:mysql-connector-java:5.1.35'
    testImplementation 'com.squareup.retrofit2:adapter-rxjava2:2.9.0'
    testImplementation 'io.reactivex.rxjava2:rxjava:2.2.10'
    testImplementation 'com.google.code.findbugs:jsr305:3.0.2'
    testImplementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
    testImplementation 'com.squareup.retrofit2:converter-jackson:2.9.0'
    testImplementation 'com.squareup.retrofit2:retrofit:2.9.0'
    testImplementation 'com.squareup.okhttp3:logging-interceptor:3.14.9'
    testImplementation 'io.swagger:swagger-annotations:1.6.0'
    testImplementation 'javax.validation:validation-api:2.0.1.Final'
    testImplementation 'ch.qos.logback:logback-classic:1.2.3'
    testImplementation 'org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final'
    testImplementation 'org.javassist:javassist:3.26.0-GA'
    testImplementation 'org.hibernate:hibernate-commons-annotations:3.2.0.Final'
    testImplementation 'dom4j:dom4j:1.6.1'
    testImplementation 'javax.transaction:jta:1.1'
    testImplementation 'antlr:antlr:2.7.6'
    testImplementation 'org.hibernate.validator:hibernate-validator:6.0.17.Final'
    testImplementation 'org.reactivestreams:reactive-streams:1.0.3'
    testImplementation 'com.squareup.okhttp3:okhttp:3.14.9'
    testImplementation 'ch.qos.logback:logback-core:1.2.3'
    testImplementation 'org.jboss.logging:jboss-logging:3.3.2.Final'
    testImplementation 'com.fasterxml:classmate:1.3.4'
    testImplementation 'com.squareup.okio:okio:1.17.2'
    testImplementation 'org.latencyutils:LatencyUtils:2.0.3'
}
jansorg commented 2 years ago

@effiban Are you sure that this is related to the length of the classpath? Your list of dependencies includes testImplementation 'com.intuit.karate:karate-core:0.9.3'. The Karate plugin does not add its own karate.jar to the classpath if there's an entry karate-core*.jar in the classpath. AFAIK 0.9.3 is incompatible with the plugin.

I'm not seeing the "ClassNotFound" exception when I remove the karate-core from the list of dependencies.

@ptrthomas Could you comment on the required version of karate-core, please?

(The length of the classpath could certainly become an issue, but I'm not sure if it's causing this problem).

ptrthomas commented 2 years ago

@ptrthomas I just realized that this user has most likely given a different name to the JARs - to quote: we have our own wrapper library on top of the karate libs so I think karate-core will not even appear.

I think we may need a setting in the run-options to include bundled karate.jar which defaults to UNCHECKED for maven + gradle projects.

ptrthomas commented 2 years ago

sorry meant to tag @jansorg in above comment

jansorg commented 2 years ago

@ptrthomas Sure, that's possible. I'd have to verify this, but it may be possible to lookup the class itself com.intuit.karate.Main in the classpath to decide if we should attach our own karate.jar file. What do you think? Is the Main class only available in compatible Karate jars, or also in older, unsupported versions of Karate?

Regarding include bundled karate.jar : We're attaching karate.jar in maven and Gradle projects if the karate-core.jar is not on the classpath. So the default of UNCHECKED would be a change of behavior. I think it should have three values: "Automatic", "Always include", "Always Exclude" but this seems a complicated to me...

ptrthomas commented 2 years ago

@jansorg I think looking for com.intuit.karate.Main is a good solution and should work for most if not all the cases out there. so yes, I would prefer this if it works. that Main should always be available. even in old versions of karate

effiban commented 1 year ago

@ptrthomas @jansorg - any updates on this?

ptrthomas commented 1 year ago

@effiban it should have been fixed in this version, can you confirm: https://plugins.jetbrains.com/plugin/19232-karate/versions/stable/262620

effiban commented 1 year ago

@effiban it should have been fixed in this version, can you confirm: https://plugins.jetbrains.com/plugin/19232-karate/versions/stable/262620

That's great, thanks! I will check it soon and let you know

effiban commented 1 year ago

@ptrthomas @jansorg - I tried running a feature file with the new plugin, and it seems like the problem is (in general) resolved - the scenarios are running :) There is just one issue - a couple scenarios failed on a match between a string and a number, and the same scenarios pass when I use the IJ cucumber runner. So I suspect that the plugin is somehow overriding the Karate version we already have in the classpath with a later one, which has different behavior for this type of comparison. If so, it's probably not a big deal to resolve - we can align our versions as needed, just need to figure out which minimum version is required.

ptrthomas commented 1 year ago

@effiban my guess is you may be "shading" the JARs in your wrapper JAR. that's really hard for us to support - we currently try to figure out if karate is already in your path by using the class name and if not found we add the bundled karate to the path. if you still have issues, I would request a way to replicate

effiban commented 1 year ago

@ptrthomas - I think I figured it out: We aren't shading the karate jars, we simply depend on an extremely old Karate version 0.9.3 - and as far as I can tell, this version does not have the class com.intuit.karate.Main. This is our legacy monolith and changes are difficult - but I will check and see what the effort would be to upgrade at least to 1.0.0, if not later than that. Thanks for your help!

ptrthomas commented 1 year ago

closing