当我试图编译在Spring-Boot上编写的项目时,Jooq和MySql得到以下错误:
[ERROR] Failed to execute goal org.jooq:jooq-codegen-maven:3.11.11:generate (default) on project myapp: Error running jOOQ code generation tool: Communications link failure
[ERROR]
[ERROR] The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. Connection refused (Connection refused)
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jooq:jooq-codegen-maven:3.11.11:generate (default) on project myapp: Error running jOOQ code generation tool
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error running jOOQ code generation tool
at org.jooq.codegen.maven.Plugin.execute (Plugin.java:200)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException (SQLError.java:590)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException (SQLExceptionsMapping.java:57)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO (ConnectionImpl.java:1606)
at com.mysql.cj.jdbc.ConnectionImpl.<init> (ConnectionImpl.java:633)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance (ConnectionImpl.java:347)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect (NonRegisteringDriver.java:219)
at org.jooq.codegen.GenerationTool.run (GenerationTool.java:320)
at org.jooq.codegen.GenerationTool.generate (GenerationTool.java:222)
at org.jooq.codegen.maven.Plugin.execute (Plugin.java:197)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: com.mysql.cj.core.exceptions.CJCommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance (Constructor.java:423)
at com.mysql.cj.core.exceptions.ExceptionFactory.createException (ExceptionFactory.java:54)
at com.mysql.cj.core.exceptions.ExceptionFactory.createException (ExceptionFactory.java:93)
at com.mysql.cj.core.exceptions.ExceptionFactory.createException (ExceptionFactory.java:133)
at com.mysql.cj.core.exceptions.ExceptionFactory.createCommunicationsException (ExceptionFactory.java:149)
at com.mysql.cj.mysqla.io.MysqlaSocketConnection.connect (MysqlaSocketConnection.java:83)
at com.mysql.cj.mysqla.MysqlaSession.connect (MysqlaSession.java:122)
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly (ConnectionImpl.java:1726)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO (ConnectionImpl.java:1596)
at com.mysql.cj.jdbc.ConnectionImpl.<init> (ConnectionImpl.java:633)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance (ConnectionImpl.java:347)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect (NonRegisteringDriver.java:219)
at org.jooq.codegen.GenerationTool.run (GenerationTool.java:320)
at org.jooq.codegen.GenerationTool.generate (GenerationTool.java:222)
at org.jooq.codegen.maven.Plugin.execute (Plugin.java:197)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect (Native Method)
at java.net.AbstractPlainSocketImpl.doConnect (AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress (AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect (AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect (SocksSocketImpl.java:392)
at java.net.Socket.connect (Socket.java:589)
at com.mysql.cj.core.io.StandardSocketFactory.connect (StandardSocketFactory.java:202)
at com.mysql.cj.mysqla.io.MysqlaSocketConnection.connect (MysqlaSocketConnection.java:57)
at com.mysql.cj.mysqla.MysqlaSession.connect (MysqlaSession.java:122)
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly (ConnectionImpl.java:1726)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO (ConnectionImpl.java:1596)
at com.mysql.cj.jdbc.ConnectionImpl.<init> (ConnectionImpl.java:633)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance (ConnectionImpl.java:347)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect (NonRegisteringDriver.java:219)
at org.jooq.codegen.GenerationTool.run (GenerationTool.java:320)
at org.jooq.codegen.GenerationTool.generate (GenerationTool.java:222)
at org.jooq.codegen.maven.Plugin.execute (Plugin.java:197)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
java版本openjdk版本“1.8.0212”openjdk运行时环境(build 1.8.0212-8U212-B01-1-B01)openjdk 64位服务器VM(build 25.212-B01,混合模式)
db:
username: root
password: 123
dbname: myapp
dbaddress: localhost
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.myapp</groupId>
<artifactId>myapp-api</artifactId>
<version>0.1</version>
</parent>
<artifactId>myapp-api-db</artifactId>
<version>0.2</version>
<dependencies>
<!-- Database access -->
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq</artifactId>
<version>3.11.11</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.4.0.Final</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${spring-security.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<configLocation>
${basedir}/../myapp-api-app/src/main/resources/application.yml
</configLocation>
<buildEnvironment>prod</buildEnvironment>
<databaseUri>
jdbc:mysql://mysql/myapp?user=root&password=123&useLegacyDatetimeCode=false&serverTimezone=UTC&characterEncoding=UTF-8&characterSetResults=utf8&connectionCollation=utf8_general_ci
</databaseUri>
</properties>
<profiles>
<profile>
<id>default-cli</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
<version>3.11.11</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<jdbc>
<driver>com.mysql.cj.jdbc.Driver</driver>
<url>${databaseUri}</url>
<user>root</user>
<password>123</password>
</jdbc>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<resources>
<resource>
<directory>src/main/resources/hibernate</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>it.ozimov</groupId>
<artifactId>yaml-properties-maven-plugin</artifactId>
<version>1.1.3</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${configLocation}</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
<version>3.11.11</version>
<configuration>
<generator>
<database>
<inputSchema>myapp</inputSchema>
<excludes>SCHEMA_VERSION</excludes>
<name>org.jooq.meta.mysql.MySQLDatabase</name>
</database>
<target>
<packageName>com.myapp.db</packageName>
<directory>target/generated-sources/jooq</directory>
<encoding>UTF-8</encoding>
</target>
<generate>
<fluentSetters>true</fluentSetters>
<daos>true</daos>
</generate>
</generator>
</configuration>
</plugin>
</plugins>
</build>
</project>
什么是理性?多谢了。
我认为pom.xml
中的数据库URL看起来有点奇怪。您有jdbc:mysql:/mysql/myapp?user=root&password=123...
,而在application.yaml
中,您说主机是localhost
。因此,请尝试jdbc:mysql:/localhost/myapp?user=root&password=123...
。
Java版本 openjdk版本“11.0.2”2019-01-15 openjdk运行时环境(构建11.0.2 9-Debian-3)openjdk 64位服务器虚拟机(构建11.0.2 9-Debian-3,混合模式,共享) mvn-版本Apache Maven 3.6.0 Maven home:/usr/share/Maven Java版本:11.0.2,供应商:Oracle Corpora
我的系统中有以下配置: Apache Maven 3.5.2 Maven主页: /usr/share/mavenJava版本:1.8.0_162,供应商:Oracle CorporationJava主页: /usr/lib/jvm/java-8-openjdk-amd64/jre默认语言环境:en_US,平台编码:UTF-8操作系统名称:"linux",版本:"4.15.0-20-通用", arc
当我尝试编译代码时,我得到以下错误: 错误:任务“:app:DexDebug”执行失败。 为google location services/gcm使用了单独的api库,并删除了完整的play service库。这减少了可靠的库方法和错误得到了解决。
我在Windows 7中使用Python 3.4和Pygame为我的小儿子创建了一个小游戏。它也适用于Python 2。十、 有一些小错误。然后我尝试创建一个。使用py2exe的exe文件。我准备了一个设置。py文件复制我在pygame2exe wiki上找到的源(http://www.pygame.org/wiki/Pygame2exe?parent=CookBook)还尝试使用我在这里和pyt
问题内容: 我进行了全新的OSX 10.9.3全新安装并安装了pip,然后执行了 两次安装似乎都非常令人满意,并且运行没有任何错误(尽管有不计其数的警告)。当我尝试使用导入熊猫运行python脚本时,出现以下错误: 如何解决此错误并使熊猫正确加载? 问题答案: 您可以安装熊猫的早期版本。 在我的情况下,它解决了问题…
问题内容: 导入熊猫时,会出现以下错误: 我正在运行Python 2.7.5,Pandas 0.14.1和Numpy 1.9.0。我尝试使用pip安装两种版本的旧版本,每次都会出现重大错误。我是Python的初学者,因此这里的任何帮助将不胜感激。:) 编辑:运行OS X 10.9.4 编辑2:这是我卸载并重新安装Numpy + Pandas,然后运行.py文件的视频的链接:https ://www