Tuesday, 13 January 2015

JDeveloper 12c: Resolving 'MDS-01368: Variable "oracle.home" used in configuration document is not defined' error

 When I started up my Integrated Domain I encountered loads of errors in the log regarding the starting of my ADF application:

...
Caused By: oracle.mds.config.MDSConfigurationException: MDS-01330: Kan MDS-configuratiedocument niet laden.    
MDS-01329: Kan element "persistence-config" niet laden.
MDS-01370: Configuratie van MetadataStore voor metadata-store-usage "mstore-usage_1" is ongeldig.    
MDS-01368: Variabele "oracle.home" in het configuratiedocument is niet gedefinieerd als systeemeigenschap of omgevingsvariabele.

...

I found several questions on the oracle community about this, but none answers. Yet the answer turns out to be quite simple.

It is apparently caused by the adf-config.xml in the workspace where you'll find a snippet like:
                    <metadata-store-usage id="mstore-usage_1">
                        <metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
                            <property name="metadata-path" value="${oracle.home}/integration"/>
                            <property name="partition-name" value="seed"/>
                        </metadata-store>
                    </metadata-store-usage>

Here you see that in the metadata-path a reference to the oracle.home property is made.

It turns out that Oracle lacked to add this property in the startup script of the integrated weblogic default domain.

So open the setDomainEnv.cmd (Windows) or setDomainEnv.sh (Linux) script. Under Window for the DefaultDomain of the Integrated Weblogic, it is found in your Roaming Application data similar to: c:\Users\martien\AppData\Roaming\JDeveloper\system12.1.3.0.41.140521.1008\DefaultDomain\bin\

Then find the setting for EXTRA_JAVA_PROPERTIES and add the property -Doracle.home=%SOA_ORACLE_HOME%
Like:
set EXTRA_JAVA_PROPERTIES=%EXTRA_JAVA_PROPERTIES% -Dsoa.archives.dir=%SOA_ORACLE_HOME%\soa -Doracle.home=%SOA_ORACLE_HOME% -Dsoa.oracle.home=%SOA_ORACLE_HOME% -Dsoa.instance.home=%DOMAIN_HOME% -Dtangosol.coherence.log=jdk -Djavax.xml.soap.MessageFactory=oracle.j2ee.ws.saaj.soap.MessageFactoryImpl -Dweblogic.transaction.blocking.commit=true -Dweblogic.transaction.blocking.rollback=true -Djavax.net.ssl.trustStore=%WL_HOME%\server\lib\DemoTrust.jks -Doracle.xml.schema\Ignore_Duplicate_Components=true -Doracle.xdkjava.compatibility.version=11.1.1 -Doracle.soa.compatibility.version=11.1.1

Refire your domain and it should startup smoothly, regarding this issue. Probably it saves you some startup time too.

2 comments: