You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2022/07/26 08:29:13 UTC

[GitHub] [servicecomb-java-chassis] lizeze opened a new issue, #3222: 配合JPA使用的一些问题

lizeze opened a new issue, #3222:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3222

   Clear long time not updated issue. Please feel free to submit a new one if problem happended again.
   
   _Originally posted by @liubao68 in https://github.com/apache/servicecomb-java-chassis/issues/908#issuecomment-518524457_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [servicecomb-java-chassis] lizeze commented on issue #3222: 配合JPA使用的一些问题

Posted by GitBox <gi...@apache.org>.
lizeze commented on issue #3222:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3222#issuecomment-1195175411

   pom
   
   ```
   <dependencyManagement>
           <dependencies>
               <dependency>
                   <groupId>org.apache.servicecomb</groupId>
                   <artifactId>java-chassis-dependencies</artifactId>
                   <version>2.7.5</version>
                   <type>pom</type>
                   <scope>import</scope>
               </dependency>
           </dependencies>
       </dependencyManagement>
       <dependencies>
           <dependency>
               <groupId>org.apache.servicecomb</groupId>
               <artifactId>solution-basic</artifactId>
           </dependency>
           <dependency>
               <groupId>org.apache.servicecomb</groupId>
               <artifactId>registry-service-center</artifactId>
           </dependency>
           <dependency>
               <groupId>ch.qos.logback</groupId>
               <artifactId>logback-classic</artifactId>
           </dependency>
           <dependency>
               <groupId>org.projectlombok</groupId>
               <artifactId>lombok</artifactId>
           </dependency>
           <dependency>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-starter-data-jpa</artifactId>
           </dependency>
           <dependency>
               <groupId>mysql</groupId>
               <artifactId>mysql-connector-java</artifactId>
               <version>8.0.29</version>
           </dependency>
           <dependency>
               <groupId>ch.qos.logback</groupId>
               <artifactId>logback-core</artifactId>
               <version>1.2.3</version>
           </dependency>
           <dependency>
               <groupId>ch.qos.logback</groupId>
               <artifactId>logback-classic</artifactId>
               <version>1.2.3</version>
           </dependency>
   
       </dependencies>
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [servicecomb-java-chassis] lizeze closed issue #3222: 配合JPA使用的一些问题

Posted by GitBox <gi...@apache.org>.
lizeze closed issue #3222: 配合JPA使用的一些问题
URL: https://github.com/apache/servicecomb-java-chassis/issues/3222


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [servicecomb-java-chassis] lizeze commented on issue #3222: 配合JPA使用的一些问题

Posted by GitBox <gi...@apache.org>.
lizeze commented on issue #3222:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3222#issuecomment-1195174494

   我的示例代码 https://github.com/lizeze/jpa-demo1
   
   日志信息
   
   ```
   [] 2022-07-26 16:30:01,937 [INFO] [main] - Found main class "org.example.Main". (JvmUtils.java:94)
   [] 2022-07-26 16:30:01,937 [INFO] [main] - Found main class "org.example.Main" by stackTrace. (JvmUtils.java:63)
   [] 2022-07-26 16:30:01,937 [INFO] [main] - Scb scan package list: org.apache.servicecomb,org.example (BeanUtils.java:118)
   [] 2022-07-26 16:30:02,969 [INFO] [main] - Bootstrapping Spring Data JPA repositories in DEFAULT mode. (RepositoryConfigurationDelegate.java:132)
   [] 2022-07-26 16:30:03,062 [INFO] [main] - Finished Spring Data repository scanning in 85 ms. Found 1 JPA repository interfaces. (RepositoryConfigurationDelegate.java:201)
   [] 2022-07-26 16:30:03,344 [INFO] [main] - Found SPI service org.apache.servicecomb.foundation.bootstrap.BootStrapService, count=1. (SPIServiceUtils.java:79)
   [] 2022-07-26 16:30:03,344 [INFO] [main] -   0. org.apache.servicecomb.serviceregistry.auth.RBACBootStrapService. (SPIServiceUtils.java:82)
   [] 2022-07-26 16:30:03,344 [INFO] [main] - Environment received, will get configurations from [org.springframework.core.env.StandardEnvironment@2038185019]. (ConfigurationSpringInitializer.java:149)
   [] 2022-07-26 16:30:03,390 [WARN] [main] - No URLs will be polled as dynamic configuration sources. (URLConfigurationSource.java:126)
   [] 2022-07-26 16:30:03,390 [INFO] [main] - To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath. (URLConfigurationSource.java:127)
   [] 2022-07-26 16:30:03,406 [INFO] [main] - DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@d2e6b0b (DynamicPropertyFactory.java:281)
   [] 2022-07-26 16:30:03,406 [INFO] [main] - create local config from paths=[:/:/s/n/2/y/g/e/b/y/5/!/microservice.yaml,:/:/s/n/2/y/g/e/b/e/5/!/microservice.yaml,:/:/s/n/2/y/g/e/b/c/5/!/microservice.yaml,:/:/s/n/p/o/1/t/s/microservice.yaml] (ConfigUtil.java:130)
   [] 2022-07-26 16:30:03,437 [INFO] [main] - create local config from paths=[:/:/s/n/2/y/g/e/b/y/5/!/microservice.yaml,:/:/s/n/2/y/g/e/b/e/5/!/microservice.yaml,:/:/s/n/2/y/g/e/b/c/5/!/microservice.yaml,:/:/s/n/p/o/1/t/s/microservice.yaml] (ConfigUtil.java:130)
   [] 2022-07-26 16:30:03,453 [INFO] [main] - Found SPI service org.apache.servicecomb.config.spi.ConfigCenterConfigurationSource, count=2. (SPIServiceUtils.java:79)
   [] 2022-07-26 16:30:03,453 [INFO] [main] -   0. org.apache.servicecomb.config.ConfigCenterConfigurationSourceImpl. (SPIServiceUtils.java:82)
   [] 2022-07-26 16:30:03,453 [INFO] [main] -   1. org.apache.servicecomb.config.kie.KieConfigurationSourceImpl. (SPIServiceUtils.java:82)
   [] 2022-07-26 16:30:03,453 [INFO] [main] - create local config from paths=[:/:/s/n/2/y/g/e/b/y/5/!/microservice.yaml,:/:/s/n/2/y/g/e/b/e/5/!/microservice.yaml,:/:/s/n/2/y/g/e/b/c/5/!/microservice.yaml,:/:/s/n/p/o/1/t/s/microservice.yaml] (ConfigUtil.java:130)
   [] 2022-07-26 16:30:03,453 [INFO] [main] - create local config from paths=[:/:/s/n/2/y/g/e/b/y/5/!/microservice.yaml,:/:/s/n/2/y/g/e/b/e/5/!/microservice.yaml,:/:/s/n/2/y/g/e/b/c/5/!/microservice.yaml,:/:/s/n/p/o/1/t/s/microservice.yaml] (ConfigUtil.java:130)
   [] 2022-07-26 16:30:03,469 [INFO] [main] - create local config from paths=[:/:/s/n/2/y/g/e/b/y/5/!/microservice.yaml,:/:/s/n/2/y/g/e/b/e/5/!/microservice.yaml,:/:/s/n/2/y/g/e/b/c/5/!/microservice.yaml,:/:/s/n/p/o/1/t/s/microservice.yaml] (ConfigUtil.java:130)
   [] 2022-07-26 16:30:03,469 [INFO] [main] - Found SPI service org.apache.servicecomb.deployment.DeploymentProvider, count=3. (SPIServiceUtils.java:79)
   [] 2022-07-26 16:30:03,469 [INFO] [main] -   0. org.apache.servicecomb.config.collect.ConfigCenterDefaultDeploymentProvider. (SPIServiceUtils.java:82)
   [] 2022-07-26 16:30:03,469 [INFO] [main] -   1. org.apache.servicecomb.config.kie.collect.KieCenterDefaultDeploymentProvider. (SPIServiceUtils.java:82)
   [] 2022-07-26 16:30:03,469 [INFO] [main] -   2. org.apache.servicecomb.serviceregistry.collect.ServiceCenterDefaultDeploymentProvider. (SPIServiceUtils.java:82)
   [] 2022-07-26 16:30:03,469 [INFO] [main] - config center server is not configured. (ConfigCenterConfigurationSourceImpl.java:81)
   [] 2022-07-26 16:30:03,469 [INFO] [main] - Kie server is not configured. (KieConfigurationSourceImpl.java:77)
   [] 2022-07-26 16:30:03,469 [INFO] [main] - none of config center source enabled. (ConfigUtil.java:222)
   [] 2022-07-26 16:30:03,640 [INFO] [main] - Bean 'priorityPropertyFactory' of type [org.apache.servicecomb.config.priority.PriorityPropertyFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) (PostProcessorRegistrationDelegate.java:376)
   [] 2022-07-26 16:30:03,640 [INFO] [main] - Bean 'configObjectFactory' of type [org.apache.servicecomb.config.priority.ConfigObjectFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) (PostProcessorRegistrationDelegate.java:376)
   [] 2022-07-26 16:30:03,640 [INFO] [main] - Bean 'priorityPropertyManager' of type [org.apache.servicecomb.config.priority.PriorityPropertyManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) (PostProcessorRegistrationDelegate.java:376)
   [] 2022-07-26 16:30:03,672 [WARN] [main] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: Unsatisfied dependency expressed through method 'dataSourceScriptDatabaseInitializer' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoco
 nfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class (AbstractApplicationContext.java:591)
   Exception in thread "main" org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: Unsatisfied dependency expressed through method 'dataSourceScriptDatabaseInitializer' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable 
 driver class
   	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
   	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:541)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
   	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
   	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154)
   	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908)
   	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
   	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)
   	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:95)
   	at org.apache.servicecomb.foundation.common.utils.BeanUtils.init(BeanUtils.java:65)
   	at org.apache.servicecomb.foundation.common.utils.BeanUtils.init(BeanUtils.java:56)
   	at org.example.Main.main(Main.java:11)
   Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
   	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
   	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
   	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
   	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
   	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
   	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
   	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
   	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
   	... 19 more
   Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
   	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
   	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
   	... 33 more
   Caused by: org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
   	at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.determineDriverClassName(DataSourceProperties.java:252)
   	at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.initializeDataSourceBuilder(DataSourceProperties.java:193)
   	at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration.createDataSource(DataSourceConfiguration.java:48)
   	at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari.dataSource(DataSourceConfiguration.java:90)
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.lang.reflect.Method.invoke(Method.java:498)
   	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
   	... 34 more
   
   Process finished with exit code 1
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #3222: 配合JPA使用的一些问题

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #3222:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3222#issuecomment-1195250516

   seams you are using spring boot. Write your main like this https://github.com/apache/servicecomb-samples/blob/master/basic/provider/src/main/java/org/apache/servicecomb/samples/ProviderApplication.java  and try


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org