java.lang.NoSuchMethodError:org.hsqldb.DatabaseURL.parseURL Maven运行时 [英] java.lang.NoSuchMethodError: org.hsqldb.DatabaseURL.parseURL maven runtime

查看:149
本文介绍了java.lang.NoSuchMethodError:org.hsqldb.DatabaseURL.parseURL Maven运行时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出现以下错误.问题是,当我们重新启动服务器时,它会间歇性地发生.有时会出现错误,有时则不会.如何解决呢?我正在使用Maven.

Getting the following error. The problem is it happens intermittently when we restart our server. Sometimes the error comes and sometimes not. How to resolve this? I am using maven.

java.lang.NoSuchMethodError: org.hsqldb.DatabaseURL.parseURL(Ljava/lang/String;ZZ)Lorg/hsqldb/persist/HsqlProperties;
org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoSuchMethodError: org.hsqldb.DatabaseURL.parseURL(Ljava/lang/String;ZZ)Lorg/hsqldb/persist/HsqlProperties;

不起作用.旧版本来自hadoop-client:2.0.0-mr1-cdh4.2.0.我从中排除了hsqldb并签入了依赖关系树,而旧版本没有显示出来.但是我仍然在运行时遇到错误.

It's not working. Old version is coming from hadoop-client:2.0.0-mr1-cdh4.2.0. I excluded hsqldb from this and checked in dependency tree and the old version is not showing up. But still I am getting the error at runtime.

推荐答案

几乎可以肯定您的依赖项不匹配.

You almost certainly have a dependency mismatch.

确保您知道要使用的hsqldb版本.

Make sure you know which version of hsqldb you expect to be using.

检查应用程序正在使用的依赖项列表,这是指构建的应用程序中的实际JAR文件,而不是Maven依赖项列表.

Check the list of dependencies that are in use by the app, by that I mean the actual JAR files in the built application, not the list of maven dependencies.

最有可能是您使用了错误版本的hsqldb jar或多个不同版本(即正确的版本和错误的版本).

Most likely you have either the wrong version of the hsqldb jar or multiple different versions (ie the right version and a wrong version).

这可能是由于引入了意外的传递性依赖

This can be caused by unexpected transitive dependencies being pulled in

要确定可传递依赖关系的来源,可以使用maven依赖关系:树目标:

To identify where the transitive dependencies are coming from, you can use the maven dependency:tree goal:

例如

mvn dependency:tree -Dverbose -Dincludes=hsqldb

hsqldb是您要查找的工件的名称.

Where hsqldb is the name of the artifact you are looking for.

http: //maven.apache.org/plugins/maven-dependency-plugin/examples/resolving-conflicts-using-the-dependency-tree.html

一旦确定了多个版本的来源,就可以从这些依赖项中排除,例如:

Oncer you have identified where the multiple versions are coming from, you can exclude from those dependencies, e.g.:

<dependency>
  <groupId>sample.ProjectA</groupId>
  <artifactId>Project-A</artifactId>
  <version>1.0</version>
  <scope>compile</scope>
  <exclusions>
    <exclusion>  <!-- declare the exclusion here -->
      <groupId>sample.ProjectB</groupId>
      <artifactId>Project-B</artifactId>
    </exclusion>
  </exclusions> 
</dependency>

此处有更多详细信息: http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html

More details here: http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html

这篇关于java.lang.NoSuchMethodError:org.hsqldb.DatabaseURL.parseURL Maven运行时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆