the openfire development environment is prone to cocould not locate home exceptions, mainly caused by xmppserver. Code in Java:
Private void initialize () filenotfoundexception {<br/> locateopenfire (); <br/> ...... <br/>}</P> <p> private void locateopenfire () throws filenotfoundexception {<br/> string jiveconfigname = "conf" + file. separator + "openfire. XML "; <br/> // first, try to load it openfirehome as a system property. <br/> If (openfirehome = NULL) {<br/> string homeproperty = system. getproperty ("openfirehome"); <br/> Try {<br/> If (homeproperty! = NULL) {<br/> openfirehome = verifyhome (homeproperty, jiveconfigname); <br/>}< br/> catch (filenotfoundexception Fe) {<br/> // ignore. <br/>}</P> <p> // if we still don't have home, let's assume this is standalone <br/> // and just look for home in a standard sub-Dir location and verify <br/> // by looking for the config file <br/> If (openfirehome = NULL) {<br/> try {<br/> openfirehome = verifyhome (".. ", jiveconfigname ). getcanonicalfile (); <br/>}< br/> catch (filenotfoundexception Fe) {<br/> // ignore. <br/>}< br/> catch (ioexception IE) {<br/> // ignore. <br/>}</P> <p> ..... </P> <p >}</P> <p>
Here we mainly look for the start directory of openfire based on the system configuration.
If the preceding error is found:
1. Check whether ant is used to compile openfire. Make sure that all compilation results are in the target \ openfire directory in the source code path.
2. check that the configuration value of arguments --> VM arguments in the configuration of DEBUG configuration/run configuration is-dopenfirehome =$ {workspace_loc: openfire_src/target/openfire}. Only this parameter is configured.System. getproperty ("openfirehome ")No null occurs.