Documentum NPE when running as jar

主宰稳场 提交于 2019-12-12 17:13:53

问题


I'm writing a simple application to create a Documentum folder structure from a directory structure on disk. When I run the application through SpringSource Tool Suite, it works fine. When I package it as a jar, with all dependencies, and run it, I receive the following error:

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)

Here is the line in my code where this error occurs:

IDfClient client = DfClient.getLocalClient();

The jar includes the dfc.properties file, which I specify on the command line using

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

For the record, the full command line looks like this (slightly anonymized):

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

Thanks much for your time!

来源:https://stackoverflow.com/questions/16525570/documentum-npe-when-running-as-jar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!