, ,

Using jdeveloper to host the application is painful. It abstracts lot of things. when we try to build and deploy our application by our own code, we will come to  know lot of stuffs happening behind the scenes.

Start the web logic server (.sh file)


we need to set the web logic environment, it sets few variables like WL_HOME, JAVA_HOME, CLASSPATH, PATH, etc.

. $WEBLOGIC_HOME/bin/setWLSEnv.sh
java weblogic.WLST ./weblogicdeploy.py

The following is the python code to deploy our application in web logic server.

import re
warPath = 'WebService/target/build/dist/webservice.ear'
appName = 'webservice'
weblogicUrl = 't3://'  //change the port number depending on our weblogic server configuration
userName = 'weblogic'
password = 'weblogic1'
connect(userName, password, weblogicUrl)
appList = re.findall(appName, ls('/AppDeployments'))
if len(appList) >= 1:
print 'undeploying application'
deploy(appName, path = warPath, retireTimeout = -1, upload = 'True')

you can use a war if it contain simple java classes and libs, ear contains same with wars inside (can have multiple applications inside it).

Difference between ear, war, jar:
Ear Structure:

My git repository https://github.com/dineshkumar-cse/Team-Amazing which contains the scrips and application.