ISSUE:
While migrating some SOA 11g codes to 12C the migration wizard displays that the codes are successfully migrated.
But when the composite.xml is opened it will not load the composite diagram and throws - "Invalid Composite File" error.
The composite.xml file can be opened in source mode and you can notice that the version number is still pointing to 11g.
Which means the migration logic never executed when the project is opened in 12c.
If you take a look into the logs, the following error can be noticed.
oracle.bali.xml.model.XmlContext _setSourceModel
SEVERE: Exception thrown when initializing model:oracle.tip.tools.ide.bpel.v1.designer.addin.model.BPELXmlModelImpl
Caused by: java.lang.RuntimeException: CompositeModel.getCompositeModel returned null.
at oracle.tip.tools.ide.fabric.api.SCAControllerContext.getScaComposite(SCAControllerContext.java:275)
at oracle.tip.tools.ide.fabric.api.SCAControllerContext.getXmlModel(SCAControllerContext.java:282)
at oracle.tip.tools.ide.fabric.api.SCAControllerContext.releaseCompositeReadLock(SCAControllerContext.java:257)
at oracle.tip.tools.ide.fabric.api.SCAControllerServRefImpl.getComponents(SCAControllerServRefImpl.java:110)
at oracle.tip.tools.ide.fabric.api.SCAControllerImpl.getComponents(SCAControllerImpl.java:496)
at oracle.tip.tools.ide.bpel.v1.plugins.plugins.soa.utils.JDevSCAIntegrationUtil.getBPELComponentName(JDevSCAIntegrationUtil.java:90)
at oracle.tip.tools.ide.bpel.v1.plugins.plugins.soa.deployment.BPELDeploymentFile.getComponentName(BPELDeploymentFile.java:217)
at oracle.tip.tools.ide.bpel.v1.plugins.plugins.soa.deployment.BPELDeploymentFile.getWSDLLocation(BPELDeploymentFile.java:221)
at oracle.tip.tools.ide.bpel.v1.designer.addin.model.wsdl.WSDLModel.setPartnerLinkWSDLLocations(WSDLModel.java:244)
at oracle.tip.tools.ide.bpel.v1.designer.addin.model.BPELXmlModelImpl.createProcess(BPELXmlModelImpl.java:374)
at oracle.tip.tools.ide.bpel.v1.designer.addin.model.BPELXmlModelImpl.postAttachmentHook(BPELXmlModelImpl.java:165)
at oracle.bali.xml.model.XmlContext._initializeModel(XmlContext.java:322)
at oracle.bali.xml.model.XmlContext._setSourceModel(XmlContext.java:2324)
at oracle.bali.xml.model.XmlContext.setModel(XmlContext.java:345)
at oracle.bali.xml.addin.XMLSourceNode._createAndInitXmlContext(XMLSourceNode.java:1781)
at oracle.tip.tools.ide.fabric.api.SCAControllerContext.getScaComposite(SCAControllerContext.java:275)
at oracle.tip.tools.ide.fabric.api.SCAControllerContext.getXmlModel(SCAControllerContext.java:282)
at oracle.tip.tools.ide.fabric.api.SCAControllerContext.releaseCompositeReadLock(SCAControllerContext.java:257)
at oracle.tip.tools.ide.fabric.api.SCAControllerServRefImpl.getComponents(SCAControllerServRefImpl.java:110)
at oracle.tip.tools.ide.fabric.api.SCAControllerImpl.getComponents(SCAControllerImpl.java:496)
at oracle.tip.tools.ide.bpel.v1.plugins.plugins.soa.utils.JDevSCAIntegrationUtil.getBPELComponentName(JDevSCAIntegrationUtil.java:90)
at oracle.tip.tools.ide.bpel.v1.plugins.plugins.soa.deployment.BPELDeploymentFile.getComponentName(BPELDeploymentFile.java:217)
at oracle.tip.tools.ide.bpel.v1.plugins.plugins.soa.deployment.BPELDeploymentFile.getWSDLLocation(BPELDeploymentFile.java:221)
at oracle.tip.tools.ide.bpel.v1.designer.addin.model.wsdl.WSDLModel.setPartnerLinkWSDLLocations(WSDLModel.java:244)
at oracle.tip.tools.ide.bpel.v1.designer.addin.model.BPELXmlModelImpl.createProcess(BPELXmlModelImpl.java:374)
at oracle.tip.tools.ide.bpel.v1.designer.addin.model.BPELXmlModelImpl.postAttachmentHook(BPELXmlModelImpl.java:165)
at oracle.bali.xml.model.XmlContext._initializeModel(XmlContext.java:322)
at oracle.bali.xml.model.XmlContext._setSourceModel(XmlContext.java:2324)
at oracle.bali.xml.model.XmlContext.setModel(XmlContext.java:345)
at oracle.bali.xml.addin.XMLSourceNode._createAndInitXmlContext(XMLSourceNode.java:1781)
Also in the live issues tab of Jdev the following exception can be found.
No grammar available for namespace http://xmlns.oracle.com/sca/1.0, contents of element composite cannot be validated
If you try to deploy the code then following exception occurs.
oracle.ideimpl.feedback2.client.FeedbackManagerImpl uncaughtException
SEVERE: Uncaught Exception
java.lang.NullPointerException
at oracle.tip.tools.ide.fabric.deploy.sar.SarProfile.setFilters(SarProfile.java:165)
at oracle.tip.tools.ide.fabric.deploy.sar.SarProfile.initFileGroups(SarProfile.java:158)
at oracle.tip.tools.ide.fabric.deploy.sar.SarProfile.copyTo(SarProfile.java:297)
at oracle.tip.tools.ide.fabric.deploy.wizard.DeployToSOAArchiveCmd.setProfile(DeployToSOAArchiveCmd.java:68)
at oracle.jdeveloper.deploy.cmd.ProfileDeployCmd.setContext(ProfileDeployCmd.java:86)
Solution/Fix:
This is not a migration issue but the 11g jpr file was missing some important details like resource structure, technology scope and configuration entries.
I was able to find this by comparing the jpr with the working code.
Below are the screenshot of problematic and the correct jpr respectively.
Issue JPR:
Correct JPR:
Following are the missing details in the jpr having issue -
<hash n="oracle.ide.model.ResourcePaths">
<hash n="resourcesContentSet">
<list n="url-path"/>
</hash>
</hash>
<hash n="oracle.ide.model.TechnologyScopeConfiguration">
<list n="technologyScope">
<string v="SOA"/>
</list>
</hash>
<hash n="oracle.jdeveloper.compiler.OjcConfiguration">
<list n="copyRes">
<string v=".gif"/>
<string v=".jpg"/>
<string v=".jpeg"/>
<string v=".png"/>
<string v=".properties"/>
<string v=".xml"/>
<string v=".ejx"/>
<string v=".xcfg"/>
<string v=".cpx"/>
<string v=".dcx"/>
<string v=".sva"/>
<string v=".wsdl"/>
<string v=".ini"/>
<string v=".tld"/>
<string v=".tag"/>
<string v=".xlf"/>
<string v=".xsl"/>
<string v=".xsd"/>
<string v=".exm"/>
<string v=".xml"/>
<string v=".exm"/>
<string v=".xml"/>
</list>
<value n="internalEncoding" v="Cp1252"/>
<list n="Javac.commandline.optionlist">
<string v="-g"/>
<string v="-Xlint:all"/>
<string v="-Xlint:-cast"/>
<string v="-Xlint:-empty"/>
<string v="-Xlint:-fallthrough"/>
<string v="-Xlint:-path"/>
<string v="-Xlint:-serial"/>
<string v="-Xlint:-unchecked"/>
</list>
<value n="webIANAEncoding" v="windows-1252"/>
</hash>
Adding the above entries to your jpr should help in resolving the issue.
Happy coding, Happy learning :)