Tuesday, February 3, 2015

Scripts to setup WAS Profile for MDM v10.1


This is a great article from MDM Developers forum on IBM
Scripts to setup WAS Profile for MDM v10.1. This is done by the DEST tool, but is useful to have the scripts for autromation purposes.
a)
Commands to delete/create the Profile if not there/want to test from fresh:

manageprofiles.bat -delete -profileName AppSrv01
rmdir C:\IBM\WebSphere\AppServer\profiles\AppSrv01
manageprofiles.bat -create -profileName AppSrv01 -profilePath C:\IBM\WebSphere\AppServer\profiles\AppSrv01 -templatePath C:\IBM\WebSphere\AppServer\profileTemplates\default

b)
command to setup the WAS Profile with MDM artifacts ie SIB, JDBC, Qs etc

C:\IBM\WEBSPH~1\APPSER~1\java\jre\bin\java.exe -classpath C:\IBM\SDP\plugins\MDMDevEnvTooling\autotooling.jar com.ibm.mdm.setup.tooling.utils.ConfigWASStarter C:\IBM\SDP\plugins db2admin db2admin MDM101 C:\IBM\SQLLIB\java C:\WORKSP~1 DB2 AppSrv01 IBM-b65cd2b4faaNode01Cell IBM-b65cd2b4faaNode01 C:\IBM\WEBSPH~1\APPSER~1 ibm-b65cd2b4faa true null C:\workspaceMDM101\.metadata\.plugins\com.ibm.mdm.config.external.automation null null C:\WORKSP~1\.metadata\.plugins\com.ibm.mdm.config.external.automation\config_WAS_2014-04-30-15-08-59.log custSetupAppServer.py custSetupClasspath.py MDMServer 1010 1 50000 server1

Not tested, but this is Oracle equivalent

C:\<WAS home>\java\jre\bin\java.exe -classpath C:\IBM\SDP\plugins\MDMDevEnvTooling\autotooling.jar com.ibm.mdm.setup.tooling.utils.ConfigWASStarter C:\IBM\SDP\plugins <ora user> <ora password> MDM101 <ORA PATH TO JDBC> C:\WORKSP~1 ORACLE AppSrv01 <localhost name>Node01Cell <localhost name>Node01 C:\IBM\WEBSPH~1\APPSER~1 <localhost name> true null C:\<workspace home>\.metadata\.plugins\com.ibm.mdm.config.external.automation null null C:\WORKSP~1\.metadata\.plugins\com.ibm.mdm.config.external.automation\config_WAS_2014-04-30-15-08-59.log custSetupAppServer.py custSetupClasspath.py MDMServer 1010 1 <ORA port #> server1

c)
command to deploy MDM.ear file to WAS Profile

C:\IBM\SDP\plugins\MDMDevEnvTooling\controller\deploy.bat AppSrv01 IBM-b65cd2b4faaNode01Cell IBM-b65cd2b4faaNode01 C:\IBM\WEBSPH~1\APPSER~1 true C:\IBM\SDP\plugins C:\Users\IBM_AD~1\AppData\Local\Temp\DEST\ear\MDM.ear MDMServer C:\workspaceMDM101\.metadata\.plugins\com.ibm.mdm.config.external.automation\scripts\custDeployApp.py C:\workspaceMDM101\.metadata\.plugins\com.ibm.mdm.config.external.automation\scripts\uninstallApplication.py DB2UDBNT_V82_1 server1

d)
To set WAS Variable for Oracle path:

cd C:\IBM\WebSphere\AppServer\bin
wsadmin -f setWASVariable.py


File setWASVariable.py:


import sys
global AdminConfig
global AdminTask

#AdminTask.setVariable('[ -scope Server=server1 -variableName DB2_JDBC_DRIVER_PATH -variableValue c:\\ibm\\sqllib1]')
AdminTask.setVariable('[ -scope Server=server1 -variableName ORACLE_JDBC_DRIVER_PATH -variableValue c:\\oracle\\appl1]')
AdminConfig.save()

print ""
print "  Done setting up environment."
print ""

Original Link: 

https://www.ibm.com/developerworks/community/blogs/64033fdd-4a35-4733-852f-a39abcdf4fb3/entry/scripts_to_setup_was_profile_for_mdm_v10_1?lang=en

Monday, February 2, 2015

Class Not Found Exception for DB2 Driver in WebSphere Runtime

[1/30/15 10:03:27:613 EST] 0000001f SystemErr     R java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver

[1/30/15 10:03:27:613 EST] 0000001f SystemErr     R   at java.lang.Class.forNameImpl(Native Method)

The above error is pretty common when configuring a DB2 driver and trying to establish a connection. Although you many connect to the DB in some circumstances, you might get a runtime error at Class loader time when the Driver is unable to load even when you have that driver jar in your build path.

Solution: 

Place the jar files below in the location specified below. 
  1. Db2jcc.jar
  2. Db2jcc4.jar
  3. Db2jcc_license_cu.jar

PATH: 
C:\Program Files (x86)\IBM\SDP\runtimes\base_v7\lib