Forum Discussion
myLogin_24886
Nimbostratus
Oct 16, 2007Need help on CreateParition error....
Hi
Follwoing code throwing Null Pointer Exception when I try to run it
// Create partition
void createPartition() throws Exception
{
iControl.ManagementPartitionAuthZPartition partition = new
iControl.ManagementPartitionAuthZPartition();
partition.setDescription("Customer 1 Partition");
partition.setPartition_name("Customer1");
iControl.ManagementPartitionAuthZPartition[] partitions = {partition};
m_partition.create_partition(partitions);
System.out.println(" Partition created sucessfully ");
}
3 Replies
- I don't see anything wrong with the code. Is the Null Pointer Exception on the client side before the SOAP request is made or it an iControl exception returned from the server in a SOAP Fault?
A couple of questions that might have been overlooked.
1. Is m_partition null?
2. Is partitions initialized as an array with 1 dimension?
3. Is partitions[0] null?
The only one I'm not sure about is 1 as I don't see where you initialize that variable. I'd step through in a debugger and find out which line is causing the exception and then which variable is null at the point of the exception.
-Joe - myLogin_24886
Nimbostratus
Thanks for pointing out. It was my mistack I didn't initilized the
m_partition = (iControl.ManagementPartitionBindingStub)
new iControl.ManagementPartitionLocator().getManagementPartitionPort(new java.net.URL(m_endpoint));
it works now. - Great! It's funny how often it turns out the source of issues are not really what it seems...
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects