Shiro 插件与 Grails 中的 Quartz 框架冲突

发布于 2024-09-25 20:37:18 字数 1438 浏览 1 评论 0原文

我一直在我的 grails 项目中使用 Quartz 框架,使用名为quartz-all-1.7.3 的库。

现在我需要将 shiro 插件安装到我的项目中。因此,每当我将 shiro 插件安装到我的项目中时,它都会成功安装。

但是每当我再次运行我的项目时,它都会给出编译错误,如下所示:

  [groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
  [groovyc] Compile error during compilation with javac.
  [groovyc] ....scheduler\quartz\framework\CustomJDBCDelegate.java:46: com.securonix.application.scheduler.quartz.framework.CustomJDBCDelegate is not abstract and does not override abstract method updateSchedulerState(java.sql.Connection,java.lang.String,long,java.lang.String) in org.quartz.impl.jdbcjobstore.DriverDelegate
  [groovyc] public class CustomJDBCDelegate implements DriverDelegate, StdJDBCConstants {
  [groovyc]        ^

所以经过长时间查看 shiro 插件,我发现它与插件有一些依赖关系。其中依赖项之一是 shiro-quartz-1.0.0-incubating.jar。所以,现在在它的 pom.xml 文件中,我看到了以下行代码:

<dependency>
     <groupId>quartz</groupId>
     <artifactId>quartz</artifactId>
</dependency>

根据 pom.xml 中的行,没有具有quartz依赖项的版本标签,这意味着每当在我的项目中安装 shiro 时,它都会同时提取最新的库石英即 1.8.3 与 Maven。

quartz 1.8.3 中,CustomJDBCDelegate 类的 updateSchedulerState 方法已从 quarts 1.7.3 版本更改。

所以现在的问题是我无法在现有项目中更改 quartz-all-1.7.3 ,并且也想在我的项目中使用 Shiro 插件。

因此应该有一些解决方案,以便 shiro 应该获得 quartz-1.7.3 版本,而不是使用 maven 的最新版本。

任何帮助将不胜感激...

谢谢...

I have been working Quartz framework in my grails project with lib called quartz-all-1.7.3.

Now I need to install the shiro plugin to my project. So, whenever I am installing shiro plugin to my project its getting installed successfully..

But again whenever I am running my project again it's giving compilation error as follows :

  [groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
  [groovyc] Compile error during compilation with javac.
  [groovyc] ....scheduler\quartz\framework\CustomJDBCDelegate.java:46: com.securonix.application.scheduler.quartz.framework.CustomJDBCDelegate is not abstract and does not override abstract method updateSchedulerState(java.sql.Connection,java.lang.String,long,java.lang.String) in org.quartz.impl.jdbcjobstore.DriverDelegate
  [groovyc] public class CustomJDBCDelegate implements DriverDelegate, StdJDBCConstants {
  [groovyc]        ^

So after long look on shiro plugin I have found that it has some dependencies with plugins. In that one of the dependency is shiro-quartz-1.0.0-incubating.jar. So, now inside it's pom.xml file I have seen following line code :

<dependency>
     <groupId>quartz</groupId>
     <artifactId>quartz</artifactId>
</dependency>

As per our line in pom.xml, there is no tag of version with quartz dependency, that means whenever shiro getting installed in my project, simultaneously it's extracting latest library of quartz i.e. 1.8.3 with maven.

And inside that quartz 1.8.3 the method updateSchedulerState of class CustomJDBCDelegate has been changed from version quarts 1.7.3.

So now problem is I cannot change quartz-all-1.7.3 in my existing project, and wanted to use Shiro plugin too in my project.

So there should be some resolution so that shiro should get quartz-1.7.3 version rather than the latest one using maven.

Any help would be highly appreciated...

Thanks...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烂人 2024-10-02 20:37:18

也许我弄错了,你的意思是这样的吗?:

    <dependency>
        <groupId>org.apache.shiro</groupId>
        <artifactId>shiro-quartz</artifactId>
        <version>1.0.0-incubating</version>
        <exclusions>
            <exclusion>
                <groupId>quartz</groupId>
                <artifactId>quartz</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.quartz-scheduler</groupId>
        <artifactId>quartz</artifactId>
        <version>1.7.3</version>
    </dependency>

然后 $ mvn dependency:tree

[...]

[INFO] +- org.apache.shiro:shiro-quartz:jar:1.0.0-incubating:compile
[INFO] |  \- org.apache.shiro:shiro-core:jar:1.0.0-incubating:compile
[INFO] |     +- org.slf4j:slf4j-api:jar:1.5.6:compile
[INFO] |     \- commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] \- org.quartz-scheduler:quartz:jar:1.7.3:compile
[INFO]    \- commons-logging:commons-logging:jar:1.1:compile
[INFO]       +- log4j:log4j:jar:1.2.12:compile
[INFO]       +- logkit:logkit:jar:1.0.1:compile
[INFO]       \- avalon-framework:avalon-framework:jar:4.1.3:compile

Maybe I'm getting this wrong, do you mean something like this?:

    <dependency>
        <groupId>org.apache.shiro</groupId>
        <artifactId>shiro-quartz</artifactId>
        <version>1.0.0-incubating</version>
        <exclusions>
            <exclusion>
                <groupId>quartz</groupId>
                <artifactId>quartz</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.quartz-scheduler</groupId>
        <artifactId>quartz</artifactId>
        <version>1.7.3</version>
    </dependency>

then $ mvn dependency:tree

[...]

[INFO] +- org.apache.shiro:shiro-quartz:jar:1.0.0-incubating:compile
[INFO] |  \- org.apache.shiro:shiro-core:jar:1.0.0-incubating:compile
[INFO] |     +- org.slf4j:slf4j-api:jar:1.5.6:compile
[INFO] |     \- commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] \- org.quartz-scheduler:quartz:jar:1.7.3:compile
[INFO]    \- commons-logging:commons-logging:jar:1.1:compile
[INFO]       +- log4j:log4j:jar:1.2.12:compile
[INFO]       +- logkit:logkit:jar:1.0.1:compile
[INFO]       \- avalon-framework:avalon-framework:jar:4.1.3:compile
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文