无法执行目标 org.codehaus.mojo exec-maven-plugin

2024-03-21

我有一个问题,我花了5天没有解决: 执行时mvn exec:java它无法正确解析配置参数,引发以下错误:

"Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.1:java (default-cli) on project poll-translator: An exception occured while executing the Java class. null: InvocationTargetException: Error creating bean with name 'serviceLocator' defined in class path resource [META-INF/dsol/dsol.xml]: Cannot resolve reference to bean 'dsol-service-proxy' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dsol-service-proxy' defined in class path resource [META-INF/dsol/dsol.xml]: Instantiation of bean failed; nested exception is net.sf.cglib.core.CodeGenerationException: java.lang.NullPointerException-->null -> [Help 1]"

这是POM配置使用的文件(使用阿帕奇Maven 3.0.4):

<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>org.dsol</groupId>
    <artifactId>dsol-parent</artifactId>
    <version>1-SNAPSHOT</version>
    <relativePath>../dsol/dsol-parent/pom.xml</relativePath>
</parent>

<groupId>org.dsol.project</groupId>
<artifactId>poll-translator</artifactId>
<version>0.1-SNAPSHOT</version>

<properties>
    <dsol.version>0.1-SNAPSHOT</dsol.version>
</properties>

<repositories>
    <repository>
        <id>dsol.internal</id>
        <url>http://maven.dsol-lang.net:8080/archiva/repository/internal/</url>
    </repository>
    <repository>
        <id>dsol.snapshots</id>
        <url>http://maven.dsol-lang.net:8080/archiva/repository/snapshots/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>org.dsol</groupId>
        <artifactId>dsol-interpreter</artifactId>
        <version>${dsol.version}</version>
    </dependency>
    <dependency>
        <groupId>org.dsol</groupId>
        <artifactId>dsol-default-planner-plugin-impl</artifactId>
        <version>${dsol.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-transports-http-jetty</artifactId>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.1</version>
            <executions>
                <execution>
                    <goals>
                        <goal>java</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <mainClass>org.dsol.engine.DSOLServer</mainClass>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.thoughtworks.paranamer</groupId>
            <artifactId>paranamer-maven-plugin</artifactId>
            <executions>
                <execution>
                    <id>run</id>  <!-- id is optional -->
                    <configuration>
                        <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
                        <outputDirectory>${project.build.outputDirectory}</outputDirectory>
                    </configuration>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
    <pluginManagement>
        <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e settings 
                only. It has no influence on the Maven build itself. -->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>
                                        com.thoughtworks.paranamer
                                    </groupId>
                                    <artifactId>
                                        paranamer-maven-plugin
                                    </artifactId>
                                    <versionRange>
                                        [2.3,)
                                    </versionRange>
                                    <goals>
                                        <goal>generate</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

我不知道问题出在哪里以及如何解决!你能帮我吗?

问候, 萨那。


问题出在你的 spring 配置上,而不是你的 maven 配置上。 在你的情况下,当 spring 尝试创建dsol-service-proxy其构造函数需要的对象serviceLocator这又创造了serviceLocator春天在创建你的过程中遇到了一些问题serviceLocator。检查你的dsol.xml并确保serviceLocator配置正确。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

无法执行目标 org.codehaus.mojo exec-maven-plugin 的相关文章

  • 使用“mvncompilejib:build”推送到 Docker 注册表失败

    我正在尝试使用以下命令构建并将我的 docker 映像部署到私有注册表谷歌联合投资银行Maven 插件 但是 它因访问私有注册表时出现问题而失败 我已经安装了Docker 桌面 v19 03 1 on my Windows 10机器 接下来
  • Spring(MVC)SQL注入避免?

    我想知道 Spring MVC 如何处理 SQL 注入 以及其他安全问题 XSS 代码 javascript 注入等 我主要讨论的是转义添加到数据库等的值 我似乎找不到任何答案 因为每次我搜索涉及依赖注入的 spring sql 注入结果时
  • Lombok 不适用于 Eclipse Neon

    我下载了lombok jar lombok 1 16 14 jar 并将其放入我的下载中 然后我点击这个 jar 执行正确地识别了我的 MacOS 上的 Eclipse 实例 然后我选择了我想要的实例 Lombok也在pom xml中指定
  • 由于 http 响应 405,无法执行 mvn tomcat:deploy

    我正在将 Tomcat 7 作为 Windows 服务运行 我想在我的项目根目录中进行 mvn tomcat 部署 但总是出现这个错误 你能帮我解决这个问题吗 INFO Deploying war to http localhost 808
  • Autofac 无法解析构造函数的参数“System.String applicationClientId”

    我有以下类 接口结构 class ProviderSetting public delegate ProviderSetting Factory string applicationClientId string appKey public
  • 在 swagger 中隐藏 spring 请求正文中的某些字段

    下面的示例 api 允许用户创建一个对象 用户应该能够指定name的领域Thing对象 而id字段应该自动生成 根据以下设置 将显示 swaggerboth请求的名称和 id 字段作为用户可以输入的内容 并将这两个字段显示为可选 事实上 对
  • Java:枚举:NoClassDefFoundError

    我在 J2EE 应用程序中使用枚举时遇到问题 我在无状态服务 bean 内的 switch case 中使用枚举 在运行时 我在 switch 语句上看到以下异常 Caused by java lang NoClassDefFoundErr
  • AngularJS - 服务、工厂、过滤器等中的依赖注入

    因此 我想在我的 Angular 应用程序中使用一些插件和库 目前 我只是引用这些函数 方法 因为它们是在 99 的应用程序中以完全忽略依赖注入的方式使用的 我有 例如 javascript 库 MomentJS 它处理格式化和验证日期 并
  • 如何在 Spring 3.1 中构造函数自动装配 HttpServletResponse?

    我有一个请求范围的 bean 并且需要访问 HttpServletResponse 和 HttpServletRequest 对象 我需要在构造函数中访问这些对象 因此属性自动装配不是一个选项 我做了以下事情 Component Scope
  • Spring @Cacheable 和 @Async 注解

    我需要缓存一些异步计算的结果 具体来说 为了克服这个问题 我尝试使用 Spring 4 3 缓存和异步计算功能 作为示例 我们采用以下代码 Service class AsyncService Async Cacheable users C
  • Spring Boot中ServletContext初始化后如何创建bean?

    我有一个 bean 它实现 ServletContextAware 和 BeanFactoryPostProcessor 接口 我需要在 ServletContext 完成初始化后将此 bean 注册到 applicationContext
  • 在 Spring 上下文中查找方法级自定义注释

    我想知道的是 所有的类 方法Spring http en wikipedia org wiki Spring Framework注释为 Versioned的bean 我创建了自定义注释 Target ElementType METHOD E
  • 新任务中使用的依赖注入服务

    我在需要时使用依赖项注入来访问我的服务 但我现在想要创建一个并发任务 但这会由于依赖项注入对象及其生命周期而导致问题 我读过这篇文章 标题 防止多线程 Link http mehdi me ambient dbcontext in ef6
  • Maven:从构建中排除测试

    我在项目的 src test java 文件夹中有一些类用作测试 当我使用标准 Maven 编译插件运行 Maven 时 这些项目被编译成 class 文件 并包含在打包编译代码的 jar 中 在运行 Maven 和构建我的版本之前 我已经
  • Spring Integration:SecurityContext 传播

    我对 Spring Integration 中的 SecurityContext 传播有一些困惑 这是文档的要点 http docs spring io spring integration reference htmlsingle sec
  • 使用 Spring 的 REST 多部分混合请求(文件+json)

    我需要将一个文件和一个 json 一起发送到我的 Spring 控制器 我有以下控制器类 Controller RequestMapping perform public class PerformController RequestMap
  • 如何在url请求中发送数组

    我的要求如下 我想给出演员姓名 开始日期 结束日期并获取他在该时期出演的所有电影 因此 我的服务请求是这样的 http localhost 8080 MovieDB GetJson name Actor startDate 20120101
  • 如何正确使用“mvn release:prepare”?

    我尝试了这个命令 用dryrun在我的 Maven 项目上进行测试 mvn release clean release prepare DdryRun true DgenerateBackupPoms false Dtag solocal
  • 如何通过基本身份验证确保 Spring Cloud Eureka 服务的安全?

    我在同一主机上设置了多个尤里卡服务器实例 他们使用主机名 eureka primary secondary 和 tertiary 这些主机名在主机文件中定义为 localhost 别名 一切都工作正常 它们都是可见的 并且可以作为不同的实例
  • Maven 版本插件跳过更新检查

    当我尝试使用versions use releases我的发布存储库被标记为 已禁用 这意味着快照依赖项不会解析为发布 我不明白为什么存储库被认为是禁用的 以下是构建的简短调试输出 DEBUG f remoteArtifactReposit

随机推荐