Open berlinets opened 5 years ago
Hi, Please update your comment/issue with good formatting. Meanwhile I am seeing old copy. I can see some error with bean creation in spring boot.
Share your code on any version control system like github/gitlab/bitbucket etc so that we can reproduce the issue and tell you more about problem and solution.
I try to add stacktrace but it looks ugly without formatting. Code block doesn't help
` 2019-04-03 17:03:59.832 INFO 18276 --- [ main] c.e.DemoGraphQL.DemoGraphQlApplication : Starting DemoGraphQlApplication on DESKTOP-5N175B6 with PID 18276 (C:\work\DemoGraphQL\target\classes started by admin in C:\work\DemoGraphQL) 2019-04-03 17:03:59.833 INFO 18276 --- [ main] c.e.DemoGraphQL.DemoGraphQlApplication : No active profile set, falling back to default profiles: default 2019-04-03 17:04:00.383 INFO 18276 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode. 2019-04-03 17:04:00.428 INFO 18276 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 39ms. Found 2 repository interfaces. 2019-04-03 17:04:00.619 INFO 18276 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$eecdadf9] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-04-03 17:04:00.809 INFO 18276 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http) 2019-04-03 17:04:00.824 INFO 18276 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2019-04-03 17:04:00.824 INFO 18276 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.16] 2019-04-03 17:04:00.829 INFO 18276 --- [ main] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk-12\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Gradle\gradle-5.2.1\bin;C:\Program Files\PuTTY\;C:\apache-maven-3.6.0\bin;C:\Program Files\nodejs\;C:\Users\admin.windows-build-tools\python27\;C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\admin\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules.bin;C:\Users\admin\AppData\Roaming\npm\node_modules.bin;C:\cmder\bin;C:\cmder\vendor\bin;C:\cmder\vendor\conemu-maximus5\ConEmu\Scripts;C:\cmder\vendor\conemu-maximus5;C:\cmder\vendor\conemu-maximus5\ConEmu;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Gradle\gradle-5.2.1\bin;C:\Program Files\PuTTY\;C:\apache-maven-3.6.0\bin;C:\Program Files\nodejs\;C:\Users\admin\AppData\Local\Programs\Python\Python37\Scripts\;C:\Users\admin\AppData\Local\Programs\Python\Python37\;C:\Users\admin\AppData\Local\Microsoft\WindowsApps;C:\Users\admin\AppData\Local\Programs\Fiddler;C:\Users\admin\AppData\Roaming\npm;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\cmder;.] 2019-04-03 17:04:00.916 INFO 18276 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2019-04-03 17:04:00.916 INFO 18276 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1058 ms 2019-04-03 17:04:01.020 INFO 18276 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2019-04-03 17:04:01.079 INFO 18276 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2019-04-03 17:04:01.124 INFO 18276 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [ name: default ...] 2019-04-03 17:04:01.166 INFO 18276 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.3.7.Final} 2019-04-03 17:04:01.167 INFO 18276 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found 2019-04-03 17:04:01.243 INFO 18276 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.4.Final} 2019-04-03 17:04:01.318 INFO 18276 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect 2019-04-03 17:04:01.710 INFO 18276 --- [ main] o.h.t.schema.internal.SchemaCreatorImpl : HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl@2dd8a273' 2019-04-03 17:04:01.713 INFO 18276 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2019-04-03 17:04:01.846 ERROR 18276 --- [ main] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'graphQLServletRegistrationBean' defined in class path resource [com/oembedler/moon/graphql/boot/GraphQLWebAutoConfiguration.class]: Unsatisfied dependency expressed through method 'graphQLServletRegistrationBean' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'graphQLHttpServlet' defined in class path resource [com/oembedler/moon/graphql/boot/GraphQLWebAutoConfiguration.class]: Unsatisfied dependency expressed through method 'graphQLHttpServlet' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'invocationInputFactory' defined in class path resource [com/oembedler/moon/graphql/boot/GraphQLWebAutoConfiguration.class]: Unsatisfied dependency expressed through method 'invocationInputFactory' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'graphQLSchemaProvider' defined in class path resource [com/oembedler/moon/graphql/boot/GraphQLWebAutoConfiguration.class]: Unsatisfied dependency expressed through method 'graphQLSchemaProvider' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'graphQLSchema' defined in class path resource [com/oembedler/moon/graphql/boot/GraphQLJavaToolsAutoConfiguration.class]: Unsatisfied dependency expressed through method 'graphQLSchema' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'schemaParser' defined in class path resource [com/oembedler/moon/graphql/boot/GraphQLJavaToolsAutoConfiguration.class]: Unsatisfied dependency expressed through method 'schemaParser' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authorResolver' defined in com.example.DemoGraphQL.DemoGraphQlApplication: Unsatisfied dependency expressed through method 'authorResolver' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authorRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract com.example.DemoGraphQL.model.Author com.example.DemoGraphQL.repository.AuthorRepository.findOne(java.lang.Long)! No property findOne found for type Author! 2019-04-03 17:04:01.857 INFO 18276 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2019-04-03 17:04:01.859 WARN 18276 --- [ main] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [HikariPool-1 housekeeper] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.base@12/jdk.internal.misc.Unsafe.park(Native Method) java.base@12/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:235) java.base@12/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2123) java.base@12/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182) java.base@12/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899) java.base@12/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054) java.base@12/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114) java.base@12/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) java.base@12/java.lang.Thread.run(Thread.java:835) 2019-04-03 17:04:01.860 WARN 18276 --- [ main] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [HikariPool-1 connection adder] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.base@12/jdk.internal.misc.Unsafe.park(Native Method) java.base@12/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:235) java.base@12/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2123) java.base@12/java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:458) java.base@12/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1053) java.base@12/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114) java.base@12/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) java.base@12/java.lang.Thread.run(Thread.java:835) 2019-04-03 17:04:01.861 WARN 18276 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat 2019-04-03 17:04:01.861 INFO 18276 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 2019-04-03 17:04:01.862 INFO 18276 --- [ main] .SchemaDropperImpl$DelayedDropActionImpl : HHH000477: Starting delayed evictData of schema as part of SessionFactory shut-down' 2019-04-03 17:04:01.867 INFO 18276 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... 2019-04-03 17:04:01.870 INFO 18276 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. 2019-04-03 17:04:01.874 INFO 18276 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2019-04-03 17:04:01.882 ERROR 18276 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:157) ~[spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) ~[spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) ~[spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) ~[spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) ~[spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) ~[spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at com.example.DemoGraphQL.DemoGraphQlApplication.main(DemoGraphQlApplication.java:27) ~[classes/:na]
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:125) ~[spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.
`
Create repo of your project code (what ever you are trying to run as it is) on github. Shre the link in comment. That would be just fine.
Hi @berlinets and @themanojshukla.
It's hard to go through the stacktrace, but I noticed a few things:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'authorRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException:
Failed to create query for method
public abstract com.example.DemoGraphQL.model.Author com.example.DemoGraphQL.repository.AuthorRepository.findOne(java.lang.Long)!
No property findOne found for type Author!
I'm guessing you made some changes to the project and now something is not compatible.
@themanojshukla is right, without sharing more information or your project code, I don't think we can help you.
Google for "...isJavaVersionAtLeast..." reveals a bug in Common Lang3 library, which is fixed in version 3.8. Add this to pom.xml:
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
</dependency>
The app should start up fine now. This is the problem with earlier version of Common Lang3 expecting Java 9, but failed to deal with Java version > 9
Hi! Great article! I tried to launch application and caught an error. Pease, help me to solve this problem. Thanks