Search Results


Thursday, November 26, 2015

How to zip the folder in windows using bat script

It often happens that when you working on ADF and SOA suite using Jdeveloper and something goes wrong and you haven't got a clue what it is. This is mainly because the jdevelopers error reporting is really poor and it doesn't actually say which recent change has caused the XX error in your project.


Unfortunately there is no quick reference that could help resolving the issues. I often rollback to the last checked-in version to fix the issue. If your recent work is not checked in to source control its going to be a nightmare finding the problem.


The work around I have been using, to roll back unchecked-in work, is to zip all the files up using a scheduled windows script, so that I could go back whenever I want or to compare previous files.

Note: If you never used JDeveloper, you will have hard time understanding why we do this.


How to zip the folder in windows using script (No extra Software needed)

  • Create a file zip.vbs with following content

'Get command-line arguments.
Set objArgs = WScript.Arguments
InputFolder = objArgs(0)
ZipFile = objArgs(1)

'Create empty ZIP file.
CreateObject("Scripting.FileSystemObject").CreateTextFile(ZipFile, True).Write "PK" & Chr(5) & Chr(6) & String(18, vbNullChar)

Set objShell = CreateObject("Shell.Application")

Set source = objShell.NameSpace(InputFolder).Items

objShell.NameSpace(ZipFile).CopyHere(source)

'Required!
wScript.Sleep 20000


  • Create archieve.bat script with following content in the same folder

for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set "dt=%%a"
set "DATE=%dt:~0,8%"
set "HOUR=%dt:~8,4%"

set datestamp=%DATE%_%HOUR%
echo datestamp: "%datestamp%"

CScript C:\JDeveloper\mywork\zip.vbs  C:\JDeveloper\mywork\Project12c C:\JDeveloper\mywork\Project12c_%datestamp%.zip



This script will zip the Project12c folder into Project12c_YYYYMMDD_HHMM.zip format. e.g. Project12c_20151126_1000.zip

Now it could be either scheduled in windows or double click the archieve.bat file to zip the project whenever it's needed.

Note 2: If there is a better solution, please leave it on the comments section.

Wednesday, November 25, 2015

JDeveloper shortcuts

These are some of the useful shortcuts for Jdeveloper

Navigation

Find Java class: CTRL+ Minus (-)
Find Any file: CTRL + ALT + Minus (-)
Go to Recent File: CTRL + =
Go to Line Number: CTRL + g
Switch between open files: CTRL + tab
Back: ALT + Left
Forward: ALT + Right
Go to Last Edit: CTRL+Shift + Backspace
Locate a file in Project window: ALT + Home
Find Usages: CTRL + ALT + U


Editing

Completion Insight: CTRL + Space
Smart Insight: CTRL + ALT + Space
Parameter Insight: CTRL + SHIFT + Space
Complete Statement: CTRL + Shift + Enter
Expand Template: CTRL + Enter
Toggle Comment: CTRL + Slash (/)


Refactoring

Rename: CTRL + ALT + R
Move: CTRL + ALT + M
Inline: CTRL + ALT + N
Delete Safely: ALT + Delete
Introduce Field: CTRL + ALT + F
Introduce Variable: CTRL + ALT + V
Introduce Parameter: CTRL + ALT + P
Introduce Constant: CTRL + ALT + C
Extract Method: CTRL + ALT + X


Searching

Incremental Find Forward: CTRL + E
Incremental Find Backward Shift + E
Highlight Text: CTRL + ALT + H
Clear Highlight: CTRL + ALT + K


Run

Run Project: F11
Make Project: CTRL + F9
Rebuild Project: ALT+ F9


You could find more of these in JDeveloper > Tools > Preferences > Shortcuts and the keys could be reassigned as well.





Tuesday, November 24, 2015

Refresh MDS in SOA Suite

How to refresh or reload MDS in SOA suite (11g/12c)?

MDS is the best way to store the common artifacts in SOA suite.The soa suite caches these artifacts in the memory when it is accessed for the first, oracle does it to improve performance of the MDS access.

But the problem here is when the MDS artifacts, like DVM and wsdls, are redeployed with changes, the cache won't get cleared automatically leaving stale values in the cache.

The cached mds objects are cleared when the server is restarted and it takes a lot of time to restart SOA servers.

Alternatively SOA suite provides an MBEAN which can be used to clear the cache after deploying the MDS changes. Here are the steps


Steps to clear MDS cache

  • Login in to Oracle Weblogic em console 
    • e.g.; http://localhost:7001/em
  • Expand the Weblogic domain > DefaultDomain from the left hand side navigation tree
  • Right click on the DefaultDomain and select System Mbean Browser
                  
  • In the MBean Browser navigate to Application Define Mbeans -> oracle.mds.lcm > Server: DefaultServer > Application: soa-infra -> MDSAppRuntime > MDSAppRuntime Bean

  • And switch to Operations tab


  • Click on clearCache link and Invoke the method



Friday, November 13, 2015

How to export MDS to a file from SOA Suite

What is MDS in SOA suite?

MDS or Metadata Services is a key infrastructure component in Fusion Middleware which allows for sharing common artifacts among the SOA components. Some of the examples inlcude wsdls, xsd, dvm(domain value maps), transformations, policies, config files etc.

And in SOA Suite, SOA composites are also stored in the MDS when deployed to the servers.


How to export a MDS from SOA suite?
  1. Go to em console
    1. http://soaserver.name:portnumber/em
  2. Expand soa_domain and SOA on the left hand side tree
  3. Right click on the soa-infra > Administration > MDS Configuration


  4. Click on the Export button and save the zip file. This file should contain all the artifacts deployed on the SOA suite.