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

Facing issue while running docker image on Apple M1 platform. #287

Closed
NikhilPareek88 opened this issue Aug 31, 2021 · 7 comments
Closed

Comments

@NikhilPareek88
Copy link

NikhilPareek88 commented Aug 31, 2021

Logs as follows:

docker run -it adobe/s3mock

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested


  .-')              _   .-')                           .-. .-')  
 ( OO ).           ( '.( OO )_                         \  ( OO ) 
(_)---\_) .-----.   ,--.   ,--.).-'),-----.    .-----. ,--. ,--. 
/    _ | /  -.   \  |   `.'   |( OO'  .-.  '  '  .--./ |  .'   / 
\  :` `. '-' _'  |  |         |/   |  | |  |  |  |('-. |      /, 
 '..`''.)   |_  <   |  |'.'|  |\_) |  |\|  | /_) |OO  )|     ' _)
.-._)   \.-.  |  |  |  |   |  |  \ |  | |  | ||  |`-'| |  .   \  
\       /\ `-'   /  |  |   |  |   `'  '-'  '(_'  '--'\ |  |\   \ 
 `-----'  `----''   `--'   `--'     `-----'    `-----' `--' '--' 



2021-08-31 13:38:53.029  INFO 1 --- [           main] c.a.testing.s3mock.S3MockApplication     : Starting S3MockApplication on 5645918340f0 with PID 1 (/opt/service/s3mock-2.2.1-exec.jar started by root in /)
2021-08-31 13:38:53.091  INFO 1 --- [           main] c.a.testing.s3mock.S3MockApplication     : No active profile set, falling back to default profiles: default
2021-08-31 13:38:58.367  WARN 1 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webServerFactory' defined in class path resource [com/adobe/testing/s3mock/S3MockApplication$Config.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.server.ServletWebServerFactory]: Factory method 'webServerFactory' threw exception; nested exception is org.springframework.cglib.core.CodeGenerationException: java.lang.ClassFormatError-->Illegal class name "java/lang/Class[]" in class file com/adobe/testing/s3mock/S3MockApplication$Config$$FastClassBySpringCGLIB$$1db321fa
2021-08-31 13:38:58.419  INFO 1 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-08-31 13:38:58.531 ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webServerFactory' defined in class path resource [com/adobe/testing/s3mock/S3MockApplication$Config.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.server.ServletWebServerFactory]: Factory method 'webServerFactory' threw exception; nested exception is org.springframework.cglib.core.CodeGenerationException: java.lang.ClassFormatError-->Illegal class name "java/lang/Class[]" in class file com/adobe/testing/s3mock/S3MockApplication$Config$$FastClassBySpringCGLIB$$1db321fa
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:161) ~[spring-boot-2.3.12.RELEASE.jar!/:2.3.12.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545) ~[spring-context-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.12.RELEASE.jar!/:2.3.12.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:755) ~[spring-boot-2.3.12.RELEASE.jar!/:2.3.12.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) ~[spring-boot-2.3.12.RELEASE.jar!/:2.3.12.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:402) ~[spring-boot-2.3.12.RELEASE.jar!/:2.3.12.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) ~[spring-boot-2.3.12.RELEASE.jar!/:2.3.12.RELEASE]
	at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140) ~[spring-boot-2.3.12.RELEASE.jar!/:2.3.12.RELEASE]
	at com.adobe.testing.s3mock.S3MockApplication.start(S3MockApplication.java:212) ~[classes!/:na]
	at com.adobe.testing.s3mock.S3MockApplication.start(S3MockApplication.java:176) ~[classes!/:na]
	at com.adobe.testing.s3mock.S3MockApplication.main(S3MockApplication.java:165) ~[classes!/:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[s3mock-2.2.1-exec.jar:na]
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[s3mock-2.2.1-exec.jar:na]
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[s3mock-2.2.1-exec.jar:na]
	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[s3mock-2.2.1-exec.jar:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webServerFactory' defined in class path resource [com/adobe/testing/s3mock/S3MockApplication$Config.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.server.ServletWebServerFactory]: Factory method 'webServerFactory' threw exception; nested exception is org.springframework.cglib.core.CodeGenerationException: java.lang.ClassFormatError-->Illegal class name "java/lang/Class[]" in class file com/adobe/testing/s3mock/S3MockApplication$Config$$FastClassBySpringCGLIB$$1db321fa
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:657) ~[spring-beans-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:485) ~[spring-beans-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1341) ~[spring-beans-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1181) ~[spring-beans-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) ~[spring-beans-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:207) ~[spring-beans-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getWebServerFactory(ServletWebServerApplicationContext.java:212) ~[spring-boot-2.3.12.RELEASE.jar!/:2.3.12.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:177) ~[spring-boot-2.3.12.RELEASE.jar!/:2.3.12.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:158) ~[spring-boot-2.3.12.RELEASE.jar!/:2.3.12.RELEASE]
	... 18 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.server.ServletWebServerFactory]: Factory method 'webServerFactory' threw exception; nested exception is org.springframework.cglib.core.CodeGenerationException: java.lang.ClassFormatError-->Illegal class name "java/lang/Class[]" in class file com/adobe/testing/s3mock/S3MockApplication$Config$$FastClassBySpringCGLIB$$1db321fa
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:652) ~[spring-beans-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	... 30 common frames omitted
Caused by: org.springframework.cglib.core.CodeGenerationException: java.lang.ClassFormatError-->Illegal class name "java/lang/Class[]" in class file com/adobe/testing/s3mock/S3MockApplication$Config$$FastClassBySpringCGLIB$$1db321fa
	at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:514) ~[spring-core-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:363) ~[spring-core-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:110) ~[spring-core-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:108) ~[spring-core-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54) ~[spring-core-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source) ~[na:na]
	at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61) ~[spring-core-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34) ~[spring-core-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:134) ~[spring-core-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:319) ~[spring-core-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.cglib.reflect.FastClass$Generator.create(FastClass.java:65) ~[spring-core-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.cglib.proxy.MethodProxy.helper(MethodProxy.java:135) ~[spring-core-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.cglib.proxy.MethodProxy.init(MethodProxy.java:76) ~[spring-core-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:242) ~[spring-core-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	at com.adobe.testing.s3mock.S3MockApplication$Config$$EnhancerBySpringCGLIB$$a9e88d11.webServerFactory(<generated>) ~[classes!/:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	... 31 common frames omitted
Caused by: java.lang.ClassFormatError: Illegal class name "java/lang/Class[]" in class file com/adobe/testing/s3mock/S3MockApplication$Config$$FastClassBySpringCGLIB$$1db321fa
	at java.base/java.lang.ClassLoader.defineClass1(Native Method) ~[na:na]
	at java.base/java.lang.System$2.defineClass(Unknown Source) ~[na:na]
	at java.base/java.lang.invoke.MethodHandles$Lookup.defineClass(Unknown Source) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
	at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:509) ~[spring-core-5.2.15.RELEASE.jar!/:5.2.15.RELEASE]
	... 51 common frames omitted
@afranken
Copy link
Member

this seems to be a duplicate of #253

@afranken
Copy link
Member

afranken commented Sep 1, 2021

@NikhilPareek88 did you check #253? Is this a duplicate?

@NikhilPareek88
Copy link
Author

@NikhilPareek88 did you check #253? Is this a duplicate?

yes, this is similar to #253 and I trying to follow the last comment to write own docker images based on jar.

@NikhilPareek88
Copy link
Author

One suggestion for those who are trying to create own image with s3mock.jar, please build the code (git@github.com:adobe/S3Mock.git) on own machine, as this generates separate executable jar.

@ansman
Copy link

ansman commented Nov 2, 2021

FYI I have deployed a mirror that supports arm64 to bontouch/s3mock:2.2.2.

@PoladMahmudov
Copy link

Upgrading to the latest version of S3Mock (v 2.3.2) and Docker (v 4.3.2) fixed this issue for me.

@afranken afranken mentioned this issue Jan 26, 2022
afranken added a commit that referenced this issue Jan 31, 2022
This supports linux/amd64 and linux/arm64 for now.

Fixes #253 #287 #389
afranken added a commit that referenced this issue Jan 31, 2022
This supports linux/amd64 and linux/arm64 for now.

Fixes #253 #287 #389
@afranken
Copy link
Member

afranken commented Feb 1, 2022

just released version 2.4.6 which is multi arch for arm64 and amd64.
https://hub.docker.com/r/adobe/s3mock/tags?page=1&ordering=last_updated

@afranken afranken closed this as completed Feb 1, 2022
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

4 participants