当前位置: 首页 > 知识库问答 >
问题:

如何使用Grails 3框架和Intellij15连接到mySQL服务器5.7

高修伟
2023-03-14

我对Grails和Intellij相当陌生。只是想知道我是否能得到一些关于将Grails连接到mySQL的帮助。我会在下面提供我的pplication.yml文件和build.gradle文件的配置。此外,我会向您提供我收到的错误消息。

应用yml文件

            dataSource:
                pooled: true
                jmxExport: true
                driverClassName: "com.mysql.jdbc.Driver"
                dialect: "org.hibernate.dialect.MySQL5InnoDBDialect"
                username: "root"
                password: "jams"

            environments:
                development:
                    dataSource:
                        dbCreate: create-drop
                        url: "jdbc:mysql://localhost:3306/DDTR?useSSL=false"
                test:
                    dataSource:
                        dbCreate: update
                        url: "jdbc:mysql://localhost:3306/DDTR?useSSL=false"
                production:
                    dataSource:
                        dbCreate: update
                        url: "jdbc:mysql://localhost:3306/DDTRuseSSL=false"
                        properties:
                            jmxEnabled: true
                            initialSize: 5
                            maxActive: 50
                            minIdle: 5
                            maxIdle: 25
                            maxWait: 10000
                            maxAge: 600000
                            timeBetweenEvictionRunsMillis: 5000
                            minEvictableIdleTimeMillis: 60000
                            validationQuery: SELECT 1
                            validationQueryTimeout: 3
                            validationInterval: 15000
                            testOnBorrow: true
                            testWhileIdle: true
                            testOnReturn: false
                            jdbcInterceptors: ConnectionState
                            defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED

建筑格雷德尔锉刀

基本上,我只是在依赖项中添加了运行时“mysql:mysql连接器java:5.1.38”。

错误消息

/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:CICompilerCount=3 -Dfile.encoding=UTF-8 -classpath "/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-async-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-bootstrap-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-compat-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-console-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-core-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-databinding-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-docs-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-encoder-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-gradle-model-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-gradle-plugin-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-gsp-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-logging-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-plugin-async-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-plugin-codecs-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-plugin-controllers-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-plugin-converters-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-plugin-databinding-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-plugin-datasource-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-plugin-domain-class-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-plugin-events-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-plugin-filters-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-plugin-gsp-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-plugin-i18n-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-plugin-interceptors-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-plugin-mimetypes-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-plugin-rest-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-plugin-services-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-plugin-testing-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-plugin-url-mappings-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-plugin-validation-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-shell-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-spring-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-taglib-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-test-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-validation-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-web-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-web-boot-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-web-common-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-web-databinding-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-web-fileupload-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-web-gsp-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-web-gsp-taglib-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-web-jsp-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-web-mvc-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-web-sitemesh-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-web-taglib-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/dist/grails-web-url-mappings-3.0.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/com.googlecode.javaewah/JavaEWAH/jars/JavaEWAH-0.7.9.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/com.jcraft/jsch/jars/jsch-0.1.50.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/commons-codec/commons-codec/jars/commons-codec-1.6.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/jline/jline/jars/jline-2.12.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/junit/junit/jars/junit-3.8.1.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/net.sf.jopt-simple/jopt-simple/jars/jopt-simple-4.6.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.apache.ant/ant/jars/ant-1.9.4.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.apache.ant/ant-antlr/jars/ant-antlr-1.9.4.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.apache.ant/ant-junit/jars/ant-junit-1.9.4.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.apache.ant/ant-launcher/jars/ant-launcher-1.9.4.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.apache.httpcomponents/httpclient/jars/httpclient-4.2.6.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.apache.httpcomponents/httpcore/jars/httpcore-4.2.5.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.apache.maven/maven-aether-provider/jars/maven-aether-provider-3.2.1.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.apache.maven/maven-model/jars/maven-model-3.2.1.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.apache.maven/maven-model-builder/jars/maven-model-builder-3.2.1.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.apache.maven/maven-repository-metadata/jars/maven-repository-metadata-3.2.1.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.apache.maven/maven-settings/jars/maven-settings-3.1.1.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.apache.maven/maven-settings-builder/jars/maven-settings-builder-3.1.1.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.codehaus.groovy/groovy/jars/groovy-2.4.5.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.codehaus.groovy/groovy-ant/jars/groovy-ant-2.4.5.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.codehaus.groovy/groovy-groovydoc/jars/groovy-groovydoc-2.4.5.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.codehaus.groovy/groovy-jmx/jars/groovy-jmx-2.4.5.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.codehaus.groovy/groovy-json/jars/groovy-json-2.4.5.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.codehaus.groovy/groovy-templates/jars/groovy-templates-2.4.5.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.codehaus.groovy/groovy-xml/jars/groovy-xml-2.4.5.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.codehaus.plexus/plexus-classworlds/jars/plexus-classworlds-1.2-alpha-10.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.codehaus.plexus/plexus-component-annotations/jars/plexus-component-annotations-1.5.5.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.codehaus.plexus/plexus-component-api/jars/plexus-component-api-1.0-alpha-33.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.codehaus.plexus/plexus-interpolation/jars/plexus-interpolation-1.19.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.codehaus.plexus/plexus-utils/jars/plexus-utils-3.0.17.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.eclipse.aether/aether-api/jars/aether-api-0.9.1.v20140329.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.eclipse.aether/aether-connector-basic/jars/aether-connector-basic-0.9.1.v20140329.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.eclipse.aether/aether-impl/jars/aether-impl-0.9.1.v20140329.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.eclipse.aether/aether-spi/jars/aether-spi-0.9.1.v20140329.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.eclipse.aether/aether-transport-file/jars/aether-transport-file-0.9.1.v20140329.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.eclipse.aether/aether-transport-http/jars/aether-transport-http-0.9.1.v20140329.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.eclipse.aether/aether-util/jars/aether-util-0.9.1.v20140329.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.eclipse.jgit/org.eclipse.jgit/jars/org.eclipse.jgit-3.5.2.201411120430-r.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.fusesource.jansi/jansi/jars/jansi-1.11.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.gradle/gradle-tooling-api/jars/gradle-tooling-api-2.3.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.json/json/jars/json-20140107.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.slf4j/jcl-over-slf4j/jars/jcl-over-slf4j-1.7.10.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.slf4j/slf4j-api/jars/slf4j-api-1.7.10.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.slf4j/slf4j-simple/jars/slf4j-simple-1.7.10.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.sonatype.plexus/plexus-cipher/jars/plexus-cipher-1.4.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.sonatype.plexus/plexus-sec-dispatcher/jars/plexus-sec-dispatcher-1.3.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.springframework/spring-core/jars/spring-core-4.1.8.RELEASE.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.springframework.boot/spring-boot-cli/jars/spring-boot-cli-1.2.7.RELEASE.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.springframework.boot/spring-boot-dependency-tools/jars/spring-boot-dependency-tools-1.2.7.RELEASE.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.springframework.boot/spring-boot-loader-tools/jars/spring-boot-loader-tools-1.2.7.RELEASE.jar:/Users/michaelrudner/.sdkman/candidates/grails/3.0.12/lib/org.yaml/snakeyaml/jars/snakeyaml-1.14.jar:/Applications/IntelliJ IDEA 15.app/Contents/plugins/Grails/lib/grails-rt.jar" org.grails.cli.GrailsCli run-app| Running application...
            objc[96973]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
            ERROR org.apache.coyote.http11.Http11NioProtocol - Failed to start end point associated with ProtocolHandler ["http-nio-8080"]
            java.net.BindException: Address already in use
                at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_65]
                at sun.nio.ch.Net.bind(Net.java:433) ~[na:1.8.0_65]
                at sun.nio.ch.Net.bind(Net.java:425) ~[na:1.8.0_65]
                at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[na:1.8.0_65]
                at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:1.8.0_65]
                at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:340) ~[tomcat-embed-core-8.0.28.jar:8.0.28]
                at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:765) ~[tomcat-embed-core-8.0.28.jar:8.0.28]
                at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:472) ~[tomcat-embed-core-8.0.28.jar:8.0.28]
                at org.apache.catalina.connector.Connector.startInternal(Connector.java:986) [tomcat-embed-core-8.0.28.jar:8.0.28]
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.0.28.jar:8.0.28]
                at org.apache.catalina.core.StandardService.addConnector(StandardService.java:237) [tomcat-embed-core-8.0.28.jar:8.0.28]
                at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:186) [spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:149) [spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:288) [spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:140) [spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483) [spring-context-4.1.8.RELEASE.jar:4.1.8.RELEASE]
                at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:117) [spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:689) [spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at org.springframework.boot.SpringApplication.run(SpringApplication.java:321) [spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at grails.boot.GrailsApp.run(GrailsApp.groovy:54) [grails-core-3.0.12.jar:3.0.12]
                at grails.boot.GrailsApp.run(GrailsApp.groovy:353) [grails-core-3.0.12.jar:3.0.12]
                at grails.boot.GrailsApp.run(GrailsApp.groovy:342) [grails-core-3.0.12.jar:3.0.12]
                at grails.boot.GrailsApp$run.call(Unknown Source) [grails-core-3.0.12.jar:3.0.12]
                at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) [groovy-2.4.5.jar:2.4.5]
                at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) [groovy-2.4.5.jar:2.4.5]
                at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133) [groovy-2.4.5.jar:2.4.5]
                at grails_help.Application.main(Application.groovy:8) [main/:na]
            ERROR org.apache.catalina.core.StandardService - Failed to start connector [Connector[HTTP/1.1-8080]]
            org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-8080]]
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) ~[tomcat-embed-core-8.0.28.jar:8.0.28]
                at org.apache.catalina.core.StandardService.addConnector(StandardService.java:237) ~[tomcat-embed-core-8.0.28.jar:8.0.28]
                at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:186) [spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:149) [spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:288) [spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:140) [spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483) [spring-context-4.1.8.RELEASE.jar:4.1.8.RELEASE]
                at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:117) [spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:689) [spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at org.springframework.boot.SpringApplication.run(SpringApplication.java:321) [spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at grails.boot.GrailsApp.run(GrailsApp.groovy:54) [grails-core-3.0.12.jar:3.0.12]
                at grails.boot.GrailsApp.run(GrailsApp.groovy:353) [grails-core-3.0.12.jar:3.0.12]
                at grails.boot.GrailsApp.run(GrailsApp.groovy:342) [grails-core-3.0.12.jar:3.0.12]
                at grails.boot.GrailsApp$run.call(Unknown Source) [grails-core-3.0.12.jar:3.0.12]
                at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) [groovy-2.4.5.jar:2.4.5]
                at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) [groovy-2.4.5.jar:2.4.5]
                at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133) [groovy-2.4.5.jar:2.4.5]
                at grails_help.Application.main(Application.groovy:8) [main/:na]
            Caused by: org.apache.catalina.LifecycleException: service.getName(): "Tomcat";  Protocol handler start failed
                at org.apache.catalina.connector.Connector.startInternal(Connector.java:993) ~[tomcat-embed-core-8.0.28.jar:8.0.28]
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.0.28.jar:8.0.28]
                ... 17 common frames omitted
            Caused by: java.net.BindException: Address already in use
                at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_65]
                at sun.nio.ch.Net.bind(Net.java:433) ~[na:1.8.0_65]
                at sun.nio.ch.Net.bind(Net.java:425) ~[na:1.8.0_65]
                at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[na:1.8.0_65]
                at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:1.8.0_65]
                at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:340) ~[tomcat-embed-core-8.0.28.jar:8.0.28]
                at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:765) ~[tomcat-embed-core-8.0.28.jar:8.0.28]
                at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:472) ~[tomcat-embed-core-8.0.28.jar:8.0.28]
                at org.apache.catalina.connector.Connector.startInternal(Connector.java:986) ~[tomcat-embed-core-8.0.28.jar:8.0.28]
                ... 18 common frames omitted
            ERROR grails.boot.GrailsApp - Application startup failed
            java.lang.IllegalStateException: Tomcat connector in failed state
                at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:157) ~[spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:288) ~[spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:140) ~[spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483) ~[spring-context-4.1.8.RELEASE.jar:4.1.8.RELEASE]
                at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:117) ~[spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:689) ~[spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at org.springframework.boot.SpringApplication.run(SpringApplication.java:321) ~[spring-boot-1.2.7.RELEASE.jar:1.2.7.RELEASE]
                at grails.boot.GrailsApp.run(GrailsApp.groovy:54) [grails-core-3.0.12.jar:3.0.12]
                at grails.boot.GrailsApp.run(GrailsApp.groovy:353) [grails-core-3.0.12.jar:3.0.12]
                at grails.boot.GrailsApp.run(GrailsApp.groovy:342) [grails-core-3.0.12.jar:3.0.12]
                at grails.boot.GrailsApp$run.call(Unknown Source) [grails-core-3.0.12.jar:3.0.12]
                at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) [groovy-2.4.5.jar:2.4.5]
                at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) [groovy-2.4.5.jar:2.4.5]
                at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133) [groovy-2.4.5.jar:2.4.5]
                at grails_help.Application.main(Application.groovy:8) [main/:na]
            Exception in thread "main" java.lang.IllegalStateException: Tomcat connector in failed state
                at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:157)
                at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:288)
                at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:140)
                at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)
                at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:117)
                at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:689)
                at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
                at grails.boot.GrailsApp.run(GrailsApp.groovy:54)
                at grails.boot.GrailsApp.run(GrailsApp.groovy:353)
                at grails.boot.GrailsApp.run(GrailsApp.groovy:342)
                at grails.boot.GrailsApp$run.call(Unknown Source)
                at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
                at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
                at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
                at grails_help.Application.main(Application.groovy:8)

            FAILURE: Build failed with an exception.

            * What went wrong:
            Execution failed for task ':bootRun'.
            > Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

            * Try:
            Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
            | Error Failed to start server (Use --stacktrace to see the full trace)

共有1个答案

宫俊远
2023-03-14

从错误消息中,

ERROR org.apache.coyote.http11.Http11NioProtocol - Failed to start end point associated with ProtocolHandler ["http-nio-8080"]
            java.net.BindException: Address already in use

端口8080已在使用中。您可以检查端口8080上正在运行什么,如果不需要,可以终止进程,或者在其他未使用的端口上启动grails应用程序。

这可能是IntelliJ或grails应用程序未能正确关闭,并且应用程序在8080端口的后台继续运行的情况之一。你可以搜索进程并杀死它。

 类似资料:
  • 问题内容: 我正在尝试使用以下代码从本地计算机virtualhost连接到远程MySQL服务器: 我的问题是我无法本地连接,收到错误消息: 无法连接到“ xxx.xxx.xxx.xxx”上的MySQL服务器(10060) 当我将相同的PHP文件上传到服务器时,情况并非如此。我能够毫无问题地查询数据库。 我也无法通过命令行进行连接,但是我可以访问cPanel,它排除了我的IP被意外禁止的可能性。 我

  • 我是第一次使用jprofiler,首先我下载了jprofiler,然后安装了jprofiler。请帮助我如何使用jboss服务器配置jprofiler。我们不使用jboss服务器默认部署,我们有特定的部署,如C:\jboss-4.2.2。GA \服务器\测试\,我们的应用程序部署在测试文件夹中,如何使用jprofiler配置测试部署文件夹?

  • 问题内容: 我正在尝试在Java项目中通过SSH连接到远程MySQL服务器。如何将SSH连接与JPA集成在一起? 我正在使用Netbeans 6.9.1,JPA,MySQL 5.2。 问题答案: 我假设您想隧道传输到仅侦听localhost(或已防火墙)的远程mysql 那么最简单的方法是 在运行应用程序服务器的帐户之间建立信任关系,以便将JPA服务提供给您的应用程序 创建隧道使用来创建隧道,该隧

  • 我使用Sabre DAV在PHP中实现了一个webdav目录,用于我的网站(Application Server Webinterface)。 对于这个网站,我现在使用C#编写了一个TCP套接字,它运行在另一个服务器上(实际上它在同一个数据中心,但从理论上讲,它在另一个半球上)。 我想连接我的网络Dav到我的套接字的FTP服务器,这意味着文件监听,下载,上传。用户只能连接到一个服务。想象一下,我的

  • 问题内容: 这是关于如何通过Docker连接到本地服务的更普遍的问题。有在Github上的问题类似的问题在这里,似乎并未有任何决议。我真正想要的是能够针对本地开发MySQL服务器在本地进行开发,然后一旦准备好进行部署,就可以针对新创建的部署候选docker映像进行本地测试。 理想情况下,两者都可以从同一位置获取设置,所以我可以放。这似乎是一个典型的用例。目前有这种可能吗? 我正在将Boot2Doc