My products are:
I hope you will find it useful 😃
Spring Boot Starter for Orika.
License: Apache License 2.0
My products are:
I hope you will find it useful 😃
Getting NoSuchMethod exception with mapper facade in spring boot native image. Is there any temporary fix or options to over come this issue.
I have added JVM '--aad-opens=java.base/java.lang=ALL-UNNAMED' argument as suggested
2024-05-20 18:02:26,430||INFO|main|org.apache.catalina.core.StandardService - Starting service [Tomcat]
2024-05-20 18:02:26,430||INFO|main|org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/10.1.20]
2024-05-20 18:02:26,485||INFO|main|o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
2024-05-20 18:02:28,746||INFO|main|org.apache.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-8080"]
2024-05-20 18:02:28,840||INFO|main|o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port 8080 (http) with context path ''
2024-05-20 18:02:29,012||INFO|main|c.g.org.JobApplication - Started JobApplication in 4.401 seconds (process running for 6.288)
2024-05-20 18:02:41,631||INFO|http-nio-8080-exec-1|o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
2024-05-20 18:02:41,722||ERROR|http-nio-8080-exec-1|o.a.c.c.C.[.[.[/].[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentEventFunction': Unsatisfied dependency expressed through field 'documentEventService': Error creating bean with name 'documentEventService': Instantiation of supplied bean failed] with root cause
java.lang.NoSuchMethodException: ma.glasnost.orika.converter.DefaultConverterFactory.<init>()
at [email protected]/java.lang.Class.checkMethod(DynamicHub.java:1038)
at [email protected]/java.lang.Class.getConstructor0(DynamicHub.java:1204)
at [email protected]/java.lang.Class.newInstance(DynamicHub.java:626)
at ma.glasnost.orika.impl.UtilityResolver.resolveUtility(UtilityResolver.java:131)
at ma.glasnost.orika.impl.UtilityResolver.getDefaultConverterFactory(UtilityResolver.java:61)
at ma.glasnost.orika.impl.DefaultMapperFactory$MapperFactoryBuilder.<init>(DefaultMapperFactory.java:281)
at ma.glasnost.orika.impl.DefaultMapperFactory$Builder.<init>(DefaultMapperFactory.java:562)
at com.gac.creds.service.DocumentEventService.<init>(DocumentEventService.java:70)
at org.springframework.beans.factory.support.InstanceSupplier.lambda$using$0(InstanceSupplier.java:105)
at org.springframework.beans.factory.support.InstanceSupplier$1.get(InstanceSupplier.java:83)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:949)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1217)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1161)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1443)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353)
at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:188)
at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveAndSet(AutowiredFieldValueResolver.java:167)
at com.gac.creds.function.DocumentEventFunction__Autowiring.apply(DocumentEventFunction__Autowiring.java:19)
at org.springframework.beans.factory.support.InstanceSupplier$1.get(InstanceSupplier.java:83)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:949)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1217)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1161)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1234)
at org.springframework.cloud.function.context.catalog.BeanFactoryAwareFunctionRegistry.lookup(BeanFactoryAwareFunctionRegistry.java:124)
at org.springframework.cloud.function.context.FunctionCatalog.lookup(FunctionCatalog.java:39)
at org.springframework.cloud.function.web.util.FunctionWebRequestProcessingHelper.doFindFunction(FunctionWebRequestProcessingHelper.java:205)
at org.springframework.cloud.function.web.util.FunctionWebRequestProcessingHelper.findFunction(FunctionWebRequestProcessingHelper.java:62)
at org.springframework.cloud.function.web.mvc.FunctionHandlerMapping.getHandlerInternal(FunctionHandlerMapping.java:100)
at org.springframework.cloud.function.web.mvc.FunctionHandlerMapping.getHandlerInternal(FunctionHandlerMapping.java:44)
at org.springframework.web.servlet.handler.AbstractHandlerMapping.getHandler(AbstractHandlerMapping.java:507)
at org.springframework.web.servlet.DispatcherServlet.getHandler(DispatcherServlet.java:1283)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1065)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:590)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:175)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:175)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:175)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:175)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:673)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1736)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
at [email protected]/java.lang.Thread.run(Thread.java:833)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:807)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:210)
Hi,
I created a pull request on spring-io/initializr#687
but the pull request has been declined because of missing support for Spring-Boot 2.0 and general lack of active development.
I see that the support to Spring-Boot 2.x has been added.
What do you think about re-asking to add this pull request?
项目使用的spring-boot:
java 1.8
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
<relativePath/>
</parent>
<!-- https://mvnrepository.com/artifact/net.rakugakibox.spring.boot/orika-spring-boot-starter -->
<dependency>
<groupId>net.rakugakibox.spring.boot</groupId>
<artifactId>orika-spring-boot-starter</artifactId>
<version>1.6.0</version>
</dependency>
测试代码:
import org.springframework.beans.factory.annotation.Autowired;
import ma.glasnost.orika.MapperFacade;
···
@Autowired
private MapperFacade orikaMapperFacade;
···
OrderPriceInput orderPriceInput = orikaMapperFacade.map(input, OrderPriceInput.class);
出现如下异常:
ma.glasnost.orika.MappingException: While attempting the following mapping:
sourceType = null
destinationType = com.jsj.hotel.channel.quner.qunerapi.dto.OrderPriceInput
Error occurred: ma.glasnost.orika.impl.generator.CompilerStrategy$SourceCodeGenerationException: Error compiling com.jsj.hotel.channel.quner.serviceimpl.Orika_OrderPriceInput__Mapper4168342731330$0
从异常信息上来看,应该是需要我告知源类型,但是按照文档说的,并没有显示输入源类型的代码。
hello guys, do you know the cause of this problem?
I just switched the version of jdk,I don't know if orika supports jdk11 or not
WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by ma.glasnost.orika.converter.builtin.CloneableConverter (file:/Users/sun/.gradle/caches/modules-2/files-2.1/ma.glasnost.orika/orika-core/1.5.4/b4f1019bfeda6d6aa0790a42f2d317151d2d2f4d/orika-core-1.5.4.jar) to method java.lang.Object.clone() WARNING: Please consider reporting this to the maintainers of ma.glasnost.orika.converter.builtin.CloneableConverter WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release
orika-spring-boot-starter 2.4.3
springboot 2.6.3
jdk zulu-11.jdk
@akkinoc @123Haynes If we want to use this library with Spring boot 3.0.x and Java 17 we need to add a vm option --add-opens, but that would yield a serious security consequence as any module can be accessed by any module, and encapsulation will loose it's presence, So how to overcome this? And Considering this what effects can possibly arise that code should handle.
Can´t autowire MapperFacade in other starter when test application with devtools
Remove src/main/resources/META-INF/spring-devtools.properties from final build. User for example maven resources plugin to exclude file or add to gitignore.
The starter is working fine with project based on Spring Boot and Java 9.
But when tried to compile starter locally using mvn clean verify
with Java 9 I got:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.0.0:jar (jar) on project orika-spring-boot-starter: MavenReportException: Error while generating Javadoc: Unable to find javadoc command: The environment variable JAVA_HOME is not correctly set. -> [Help 1]
[ERROR]
Please add support for Java 9.
The annotation processor does not handle javadoc tags and they are written as is in the json file. It's not a requirement for IDE to be able to parse this so the output may not be nice (I haven't tried though).
Also, please do not write "Defaults to XYZ" in the documentation since the default value is picked up by the initial value and IDE display that information when available already. If the metadata does not contain that value the defaultValue
field in manual metadata is a much better option than in the description.
Thanks!
Relates to spring-projects/spring-boot#13510
We are reviewing our community starters list and a quick look here suggests that this starter doesn’t yet support Spring Boot 2.
Can you please let us know if/when you plan to support Spring Boot 2?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.