Deployment “AttachmentStore“ is in error due to: java.lang.IllegalArgumentException: Wrong arguments

Jboss5.1GA在linux环境下启动报错:

DEPLOYMENTS IN ERROR:
  Deployment "AttachmentStore" is in error due to: java.lang.IllegalArgumentException: Wrong arguments. new for target java.lang.reflect.Constructor expected=[java.net.URI] actual=[java.io.File]

DEPLOYMENTS MISSING DEPENDENCIES:
  Deployment "ProfileService" is missing the following dependencies:
    Dependency "ProfileServiceDeployer" (should be in state "Installed", but is actually in state "Instantiated")
    Dependency "jboss.kernel:service=KernelController" (should be in state "Installed", but is actually in state "**ERROR**")
  Deployment "ProfileServiceBootstrap" is missing the following dependencies:
    Dependency "ProfileService" (should be in state "Installed", but is actually in state "Instantiated")
    Dependency "jboss.kernel:service=Kernel" (should be in state "Installed", but is actually in state "**ERROR**")
  Deployment "ProfileServiceDeployer" is missing the following dependencies:
    Dependency "AttachmentStore" (should be in state "Installed", but is actually in state "**ERROR**")
  Deployment "ProfileServicePersistenceDeployer" is missing the following dependencies:
    Dependency "AttachmentStore" (should be in state "Installed", but is actually in state "**ERROR**")

	at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:278)
	at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:174)
	at org.jboss.bootstrap.microcontainer.ServerImpl.doStart(ServerImpl.java:142)
	at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:450)
	at org.jboss.Main.boot(Main.java:221)
	at org.jboss.Main$1.run(Main.java:556)
	at java.lang.Thread.run(Thread.java:745)

解决方法:

        修改配置文件$JBOSS_HOME/server/<serverName>/conf/bootstrap/profile.xml,把其中的节点:

<bean name="AttachmentStore" class="org.jboss.system.server.profileservice.repository.AbstractAttachmentStore">

 <constructor><parameter><inject bean="BootstrapProfileFactory" property="attachmentStoreRoot" /></parameter></constructor>

修改为:

<bean name="AttachmentStore" class="org.jboss.system.server.profileservice.repository.AbstractAttachmentStore">

 <constructor><parameter class="java.io.File"><inject bean="BootstrapProfileFactory" property="attachmentStoreRoot" /></parameter></constructor>

### Java 编译时内部映射处理器出现 NullPointerException 的解决方案 在使用 MapStruct 进行开发时,如果遇到 `java: Internal error in the mapping processor: java.lang.NullPointerException` 错误,通常是因为 IDE 或构建工具中的某些配置不兼容所导致。以下是详细的分析与解决方法: #### 1. 配置 IDEA 构建选项 可以通过调整 IntelliJ IDEA 的编译器设置来解决问题。具体操作如下: - 打开 **Settings** -> **Build, Execution, Deployment** -> **Compiler**。 - 在 **User-local build process VM options** 中添加参数 `-Djps.track.ap.dependencies=false`[^1]。 此参数的作用是禁用注解处理器对依赖关系的跟踪功能,从而避免因空指针异常引发的问题。 #### 2. 更新 MapStruct 版本 确保使用的 MapStruct 库版本是最新的稳定版。旧版本可能存在未修复的 Bug,而新版本可能已经解决了这些问题。可以在项目的 `pom.xml` 文件中指定最新版本号,例如: ```xml <dependency> <groupId>org.mapstruct</groupId> <artifactId>mapstruct</artifactId> <version>1.5.3.Final</version> </dependency> ``` 同时,还需要确认 Maven/Gradle 插件是否支持当前版本的 MapStruct 注解处理器。 #### 3. 清理并重新构建项目 有时缓存文件可能导致问题。可以尝试清理整个项目后再重新构建: - 使用命令行运行以下指令: ```bash mvn clean install ``` 或者对于 Gradle 用户: ```bash gradle clean build ``` 这一步有助于移除潜在的损坏文件或临时数据。 #### 4. 检查 JDK 和 IDE 兼容性 不同版本的 JDK 可能会与特定版本的 MapStruct 存在兼容性问题。建议验证正在使用的 JDK 是否满足官方文档的要求。此外,升级到更高版本的 IntelliJ IDEA(如 2023.x 系列)也可能帮助规避此类错误[^2]。 #### 5. 调试模式下的日志排查 当以上措施均未能奏效时,可启用更详尽的日志记录以便进一步诊断根本原因。通过修改 JVM 参数增加调试信息输出: ```properties -Djavax.annotation.processinggenerated=some/path/to/output/directory ``` 将生成的中间产物保存下来供后续审查。 --- ### 总结 综上所述,针对 `java: Internal error in the mapping processor: java.lang.NullPointerException` 的处理方式主要包括调整 IDEA 设置、更新库版本以及优化环境适配等方面的工作。按照上述指导逐一实施应该能够有效缓解甚至彻底消除该类故障现象。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值