My B+Tree can compile but have runtime error ... i can't tink why ...

Sorry to bother anyone ... i have spent almost 3 weeks trying to debug the problem...
My B+ Tree can compile but can't run as it throw invalid Null pointer Exception ..
I suspected the error is in the split (int order ) method in the BTreeNode class but i can't remedy for it
This my program code
public class BTree {
* The order of the B-Tree. All nodes of the B-Tree can store up to 2*order key values.
private int order;
* The number of key (with associated data values) stored in the B-Tree.
private int count;
* The root node of the B-Tree
private BTreeNode root;
* The first leaf node in the B-Tree. This field is used to give the starting point for sequential
* access to the keys and data stored in the leaf nodes.
private BTreeNode first;
* The last leaf node in the B-Tree. This field is used to give the starting point for reverse
* sequential access to the keys and data stored in the leaf nodes.
private BTreeNode last;
* A change count that can be used to invalidate iterators. This field is updated whenever a key plus data pair
* is added to the B-Tree (or the data associated with a key is changed), or when a key plus data pair are
* deleted from the B-Tree.
private int changeCount = 0;
// WHEN DOING ASSIGNMENT 5, DO NOT ADD ANY ADDITIONAL FIELDS TO THIS CLASS
// You will loose marks if you add additional fields to this class. The fields above are all that
// you need. If you need a variable in a method, use a local variable. I have seen too many
// assignments where students add fields rather than create local variables. Hopefull the threat
// of loosing (quite a few) marks will help reduce this habit.
* A general exception class for errors when constructing or manipulating a B-Tree. Use the string
* parameter to the constructor to say what the error really is.
public class BTreeError extends RuntimeException {
public BTreeError(String reason) {
super(reason);
* A constructor that creates an empty B-Tree of the given order.
* <p/>This is the only constructor provided at the moment for this BTree class. Could consider
* adding the equivalent of a 'copy constructor' that creates a new BTree object from an existing
* BTree object.Constructor
* creates the root of a btree
* A constructor that creates an empty B-Tree of the given order.
* <p/>This constructor need to copy the order parameter to the field of same name, and initialise the
* root, cound, first and last fields of the BTree object.
* @param order The order of the BTree.
public BTree(int order) {
count = 0;
this.order = order;
root = new BTreeNode(true, null, -1, null, null);
first = root;
last = root;
* A method to return a SequentialIterator object that is positioned just before the first key
* of the BTree object.
* <p/>Do not modify this method.
* @return A SequentialIterator object.
public SequentialIterator iterator() {
return new BTreeIterator();
* A mehtod to return a SequentialIterator object that is positioned at a key found through a call
* to the searchFor() method.
* <p/>Do not modify this method.
* @param position A SearchPosition() object that usually has been returne by a call to the searchFor() method.
* @return A SequentialIterator object initialised to start at particular key in the BTree.
public SequentialIterator iterator(SearchPosition position) {
return new BTreeIterator(position);
* A method to return a string representationo the BTree.
* <p>The format of the string is:
* <pre>BTree: Order=<digits>, size=<digits>, root=<BTreeNode string></pre>
* <p/>Do not modify this method.
* @return A string to represent the BTree
public String toString() {
StringBuffer s = new StringBuffer("BTree: Order=");
s.append(order).append(", size=").append(size()).append(", root=").append(root.toString());
return s.toString();
* Method to determine the number of records stored in the B-Treee.
* <p/>Do not modify this method
* @return the number of records in the B-Tree.
public int size() {
return count;
* method to return the order of the B-Tree.
* <p/>
* <p>This is the smallest number of key values for all nodes
* except the root node. The maximum number of key values in a node is 2*order, and the maximum number
* of child nodes for a node is 2*order+1.
* <p/>Do not modify this method.
* @return The order of the B-tree.
public int order() {
return order;
* Insert a key plus data value into the BTree.
* <p/>This method needs to locate the leaf node in which the key + data value should be
* inserted, and then call the insertLeaf() method of BTreeNode to do the insertion.
* <p/>This method will always result in a change to the BTree, so it should increment
* the change count.
* <p/>The method may result in only the data associated with an existing ke being changed,
* so incrementing the count field should be done in the BTreeNode method (if needed).
* <p/>This is one of the method you need to complete for assignment 5.
* @param key The key associated with the data value to be added to the B-Tree
* @param data The data value to be added (with it's associated key) to the B-Tree.
public void add(Comparable key, Object data) {
// you need to add the code for this method
// i added
BTreeNode btNode = root;
while (!btNode.isLeaf) {
int i=0;
while(key.compareTo(btNode.keys) > 0) {
i++;
if (i == btNode.numberOfKeys) break;
btNode = btNode.childNodes[i];
btNode.insert(key,data);
if (root.numberOfKeys == order*2-1) root.split(order);
* insert a object with the given key into the tree
//KeyNode keyNode = new KeyNode(key, data);
// BTreeNode keyNode = new BTreeNode(key,data);
BTreeNode btNode = root;
while (!btNode.isLeaf) {
int i=0;
while(key.compareTo(btNode.key(i)) > 0) {
i++;
if (i == btNode.numberOfKeys())
break;
btNode = btNode.child(i); }
System.out.println("hmm1");
btNode.insert(key,data );
System.out.println("hmm2");
if (root.numberOfKeys == order*2-1)
System.out.println("hmm3");
root.split(order);
System.out.println("hmm4");
* This method searches the B-Tree for an occurence of the key in a leaf node and returns the result
* of the search in a SearchPosition object.
* <p/>Note that the key may occur in an interior node of the BTree without occuring in the leaf
* nodes. This can be the result of a deletion operation. This method need to search down to the
* leaf node that should contain the key if the key and associated data is in the B-Tree, and then
* scan through the keys in the leaf node for the search key.
* <p/>The result of the search is returned as a SearchPosition object, as this allow the return
* of the success or failure of the search, as well as the data belonging to the key. It also
* allows position information to be returned so that an interator can be initialised with the
* key as the starting position for subsequent sequential access to adjacent keys.
* <p/>This is one of the method you need to implement.
* <p/>Implementation nodes:<br>
* You need to find the leaf node that may contain the key (same code as for add()), then
* scan the leaf BTreeNode for the search tree. You can do this within this method, as you
* have total access to the fields and methods of BTreeNode (as BTreeNode is an inner class
* of BTree). If you find the key, construct and return a SearchPosition object with the appropriate
* details of the position, otherwise construct add return a SearchPosition object that indicates the
* search failed.
* @param key The key to search for in the BTree
* @return A SearchPosition object returning the data and position information for the search
public SearchPosition searchFor(Comparable key) {
// You need to add the code for this method. The code below simply creates a
// SearchPosition object which indicates an unsuccessful search.
return new SearchPosition(false, null, -1);
* A method to delete a node from the BTree.
* <p/>The method should return the data object that was deleted when the key plus data object pair
* are deleted from the B-tree.
* <p/>The method should throw a BTreeError exception (with an appropriate reason string) if the
* key is not found in the B-tree.
* <p/>This is a method you can implement for bonus marks in Assignment 5.
* <p/>Implementation notes:<br>
* The easiest way to proceed is to use searchFor() to determine if they key is in the BTree, and
* (if it is in the B-tree) to return position information about the key. Throw an exception if the
* key is not in the B-tree, otherwise keep a copy of the data assocaited with the key (to return),
* then for the leaf node containing the key (a BTreeNode object), call the deleteLeafNodeKey() method,
* passing across the leaf key index of the key (so you don't have to find it again in the leaf node).
* After this method deletes the key, return the data you saved as the method result.
* @param key The key to delete (along with it's associated data) from the B-tree.
* @return The data associated with the key that was deleted.
public Object delete(Comparable key){
// You need to add the code for this method.
return null;
* The inner class BTreeNode is used to represent the nodes in the B-Tree.
* <p/>The nodes in the BTree are of two types:
* <ol>
* <li>Leaf nodes that contain the keys and associated data values, stored in ascending key order.<br>
* These leaf nodes have next and previous pointers to adjacent leaf nodes to allow an easy
* implementation of an iterator class to provide bi-directional sequential access to the keys stored
* in the BTree nodes.
* <li>Interior nodes that contain keys and links to child nodes (that are either all internal nodes
* or all leaf nodes), organised as the node of a multi-way search tree. The interior nodes have
* one more child node link than keys. The child node link at index k is to a node with keys that
* are all less than the key at index k in this node. The link at index k+1 is to a child node
* with keys that are all greater than or equal to the key at index k.
* </ol>
* The BTreeNode class allows you to create these two 'types' of nodes, depending on the parameters
* passed to the constructor.
* <p/>There are methods that should only be called for leaf nodes and methods that should only be
* called for interior nodes. These methods should throw an exception if called by the wrong node
* type. This class should really be designed using inheritance to mimic the pascal/C++ variant
* record structure, but this design is relatively easy to understand and to implement.
* <p/>Note that this class is an inner class of BTree, and so all objects will have an implict
* reference to the BTree container object. This class has direct access to all the fields of the
* BTree contaner object. In particular, the order of the BTree is available, hence this class
* does not need to keep a copy of the order as a field.
* <p/>Skeleton class provided for Objects and Algorithms Assignment 5
* <p/>Only modify the methods where the JavaDoc indicates that you need to provide code.
* @author a.sobey
* @version 1.0
* Date: 16/05/2005
public class BTreeNode {
* The actual number of key values stored in the BTreeNode. <br>Note that the BTree node has an implicit
* reference to the containing BTree object, and the maximum number of nodes that can be stored in a
* a BTreeNode (except temporarily during the split operation) is twice the <i>order</i> of the BTree.<br>
* This field is valid for both internal and leaf nodes.
private int numberOfKeys = 0;
* The array of pointers to child nodes of this node. Only <i>(numberOfKeys+1)</i> are valid if <i>numberOfKeys</i>
* is non-zero.<br>
* This array is only valid and created for internal nodes - this array is not created for leaf nodes.<br>
* There is space in the array created for one additional child node link - this makes the coding for
* splitting of an internal node easier to implement.
private BTreeNode[] childNodes;
* A reference to the parent node of this node.<br>
* This link is null if this node is the root node of the tree of BTreeNodes.<br>
* This node is valid for both internal and leaf nodes.
private BTreeNode parent;
* The index in the parent node's array of links (the <i>childNodes</i> array) for the link to this node.<br>
* This value should be set to -1 if this node is the root node (and so has no parent node).<br>
* This field is valid for both internal and leaf nodes.
private int parentIndex;
* A link to the next leaf node in the B-tree, provided to allow easy sequential access of the keys
* and values stored in the B-tree.<br>
* This field is only valid if the node is a leaf node. For non-leaf nodes set the value to null.<br>
* For leaf nodes, set the value to null if this node is the last leaf node in the B-tree.
private BTreeNode next;
* The link to the previous leaf node in the B-tree, provided ot allow easy reverse sequential access of the keys
* and values stored in the B-Tree.<br>
* This values should be set to null if this node is a leaf node but is the first leaf node in the B-Tree, or
* if this node is not a leaf node.<br>
* This field is only used in leaf nodes.
private BTreeNode previous;
* An array of comparable key objects that are stored in this node of the B-tree.<br>
* Only the first <i>numberOfKey</i> values in the array are valid.<br>
* The maximum number of keys in a node is 2*<i>order</i>, however there is space in this array
* for one additional value to make the coding of the node splitting operation easier to implement.<br>
* This field is valid for both internal and leaf nodes.
private Comparable[] keys;
* An array of data values associated with the keys stored in this leaf node of the B-tree.<br>
* Only the first <i>numberOfKey</i> values are valid.<br>
* The maximum number of data values in a node is 2*<i>order</i>, however there is space in this array
* for one additional value to make the codingof the leaf node splitting operation easier to implement.<br>
* This field is only valid for leaf nodes - for interior nodes this array is not created.
private Object[] data;
* A boolean value to indicate if the node is a leaf node or not. The structure of the remainder of the node
* depends on this value (would be nice to have variant records in Java ...).<br>
* This field is valid for both leaf and internal nodes.
private boolean isLeaf;
private int order;
* The constructor for a BTreeNode.
* <p/>The code for the constructor is provided - do not modify this constructor.
* @param isLeaf True if this node is a leaf node.
* @param parent A link to the parent node or null if this node is the root node of the B-Tree
* @param parentIndex The index of the link in the array of child node linkes in the parent node that points to this node.
* @param previous A link to the previous leaf node for sequentail access, or null if not a leaf node or no previous leaf nodes.
* @param next A link to the next leaf node for sequential access, or null if not a leaf node or the last leaf node.
public BTreeNode(boolean isLeaf, BTreeNode parent, int parentIndex, BTreeNode previous, BTreeNode next) {
this.parent = parent;
this.parentIndex = parentIndex;
this.previous = previous;
this.next = next;
this.isLeaf = isLeaf;
if (isLeaf)
data = new Object[2 * order + 1];
else
childNodes = new BTreeNode[2 * order + 2];
keys = new Comparable[2 * order + 1];
public BTreeNode( int order, BTreeNode parent)
this.order = order;
this.parent=parent;
this.keys = new Comparable[2*order-1];
this.data = new Object[2*order-1];
this.childNodes=new BTreeNode[2*order];
this.isLeaf=true;
* Returns the number of keys in this BTreeNode. Note that within the code in BTree you have access
* to all the fields of BTreeNode, so this method is not strictly necessary.
* @return The number of keys in this BTreeNode object.
public int numberOfKeys() {
return numberOfKeys;
* Returns the container BTree object for this BTreeNode object. You may like to check that container objects
* are the same when manipulating two BTreeNode objects.
* @return the containing BTree object.
public BTree container() {
return BTree.this;
* A private method to return a string representation of the array <i>keys</i>. This method is used in
* the toString() method for this class.<br>
* Do not modify the code provided for this method.
* @return A string representation of this nodes array of keys.
private String keyString() {
StringBuffer s = new StringBuffer("{");
for (int index = 0; index < numberOfKeys; index++)
s.append(index > 0 ? "," + keys[index] : keys[index]);
return s.append("}").toString();
* A private method to return a string representation of the array of data values stored in a leaf node.<br>
* This method is used in the toString() method of BTreeNode. The method does not check if this node is a
* leaf node, as it is not intended to be called directly from outside of this class, and the toString()
* method only calls this method if the node is a leaf node.<br>
* Do not modify the provided code for this method.
* @return a string representation of the data values array of a BTreeNode.
private String dataString() {
StringBuffer s = new StringBuffer("(");
for (int index = 0; index < numberOfKeys; index++)
s.append(index > 0 ? "," + data[index] : data[index]);
return s.append(")").toString();
* A private method to return a string prepresentation of the array of child node links in an interior node.<br>
* This method is used in the toString() method. This method does not check if this node is an interior
* node, so you must take care to only call this method for interior nodes.<br>
* Do not modify the provided code for this method.
* @return A string representation of the array of child nodes of this BTreeNode.
private String childString() {
StringBuffer s = new StringBuffer("<");
for (int index = 0; index < numberOfKeys + 1; index++)
s.append(childNodes[index] + (index == numberOfKeys ? "" : ","));
return s.append(">").toString();
* The toString method provides a string representation of a BTreeNode.<br> This particular method does not
* include the details of all the fields of a BTreeNode. While debugging your code, you may like to include
* more information (such as the parentIndex value), but in your final submission you must have the code
* as provided in the skeleton BTreeNode class provided to you.
* @return A string representation of a BTreeNode.
public String toString() {
if (isLeaf)
return (new StringBuffer("[")).append(numberOfKeys)
// .append(',').append(parentIndex) // uncomment this line if need to check parentIndex values
.append(',').append(keyString()).append(',').append(dataString()).append(']').toString();
else
return (new StringBuffer("[")).append(numberOfKeys)
//.append(',').append(parentIndex) // uncomment this line if need to check parentIndex values
.append(',').append(keyString()).append(',').append(childString()).append(']').toString();
* Returns the key with the given index in this node. Throws a BTreeError exception if the index is not valid.<br>
* Do not modify this provided code.
* @param index The index of the key.
* @return The key value at the given index.
public Comparable key(int index) {
if (index < 0 || index >= numberOfKeys)
throw new BTreeError("Key index out of range - value = " + index);
return keys[index];
* Returns the child node at the provided index into the childNodes array.<br>
* A BTreeError exception is thrown if the node is not an internal
* node or if the index is not valid.
* <p/>Note that the child node returned will have keys that are all less than the key stored
* in the <i>keys</i> array of this node at the given index value (except the last childNode
* at index numberOfkeys, as this node has keys that are all greater than or equal to the last
* key value stored in this node).<br>
* Do not modify the provided code for this method.
* @param index The index into the array of child nodes for this internal BTreeNode object.
* @return The child node link.
public BTreeNode child(int index) {
if (isLeaf) throw new BTreeError("child() called for a leaf node");
if (index < 0 || index > numberOfKeys)
throw new BTreeError("Child node index out of range - value = " + index);
return childNodes[index];
* Returns the data value associated with the key at the given index. An BTreeError exception is thrown if the
* node is not a leaf node or if the index is invalid.
* <p/>Do not modify the provided code for this method.
* @param index The index of the key assocaited with the data value.
* @return The data value associated with the key with given index.
public Object data(int index) {
if (!isLeaf) throw new BTreeError("data() called for an internal node");
if (index < 0 || index >= numberOfKeys)
throw new BTreeError("Data index out of range - value = " + index);
return data[index];
* This method is used to determine if this node is a leaf node.
* @return True if this node is a leaf node.
public boolean isLeaf() {
return isLeaf;
* Inserts the (key, data) pair into this BTreeNode object.
* <p/>You must supply the code for this method.
* <p/>Implementation notes:<br>
* <ol>
* <li>Throw an exception if this node is not a leaf node.
* <li>Scan the keys array for index of the key greater than or equal to the insertion key.
* <li>If the key at the index is equal to the insertion key, update the data field and return - you are done.
* <li>Otherwise shuffle the keys values from the insertion index along to make a hole for the insertion key,
* and insert the insertion key into the keys array. Do the same for the data array values to insert the
* new data value into the data array at the insertion index.
* <li>increment the number of keys, and increment the container BTree object's count field.
* <li>If the number of keys in the node is now no more than 2*order, you are done, so simply return.
* <li>Otherwise the node has (2*order+1) key values, and need to split. The split operation leaves the first
* <i>order</i> keys and data values in this node (and so the node's numberOfKeys value will become
* <i>order</i>, and moves the remaining (order + 1) keys and data values to a new BTreeNode leaf node
* that you need to create.<br>
* You need to fix up the previous and next fields of this leaf node and the new leaf node you have created.<br>
* Two sub-cases:
* <ol>
* <li>If this node is the root node (i.e., it does not have a parent node), the split of this node will create
* a new root node, with a single key (the key at index (order+1)) and this node and the new BTreeNode as
* the child nodes. In my solution I used a call to the method newRootNode to do this. The newRootNode()
* method will also be used when a split of an interior node creates a new root node. See the JavaDoc for
* details of what the newRootNode() method should do. Once the new root node has been created, and all
* the fields updated due to the split, you are done.
* <li>Otherwise we need to insert in this node's parent node the middle key (at index (order+1) and the
* new node that we created. This is done by the method insertInterior(). The method is passed the
* key to insert (at location this.parentIndex in the keys array of the parent node), the index to
* to insert the key (this.parentIndex), and the new leaf node (that will be inserted at index
* (this.parentIndex+1) in the parent node's child links array).
* </ol>
* </ol>
* @param key The key to insert into the leaf node.
* @param data The key's corresponding data value.
public void insertLeaf(Comparable key, Object data) {
// You need to provide the code for this method.
// BTreeNode temp = new
int size = this.data.length;
int counter = 0;
this.keys[size] = key;
this.data[size] = data;
sort(size);
public int compareTo(Comparable o2) {
// Integer o1 = (Integer) o2;
return (((Integer)o2).compareTo(this));
*split()
*Splits a node into to nodes. This can only be done, if the node is full
*The midlest key go up into the parent, the left ones of them rest in
*this node, and the right ones go into a new node.
private BTreeNode split(int order) {
if (numberOfKeys == order*2-1) {
BTreeNode right = null;
if (parent == null) { // algo for the root-node
BTreeNode left = new BTreeNode(order, this);
right = new BTreeNode(order, this);
for (int i=0; i<order-1; i++) {
left.keys[i] = keys[i];
left.data[i] = data[i];
right.keys[i] = keys[order+i];
right.data[i] = data[order+i];
if (!isLeaf()) {
for (int i=0; i<order; i++) {
left.childNodes[i] = childNodes[i];
left.childNodes[i].parent = left;
right.childNodes[i] = childNodes[order+i];
right.childNodes[i].parent = right;
left.isLeaf = false;
right.isLeaf = false;
} else isLeaf = false;
keys[0] = keys[order-1];
numberOfKeys = 1;
left.numberOfKeys = order-1;
right.numberOfKeys = order-1;
for (int i=1; i<order*2-1; i++) {
keys[i] = null;
data[i] = null;
childNodes[i+1] = null;
childNodes[0] = left;
childNodes[1] = right;

* Don't post that much code. There should never be a reason to. You should be able to break your code down into small enough pieces that you can post a small example that demonstrates your problem.
* When you do post code, use [code] and [/code] tags to make it readable. You can use the code button on the message entry page.
* The stack trace will tell you which line the NPE occurred on, where it was called from, where that was called from, etc. You can use that to help you find your error. Look at the line it's complaining about. What references are on that line followed by a dot, and what arrays do you try to access the elements of. One of those must be null.
* Now that you know what[b] is null, put in a bunch of print statements to track [b]how it got to be null.

Similar Messages

  • MDG Material BS_MAT_OVP_03 application is fine in development but giving runtime errors when moved to quality

    Dear Experts,
    We are Facing a problem with BS_MAT_OVP_03, We have done some enhancements and it is working very much fine in development and when we move it to Quality we are getting runtime errors, they are not with the enhancements but with in standard code itself.
    "ASSERTION_FAILED" " ""CL_USMD_ACC_FLD_PROP_DATA=====CP" or "CL_USMD_ACC_FLD_PROP_DATA=====CM009" "VALIDATE_RETURNED_FLD_PROP"
    we are getting above runtime error, Please let us know the reason for issue, If some one have come across.
    Regards
    Sukumar

    Hi Sukumar,
    It's because of few generated structures could be in "Inactive" mode for your data model when you move to quality system.
    Refer each generated structure from SE11 and activate them individually..this can be a post processing activity everytime you move data model structures from one ECC to other ECC.
    Thanks
    Praveen

  • When trying to download jave have runtime error progran c:/program files/mozella\firefox exe R6205 - pure virtual function call

    I have been having problems logging in and had to go to system set not quite knowing what I am doing I sent and changed to configure default, then when I went in my plugin crashed so I tried to update java again an got the above area message,Runtime error program c:/ program files\mozilla\firefox\firefox exe R6205 -pure virtual function call. I also tried to update my driver but as soon as they started checking updates mozilla shut down

    Try checking this guide on [http://www.pcperformancetools.com/runtimeerrors.htm
    runtime error download] It discusses step-by-step instructions on how to diagnose and repair windows runtime problems. They also got a free tool to clean-out and repair corrupt associations in the Windows Registry automatically.

  • Trying to import video but have the error 'error video playback aborted'

    Hello
    can someone tell me what this error message means, I'm trying to import a video into my project but i reckon this is stopping it from loading. My code looks like this:
    I've uploaded the films up to my adobe server and have made sure the film directory is the exact same but still not having much luck. does anyone know how to get around it?
    thanks

    Hey
    i just had the file directory wrong, didn't need to reference the page it was on.
    but thanks for your response
    Emily

  • Photo Stream? I have 306 photos on my iphone but have 75 on my PC Photoshream? Why is that?

    On my phone I have more than 306 Photos in Photostream folder while on my PC i have only 75 photos in Photostream. How can i sync all of them to my PC?

    Which version of iOS do you have, and are you using iPhoto iOS with your iPhone or the Photos.app?
    Where have you looked? in iOS 8, have you looked at the "Hidden" album or the "Recently Deleted" album?

  • I have runtime error  6034 message

    My Itunes has completely stopped working on both of my computers. I am running windows 7 with the latest updates.
    This happened over a week ago and I have not been able to back up my phone. I have tried to uninstall as instructed on other sections of this forum but the uninstall process is halted with the same type of error message. I am not a pc expert by a long shot, and the process is beyond my capabilities.
    I see there are advertised quick fixes for the problem with a download, but I dont know which one to trust. Is there a way to update Itunes without all of the trouble?

    Hi Teryco!
    Here is an article that will help you troubleshoot this issue:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • At the moment to compile i have a error

    the error that send me is Note: uses or overrides an deprecated API.
    why... what can i do...

    the error that send me is Note: uses or overrides an
    deprecated API.
    why... what can i do..."run javac with -deprecated for details" at least that's what my compiler tells me to do...
    theSparko strikes again!

  • "Data binding will not be able to detect assignments" alert - but no runtime error

    I have a class that is instantiated as hhgrab, it has an
    array declared like:
    [Bindable]
    public var resultData:ArrayCollection = new
    ArrayCollection();
    In my MXML file, I bind that array to a datagrid like:
    <mx:DataGrid x="19" y="283" width="383"
    dataProvider="{hhgrab.resultData}">
    But I am given a warning that says "Data binding will not be
    able to detect assignments to hhgrab"
    I googled this and saw that this alert is thrown when a
    variable was not declared as bindable, but mine is. Could this be a
    Flex Builder 3 bug?
    Thanks..

    I made hhgrab bindable:
    package components
    public class MyAC
    import mx.collections.ArrayCollection;
    [Bindable]
    public var resultData:ArrayCollection = new
    ArrayCollection();
    public function MyAC():void {
    resultData = ArrayCollection([
    {Month:"January", Profit:2000, Expenses:1500, Amount:450},
    {Month:"February", Profit:1000, Expenses:200, Amount:600},
    {Month:"March", Profit:1500, Expenses:500, Amount:300},
    {Month:"April", Profit:500, Expenses:300, Amount:500},
    {Month:"May", Profit:1000, Expenses:450, Amount:250},
    {Month:"June", Profit:2000, Expenses:500, Amount:700}
    <?xml version="1.0"?>
    <!-- charts/BasicLine.mxml -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script><![CDATA[
    import components.MyAC;
    [Bindable]
    private var hhgrab:MyAC = new MyAC();
    ]]></mx:Script>
    <mx:DataGrid x="19" y="283" width="383"
    dataProvider="{hhgrab.resultData}"/>
    </mx:Application>

  • Alv runtime error

    Hallow I do a simple alv report that I take from se 83 example
    And I have RUNTIME ERROR what it can be
    What I doing wrong mybe I forget somtihg .
    <b>This is the
    Error analysis</b>
        You attempted to access an unassigned field symbol
        (data segment 32820).
        This error may occur if
        - You address a typed field symbol before it has been set with
          ASSIGN
        - You address a field symbol that pointed to the line of an
          internal table that was deleted
        - You address a field symbol that was previously reset using
          UNASSIGN or that pointed to a local field that no
          longer exists
        - You address a global function interface, although the
          respective function module is not active - that is, is
          not in the list of active calls. The list of active calls
          can be taken from this short dump.
    <b>This is Source Code Extract</b>
       macro_cell_data_get
         <ls_fcat>
         <ls_data>
         <l_field_value>
         ls_lvc_data-value.
    new API
       if ir_salv_adapter is bound.
         clear ls_lvc_data-style.
    or
         if g_gui_type ne 1.
           if <ls_fcat>-key eq abap_true.
             ls_lvc_data-style = alv_style_color_int_key.
           elseif l_style_color is initial
                 and ( <ls_fcat>-emphasize is initial or
                       <ls_fcat>-emphasize = '$' ).
             if <ls_stin>-counter is initial.
               ls_lvc_data-style = alv_style_color_normal.
             else.
    . <b>this is my definition in the program</b>
    *&      Module  PBO  OUTPUT
          text
    MODULE pbo OUTPUT.
      SET PF-STATUS 'MAIN100'.
      IF g_custom_container IS INITIAL.
        CREATE OBJECT g_custom_container
               EXPORTING container_name = g_container.
        CREATE OBJECT grid1
               EXPORTING i_parent = g_custom_container.
        CALL METHOD grid1->set_table_for_first_display
          EXPORTING
            i_structure_name = 'YHR_EX_TEKEN_STR'
          CHANGING
            it_outtab        = teken_itab.
      ENDIF.
    ENDMODULE.                 " PBO  OUTPUT
    *&      Module  PAI  INPUT
          text
    MODULE pai INPUT.
    to react on oi_custom_events:
    call method cl_gui_cfw=>dispatch.
      CASE ok_code.
        WHEN 'EXIT'.
          PERFORM exit_program.
        WHEN OTHERS.
        do nothing
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                 " PAI  INPUT
          FORM EXIT_PROGRAM                                             *
    FORM exit_program.
    CALL METHOD G_CUSTOM_CONTAINER->FREE.
    CALL METHOD CL_GUI_CFW=>FLUSH.
      LEAVE PROGRAM.
    ENDFORM.                    "EXIT_PROGRAM
    Thankes for your time and answers

    Hi,
    To declare a field symbol, use the statement
    FIELD-SYMBOLS <FS> [<type>|STRUCTURE <s> DEFAULT <wa>].
    For field symbols, the angle brackets are part of the syntax. They identify field symbols in the program code.
    If you do not specify any additions, the field symbol <FS> can have data objects of any type assigned to it. When you assign a data object, the field symbol inherits its technical attributes. The data type of the assigned data object becomes the actual data type of the field symbol.
    Check the sample code:
    TYPES: BEGIN OF line,
             col1 TYPE c,
             col2 TYPE c,
           END OF line.
    DATA: wa TYPE line,
          itab TYPE HASHED TABLE OF line WITH UNIQUE KEY col1,
          key(4) TYPE c VALUE 'COL1'.
    FIELD-SYMBOLS <fs> TYPE ANY TABLE.
    ASSIGN itab TO <fs>.
    READ TABLE <fs> WITH TABLE KEY (key) = 'X' INTO wa.
    Hope this helps.
    keerthi

  • Runtime Error in SE16 after adding fields in VBAK (ABAP-SD)

    Hi All,
    I have a requirement where I need to add a field in the header item of VA03, 
    So I have add new field or APPEND structure in VBAK.
    I appended structure ZZLAND1 having component field LAND1 in VBAK.
    In SE11, structure ZZLAND1 is activated and has no log of errors.
    In SE14, table VBAK is successfully adjusted as well and no log of errors.
    When I execute SE16, I have runtime error:
    Short text
        SQL error in the database when accessing a table.
    Missing Handling of System Exception
        Program                                 /1BCDWB/DBVBAK
    Trigger Location of Exception
        Program                                 /1BCDWB/DBVBAK
        Include                                 /1BCDWB/DBVBAK
        Row                                     547
        Module Name                             START-OF-SELECTION
    544 CASE ACTION.
    545   WHEN 'ANZE'.
    546 try.
    547 SELECT * FROM VBAK                     "client specified  <<-- Error Occurs here
    548                  APPENDING TABLE IVBAK
    549                  UP TO RSEUMOD-TBMAXSEL ROWS BYPASSING BUFFER
    550    WHERE VBELN IN I1.
    Am I missing any other part here?  In VBAP, after I added a field, I didn't encounter this one.
    Thanks all.

    As we see you have done everything correctly. However check whether following things are also in place:
    The fields of an append structure must lie in the customer namespace, that is the field names must begin with ZZ or YY. This prevents conflicts with fields inserted in the table by SAP.
    An append structure must be flat, that is each field of the append structure must either refer to a data element or be directly assigned a data type, length, decimal places and short text.
    If a foreign key or search help attachment is already defined for a field in the table, you cannot change this definition with the append structure.

  • Getting portal runtime error when cancel button is pressed

    Dear team,
              When i am trying to reset password, in that screen when i press cancel, i am getting portal runtime error . Actually when i press that button it should come to the intial login screen but now it is coming to the initial login screen but getting runtime error and also the images on that login screen are not being displayed. All the images are displayed as cross marks. When i press change password, its working fine and its logging into the portal .
    Please provide me some solution.
    Regards,
    Dinesh.

    Dear Prashant,
    Sorry for my delay... please find the Error Log below.
    Full Message Text
    03:30_12/04/11_0465_8587550
    [EXCEPTION]
    com.sapportals.portal.prt.runtime.PortalRuntimeException: iView not found: portalapps.default
    at com.sapportals.portal.prt.deployment.DeploymentManager.getPropertyContentProvider(DeploymentManager.java:1937)
    at com.sapportals.portal.prt.core.broker.PortalComponentContextItem.refresh(PortalComponentContextItem.java:222)
    at com.sapportals.portal.prt.core.broker.PortalComponentContextItem.getContext(PortalComponentContextItem.java:316)
    at com.sapportals.portal.prt.component.PortalComponentRequest.getComponentContext(PortalComponentRequest.java:387)
    at com.sapportals.portal.prt.connection.PortalRequest.getRootContext(PortalRequest.java:488)
    at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:607)
    at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:235)
    at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:541)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:430)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
    at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
    at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176) 

  • Runtime error when updating service item with BAPI PO CHANGE

    Hi,
    I get rutime error TABLE_INVALID_INDEX after calls:
    BAPI_PO_CHANGE-> PROCESS_NON_INTEGRATED_COMP-> CHANGE_PO_SRV_ITEM -> MS_CHANGE_SERVICE_PACKAGE_PO -> ROW_IN_PO -> CHECK_ACC_PO -> MS_CHANGE_ACCASS_PO -> ESKL_UPDATE.
    the reason is, that ESKL internal table is empty, so the function retrieves last entry index, there is no entry , so  sy-tabix = 0 , and function updates with index 0, which causes the runtime error. I dont know why it is empty, maybe I should copy this table gt_srvaccess from BAPI_PO_GETDETAIL  to BAPI_PO_CHANGE.
    This error appears only in mode KNTIMOD=2 (Multikontierung), not in KNTIMOD=1(Einfachkontierung), so just when ESKL contains more lines for one PACKAGE_NUMBER.
    I am just updating the value ordered to be equal value delivered to close the PO, or delete the item in case ordered >0 and deliveded = 0.
    Here is my part of code:
    *close existing PO's by changing the value ordered to the value receipted
                move 'X' to w_change_flag.
                w_hdrx-po_number = 'X'.
                if w_total-val_gr_for is not initial.
                  w_itemx-delete_ind = 'X'.
                  append w_itemx to gt_itemx.
                  clear: w_itemx.
                  read table gt_services into w_service2 with key pckg_no = w_item-pckg_no.
                  if sy-subrc eq 0.                                                                               
    read table gt_services into w_service with key pckg_no = w_service2-subpckg_no.
                    if sy-subrc eq 0.                                                                               
    move: w_total-val_gr_for to w_service-quantity,
                            '1'                to w_service-gr_price.
                      modify gt_services index sy-tabix from w_service transporting quantity gr_price.
                    endif.
                  endif.
                else. "nothing delivered yet, set deletion flag
                  w_itemx-po_item = w_item-po_item.
                  w_itemx-delete_ind = 'X'.
                  append w_itemx to gt_itemx.
                  clear: w_itemx.
                  w_item-delete_ind = 'L'.
                  modify gt_item index w_count from w_item transporting delete_ind.
                endif.
        call function 'BAPI_PO_CHANGE'
          exporting
            purchaseorder = w_ekko-ebeln
            poheader      = w_header
            poheaderx     = w_hdrx
            testrun       = w_testrun_flag
            no_messaging  = 'X'
          importing
            expheader     = w_exphdr
          tables
            return        = gt_return1
            poitem        = gt_item
            poitemx       = gt_itemx
            poservices    = gt_services.
    Thanks, please help.
    regards Rob
    Edited by: xsmid4 on Nov 2, 2011 11:49 AM
    Edited by: xsmid4 on Nov 2, 2011 12:08 PM

    Hi,
    Take a look at OSS Note 827731. It might be helpful to you.
    [ Link for Note 827731|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=827731]
    Regards,
    koolspy.

  • TS1468 If all tracks on an album are written by one artist, but have other supporting artists, can I group them all as one album under the original artist without having to group them as a compilation and being called "Various Artists"?

    I'm pretty sure I've tried all the suggestions I've found, but I can't seem to find a satisfactory option.
    I'll use a CD I just bought as an example.  I just bought "The Best of Sergio Mendes", all songs are written by Sergio Mendes, but some include Brasil '66.  iTunes thinks this album is a compilation, but I really just want to group it all as Sergio Mendes rather than Various Artists, but I still want to have the information about which songs include Brasil '66.  For some reason the tab "Sorting" does absolutely nothing, but it seems like the idea behind it would be really useful if it actually worked...  Is there a way of doing this or will I have to settle with a more confusing or less informative option?  I feel like this must be possible, or else it's a pretty big flaw for me as I have a fair few albums this would apply to.
    Thanks in advance for any help.

    Indeed, generally all you need to do is fill in an appropriate Album Artist. For more details see my article on Grouping Tracks Into Albums, in particular the topic One album, too many covers.
    Don't try to use sort fields to merge different things together as it quickly goes wrong. These should be used consistently to make all things with one value sort as if they had a different one, e.g. Bowie, David to make David Bowie sort under B.
    tt2

  • I have been running elements 12 for a few months now....today when I tried to open the editor I get " Visual C  C  runtime error. I can open the organizer but not the editor

    I have been running elements 12 for a few months now....today when I tried to open the editor I get " Visual C  C  runtime error. I can open the organizer but not the editor

    I'm keen to know if you get a response to this.  I've been running Elements 12 for a year now, and suddenly my Editor is not working.  I'm running Windows 8.1 and just get a message that says "The Editor is not working".    Not very helpful.

  • I have been trying to download the itunes update.  1.  I keep getting a runtime error.  i have researched and tried to the errors but can no long get into itunes

    I have been trying to update itunes but i keep getting a runtime error.  i have been working on this for 2 hours and cannot find anything in the community to help

    Solving MSVCR80 issue and Windows iTunes install issues.

Maybe you are looking for

  • Album artwork not appearing

    first time poster so bear with me here. heres the situation. when i click "get album artwork" for some songs, it doesnt work. at all. for example, i uploaded the cd "catalyst" , by new found glory, into itunes and the album artwork didnt come up. i s

  • House Bank and Payment Method Supplement

    Where is the mapping of House Bank and Payment Method Supplement done???

  • MDX report rendering takes long time and showing Conflict Message

    Hi All, This is my MDX Query with member [Measures].[Rent] as IIF(IsEmpty([Measures].[Budget]), NULL, [Measures].[Rent]) select {[Measures].[Rent]} on columns,                      [Property].[Address].[All].children *          DESCENDANTS([Account].

  • Force use of data plan

    Went into Verizon WIreless store to buy Unlocked Iphone 5 (I will own outright) and was told that any smartphone must have data plan/ This seems ureasonable as they do not subsidie the phone in any way and I am willing to spend $650.00 for the phone

  • Printing in multiple pages

    I am using the source code provided by sun available in following url http://java.sun.com/products/java-media/2D/forDevelopers/sdk12print.html (Listing 3: Using the print method: PrintText ) The problem I am facing is, if I am invoking the printjob m