Tags
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)
WEBLOGIC_DOMAIN_HOME/bin/startWebLogic.sh
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://127.0.0.1:7101' //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' undeploy(appName) deploy(appName, path = warPath, retireTimeout = -1, upload = 'True') exit()
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:
http://stackoverflow.com/questions/1594667/war-vs-ear-file
Ear Structure:
http://middlewaremagic.com/weblogic/wp-content/uploads/2010/06/EAR_Application_Diagram.jpg
My git repository https://github.com/dineshkumar-cse/Team-Amazing which contains the scrips and application.