2011-04-28 176 views
0

我在jboss上部署spring項目時遇到問題。
嗯,這裏的問題,我已經在文件的applicationContext.xml這個bean定義jboss部署錯誤

<bean id="sessionFactory" 
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> 
<property name="dataSource"> 
    <ref local="dataSource"/> 
</property> 
<property name="mappingDirectoryLocations"> 
    <list> 
    <value> 
     classpath:tn/com/zuro/ris/domain/hibernate/hbm/ 
    </value> 
    </list> 
</property> 

... 

和我在目錄類路徑文件Patient.hbm.xml:TN/COM/zuro/RIS /域/休眠/ HBM 當我部署在JBoss中的戰爭,我得到這個錯誤

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [tn/com/zuro/ris/domain/hibernate/hbm/] cannot be resolved to absolute file path because it does not reside in the file system: vfsfile:/C:/jboss/server/default/deploy/war-1.0-SNAPSHOT.war/WEB-INF/classes/tn/com/zuro/ris/domain/hibernate/hbm/ 

回答

0
  • 檢查,如果你真的有所需的路徑和具有HBM地圖坪有
  • 嘗試刪除結尾的斜線(例子中沒有一個,它應該是一個問題,但嘗試)上的目錄
+0

我在C:/jboss/server/default/deploy/war-1.0-SNAPSHOT.war/WEB-INF/classes/tn/com/zuro/ris/domain/hibernate/hbm中有hbm映射,而我嘗試刪除最後的斜槓,問題仍然存在 – Mansuro 2011-04-28 11:16:35

+0

@Mansuro檢查權限。 – Bozho 2011-04-28 11:19:31

0

  • 檢查權限如果您在使用Spring 2.5.X,你可能遇到了這個問題:

    https://jira.springsource.org/browse/SPR-5120

    基本上,春季需要的類路徑掃描特定協議的支持,並沒有與JBoss的vfsfile協議應付訪問其虛擬文件系統。

  • +0

    ,我該如何解決?我應該使用spring 3.0.x? – Mansuro 2011-04-28 13:11:12