Search code examples
weblogicwlst

How to untarget a JDBC resource using wlst script?


I am trying to untarget a JDBCResource in weblogic using wlst script.

I tried the following:

cd('/JdbcSystemResource/DataSource1')
set('Targets',jarray.array([], ObjectName))

but it fails with the following exception:

com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.jython.WLSTException: java.lang.IllegalArgumentException: Param type [Ljavax.management.ObjectName; not supported

Why does it say ObjectName not supported?


Solution

  • Basically i was trying in an offline mode and from one of the oracle documents i found that we can use unassign function to untarget in an offline mode

     cd('/JDBCSystemResources/'+ dsName)
     targets = cmo.getTargets()
     for target in targets:
         unassign("JDBCSystemResource",dsName, "Target",target.getName())