Documentum NPE作为jar运行时

时间:2013-05-13 15:18:58

标签: jar nullpointerexception documentum

我正在编写一个简单的应用程序,用于从磁盘上的目录结构创建Documentum文件夹结构。当我通过SpringSource Tool Suite运行应用程序时,它工作正常。当我将它打包为jar,包含所有依赖项并运行它时,我收到以下错误:

java.lang.NullPointerException
at com.documentum.fc.common.impl.preferences.PreferencesManager.locateMainPersistentStore(PreferencesManager.java:372) 
at com.documentum.fc.common.impl.preferences.PreferencesManager.readPersistentProperties(PreferencesManager.java:333)
    at com.documentum.fc.common.impl.preferences.PreferencesManager.<init>(PreferencesManager.java:41)
    at com.documentum.fc.common.DfPreferences.initialize(DfPreferences.java:64)
    at com.documentum.fc.common.DfPreferences.getInstance(DfPreferences.java:43)
    at com.documentum.fc.client.DfSimpleDbor.getDefaultDbor(DfSimpleDbor.java:78)
    at com.documentum.fc.client.DfSimpleDbor.<init>(DfSimpleDbor.java:66)
    at com.documentum.fc.client.DfClient$ClientImpl.<init>(DfClient.java:344)
    at com.documentum.fc.client.DfClient.<clinit>(DfClient.java:754)

以下是我的代码中出现此错误的行:

IDfClient client = DfClient.getLocalClient();

jar包含dfc.properties文件,我在命令行中使用

指定
-Ddfc.properties.file=dfc.properties.dev

对于记录,完整的命令行看起来像这样(略有匿名):

java -Ddfc.properties.file=dfc.properties.dev -jar MyTest-jar-with-dependencies.jar baseDirectory baseDocumentumFolder

非常感谢你的时间!

0 个答案:

没有答案