Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Python Execute Error: AttributeError: delete

AnandRawatAug 22 2019

Hi All,

I have written a python scipt to delete oracle service bus proxy service .

While executing it by Ant ,it is throwing below error :

Traceback (innermost last):

     [wlst]   File "/opt/oracle/FMW11.1.1.7/Oracle_OSB1/common/bin/osb_delete_service_new.wlst", line 49, in ?

     [wlst] AttributeError: delete

     [wlst]

     [wlst] Exception in thread "main" java.lang.IllegalStateException: Traceback (innermost last):

     [wlst]   File "/opt/oracle/FMW11.1.1.7/Oracle_OSB1/common/bin/osb_delete_service_new.wlst", line 49, in ?

     [wlst] AttributeError: delete

here is the python script code  :

********************************************************************************

print '@@@ Starting the script ...'

print sys.argv[1] +' ' +sys.argv[2] +' '+ sys.argv[3] +' ' + sys.argv[4] +' '+ sys.argv[5] +' '+ sys.argv[6]

adminUser = sys.argv[1]

adminPassword = sys.argv[2]

adminUrl = sys.argv[3]

project = sys.argv[4]

service = sys.argv[5]

action = sys.argv[6]

connect(adminUser,adminPassword,adminUrl)

domainRuntime()

print('WLST Connected')

sessionName = String("SessionScript"+Long(System.currentTimeMillis()).toString())

print('... after session. Session is: ', sessionName)

sessionMBean = findService(SessionManagementMBean.NAME,SessionManagementMBean.TYPE)

print sessionMBean

print('SessionMBean is: ', sessionMBean)

sessionMBean.createSession(sessionName)

print(String('Session was created ... ').concat(sessionName))

alsbConfigurationMBean = findService(String("ProxyServiceConfiguration.").concat(sessionName),'com.bea.wli.sb.management.configuration.ProxyServiceConfigurationMBean')

print alsbConfigurationMBean

projectName = Refs.makeParentRef(project + '/')

proxyRef = Refs.makeProxyRef(projectName, service)

print proxyRef

if action == 'delete':

    print('delete' + service)

    alsbConfigurationMBean.delete(Collections.singleton(proxyRef)

else:

    print('Service does exist' + service)

sessionMBean.activateSession(sessionName, "Delete PS")

disconnect()

exit()

*********************************************************************************************

All the below jar exist on the server and environment class path is also set for the same :

CLASSPATH=${CLASSPATH}:${ORACLE_HOME}/Oracle_OSB1/modules/com.bea.common.configfwk_1.7.0.0.jar

CLASSPATH=${CLASSPATH}:${ORACLE_HOME}/Oracle_OSB1/lib/sb-kernel-api.jar

CLASSPATH=${CLASSPATH}:${ORACLE_HOME}/Oracle_OSB1/lib/alsb.jar

CLASSPATH=${CLASSPATH}:${ORACLE_HOME}/Oracle_OSB1/lib/ant-contrib-1.0b3.jar

CLASSPATH=${CLASSPATH}:${ORACLE_HOME}/wlserver_10.3/server/lib/weblogic.jar

The python version at the unix box is 2.6.6 .

Can someone please have a look on it and help me why the below statement creating problem in this script :

alsbConfigurationMBean.delete(Collections.singleton(proxyRef)

if someone has written the script to delete oracle service bus proxy/business service ,please suggest what is missing here .

Thanks in advance .

Comments

Post Details

Added on Aug 22 2019
0 comments
212 views