Monday, 24 May 2021

"Invalid Composite File" error in Jdeveloper 12C

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)

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 :) 





Monday, 8 January 2018

Error while creating jar\sar using maven for SOA projects in Jdev 12.2.1.3



Below error stack can  be observed when packaging or compailing a so project.

[ERROR] The project SOAApplication:JTACaller:1.0-SNAPSHOT (C:\JDeveloper\mywork\SOAApplication\JTACaller\pom.xml) has 1 error
[ERROR] Unresolveable build extension: Plugin com.oracle.soa.plugin:oracle-soa-plugin:12.2.1-3-0 or one of its dependencies could not be resolved: Failure to find com.oracle.fmwshare:jrf_ws_client.com.oracle.webservices.fmw.client:jar:12.2.1-0-0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 2]
org.apache.maven.plugin.PluginResolutionException: Plugin com.oracle.soa.plugin:oracle-soa-plugin:12.2.1-3-0 or one of its dependencies could not be resolved: Failure to find com.oracle.fmwshare:jrf_ws_client.com.oracle.webservices.fmw.client:jar:12.2.1-0-0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:208)
at org.apache.maven.project.DefaultProjectBuildingHelper.resolveExtensionArtifacts(DefaultProjectBuildingHelper.java:386)
at org.apache.maven.project.DefaultProjectBuildingHelper.createProjectRealm(DefaultProjectBuildingHelper.java:240)
at org.apache.maven.project.DefaultModelBuildingListener.buildExtensionsAssembled(DefaultModelBuildingListener.java:110)
at org.apache.maven.model.building.ModelBuildingEventCatapult$1.fire(ModelBuildingEventCatapult.java:43)
at org.apache.maven.model.building.DefaultModelBuilder.fireEvent(DefaultModelBuilder.java:1175)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:415)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:398)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:614)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:405)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:672)
at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:663)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:253)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to find com.oracle.fmwshare:jrf_ws_client.com.oracle.webservices.fmw.client:jar:12.2.1-0-0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:367)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:200)
... 24 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find com.oracle.fmwshare:jrf_ws_client.com.oracle.webservices.fmw.client:jar:12.2.1-0-0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:231)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:206)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:585)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:503)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
... 27 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException


Steps to resolve:
Go to- (you $HOME will be c:\Users\<user_name>)
$HOME/.m2/repository/com/oracle/soa/plugin/oracle-soa-plugin/12.2.1-3-0/oracle-soa-plugin-12.2.1-3-0.pom


@ Found this following entry:
@
@ <dependency>
@    <groupId>com.oracle.fmwshare</groupId>
@    <artifactId>jrf_ws_client.com.oracle.webservices.fmw.client</artifactId>
@    <version>12.2.1-0-0</version>
@ </dependency>
@

Make the changes to artifact version as below

@ <dependency>
@    <groupId>com.oracle.fmwshare</groupId>
@    <artifactId>jrf_ws_client.com.oracle.webservices.fmw.client</artifactId>
@    <version>12.2.1-3-0</version>
@ </dependency>


Happy Learning J J

Tuesday, 21 November 2017

Direct method to decode Base64 in OSB

I had a requirement to do decode a Base64 string in OSB. I did a search and every blogs explained to do it using Java class, but i don't wanted to use Java callout.

In hunt of a easier approach i was able to figure out that using XSLT java call to do the base64 decode. Then you don't have to do the proxy java callout, and also you can save yourself from trouble of uploading some custom jar file .

Lets see how to do it-

Base 64 decode can be done using the xslt function "decode".
The class "weblogic.apache.xerces.impl.dv.util.Base64" is available inside "com.bea.core.apache_1.3.0.1.jar"

Following namespace had to be used to make a successful call  -

"http://www.oracle.com/XSL/Transform/java/weblogic.apache.xerces.impl.dv.util.Base64"

The above is under the weblogic package and was working till 12.2.1.2 but the same stopped working in 12.2.1.3 version.

For 12.2.1.3 found below which works perfectly fine. Also found that below namespace can be used in 12.1.3 and any of the above versions.

http://www.oracle.com/XSL/Transform/java/oracle.soa.common.util.Base64Decoder



Sample Code FYR-
====================
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc64="http://www.oracle.com/XSL/Transform/java/oracle.soa.common.util.Base64Decoder"
exclude-result-prefixes=" dc64 ">
 <xsl:template match="/">
 <Out>
       <xsl:value-of select="dc64:decode('Your base64 string\variable\XPATH here')"/>
   </fOut>
 </xsl:template>
</xsl:stylesheet>




Happy coding, Happy learning :) 

Tuesday, 12 September 2017

12C Jdeveloper startup exception

Jdeveloper 12.2.1/12.1.3 startup error on Windows/Linux



Sometime 12C Jdeveloper fails to start with following exception. The jdeveloper just gets stuck after loading upto 80%.

Oracle JDeveloper 12c 12.2.1.0.0
Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
java.lang.RuntimeException: Exception in org.eclipse.osgi.framework.internal.core.SystemBundleActivator.start() of bundle org.eclipse.osgi.
  at org.eclipse.osgi.framework.internal.core.InternalSystemBundle.resume(InternalSystemBundle.java:233)
  at org.eclipse.osgi.framework.internal.core.Framework.launch(Framework.java:657)
  at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.internalInit(EquinoxLauncher.java:69)
  at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.init(EquinoxLauncher.java:37)
  at org.eclipse.osgi.launch.Equinox.init(Equinox.java:178)
  at org.netbeans.modules.netbinox.Netbinox.init(Netbinox.java:84)
  at org.netbeans.core.netigso.Netigso.prepare(Netigso.java:166)
  at org.netbeans.NetigsoHandle.turnOn(NetigsoHandle.java:127)
  at org.netbeans.ModuleManager.enable(ModuleManager.java:1176)
  at org.netbeans.ModuleManager.enable(ModuleManager.java:1011)
  at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:340)
  at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:276)
  at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:301)
  at org.netbeans.core.startup.Main.getModuleSystem(Main.java:181)
  at org.netbeans.core.startup.Main.getModuleSystem(Main.java:150)
  at org.netbeans.core.startup.Main.start(Main.java:307)
  at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:123)
  at java.lang.Thread.run(Thread.java:745)
Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.osgi.framework.internal.core.SystemBundleActivator.start() of bundle org.eclipse.osgi.
  at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
  at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
  at org.eclipse.osgi.framework.internal.core.InternalSystemBundle.resume(InternalSystemBundle.java:225)
  ... 17 more
Caused by: java.lang.NumberFormatException: For input string: "2.0.0"
  at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
  at java.lang.Integer.parseInt(Integer.java:492)
  at java.lang.Integer.parseInt(Integer.java:527)
  at org.eclipse.osgi.internal.resolver.StateBuilder.createBundleDescription(StateBuilder.java:61)
  at org.eclipse.osgi.internal.resolver.StateObjectFactoryImpl.createBundleDescription(StateObjectFactoryImpl.java:33)
  at org.eclipse.osgi.internal.baseadaptor.BaseStorage.readStateData(BaseStorage.java:845)
  at org.eclipse.osgi.internal.baseadaptor.BaseStorage.getStateManager(BaseStorage.java:791)
  at org.eclipse.osgi.baseadaptor.BaseAdaptor.getPlatformAdmin(BaseAdaptor.java:380)
  at org.eclipse.core.runtime.internal.adaptor.EclipseAdaptorHook.frameworkStart(EclipseAdaptorHook.java:90)
  at org.eclipse.osgi.baseadaptor.BaseAdaptor.frameworkStart(BaseAdaptor.java:253)
  at org.eclipse.osgi.framework.internal.core.SystemBundleActivator.start(SystemBundleActivator.java:60)
  at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
  at java.security.AccessController.doPrivileged(Native Method)
  at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
  ... 19 more


 Work around :

1.     Navigate to below location(on both windows and linux) :

            <User_Home>/.jdeveloper/system12.2.1.0.42.151011.0031/

            Eg For windows - C:\Users\<USER>\AppData\Roaming\JDeveloper\system12.2.1.0.42.151011.0031\system_cache

2.     Delete  the "system_cache" directory or rename the "system_cache" directory.

3.     Start the Jdevloper and it comes up!!!!
               

                Happy Learning J J

5 steps to configure Password less SSH Login In Linux

Below are the steps to configure password less authentication between two hosts.

Consider you are on "machine1.company1.com" and you want to establish password less authentication on "machine2.company2.com" for user "user2"

Follow the below 5 steps:

1.       Log in to "machine1.company1.com" with user "user1".

Go to below directory:
cd /home/user1/.ssh/


2.       Generate public-private key pair using below command.

Note: If you already have the public and private keys in machine1 then step#2 can be skipped.
               ssh-keygen -t rsa
                Below are the details needs to give for the command
·         Enter file in which to save the key (/home/user1/.ssh/id_rsa):Press Enter (You can just press enter and accept the defaults if you have no requirement to change the directory)
·         Enter passphrase (empty for no passphrase): Press Enter
·         Enter same passphrase again: Press Enter
                Your identification (private key) has been saved in /home/user1/.ssh/id_rsa.
                Your public key has been saved in /home/user1/.ssh/id_rsa.pub.
                Verify the date of the above files.

3.       SSH to other machine2 and perform below steps.

·         ssh user2@machine2.company2.com , enter the password
·         cd /home/user2
·         Change .ssh directory to 700 permission (chmod 700 .ssh)
·         cd .ssh
·         Take the backup of authorized key file (authorized_keys authorized_keys_BKP)
·         Change authorized_keys to 600 permissions (chmod 600 authorized_keys)

4.       Execute the below command from machine1.info.company1.com" with user "user1":

                cat /home/user1/.ssh/id_rsa.pub | ssh user2@machine2.company2.com 'cat >> .ssh/authorized_keys'

5.       Close the current session and again log in to "machine1.company1.com" with user "user1"

                Try  ssh user2@machine2.company2.com
                This time it will not ask for the password.
                That’s all !!! You are done !!!
               

                Happy coding, Happy Learning J J

"Invalid Composite File" error in Jdeveloper 12C

ISSUE:  While migrating some SOA 11g codes to 12C the migration wizard displays that the codes are successfully migrated. But when the compo...