---
title: "Eclipse中启动JBoss 5.1 报Deployment \"AttachmentStore\" 错误"
author: "lvjun106"
date: "2013-10-15T14:19:10Z"
tags: []
categories: ["企业架构"]
slug: "eclipse-jboss-5-1-deployment-attachmentstore"
draft: false
lastmod: "2013-10-15T14:19:10Z"
id: 1958398
url: "https://lvjun106.iteye.com/blog/1958398"
---

今天在Eclipse中启动JBoss 5.1时遇到这样的一个错误：

> ……  
> ERROR \[AbstractKernelController] Error installing to Instantiated: name=AttachmentStore state=Described  
> java.lang.IllegalArgumentException: Wrong arguments. new for target java.lang.reflect.Constructor expected=\[java.net.URI] actual=\[java.io.File]  
> ……  
> 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]

        从错误信息中，就知道是 AttachmentStore 的一个参数错误。

        解决方法倒很简单，只要修改一下 profile.xml(JBOSS\_HOME\\server\\default\\conf\\bootstrap\\profile.xml) 中的 AttachmentStore 设置就可以了。在该文件中，你可以找到：

  &lt;bean name="AttachmentStore" class="org.jboss.system.server.profileservice.repository.AbstractAttachmentStore"&gt;   
      &lt;constructor&gt; 

 &lt;parameter&gt; 

   &lt;inject bean="BootstrapProfileFactory" property="attachmentStoreRoot" /&gt; 

   &lt;/parameter&gt; 

    &lt;/constructor&gt; 

     &lt;property name="mainDeployer"&gt;&lt;inject bean="MainDeployer" /&gt;&lt;/property&gt; 

   &lt;property name="serializer"&gt;&lt;inject bean="AttachmentsSerializer" /&gt;&lt;/property&gt; 

  &lt;property name="persistenceFactory"&gt;&lt;inject bean="PersistenceFactory" /&gt;&lt;/property&gt; 

    &lt;/bean&gt;

 

只需将它改为：

 

   &lt;bean name="AttachmentStore" class="org.jboss.system.server.profileservice.repository.AbstractAttachmentStore"&gt; 

  &lt;constructor&gt; 

    &lt;!-- 修改这里 --&gt; 

     &lt;parameter class="java.io.File"&gt; 

    &lt;inject bean="BootstrapProfileFactory" property="attachmentStoreRoot" /&gt; 

     &lt;/parameter&gt; 

  &lt;/constructor&gt; 

      &lt;property name="mainDeployer"&gt;&lt;inject bean="MainDeployer" /&gt;&lt;/property&gt; 

     &lt;property name="serializer"&gt;&lt;inject bean="AttachmentsSerializer" /&gt;&lt;/property&gt; 

     &lt;property name="persistenceFactory"&gt;&lt;inject bean="PersistenceFactory" /&gt;&lt;/property&gt; 

      &lt;/bean&gt;