WebLogic 11g:Override Production enabled Security

Michel Schildmeijer 1

When you configure yor domain in WebLogic 11g, by screen install or by scripts, when you choose Production Mode security will be more strict as in Development Mode.

Normally it would require a boot.properties afterwards to create in order to start; anyway, all kinds of unnecessary steps.

In a scripted install with WLST , here is a way to override it… watch wonderous python!:lol:

First, in your script define some variables:

def createBootPropertiesFile(domain_dir, username, password) :
if not os.path.exists(domain_dir + “/servers/” + “AdminServer” + “/security”):
os.makedirs(domain_dir + “/servers/” + “AdminServer” + “/security”)
filename=(domain_dir + “/servers/” + “AdminServer” + “/security/boot.properties”)
f=open(filename, ‘w’)
line=’username=’ + username + ‘\n’
f.write(line)
line=’password=’ + password + ‘\n’
f.write(line)
f.close()
else:
print ‘domain_dir + “/servers/” + “AdminServer” + “/security” exists’

Then, finally in your WriteDomain statement include

writeDomain(properties.domain_dir)
if (properties.production_mode_enabled):
createBootPropertiesFile(properties.domain_dir, ‘weblogic’, properties.weblogic_password)
else:
print ‘Dry run completed, if you still have an interactive session (started with wlst -i), ‘ + \
‘run: writeDomain(\” + properties.domain_dir + ‘\’) to write the domain to disk’
if (properties.production_mode_enabled):
print ‘and createBootPropertiesFile(\” + properties.domain_dir + ‘\’,\’weblogic\’,’+ ‘\” + properties.weblogic_password + ‘ \’)’

One thought on “WebLogic 11g:Override Production enabled Security

Comments are closed.

Next Post

Java Developers: Make the Database Work for You!

Facebook0TwitterLinkedinThis article accompanies the similarly named article in the Dutch Java Magazine. It provides additional resources, some source code and an invitation to the 4 February Masterclass by Lucas Jellema that presents a detailed study of the topics raised in this article. The article itself: Click JavaMagazine_LaatDeDatabaseVoorJeWerken_partOne_dec2010.pdf for this article. Friday […]