Python Forum
Array/Jarray problem contains null value?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Array/Jarray problem contains null value?
#1
Hi,

The problem is when creating a array 1 one go or via an interation it seems like they behave different and I don't understand why. I'm creating a python file for some wlst datasource creating in Weblogic.

        targetss = jarray.array([ObjectName('com.bea:Name=XXXXXX,Type=Cluster'), ObjectName('com.bea:Name=YYYYYY,Type=Cluster')], ObjectName)
        print targetss
        targets = jarray.zeros(0,ObjectName)
        datasourceTagret = "XXXXXX,YYYYYY"
        for target in datasourceTarget.split(','):
          targets.extend([ObjectName("com.bea:Name=" + target + ",Type=Cluster")])
        print targets
        set('Targets',targets) #this one fails with the following error: javax.management.InvalidAttributeValueException: Array has at least one null element
        set('Targets',targetss)
if I print the arrays they look like:
Output:
array(javax.management.ObjectName,[com.bea:Name=XXXXXX,Type=Cluster, com.bea:Name=YYYYYY,Type=Cluster]) array(javax.management.ObjectName,[com.bea:Name=XXXXXX,Type=Cluster, com.bea:Name=YYYYYY,Type=Cluster])
anybody and idea
Reply
#2
datasourceTarget is mispelled.
datasourceTagret = "XXXXXX,YYYYYY"
for target in datasourceTarget.split(','):
Would need to see imports.
because set does something else in python
print(set([1,1,1,2,2,3,5]))
Output:
{1, 2, 3, 5}
99 percent of computer problems exists between chair and keyboard.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to express null value klatlap 3 859 Mar-25-2023, 10:40 AM
Last Post: klatlap
  value null when update in json file 3lnyn0 6 3,230 Dec-30-2021, 05:52 PM
Last Post: ndc85430
  Problem with Json Array kwekey 2 1,669 Aug-02-2021, 05:11 PM
Last Post: kwekey
  Multiple conditions, one is null moralear27 1 2,197 Sep-13-2020, 06:11 AM
Last Post: scidam
  I didnt get the NULL values salwa17 0 1,582 Jul-10-2020, 02:54 PM
Last Post: salwa17
  Find only the rows containing null values Bhavika 2 2,437 Jun-10-2020, 01:25 PM
Last Post: Bhavika
  Array problem in pylab module - Image processing bobfat 0 1,711 Dec-31-2019, 06:02 PM
Last Post: bobfat
  g Null Byte using DictReader eshwinsukhdeve 13 7,530 May-15-2019, 08:50 AM
Last Post: buran
  Array - Problem with Simple Code emerger 8 4,400 Oct-12-2018, 02:46 AM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020