Friday, January 29, 2010

Running WLST from Ant

Running WLST from Ant


http://download.oracle.com/docs/cd/E12839_01/web.1111/e13715/using_wlst.htm#insertedID6


<taskdef name="wlst" classname="weblogic.ant.taskdefs.management.WLSTTask" classpathref="wl.ant.classpath"/>



    <target name="create-domain-using-wlst">
<echo message=" Creating domain using WLST ... "/>
<wlst debug="true" failOnError="true" fileName="./wlst/createDomain.py">
</wlst>
</target>

Monday, January 25, 2010

Create domain using WLST

Documentation root
http://download.oracle.com/docs/cd/E12839_01/index.htm

Creating Domain Templates Using the Domain Template Builder
http://download.oracle.com/docs/cd/E12839_01/web.1111/e14139/toc.htm

Prepare Scripts and Files with Replacement Variables
http://download.oracle.com/docs/cd/E12839_01/web.1111/e14139/tempbuild.htm#insertedID14


Creating Domains Using WLST Offline
http://download.oracle.com/docs/cd/E12839_01/web.1111/e13715/domains.htm#i1018386

Creating Templates and Domains Using the Pack and Unpack Commands
http://download.oracle.com/docs/cd/E12839_01/web.1111/e14144/toc.htm




WLST command reference
http://download.oracle.com/docs/cd/E12839_01/web.1111/e13813/quick_ref.htm#insertedID0


readTemplate
http://download.oracle.com/docs/cd/E12839_01/web.1111/e13813/reference.htm#i1029278


writeDomain
http://download.oracle.com/docs/cd/E12839_01/web.1111/e13813/reference.htm#i1003687

adminServerName = "AdminServer"
adminServerUrl = "t3://localhost:7001"
adminUser = "weblogic"
adminPassword = "weblogic123"

domainName = "DaVeDomain"
domainHome = "/home/dave/" + domainName

templateName = "/app/bea/user_templates/" + domainName + ".jar"

print "Reading template " + templateName

readTemplate(templateName)

set("Name",domainName)

ls()

cd("/Security/" + domainName + "/User/" + adminUser)
cmo.setPassword(adminPassword)


writeDomain(domainHome)

closeTemplate()

startServer(adminServerName,
domainName,
adminServerUrl,
adminUser,
adminPassword,
domainHome,
block="true")

connect(adminUser, adminPassword, adminServerUrl)

ls()

shutdown()

exit()



startMyWeblogic.sh

DOMAIN_NAME="@DOMAIN_NAME"

DOMAIN_HOME="@DOMAIN_HOME"

ADMIN_URL="http://@SERVER_HOST:@SERVER_PORT"


. ${DOMAIN_HOME}/bin/setDomainEnv.sh

Weblogic deployment

Deploying Applications to Oracle WebLogic Server
http://download.oracle.com/docs/cd/E12839_01/web.1111/e13702/toc.htm


Controlling Deployment File Copying with Staging Modes
http://download.oracle.com/docs/cd/E12839_01/web.1111/e13702/deploy.htm#i1027041

WLST deploy
http://download.oracle.com/docs/cd/E12839_01/web.1111/e13813/reference.htm#i1024284


deploy(appName, path, [targets], [stageMode], [planPath], [options])

Tuesday, January 5, 2010

Client connecting to Weblogic SSL port

Configuring Weblogic Security


Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3s://weblogic:7002");
env.put(Context.SECURITY_PRINCIPAL, "javaclient");
env.put(Context.SECURITY_CREDENTIALS, "javaclientpassword");
ctx = new InitialContext(env);




WLST Client has to configure trust using these properties:
java -Dssl.debug=true -Dweblogic.security.CustomTrustKeyStoreFileName=c:\app\cert\ServerTrust.jks
-Dweblogic.security.TrustKeyStore=CustomTrust
-Dweblogic.security.SSL.trustedCAKeyStore=c:\app\cert\ServerTrust.jks
weblogic.WLST connectSSL.py


http://download.oracle.com/docs/cd/E12839_01/web.1111/e13711/ssl_client.htm#i1067487