Showing posts with label WLST. Show all posts
Showing posts with label WLST. Show all posts

Thursday, November 14, 2019

creating a domain with WLST


in WLS 12.1 + the config.sh script no longer supports a silent installation

./config.sh -silent -response response_file

see Document "Can config.sh be Run in Silent or Non-GUI Mode in Weblogic 12c ? (Doc ID 2370636.1) "

"The configuration tool only works in GUI mode with 12.1.x and above. In order to create a domain without using a GUI the WLST tool will need to be used. "


this is really stupid, 99% of Linux machines are headless

and using UI defeats automation



here how to create a domain with WLST:

https://docs.oracle.com/middleware/1221/wls/WLSTG/domains.htm#WLSTG429

but when you do:

selectTemplate('Base WebLogic Server Domain')

you get a

Caused by: com.oracle.cie.domain.script.ScriptException: 60708: Template not found.

60708: Found no templates with Base WebLogic Server Domain name and null version

60708: Select a different template.

        at com.oracle.cie.domain.script.ScriptExecutor.selectTemplate(ScriptExecutor.java:556)

        at com.oracle.cie.domain.script.jython.WLScriptContext.selectTemplate(WLScriptContext.java:580)


do a showAvailableTemplates()


'20849: Available templates.\n20849: Currently available templates for loading: WebLogic Advanced Web Services for JAX-RPC Extension:12.2.1.3.0\nWebLogic Advanced Web Services for JAX-WS Extension:12.2.1.3.0\nWebLogic JAX-WS SOAP/JMS Extension:12.2.1.3.0\nBasic WebLogic Server Domain:12.2.1.3.0\nWebLogic Coherence Cluster Extension:12.2.1.3.0\n\n20849: No action required.\n'



so the solution is


selectTemplate('Basic WebLogic Server Domain', '12.2.1.3.0')


To find out more info on the domain template (like wls.jar) open its template-info.xml




Friday, February 12, 2016

Quick script to create a domain for WLS 12.2.1

in selectTemplate(), make sure you specify the right version for the WLS distribution you are installing, otherwise you get the error "60708: Found no templates with Basic WebLogic Server Domain name and 12.2.1.0 version"


# https://docs.oracle.com/middleware/1221/wls/WLSTC/reference.htm#WLSTC3772
# Use selectTemplate followed by loadTemplates in place of readTemplate.

HOSTNAME='myhost.mydomain.com'
LISTENPORT=7012
SSLLISTENPORT=7022
JAVAHOME='/usr/java/jdk1.8.0_65'
DOMAINHOME='/opt/oracle/fmw1221/user_projects/domains/mydomain'

selectTemplate('Basic WebLogic Server Domain','12.2.1.2')
loadTemplates()

#readTemplate is deprecated
#readTemplate('/opt/oracle/fmw1221/wlserver/common/templates/wls/wls.jar') 

# Admin Server SSL and Non-SSL
print('Creating Server - Admin Server')
cd('Servers/AdminServer')
set('ListenAddress', HOSTNAME)
set('ListenPort', LISTENPORT)

create('AdminServer','SSL')
cd('SSL/AdminServer')
set('Enabled', 'True')
set('ListenPort', SSLLISTENPORT)

# Security
print('Creating Password')
cd('/')
cd('Security/base_domain/User/weblogic')
set('Password', 'Welcome1')
#cmo.setPassword('Welcome1')

# Start Up
print('Setting StartUp Options')
# Setting the JDK home. Change the path to your installed JDK for weblogic
setOption('JavaHome', JAVAHOME)
setOption('OverwriteDomain', 'true')

# Create Domain to File System
print('Writing Domain To File System')
# Change the path to your domain accordingly
writeDomain(DOMAINHOME)
closeTemplate()

# Read the Created Domain
print('Reading the Domain from In Offline Mode')
readDomain(DOMAINHOME)

# updating the changes
print('Finalizing the changes')
updateDomain()
closeDomain()

# Exiting
print('Exiting...')
exit()




Sunday, October 25, 2015

Starting a Managed Server with WLST and NodeManager

1) factor out commonly used constants into a setenv.sh file:

#!/bin/sh

#prefix for domain 
PREF=osbpr1
Interface=bond0
AdminIP=10.56.5.119
NetMask=255.255.255.0

JAVA_HOME="/opt/oracle/java"
MW_HOME="/opt/oracle/fmw"
WL_HOME="${MW_HOME}/wlserver_10.3"

DOM_HOME=/opt/oracle/domains

LOG_HOME=/var/log/weblogic
# home of certificates
CERT_HOME=/opt/oracle/certs

JAVA_VERSION=java-1.6.0-sun-1.6.0.29.x86_64


2) prepare a NodeManager userConfigFile:

/opt/oracle/domains/osbdv1do/nmuserconfigfile.secure

containing
weblogic.management.username={AES}hU8qRGjiFmqK6kHqG8yZlpXTD+KZGjld85q7sIgMP4w\=
weblogic.management.password={AES}xF+6rgG5NqNYBxDzqR/MlLlR1iYSqQezJrJ+Mi52gTc\=


and a userKeyFile /opt/oracle/domains/osbdv1do/nmuserkeyfile.secure



3) Prepare a startAdmin.py file (in reality it can start ANY server, not only the admin):

adminName = sys.argv[1]
domainName = sys.argv[2]
nmHost = sys.argv[3]

nmPort = '5556'
domHome='/opt/oracle/domains/' + domainName

print nmHost, nmPort, domainName, adminName

# -----------------------------------------------------------------------------
# connect to NodeManager
# -----------------------------------------------------------------------------
nmConnect( userConfigFile=domHome + '/nmuserconfigfile.secure', userKeyFile=domHome + '/nmuserkeyfile.secure', host=nmHost, port=nmPort, domainName=domainName, domainDir=domHome, nmType='plain' )

# -----------------------------------------------------------------------------
# start the server
# -----------------------------------------------------------------------------
try:

    nmStart( adminName, domHome )

except:
    nmDisconnect()
    exit('y', 4)


nmDisconnect()





Wednesday, March 25, 2015

WLST / Python: execfile versus import

I have lately come across to some usage of "execfile".

I had immediately the impression "this stinks, why don't they use import instead?"
I also read here that execfile is stinky-stinky.

Let's see if they are actually equivalent.
vi toimport.py
def hello():
  print 'helloooo!'

To use the method I run the wlst.sh and type:
execfile('toimport.py')
hello()
helloooo!

ok cool, so execfile has the effect of "inlining" your code. This is very 1960-programming style. All is just a big ball of mud.

If instead of execfile I use import:
import toimport

hello()
NameError: hello


toimport.hello()
helloooo!

the apparent advantage is that the method is QUALIFIED by its module. Disadvantage is that you must type the extra module name.

The "better" way (IMHO) is to explicitly import the method:
from toimport import hello

hello()
helloooo!



Needless to say, one should strive for true OO programming, so that the method hello() is defined for a specific class of objects... so please steer away from this "static method compulsive programming syndrome (SMCPS)".

PS execfile is deprecated in Python 3... so just get used to NOT using it...

Poor man's unittests in WLST

Python comes with a very elaborate unittest module , and there is no reason NOT to use it, unless a) you are bound to a VERY old implementation of Python B) you are lazy and stupid like me

The good news is that it's really easy to implement a "poor man's" version of a unittest:

totalErrors = 0
totalTests = 0

def assertTrue(booleanCondition, message):
  global totalTests, totalErrors
  totalTests = totalTests + 1
  if (not booleanCondition):
    print "ERROR:", message
    totalErrors = totalErrors + 1



#your testing code here

assertTrue(domain is not None, "domain is not None")


#print test summary

print ""
print "totalTests=", totalTests
if (totalErrors == 0):
  print 'SUCCESS'
else:
  print 'FAILURE, totalErrors=', totalErrors
  





One big step forward it to use the inspect module to print the actual assertTrue statement being executed - so you avoid having to pass also the message:

import inspect

totalErrors = 0
totalTests = 0

def assertTrue(booleanCondition, message):
  global totalTests, totalErrors
  totalTests = totalTests + 1
  if (not booleanCondition):
    frame,filename,line_number,function_name,lines,index = inspect.stack()[1]
    print "ERROR:", message, frame,filename,line_number,function_name,lines,index
    totalErrors = totalErrors + 1



#your testing code here

assertTrue(domain is not None)


#print test summary

print ""
print "totalTests=", totalTests
if (totalErrors == 0):
  print 'SUCCESS'
else:
  print 'FAILURE, totalErrors=', totalErrors
  





I love being minimalistic and lazy....

Monday, March 23, 2015

Extending WLST with custom Java classes - the case of JSON parsing

I have recently looked into how to "modernize" the WLST Jithon/Python version - still sadly a prehistoric 2.2.1, while the recent-most Python version is 3.4.2 (Oracle.... how about doing something about WLST? ).

Here is some instructions on how to try this upgrade - but it's not supported, so do it at your own risk.
http://stackoverflow.com/questions/11881659/wlst-vs-jython-weblogic-10-3-3

This is an increasingly painful limitation of WLST, that it can't use any "modern" Python package, like json.

The good news is that it's relatively easy to expand WLST with any Java library you wish: just add the JAR to the CLASSPATH in /opt/oracle/middleware11g/wlserver_10.3/common/bin/wlst.sh, import the Java class with "from com.bla.mypackage import MyClass" and you can use the custom code.

In case of json parsing, there is a popular Google GSON library you could incorporate:

http://search.maven.org/#artifactdetails|com.google.code.gson|gson|2.3.1|jar which comes with a rich User Guide

The API of this GSON is here ... it seems to be aimed at parsing a JSON string directly into a Java object... there doesn't seem to be room for a more casual, random approach.

The Oracle solution is more "casual" http://www.oracle.com/technetwork/articles/java/json-1973242.html and reminiscent of a DOM approach to parsing... more suitable for a quickly hacked deserialization.

Anyway.... I wish I could simply use the Python JSON module...

Thursday, March 19, 2015

WLST difference between offline and online

I have a WLST script written for ONLINE use, and I want to convert it into an OFFLINE script... It's mostly a philosophical issue, I believe it's awkward to CONFIGURE a domain while the domain's ADMIN is running, it's a stupid requirement to have to start the ADMIN.

Google finds these 2 links but they don't tell you much.
https://docs.oracle.com/cd/E24329_01/web.1211/e24491/wlst_faq.htm#WLSTG243
http://wlstbyexamples.blogspot.ch/2010/01/wlst-offline-vs-wlst-online.html#.VQmoh0YzDOo

FIRST thing: you don't "connect" to a URL (t3..), but you readDomain("/path/to/mydomain'), and you don't "edit/startEdit" any longer.

You create(msname, 'Server') to create a server.... don't use cmo.createServer() !

You can cd('/Servers' + msname) and you will see it WITHOUT subdirectories (like ServerStart, SSL....)... this is NORMAL, as wlsf-offline reflects the structure of the config.xml that would be written, and the config.xml is a LAZY document, which doesn't specify the defaults.... so if a SSL option has not been yet customized, the whole folder will not appear.

So you will need to do "create(msname, 'SSL')" and "create(msname, 'ServerStart')" before you can cd('/Servers/' + msname + '/ServerStart') and do some set(property, value) commands...

The typical "create you will run are:

create(name, 'Server')
create(name, 'ServerStart')
create(name, 'SSL')
create( name, 'Log')
create( name, 'WebServer')
create(name, 'DefaultFileStore')
create(name, 'DataSource')

At the end, you "updateDomain()" to persist your changes.



Thursday, July 10, 2014

wlst goes in OutOfMemory... what to do?

If you invoke the wlst.sh, it's a can of worms of intricate shall calls, hard to disentangle:

/opt/oracle/fmw11_1_1_5/osb/common/bin/wlst.sh
/opt/oracle/fmw11_1_1_5/osb/common/bin/setHomeDirs.sh
/opt/oracle/fmw11_1_1_5/oracle_common/common/bin/wlst.sh
/opt/oracle/fmw11_1_1_5/wlserver_10.3/common/bin/wlst.sh
/opt/oracle/fmw11_1_1_5/wlserver_10.3/server/bin/setWLSEnv.sh



plus other stuff....

After some hunting, I discover that the JVM memory options are set in:


/opt/oracle/fmw11_1_1_5/wlserver_10.3/common/bin/commEnv.sh
and hardcoded to
MEM_ARGS=-Xms32m -Xmx200m -XX:MaxPermSize=128m

and there is no way you can pass these parameters BEFORE calling the script...

So finally your only option is to change commEnv.sh persistently...

Don't tell me this sucks, I already know...

So if you get the dreaded "Error: GC overhead limit exceeded", you can increase the MEM_ARGS settings or try to disable the error (I don't think this will help) with
-XX:-UseGCOverheadLimit



Friday, February 14, 2014

WLST to create machines

run wlst, and stay in offline mode. I read the domain "osbpl1do", which has already 1 machine, and I want to add an extra machine.
readDomain('/opt/oracle/domains/osbpl1do')
cd('AnyMachine')
ls()
and here I see a single instance of the previous machine.
Now I will add the second machine:
cd('/')
MACHINENAME='pippomachine'
create(MACHINENAME, 'UnixMachine')

I get this:
Error: create() failed. Do dumpStack() to see details.
I do dumpStack():
com.oracle.cie.domain.script.jython.WLSTException: java.lang.ArrayIndexOutOfBoundsException: 2

however, if I do
cd('AnyMachine')
ls()

I see the new machine listed. However, I see a duplicate entry for the previously existing machine. I do then:
updateDomain()

and I restart the servers. I verify that the "machine" tag is created in config.xml.
I have no clue what is going on... I do the same with WLST online:
connect(...)
cd('Machines')
ls()
and I see the previous machine
edit()
startEdit()
cd('Machines')
MACHINENAME='pippomachine'
create(MACHINENAME, 'UnixMachine')
and I get success: MBean type UnixMachine with name pippomachine has been created successfully.
save()
activate()
and all is fine.


However, if I create a brand new domain without machines:
createDomain('/opt/oracle/fmw11_1_1_5/wlserver_10.3/common/templates/domains/wls.jar', '/opt/oracle/domains/pippodomain', 'weblogic', 'weblogic1')

readDomain( '/opt/oracle/domains/pippodomain')
MACHINENAME='pippomachine'
create(MACHINENAME, 'UnixMachine')
updateDomain()
closeDomain()
and here again all is fine. But is I read again the same domain, and try to create a pippomachine2, again I get ArrayOutOfBoundException. HOWEVER, the machine is correctly added to the config.xml.


CONCLUSION:

it seems that WLST offline fails to behave properly when there is already 1 machine present. However this specific ArrayOutOfBoundException MAYBE can be ignored, since APPARENTLY the configuration is updated.
If you are confused, so am I.



In Oracle Support I found "Run pasteConfig.sh on Unix, WLST command setName() throw ArrayIndexOutOfBoundsException (Doc ID 1547420.1)"

"This issue was caused by internal Bug 10221694 ( SETNAME FOR MACHINE OF TYPE "UNIX MACHINE" IS THROWING ARRAYINDEXOUTOFBOUNDSEXCEPTION) and Bug 9728926 (CREATE UNIXMACHINE IN WLST OFFLINE DOESN'T WORK PROPERLY)"

so at least we know that there IS an issue and we are not totally stupid.

For patch informations, look into "WLSTException When Configuring Whole Server Migration In WLST Offline Mode (Doc ID 1463127.1)"



Monday, January 20, 2014

zxJDBC, invoking stored procedures passing parameters (zxjdbc callproc)

for the 2 world users of zxJDBC:
This works, the stored procedure is defined as:
create or replace 
PROCEDURE PVTESTPROC AS 
BEGIN
  INSERT INTO PVTEST (COLUMN1) VALUES ('mamma');
  commit;
END PVTESTPROC;



and the Python code to invoke it:

#grab somehow a connection object (conn) for the DB
....
#then invoke stored procedure
procedure='PVTESTPROC'
c  = conn.cursor()
params = [None]
c.callproc(procedure, params)


This fails, I have simply added a parameter:

create or replace 
PROCEDURE PVTESTPROC
(
  PARAM1 IN VARCHAR2  
) AS 
BEGIN
  INSERT INTO PVTEST (COLUMN1) VALUES (PARAM1);
  commit;
END PVTESTPROC;


and the Jython code is the same as before, but with params = ['PLUTO'] . This fails with "PLS-00306: wrong number or types of arguments in call to 'PVTESTPROC'"

see also same problem reported here http://code.activestate.com/lists/python-list/291477/ Frankly I give up.... I think there is definitely some problem with such an old version of Python

Tuesday, December 10, 2013

Remove annoying debug info from wlst.sh

I normally run /opt/oracle/fmw11_1_1_5/osb/common/bin/wlst.sh for all WLST commands.

This print a page of debug information (mostly, twice the CLASSPATH and once the PATH.
It's a lot of unneeded info which clutters the logs.

The script will invoke in sequence:
/opt/oracle/fmw11_1_1_5/osb/common/bin/setHomeDirs.sh
/opt/oracle/fmw11_1_1_5/utils/config/10.3/setHomeDirs.sh
/opt/oracle/fmw11_1_1_5/oracle_common/common/bin/wlst.sh

...
and plenty of other scripts, but finally it will call /opt/oracle/fmw11_1_1_5/wlserver_10.3/common/bin/wlst.sh
it's interesting that we have 4 wlst.sh scripts:
/opt/oracle/fmw11_1_1_5/oracle_common/common/bin/wlst.sh
/opt/oracle/fmw11_1_1_5/osb/common/bin/wlst.sh
/opt/oracle/fmw11_1_1_5/osb/harvester/wlst.sh
/opt/oracle/fmw11_1_1_5/wlserver_10.3/common/bin/wlst.sh

One echo is in /opt/oracle/fmw11_1_1_5/wlserver_10.3/common/bin/wlst.sh
The other echo CLASSPATH=$CLASSPATH statement is in
/opt/oracle/fmw11_1_1_5/wlserver_10.3/server/bin/setWLSEnv.sh


Wednesday, December 4, 2013

WLST: certificate parsing exception PKIX

"The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object"

it turned out that I had to add to the WLST trust store (wlsTrust.jks) the root certificate of the CA certifying the Identity Store of the domain

and add this to wlst.sh :

export WLST_PROPERTIES="-Dweblogic.security.SSL.ignoreHostnameVerification=true -Dweblogic.security.TrustKeyStore=CustomTrust -Dweblogic.security.CustomTrustKeyStoreFileName=/opt/oracle/certs/wlsTrust.jks -Dweblogic.security.CustomTrustKeyStorePassPhrase=bla -Dweblogic.security.CustomTrustKeyStoreType=JKS"



Friday, November 22, 2013

WLST to monitor all Datasources on all Managed Servers by connecting only to the Admin

#connect to the admin server

domainRuntime()
allservers=ls('/ServerRuntimes/', returnMap='true')
for server in allservers:
    allds = ls('/ServerRuntimes/' + server + '/JDBCServiceRuntime/' + server + '/JDBCDataSourceRuntimeMBeans', returnMap='true')
    for ds in allds:
        cd ('/ServerRuntimes/' + server + '/JDBCServiceRuntime/' + server + '/JDBCDataSourceRuntimeMBeans/' + ds)
        print server, ds, cmo.getActiveConnectionsCurrentCount()




Sunday, November 17, 2013

WLST reading a property file

thepropertyfile is a regular property file:
bla=value1
mumble=value2=3

This function handles also the case where a value contains a = sign


def getProperties(thepropertyfile):
    properties = dict()
    for line in open(thepropertyfile):
        strippedline = line.strip()
        if "=" in strippedline:
            key,value = line.strip().split('=', 1)
            properties[key] = value
    return properties


to get the value, do properties.get('bla')


Tuesday, November 12, 2013

Calling an Oracle Stored Procedure in Java or in Python

I needed to schedule the execution of a Stored Procedure from a cron job.... somebody advised me to use a Java class to do that.
It proved to be really cumbersome... I have followed this example and it's working, but it's very verbose and ugly.
Also, in Java there is no built-in support for getopt style of reading CLI parameters, and using the gnu getopt library seemed overkill to me.
So at the end I will keep using good old zxJDBC from a Python (WLST) script, which supports stored procedures in a VERY simple way: http://www.jython.org/archive/21/docs/zxjdbc.html
db = zxJDBC.connect(...)
c = db.cursor()
params = [None]
c.callproc("funcout", params)

The only disturbing thing is that the startup time for WLST is a bit long, much longer than for a JVM.... but who cares, really, for a job who has to be called once every 10 minutes...


Friday, November 1, 2013

wlst redirect

sometimes we don't want to clutter the stdout with the result of a ls(): http://docs.oracle.com/cd/E15051_01/wls/docs103/config_scripting/using_WLST.html#wp1094015 This works quite well:
redirect('/dev/null', 'false')
allds=ls('/SystemResources/', returnMap='true')
stopRedirect()



Thursday, October 31, 2013

WLST: expand the PYTHONPATH

Official doc here: http://docs.python.org/2/tutorial/modules.html#the-module-search-path
I run this test:

/opt/oracle/fmw11_1_1_5/osb/common/bin/wlst.sh

wls:/offline> print sys.path


['/opt/oracle/fmw11_1_1_5/wlserver_10.3/server/lib/weblogic.jar/Lib'
 '__classpath__'
 '/opt/oracle/fmw11_1_1_5/wlserver_10.3/server/lib/weblogic.jar'
 '/opt/oracle/fmw11_1_1_5/wlserver_10.3/common/wlst/modules/jython-modules.jar/Lib'
 '/opt/oracle/fmw11_1_1_5/wlserver_10.3/common/wlst'
 '/opt/oracle/fmw11_1_1_5/wlserver_10.3/common/wlst/lib'
 '/opt/oracle/fmw11_1_1_5/wlserver_10.3/common/wlst/modules'
 '/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst'
 '/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/lib'
 '/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/modules'
 '/opt/oracle/fmw11_1_1_5/oracle_common/common/script_handlers'
 '/opt/oracle/fmw11_1_1_5/osb/common/wlst'
 '/opt/oracle/fmw11_1_1_5/osb/common/wlst/lib'
 '/opt/oracle/fmw11_1_1_5/osb/common/wlst/modules'
 '.']




not all those folder/files actually exist by default:

/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/modules , /opt/oracle/fmw11_1_1_5/osb/common/wlst/modules

don't exist...
but
/opt/oracle/fmw11_1_1_5/wlserver_10.3/common/wlst/modules
exists, and that's where I would put my own modules.
However, you can RUNTIME add modules. I put a module cmdb.py in /opt/oracle/usr. It contains a function "getwhoami":
sys.path.append('/opt/oracle/usr')
wls:/offline> from cmdb import getwhoami
wls:/offline> print getwhoami()
soa


Tuesday, October 22, 2013

WebLogic: check if a Group exists

When you create users and need to assign them to Groups, chances are that you will have also to dynamically create those groups. Luckily there is a function atnt.groupExists('somegroup').

This will work only if the JMSGroup doesn't exist:
conect(...)
atnr = cmo.getSecurityConfiguration().getDefaultRealm().lookupAuthenticationProvider('DefaultAuthenticator')
atnr.createGroup('JMSGroup', 'JMSGroup')


the second time you will get a "weblogic.management.utils.AlreadyExistsException: [Security:090267]Group JMSGroup" exception. You can decide to simply catch and ignore the exception.
If you do viewMBean(atnr) you will notice that there is a host of operations available:

setGroupDescription
changeUserPassword
setUserDescription
listMemberGroups
removeMemberFromGroup
groupExists
getGroupDescription
advance
getUserDescription
haveCurrent
listGroupMembers
unSet
getSupportedUserAttributeType
getUserAttributeValue
wls_getDisplayName
userExists
close
isSet
createGroup
listGroups
resetUserPassword
createUser
removeUser
addMemberToGroup
listAllUsersInGroup
setUserAttributeValue
importData
isMember
removeGroup
listUsers
exportData
isUserAttributeNameSupported
getCurrentName

so the code becomes:
#ROLES contains a CSV list of groups for the user USERNAME 
for role in ROLES.split(','):
    if not atnr.groupExists(role):
        atnr.createGroup(role, role)
        print "WARNING: I have  created group ", role
    print "adding ", USERNAME, "to group", role
    atnr.addMemberToGroup(role, USERNAME)


Thursday, October 10, 2013

base64 in WLST

if you try using base64 in WLST:
import base64
encoded = base64.b64encode('data to be encoded')


you get a:

AttributeError: 'module' object has no attribute 'b64encode'


reason being that there is:
/usr/lib64/python2.4/base64.py
and
/opt/oracle/fmw11_1_1_5/oracle_common/util/jython/Lib/base64.py

b64decode does:
import binascii
binascii.a2b_base64(s)
b64encode does:
import binascii
binascii.b2a_base64(s)[:-1]
So basically:
import binascii
s='string to encode'
encoded = binascii.b2a_base64(s)[:-1]
print binascii.a2b_base64(encoded)
string to encode
print encoded
c3RyaW5nIHRvIGVuY29kZQ==



Friday, September 27, 2013

Unable to find interpreter named WebLogic 10.3.5 WLST

If you get this error message
Unable to find interpreter named WebLogic 10.3.5 WLST
in an Eclipse project containing WLST code, chances are that you forgot to configure a Runtime.
Windows/Preferences, search for "runtime", add an Oracle runtime pointing to your local installation of WebLogic, and wait for Eclipse to reconfigure WLST interpreter.