Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to use JIB with JAXWS dependencies #1907

Closed
raizoor opened this issue Aug 15, 2019 · 25 comments
Closed

Fail to use JIB with JAXWS dependencies #1907

raizoor opened this issue Aug 15, 2019 · 25 comments
Milestone

Comments

@raizoor
Copy link

raizoor commented Aug 15, 2019

Environment:

  • Jib version: 1.4
  • Build tool: Maven 3.6 -->
  • OS: Linux Server

Description of the issue:
Team,

Today, i have this problem:

  • An team need building API that need use JAXWS dependencies, to handle SOAP requests. My build tests (unit and integration) has ok, but when goes to deploy, we have that stack:

*************************** APPLICATION FAILED TO START *************************** Description: An attempt was made to call a method that does not exist. The attempt was made from the following location: io.undertow.websockets.jsr.Bootstrap.handleDeployment(Bootstrap.java:84) The following method did not exist: javax.servlet.ServletContext.getClassLoader()Ljava/lang/ClassLoader; The method's class, javax.servlet.ServletContext, is available from the following locations: jar:file:/app/libs/geronimo-servlet_2.5_spec-1.2.jar!/javax/servlet/ServletContext.class jar:file:/app/libs/javax.servlet-api-4.0.1.jar!/javax/servlet/ServletContext.class It was loaded from the following location: file:/app/libs/geronimo-servlet_2.5_spec-1.2.jar

As I search, this error occours when spring detect two classes to do same thing, but in this case, he uses the bad servlet =/
If eu use mvn clean install, i have success.
Exists an option where can i set which class I want use? Or do you know how can i resolve this?
Now i'm using undertow, but I already test with tomcat, but not success.

@raizoor
Copy link
Author

raizoor commented Aug 15, 2019

tempPom.txt

@chanseokoh
Copy link
Member

I assume mvn spring-boot:run runs OK, and this problem happens only when running the image built by Jib.

Can you do mvn dependency:tree and see how geronimo-servlet_2.5_spec-1.2.jar is pulled in? Perhaps just upload the output result.

@raizoor
Copy link
Author

raizoor commented Aug 19, 2019

Hi @chanseokoh ,

Yap, if I don't use jib, it work.
I have already run mvn tree, and Geronimo is pulled by <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-http-netty-server</artifactId>
I tried to put scope = provided, but it broke my startup API =/

@chanseokoh
Copy link
Member

It may be that the order of loading dependencies is different between the Jib run and the spring run. I tried excluding the dependency like below, and I do see that it avoids the conflict. (You need to do mvn clean to take the exclusion into effect.) But it seems like there may be more transitive dependencies you need to exclude further.

        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http-netty-server</artifactId>
            <version>3.3.2</version>
            <exclusions>
              <exclusion>
                <groupId>org.apache.geronimo.specs</groupId>
                <artifactId>geronimo-servlet_2.5_spec</artifactId>
              </exclusion>
            </exclusions> 
        </dependency>

However, I only think this is a stopgap workaround. I have no idea about this Apache CFX Runtime dependency, but from the fact that it embeds the Servlet API (runtime or API only, I don't know), I conjecture this is a standalone HTTP server based on Jetty. Maybe the project shouldn't really be set up this way to pull this dependency, which I think is a standalone server runtime competing with undertow? (I may be wrong though.) This link says CFX includes two HTTP options: one for deploying into a Servlet container (like tomcat), and a Jetty-based standalone HTTP server.

@chanseokoh
Copy link
Member

It may be that the order of loading dependencies is different between the Jib run and the spring run.

Basically, #1871

@raizoor
Copy link
Author

raizoor commented Aug 19, 2019

Ass i've seen with de develop team, this dependency was made to help construct stubs to SOAP. We need call an external webservice with SOAP. Probaly it uses the servlet in specific executions.
This API is an "connector". It's a online service that execute a operations (like bellow), job logicalls and than write into a DB the result.
I will test this workaround.

@raizoor
Copy link
Author

raizoor commented Aug 20, 2019

@chanseokoh It works !
About your last questions, project need this because it runs another things, not only the servlet HTTP server.
Do you can think any idea about how JIB could help this situation?

Thank you so much for your help

@chanseokoh
Copy link
Member

So we think the difference between the Spring run and the Jib run comes from the difference in the order of loading JARs. Jib just does java -cp ...:/app/libs/*:... mainClass, and I guess the order depends on how JVM interprets /app/libs/*. OTOH, Spring does java -jar spring-boot-built-fat.jar and it must be loading the embedded dependency JARs in a different order. This is actually the issue #1871. We've been discussing that Jib could try to preserve the order of dependencies as defined in pom.xml, but not sure how actually we can achieve that. I don't think this can be fixed easily soon.

But at least it's clear that your project pulls in two different JARs that contain exact same classes, which I think is never good and can easily lead to a situation like this whenever there is a change to the order of JAR/class loading. I think you should try to avoid or resolve it somehow. Excluding the dependency as I suggested can be one way.

Aside, personally I feel strange that geronimo-servlet_2.5_spec (re)defines javax.servlet.ServletContext. Isn't javax.servlet-api the sort of an authoritative one to define it and everyone else should just depend on it rather than redefining its own class?

@raizoor
Copy link
Author

raizoor commented Aug 20, 2019

First, for me it's a great solution that you have give me, it's simple and resolve my problem. My question is more: " Can we help (jib) in any more thing? Logs or any functional solution, you know?"
Second, i don't know that plugins too, it's new to me. The developers on my squad (i'm ops analyst) "knew it", so i think I can't change the code to not use that. Now, the best solution is exclude.
Third, i really don't know why this f*** geronimo have the authority to change my all servlet uses in this case. The bad thing in all of this is the geronimo are the principal choice to spring... If i've this log, but my API uses de default servlet (undertow or tomcat servlet), it's perfect.

@snowe2010
Copy link

for some reason any time I try to post the error log it breaks github's rendering and removes half my content...

we are also encountering this with jib (at least I think it's jib). It fails to start with this message:

Details
2019-09-30 21:34:19.428  INFO 1 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$79dd7fdd] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying),
2019-09-30 21:34:19.904  WARN 1 --- [           main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'spring.cloud.vault.consul-org.springframework.cloud.vault.config.consul.VaultConsulProperties': Could not bind properties to 'VaultConsulProperties' : prefix=spring.cloud.vault.consul, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.cloud.vault.consul' to org.springframework.cloud.vault.config.consul.VaultConsulProperties,
2019-09-30 21:34:19.920  INFO 1 --- [           main] ConditionEvaluationReportLoggingListener : ,
,
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.,
2019-09-30 21:34:19.924 ERROR 1 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : ,
,
***************************,
APPLICATION FAILED TO START,
***************************,
,
Description:,
,
Failed to bind properties under 'spring.cloud.vault.consul' to org.springframework.cloud.vault.config.consul.VaultConsulProperties:,
,
    Property: spring.cloud.vault.consul.enabled,
    Value: false,
    Origin: class path resource [bootstrap.yml]:25:18,
    Reason: HV000030: No validator could be found for constraint 'javax.validation.constraints.NotEmpty' validating type 'java.lang.String'. Check configuration for 'backend',
,
Action:,
,
Update your application's configuration,
,
2019-09-30 21:34:19.936 ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application run failed,
,
org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'spring.cloud.vault.consul-org.springframework.cloud.vault.config.consul.VaultConsulProperties': Could not bind properties to 'VaultConsulProperties' : prefix=spring.cloud.vault.consul, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.cloud.vault.consul' to org.springframework.cloud.vault.config.consul.VaultConsulProperties,
	at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:110) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:93) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:414) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1770) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:203) ~[spring-cloud-context-2.1.2.RELEASE.jar:2.1.2.RELEASE],
	at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:114) ~[spring-cloud-context-2.1.2.RELEASE.jar:2.1.2.RELEASE],
	at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:71) ~[spring-cloud-context-2.1.2.RELEASE.jar:2.1.2.RELEASE],
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:75) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:347) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:306) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at com.promontech.Application.main(Application.java:46) [classes/:na],
Caused by: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.cloud.vault.consul' to org.springframework.cloud.vault.config.consul.VaultConsulProperties,
	at org.springframework.boot.context.properties.bind.Binder.handleBindError(Binder.java:249) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:225) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:208) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:190) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.ConfigurationPropertiesBinder.bind(ConfigurationPropertiesBinder.java:83) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:107) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	... 28 common frames omitted,
Caused by: javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'javax.validation.constraints.NotEmpty' validating type 'java.lang.String'. Check configuration for 'backend',
	at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.throwExceptionForNullValidator(ConstraintTree.java:228) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getConstraintValidatorNoUnwrapping(ConstraintTree.java:309) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getConstraintValidatorInstanceForAutomaticUnwrapping(ConstraintTree.java:243) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getInitializedConstraintValidator(ConstraintTree.java:164) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:109) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:88) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:73) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.ValidatorImpl.validateMetaConstraint(ValidatorImpl.java:617) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:582) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForSingleDefaultGroupElement(ValidatorImpl.java:528) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:496) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:461) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:411) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:208) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.springframework.validation.beanvalidation.SpringValidatorAdapter.validate(SpringValidatorAdapter.java:108) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.boot.context.properties.ConfigurationPropertiesJsr303Validator.validate(ConfigurationPropertiesJsr303Validator.java:52) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.bind.validation.ValidationBindHandler.lambda$validateAndPush$1(ValidationBindHandler.java:111) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[na:1.8.0_222],
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[na:1.8.0_222],
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[na:1.8.0_222],
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[na:1.8.0_222],
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[na:1.8.0_222],
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[na:1.8.0_222],
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[na:1.8.0_222],
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:1.8.0_222],
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485) ~[na:1.8.0_222],
	at org.springframework.boot.context.properties.bind.validation.ValidationBindHandler.validateAndPush(ValidationBindHandler.java:111) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.bind.validation.ValidationBindHandler.validate(ValidationBindHandler.java:89) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.bind.validation.ValidationBindHandler.onFinish(ValidationBindHandler.java:72) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.bind.Binder.handleBindResult(Binder.java:235) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:222) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	... 32 common frames omitted,
,
2019-09-30 22:11:58.274  INFO 1 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$c878053b] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying),
2019-09-30 22:11:58.594  WARN 1 --- [           main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'spring.cloud.vault.consul-org.springframework.cloud.vault.config.consul.VaultConsulProperties': Could not bind properties to 'VaultConsulProperties' : prefix=spring.cloud.vault.consul, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.cloud.vault.consul' to org.springframework.cloud.vault.config.consul.VaultConsulProperties,
2019-09-30 22:11:58.608  INFO 1 --- [           main] ConditionEvaluationReportLoggingListener : ,
,
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.,
2019-09-30 22:11:58.611 ERROR 1 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : ,
,
***************************,
APPLICATION FAILED TO START,
***************************,
,
Description:,
,
Failed to bind properties under 'spring.cloud.vault.consul' to org.springframework.cloud.vault.config.consul.VaultConsulProperties:,
,
    Property: spring.cloud.vault.consul.enabled,
    Value: false,
    Origin: class path resource [bootstrap.yml]:25:18,
    Reason: HV000030: No validator could be found for constraint 'javax.validation.constraints.NotEmpty' validating type 'java.lang.String'. Check configuration for 'tokenProperty',
,
Action:,
,
Update your application's configuration,
,
2019-09-30 22:11:58.623 ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application run failed,
,
org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'spring.cloud.vault.consul-org.springframework.cloud.vault.config.consul.VaultConsulProperties': Could not bind properties to 'VaultConsulProperties' : prefix=spring.cloud.vault.consul, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.cloud.vault.consul' to org.springframework.cloud.vault.config.consul.VaultConsulProperties,
	at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:110) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:93) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:414) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1770) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:203) ~[spring-cloud-context-2.1.2.RELEASE.jar:2.1.2.RELEASE],
	at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:114) ~[spring-cloud-context-2.1.2.RELEASE.jar:2.1.2.RELEASE],
	at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:71) ~[spring-cloud-context-2.1.2.RELEASE.jar:2.1.2.RELEASE],
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:75) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:347) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:306) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at com.promontech.Application.main(Application.java:46) [classes/:na],
Caused by: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.cloud.vault.consul' to org.springframework.cloud.vault.config.consul.VaultConsulProperties,
	at org.springframework.boot.context.properties.bind.Binder.handleBindError(Binder.java:249) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:225) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:208) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:190) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.ConfigurationPropertiesBinder.bind(ConfigurationPropertiesBinder.java:83) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:107) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	... 28 common frames omitted,
Caused by: javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'javax.validation.constraints.NotEmpty' validating type 'java.lang.String'. Check configuration for 'tokenProperty',
	at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.throwExceptionForNullValidator(ConstraintTree.java:228) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getConstraintValidatorNoUnwrapping(ConstraintTree.java:309) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getConstraintValidatorInstanceForAutomaticUnwrapping(ConstraintTree.java:243) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getInitializedConstraintValidator(ConstraintTree.java:164) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:109) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:88) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:73) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.ValidatorImpl.validateMetaConstraint(ValidatorImpl.java:617) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:582) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForSingleDefaultGroupElement(ValidatorImpl.java:528) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:496) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:461) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:411) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:208) ~[hibernate-validator-5.4.2.Final.jar:5.4.2.Final],
	at org.springframework.validation.beanvalidation.SpringValidatorAdapter.validate(SpringValidatorAdapter.java:108) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE],
	at org.springframework.boot.context.properties.ConfigurationPropertiesJsr303Validator.validate(ConfigurationPropertiesJsr303Validator.java:52) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.bind.validation.ValidationBindHandler.lambda$validateAndPush$1(ValidationBindHandler.java:111) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[na:1.8.0_222],
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[na:1.8.0_222],
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[na:1.8.0_222],
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[na:1.8.0_222],
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[na:1.8.0_222],
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[na:1.8.0_222],
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[na:1.8.0_222],
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:1.8.0_222],
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485) ~[na:1.8.0_222],
	at org.springframework.boot.context.properties.bind.validation.ValidationBindHandler.validateAndPush(ValidationBindHandler.java:111) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.bind.validation.ValidationBindHandler.validate(ValidationBindHandler.java:89) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.bind.validation.ValidationBindHandler.onFinish(ValidationBindHandler.java:72) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.bind.Binder.handleBindResult(Binder.java:235) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:222) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE],
	... 32 common frames omitted,
,

We do not see this error when using docker to build, or running with ./gradlew bootRun

@chanseokoh
Copy link
Member

Hi @snowe2010,

Can you share your build.gradle or provide us with a sample app that reproduces this?

@snowe2010
Copy link

I can attempt to.

@raizoor
Copy link
Author

raizoor commented Oct 1, 2019

@snowe2010 what libs are you import in your project? Which versions of spring, java and libs?
I'm using Consul / Vault and it's ok to me. See that:

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.6.RELEASE</version>
</parent>

 <dependency>
            <groupId>devops.sicredi</groupId>
            <artifactId>vault-springboot-starter</artifactId>
            <version>0.2.0</version>
</dependency>

<dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-consul-config</artifactId>
</dependency>   

<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Greenwich.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
</dependencyManagement>

Obs: java1.11

@snowe2010
Copy link

@raizoor I believe this might be an issue with overriding dependencies. We have an enterprise bom that is declared as a dependency in both a maven 'common' project and a spring boot gradle project. the spring boot gradle project has these dependencies:

springBootVersion=2.1.4.RELEASE
springDataVersion=Lovelace-SR9
springCloudVersion=Greenwich.SR2
springCloudVaultVersion=2.1.1.RELEASE

    implementation(platform("org.springframework.boot:spring-boot-dependencies:${extra["springBootVersion"]}"))
    implementation(platform("org.springframework.cloud:spring-cloud-dependencies:${extra["springCloudVersion"]}"))
    implementation(platform("org.springframework.cloud:spring-cloud-vault-dependencies:${extra["springCloudVaultVersion"]}"))
    implementation(platform("org.springframework.data:spring-data-releasetrain:${extra["springDataVersion"]}"))
    implementation(platform("org.springframework:spring-framework-bom:${extra["springBootVersion"]}"))

    implementation("org.hibernate.common:hibernate-commons-annotations")
    implementation("org.hibernate:hibernate-core")
    implementation("org.hibernate:hibernate-entitymanager")

while the BOM has these:

        <hibernate.common.version>5.0.1.Final</hibernate.common.version>
        <hibernate.version>5.2.5.Final</hibernate.version>
        <hibernate.jpa.version>1.0.1.Final</hibernate.jpa.version>
        <hibernate-pg-json.version>0.6.0</hibernate-pg-json.version>
        <hibernate-validator.version>5.4.1.Final</hibernate-validator.version>

        <spring.boot.version>1.5.6.RELEASE</spring.boot.version>
        <spring.cloud.version>1.3.1.RELEASE</spring.cloud.version>
        <spring.cloud.consul.version>1.3.1.RELEASE</spring.cloud.consul.version>
        <spring.cloud.vault.version>1.1.2.RELEASE</spring.cloud.vault.version>
        <spring.rabbit.version>1.6.6.RELEASE</spring.rabbit.version>
        <spring.retry.version>1.2.0.RELEASE</spring.retry.version>

            <dependency>
                <!-- Import dependency management from Spring Boot -->
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring.boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.springframework.amqp</groupId>
                <artifactId>spring-rabbit-test</artifactId>
                <version>${spring.rabbit.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-commons</artifactId>
                <version>${spring.cloud.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-consul-discovery</artifactId>
                <version>${spring.cloud.consul.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-consul-config</artifactId>
                <version>${spring.cloud.consul.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-context</artifactId>
                <version>${spring.cloud.consul.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-actuator</artifactId>
                <version>${spring.boot.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.retry</groupId>
                <artifactId>spring-retry</artifactId>
                <version>${spring.retry.version}</version>
            </dependency>

            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>${hibernate.version}</version>
            </dependency>

            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-entitymanager</artifactId>
                <version>${hibernate.version}</version>
            </dependency>

            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-validator</artifactId>
                <version>${hibernate-validator.version}</version>
            </dependency>

            <dependency>
                <groupId>org.hibernate.common</groupId>
                <artifactId>hibernate-commons-annotations</artifactId>
                <version>${hibernate.common.version}</version>
            </dependency>

            <dependency>
                <groupId>org.hibernate.javax.persistence</groupId>
                <artifactId>hibernate-jpa-2.0-api</artifactId>
                <version>${hibernate.jpa.version}</version>
            </dependency>

I have tried changing those versions to be higher hibernate-validator versions though (like this:)

        <hibernate.common.version>5.0.1.Final</hibernate.common.version>
        <hibernate.version>5.4.5.Final</hibernate.version>
        <hibernate.jpa.version>1.0.1.Final</hibernate.jpa.version>
        <hibernate-pg-json.version>0.6.0</hibernate-pg-json.version>
        <hibernate-validator.version>6.0.17.Final</hibernate-validator.version>

But am still seeing the issue even with that. I think some other component might be bringing in an older version of hibernate-validator and jib decides that's the best one to use.

@chanseokoh
Copy link
Member

@snowe2010 I assume the NotEmpty annotation validator is included in org.hibernate:hibernate-validator. (Have never heard of it.) I also think the issue can be due to the order of JAR classpath that is different from what Gradle (and then Spring Boot launcher) uses. That said, if this is the case, you are probably experiencing the dreaded diamond dependency problem. (Yeah, I know we should still fix Jib to follow the exact same classpath order of Gradle.)

A few ideas on top of my head at the moment:

  • Add implementation("org.hibernate:hibernate-validator") in build.gradle. It may be possible that no one is pulling this in?
  • Look at /app/libs in the build image and it has hibernate-validator-*.jar. Check if the version is 6.0.17.Final.
  • If the version is not what you expect, run gradle dependencies to figure out who pulls in the different version for runtime execution. And then I believe there is a way to enforce the version you want.
  • Unzip hibernate-validator-6.0.17.Final.jar and check whatever validator you need is there. (I don't know what is the exact class you should look for.)

Based on what you find out on these, I might be able to suggest an ugly workaround as a last resort.

@snowe2010
Copy link

@chanseokoh

I assume the NotEmpty annotation validator is included in org.hibernate:hibernate-validator

correct

I also think the issue can be due to the order of JAR classpath that is different from what Gradle (and then Spring Boot launcher) uses.

yes, I believe this is the case as well. I was just adding more information to the issue. The more information the easier I think it will be for Google to fix.

  • Add implementation("org.hibernate:hibernate-validator") in build.gradle. It may be possible that no one is pulling this in?

  • Look at /app/libs in the build image and it has hibernate-validator-*.jar. Check if the version is 6.0.17.Final.

Hadn't done this yet, I'll try it.

  • If the version is not what you expect, run gradle dependencies to figure out who pulls in the different version for runtime execution. And then I believe there is a way to enforce the version you want.

Yes I've been using the dependencyReport plugin to figure this out. It's not clear since it's being resolved through a bom. I'm still working on it though.

  • Unzip hibernate-validator-6.0.17.Final.jar and check whatever validator you need is there. (I don't know what is the exact class you should look for.)

Hadn't tried this yet. Will do it as well.

@raizoor
Copy link
Author

raizoor commented Oct 1, 2019

If it's the same problem that I have faced, problaly yes, you're alrigth !

But am still seeing the issue even with that. I think some other component might be bringing in an older version of hibernate-validator and jib decides that's the best one to use.

run gradle dependency:tree and search another dependencies that might have another hibernate version

@snowe2010
Copy link

gradle dependency:tree

I think that's just maven. But running ./gradlew dependencyReport gives me a nice tree anyway. Anyway, the issue is that the BOM dependency tree is flattened. So I can't tell where the dependency is coming from.

@raizoor
Copy link
Author

raizoor commented Oct 2, 2019

Can't you set to gradle get the dependency tree of the boom?

@raizoor
Copy link
Author

raizoor commented Oct 2, 2019

If you're using java1.11, you can try jdeps to ..

@snowe2010
Copy link

Got past the above error to even more errors though. Still only present when using jib. This time it's not even at startup though, it fails to even compile.

@chanseokoh
Copy link
Member

@raizoor I think your original issue is resolved with the workaround, and at the heart of the issue is #1871, so I'm closing this as a dup of #1871. @snowe2010 it's not clear what you are up to or if you are asking for a potential workaround, but feel free to update.

@snowe2010
Copy link

@chanseokoh my issue is covered under #1871 as well. Thanks

@chanseokoh
Copy link
Member

@raizoor @snowe2010 we've released Jib 2.7.0 which added a new configuration option (jib.container.expandClasspathDependencies (Gradle) / <container><expandClasspathDependencies> (Maven)) that enables expanding classpath dependencies in the default java command for an image ENTRYPOINT. Turning on the option (off by default) will enumerate all the dependencies, which will match the dependency loading order in Maven or Gradle builds. For example, the ENTRYPOINT becomes

java ... -cp /app/resources:/app/classes:/app/libs/spring-boot-starter-web-2.0.3.RELEASE.jar:/app/libs/shared-library-0.1.0.jar:/app/libs/spring-boot-starter-json-2.0.3.RELEASE.jar:... com.example.Main

instead of the default

java ... -cp /app/resources:/app/classes:/app/libs/* com.example.Main

Expanding the dependency list can be useful in AppCDS too.

Note that an expanded dependency list can become very long in practice, and we are not sure if there may be a potential issue due to a long command line ("argument list too long" or "command line is too long").

As with other Jib configurations, this option can also be set through the system property (-Djib.container.expandClasspathDependencies=true|false).

@chanseokoh
Copy link
Member

chanseokoh commented Jun 9, 2021

@raizoor @snowe2010 Jib 3.1.1 is released, which creates two JVM argument files inside an image. One of them is the Java runtime classpath where all the dependencies are explicitly enumerated, which enables Jib to preseve the depending loading order by using this file for Java 9+. (For Java 8, you have to continue to set expandClasspathDependencies to true.)

For those interested, see here for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants