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)"



No comments: