Friday, 1 August 2014

Remove composite/data/files in Oracle SOA MDS - Illegal character in path at index: oramds:/deployed-composites


Hi folks,

I would like to share the strange issue that I have faced recently in our SOA environments.

Mistakenly I have placed a file in the composite folder which has gaps in the file name
eg: oracle_soa  suite.xml.
It has been built successfully and deployed in one environment and when we are trying to deploy the same code onto another Env but its throwing the below error.

Deploying on "/Farm_BPM_domain/BPM_domain/dev_soa_cluster" failed!
There was an error deploying the composite on dev_soa2: Operation failed - Member(Id=3 Timestamp=2014-08-01 03:22:25.068 Address=41.75:8038 MachineId=1177 Location=site: machine:m1-dev process:1755 Role=Weblogic):Error in getting XML input stream: oramds:/deployed-composites/Se/SeProcess_rev1.0/SCA-INF/classes/HSP-21215- Sysadmin_Instructions.docx: Illegal character in path at index 90: oramds:/deployed-composites/Se/SeProcess_rev1.0/SCA-INF/classes/Sysadmin  _Instructions.docx; . Please see the server diagnostic logs on dev_soa2 for details.


Issue:- When we were deployed the composite for the first time unexpectedly it went and sat in MDS location and then we are trying to redeploy the composite again but its throwing the exception as it is having invalid documents in MDS.

Solution:- I just removed the folder in MDS from the back-end and it worked.

MDS:  Composite instance and runtime information are stored in the SOAINFRA schema. Commonly used metadata like WSDLs, XSDs, rules, fault policies, etc. as well as composite deployments are stored within the MDS schema.

With every deployment / import of the metadata artifacts a new document version will be created in the MDS. This means that re-importing an updated WSDL-file into the MDS does not delete the previous version of the document. Furthermore we sometimes need to remove unnecessary and unwanted files from the repository. If this is not considered you might end in problems like below:



OPTION 1: Remove directories and files from MDS using WLST
1) Start WLST from SOA_HOME/common/bin/wlst.sh.

Example:
  
[oracle@soabpm-vm ~]$ cd /oracle/fmwhome/Oracle_SOA1/common/bin 
[oracle@soabpm-vm bin]$ ./wlst.sh 
wls:/offline>
 

2) Execute the following command: sca_removeSharedData('http://<soahost>:<soaport>', 'directory', 'user', 'password')

Example (delete folder 'interfaces' and all its subdirectories and files):

wls:/offline> sca_removeSharedData(‘http://localhost:8001’, ‘interfaces’, ‘weblogic’, ‘welcome1’)

 

Note: With the command above you can just remove directories and files which are stored under "apps".


OPTION 2: Remove directories and files from MDS using ANT

Oracle provides some ANT scripts which can be used to integrate the "remove" command into your central build & deploy proccess. Just search for the "removeSharedData" command in ant-sca-deploy.xml. On the server this file is located under SOA_HOME/bin. You can also find the file in your JDeveloper install folder under MIDDLEWARE_HOME/jdeveloper/bin.

1) Execute the command: ant -f ant-sca-deploy.xml removeSharedData -DserverURL=server.url -DfolderName=folder.name -Drealm=realm -Duser=user -Dpassword=password -DfailOnError=true/false

Example (delete folder 'interfaces' and all its subdirectories and files):
  
ant -f ant-sca-deploy.xml removeSharedData -DserverURL=http://localhost:8001 -DfolderName=interfaces"
  

Note: With the command above you can just remove directories and files which are stored under "apps". See the Oracle Fusion Middleware Developer's Guide for Oracle SOA Suite for a detailed description of the parameters.


OPTION 3: Remove files from MDS using WLST
1) Start WLST from SOA_HOME/common/bin/wlst.sh

Example:

[oracle@soabpm-vm ~]$ cd /oracle/fmwhome/Oracle_SOA1/common/bin
[oracle@soabpm-vm bin]$ ./wlst.sh
wls:/offline>

 

2) Connect to the SOA server: connect('user', 'password', 't3://<soahost>:<soaport>')

Example: 

wls:/offline> connect('weblogic', 'welcome1', 't3://localhost:8001') 
 

3) Execute the command: deleteMetadata(application=’application-name', server=’soaserver-name’, docs=’absolutePath’)

Example (delete all files in '/apps/interfaces' as well as the files in its subdirectories): 
  
wls:/...> deleteMetadata(application='soa-infra',server='soa_server1',docs='/apps/interfaces/**') 
 

Note: With the command above all files in directory 'apps/interfaces' will be deleted. Please note the double asterisk (**) at the end of the this parameter. The asterisk (*) represents all documents under the current directory. The double asterisk (**) represents all documents under the current directory and also recursively includes all documents in subdirectories. Furthermore see the Oracle Fusion Middleware WebLogic Scripting Tool Command Reference for a detailed description of the valid arguments.


OPTION 4: Remove files from MDS using MBean Browser

You can call the command "deleteMetadata" also from the Enterprise Manager / MBean Browser.

1) Login to EM (http://host:port/em)
2) Expand SOA
3) Right-click on soa-infra
4) Select Administration -> MDS Configuration
5) Click Runtime MBean Browser
6) Click Operations tab
7) Click deleteMetadata operation
8) Provide parameters:
      docs - list of entries to remove (fully qualified path, eg: /apps/interfaces/**)
      restrictCustTo - default
      excludeAllCust - false
      excludeBaseDocs - false
      excludeExtendedMetadata - false
      cancelOnException - true
9) Click Invoke

For clear understanding the options of this method refer the link 


OPTION 5: Purge Metadata Version History using Fusion Middleware Control

For database-based MDS, you can purge the metadata version history using the Fusion Middleware Control (Enterprise Manager). This operation purges the version history of unlabeled documents from the application's repository partition. The tip version (the latest version) is not purged, even if it is unlabeled.

1) Login to EM (http://host:port/em)
2) Expand SOA
3) Right-click on soa-infra
4) Select Administration -> MDS Configuration
5) Scroll to the “Purge” section: enter a value in the Purge all unlabeled past versions older than field and click on the Purge button
6) In the Confirmation dialog box, click Close
How to view the MDS content


After you removed files and/or directories from the MDS you might want to have a look at the actual content. The easiest way to do this is to create a MDS connection in JDeveloper.


Happy Learning...!!!!!!!!!!!! Fun Sharing.........!!!!!!!!!

No comments:

Post a Comment