[opencms-dev] change opencms-system.xml with java code/site node

Christian Steinert christian_steinert at web.de
Sat Sep 16 13:15:49 CEST 2006


Andy Bicksbo schrieb:
> Hi all!
> I asked the same question afew days ago, but I didn't get s satisfying
> answer since that nor i found a solution by myself.
> So desparating pulling hair since that on my proplem:
> I am trying to add some custom site definitions to the
> opencms-system.xml through a java class with the method:
> addSite() from the Class org.opencms.site.CmsSiteManager
>  
>  i get the following error message:
>  
>  org.opencms.main.CmsRuntimeException: Site configuration has been
> frozen and can not longer be changed.
>  at org.opencms.site.CmsSiteManager.addSite(CmsSiteManager.java:289)
>  
> In javadoc its written: "Adds a new CmsSite to the list of configured
> sites, this is only allowed during configuration"
> Does anybody know how to get "during configuration"?
> -or know a different solution
> Best regards
> Andy
This is just an assumption, but this method might just be there to
inject the config information into the Site Manager, when opencms is booted.
If that is the case, then this method just initializes the state of the
Site Manager and is not meant for adding sites.

But this is just a guess. The only way to find out is by checking how
the Site Manager gets frozen. But with other classes I have seen, that
they are usually created, initialized with runtime data and then frozen.
If that's the case here, then you only way of changing the configuration
might be by injecting sth into the XML config and somehow triggering a
restart of your web app. The latter is probably not possible with any of
the opencms apis

christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060916/a6197cb4/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3269 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060916/a6197cb4/attachment.bin>


More information about the opencms-dev mailing list