CAN COMPILE BUT CANNOT RUN PROGRAM
I am finally able to compile my program, I have the extensions .class, when I try to run the program I get an error message "main"java.lang.noclassdef
after message appears after I type java Saluton or whatever program I am trying to run.
Any suggestions, someone justed I use textpad, but I don't think this has anything to do with not being able to run programs, I am using windows 98 second edition.
This is a CLASSPATH problem.
For example, if your .class file is in the directory C:\javaclasses then you would set the CLASSPATH environment variable to that using:
set CLASSPATH=C:\javaclasses
Add this to your autoexec.bat and reboot so you don't have to type this every time you open a DOS prompt.
You may want to add the current directory, ., to the list of directories (use ; to separate directories).
set CLASSPATH=.;C:\javaclasses
If your class is part of a package, you have to use the directory that is the parent of the packages' directories.
Similar Messages
-
Can compile but cannot run.
Dear Java Guru,
Wish to find out why I can compile but cannot run. I encounter the following error: 'Exception in thread "main" java.lang.NoClassDefFoundError: javax/media/jai/JAI
at saveasone.<init>(saveasone.java:29)
at saveasone.main(saveasone.java:21)'
This does not happen on one PC but happened on another PC.
The one can compile is XP, the other which cannot compile is Win2k Professional. Is there any other possible cause ?
Please advise.The problem probably lies in the Classpath. I think you are using different environments for compiling and running. If you are using an IDE for developing your code, you might have set the classpath correctly there but not in the executing environment. As about the OS's you mentioned, I think the problem is still with your Environment Settings than OS settings.
-
I can compile but not run ...
Exception in thread "main" java.lang.NoClassDefFoundError: VierOpEenRij
I can Compile my file VierOpEenRij.java , then it creates his .class but when I try to open it ( java VierOpEenRij ) then it says this error.
anyone has an Idea how come , cause I really need it for school !!
ThxNo it still doesn't work ..
If using -cp . does not work (don't forget the spaces), then either VierOpEenRij.class file does not exist in the current directory or the class inside the VierOpEenRij.class file is not named VierOpEenRij
I don't know how , It used to work but now it just
fails :(
is it possible that i Intalled something that
interrupte the proces ?Anything is possible. -
JavaService - can install java program into win2k service, but cannot run
i have a JavaService problem: i can install java program into win2k service, but cannot run
the version of javaservice is 2.0.7.0
the following is the message:
C:\DailyUpdate\dist>JavaService.exe -install DailyUpdate C:\Program Files\Java\j
dk1.5.0_05\jre\bin\client\jvm.dll -Djava.class.path=C:\DailyUpdate\dist\ftpbean.
jar;C:\DailyUpdate\dist\mysql-connector-java-3.0.10-stable-bin.jar;C:\DailyUpdat
e\dist\DailyUpdater.jar -Xms16M -Xmx64M -start DailyUpdateHandler -params C:\Dai
lyUpdate\dist -out C:\DailyUpdate\dist\logs\out.log -err C:\DailyUpdate\dist\lo
gs\err.log
The DailyUpdate automatic service was successfully installed
The DailyUpdate service is starting.
The DailyUpdate service could not be started.
The service did not report an error.
More help is available by typing NET HELPMSG 3534.I might be doing some programming for my company soon
which will require a program to monitor a database
and whenever there is a change to certain fields, it
must copy certain fields into another database. When I see "whenever thiere is a change to certain fields" I tend to think "triggers" - but maybe this won't work for you 'cause of the "another database" part. And the fact that triggers are inherently evil.
[snip]
Is it possible to run a Java program as a windows
service? And if so then how would you go about it? I'd hit Google - there're a couple ways to do this.
[snip]
Also,...if I were to use one of those programs which
can make an .exe of a Java program, then do you still
require the JRE to be on the machine? It depends on how you did the conversion. If you compile to native then no, if you just wrap up a JRE then yes.
Why I ask is
that I occasionally get asked to do small development
projects for my company, but we are a microsoft
partner and therefore do all the development in C#
and the like. So I would like to just implement as
many things in Java as I can, just to show everyone
that Java can do exactly what C# can do. But its
difficult to convince people of this since I always
require the JRE and they dont. Of course, they require the .NET framework and you don't. And last I looked that thing was around 23 Meg. -
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. -
Cannot run program "keytool": java.io.IOException
Hi,
I would like to follow the procedure to change the master password
of glassfish server hosting APEX listener
using the change-master-password subcommand, but the utility keytool
is not found:
glassfish@ahost:/opt/glassfish3/glassfish/domains/mydom01/config> /opt/glassfish3/bin/asadmin
/opt/glassfish3/bin/asadmin
Use "exit" to exit and "help" for online help.
asadmin> change-master-password mydom01
Enter the current master password> changeit
Enter the new master password> changedit
Enter the new master password again> changedit
Cannot run program "keytool": java.io.IOException: error=2, No such file or directory
Command change-master-password failed.
asadmin>
Command multimode failed.
glassfish@ahost:/opt/glassfish3/glassfish/domains/mydom01/config> which java
/usr/bin/java
glassfish@ahost:/opt/glassfish3/glassfish/domains/mydom01/config>
All of glassfish is running fine apart from this.
keytool could be found in /usr/java/latest/bin/keytool.
Do we need to have this in the path? There is no requirement in the
install guide for this, nor did the RPM installation adjust the system
path accordingly.
Hopefully someone can tell my how things ought to be regarding keytool?
Thanks, TomHi Tom,
the procedure to change the master password of glassfish server hosting APEX listener... sounds more like a GlassFish-related topic to me. I guess you'd get the best answers for such questions in a GlassFish-related forum...
For what it's worth, I'll try my best anyway:
Cannot run program "keytool": java.io.IOException: error=2, No such file or directoryThis seems to be a pretty clear error message: keytool , which is probably used to manage the keys for GlassFish users, wasn't found. This means, you're either running on an OS that is not officially certified for GlassFish, or you GlassFish hasn't been configured properly.
You ran
glassfish@ahost:/opt/glassfish3/glassfish/domains/mydom01/config> which java
/usr/bin/java... which indicates you assume your GlassFish is running without JAVA_HOME being set. If that's true, I'd begin to setup you GlassFish properly starting with that parameter.
Anyway, you also found out that
keytool could be found in /usr/java/latest/bin/keytool.... which is not +/usr/bin+ and hence probably not in the global search path of the user on whose behalf your GlassFish is running. So, you could either create a link-set[*] for +/usr/bin/keytool+ to (finally) point to +/usr/java/latest/bin/keytool+, or you setup JAVA_HOME to be +/usr/java/latest+ .
[*] Note that depending on your OS there might be more than one stage of indirection, e.g. my Ubuntu has +/usr/bin/java+ pointing to +/etc/alternatives/java+ which is pointing to +/usr/lib/jvm/java-6-sun/jre/bin/java+ where +/usr/lib/jvm/java-6-sun/+ is pointing to the directory containing the actual JDK to be used. You'll probably find something like that on your system as well. My Ubuntu box has a link for +/usr/bin/keytool+, so I get that when running "which keytool".
Do we need to have this in the path? There is no requirement in the install guide for this, nor did the RPM installation adjust the system path accordingly.Again, this is not a GlassFish forum.
I hope my hints help you solve your problem. If they don't, please choose the appropriate forum for your next post on that topic. And I guess, giving some more information on your OS and how you manage your JDK (and which version you use) will help people there to help you.
Thanks,
Udo -
Java.io.IOException: Cannot run program "ant"
Hi all,
I'm running a Job in Hudson.
I build this job from a Hudson Master Server but the job is built in a Hudson Linux Node.
This is the result:
Started by user builder
Building remotely on Linux-Node
Updating http://150.200.20.200:8000/mvtv_all/DESCOS/MVTVc_D2ph1/branches revision: 17-may-2013 16:01:46 depth:infinity ignoreExternals: false
At revision 529
Updating http://150.200.200.200:8000/mvtv_all/DESCOS/KaluModules/branches revision: 17-may-2013 16:01:46 depth:infinity ignoreExternals: false
At revision 529
no change for http://159.200.300.20:8000/mvtv_all/DESCOS/MVTVc_D2ph1/branches since the previous build
no change for http://159.230.300.20:8000/mvtv_all/DESCOS/KaluModules/branches since the previous build
No emails were triggered.
[bt] $ ant -file build.xml -DSUBSYSTEM=ALL -DTARGET=makeBuild -DCRLIST= -DOWNER= -DbuildTool.patch.release=$RELEASE -DbuildTool.system=$SYSTEM -DbuildTool.patch.type=$PATCH_TYPE -DbuildTool.subsystem=ALL -DbuildTool.buildRules=pkgBuild -DbuildTool.dynamicView=$WORKSPACE/ALL -DbuildTool.compilationRules=compile -DbuildTool.patch.name=$PATCH_NAME makeBuild
FATAL: command execution failed.Maybe you need to configure the job to choose one of your Ant installations?
java.io.IOException: Cannot run program "ant" (in directory "/hudson/buildTool/src/bt"): error=2, No existe el fichero o el directorio
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
at hudson.Proc$LocalProc.<init>(Proc.java:192)
at hudson.Proc$LocalProc.<init>(Proc.java:164)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:639)
at hudson.Launcher$ProcStarter.start(Launcher.java:274)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:794)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:768)
at hudson.remoting.UserRequest.perform(UserRequest.java:114)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:283)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.IOException: error=2, No existe el fichero o el directorio
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1021)
... 15 more
Do you know something about this issue?
Thanks and RegardsNo, and this is not the Hudson forums either. But see this error?
FATAL: command execution failed.Maybe you need to configure the job to choose one of your Ant installations?Try posting that in Google and see what you get. That's basic misery solution research 101. Post the error in Google. 999/1000 times someone has already run into it before. Please learn from their experiences by reading through them. -
Exception "Cannot run program" while using ProcessBuilder class
Hi Java-Folks,
I try to start a program within a Java application using the ProcessBuilder class. This is the first time I use ProcessBuilder so I do not have any deep knowledge of it. Here is a snippet of my code:
static void connectToHost(String Host) {
ProcessBuilder pb = new ProcessBuilder("connect.exe"), Host);
Map<String, String> env = pb.environment();
env.put("SHELLWIDTH", "64");
pb.directory(new File("C:\\MyProgram\\ExApp\\shell"));
try (
Process p = pb.start();
} catch (IOException ex) {
Logger.getLogger(ShellUtil.class.getName()).log(Level.SEVERE, null, ex);
}Using this method I get an IOException which says *"Cannot run program "connect.exe" (in directory "C:\MyProgram\ExApp\shell"): CreateProcess error=2, The system couldn't find the specified file"*
Does anybody have an idea why this is not working? I tried to start another application like "notepad.exe" and that works fine. So it seems related to the fact
that the program I want to start is only available in a certain directory and not via the PATH env-variable.
I would appreciate any help or hint :-)
Regards,
LemmyOkay I guess I misinterpreted the JavaDocs regarding the directory method. The exception message is a little bit confusing too, because it seems like Java tries to find the Application within the specified
working directory.
I tried to use the full path with the ProcessBuilder constructor and it looks like this variant is working. I still have some trouble with the application itself but I was able to start another program which is
not in the PATH var, using the full path to the executable.
Thanks for the help so far.
Bye
Lemmy -
Hi All,
I am using OWB 11gR2 and I am getting "perl" location error after start workflow for any dimension or fact.
*Cannot run program "/usr/bin/perl": CreateProcess error=2, The system cannot find the file specified
The log is below. I am using Windows 2008 R2 OS and 11gR2 DB. The perl path is set in the environment variables and I can run the perl.exe from command line.
Why OWB is looking for the Unix base path "/usr/bin/perl": is a question for me.
If anybody knows the issue please guide me.
Thanks
OUBIWF_D_DEVICE_ACTIVITY_TYPE 2012-07-04 16:57:37.0 4
Parameters
OUBIWF_D_DEVICE_ACTIVITY_TYPE:FILEMGR_PRE 1 2012-07-04 16:57:38.0 2
Parameters
RPE-02229: The following debug information was collected:
RPE-02230: Debug Information: os.name = Windows Server 2008 R2
RPE-02230: Debug Information: os.version = 6.1
RPE-02230: Debug Information: os.arch = amd64
RPE-02230: Debug Information: user.name = INT-A-MDM-01$
RPE-02230: Debug Information: user.dir = C:\product\11.2.0\dbhome_3\owb\bin\win32
RPE-02230: Debug Information: argv.arg0 = /usr/bin/perl
RPE-02230: Debug Information: argv.arg1 = /spl/intbase/DB/tools/filemgr/splfilemgr.plx
RPE-02230: Debug Information: argv.arg2 = -l
RPE-02230: Debug Information: argv.arg3 = /spl/BIDevelopment/bi2400db
RPE-02230: Debug Information: argv.arg4 = -n
RPE-02230: Debug Information: argv.arg5 = D_DEVICE_ACTIVITY_TYPE_EXT.DAT
RPE-02230: Debug Information: argv.arg6 = -p
RPE-02230: Debug Information: argv.arg7 = 1
RPE-02230: Debug Information: argv.arg8 = -s
RPE-02230: Debug Information: argv.arg9 = S
RPE-02230: Debug Information: argv.stdin =
RPE-02230: Debug Information: USERPROFILE = C:\Windows\system32\config\systemprofile
RPE-02230: Debug Information: JAVAPATH = C:\product\11.2.0\dbhome_3\jdk6
RPE-02230: Debug Information: NODEID = 1
RPE-02230: Debug Information: IAS_HOME = C:\product\11.2.0\dbhome_3
RPE-02230: Debug Information: SystemDrive = C:
RPE-02230: Debug Information: RTHOME = C:\product\11.2.0\dbhome_3
RPE-02230: Debug Information: Path = C:\product\11.2.0\dbhome_3\bin;C:\product\11.2.0\dbhome_3\jdk6\jre\bin\client;C:\product\11.2.0\dbhome_3\jdk6\jre\bin;C:\product\11.2.0\dbhome_3\owb\bin\admin;C:\Windows\system32
RPE-02230: Debug Information: CONNECT_SPEC = 10.34.32.136:1521:MDM
RPE-02230: Debug Information: PROCESSOR_REVISION = 1a05
RPE-02230: Debug Information: OCM_ORACLE_HOME = C:\product\11.2.0\dbhome_3
RPE-02230: Debug Information: USERDOMAIN = WORKGROUP
RPE-02230: Debug Information: ALLUSERSPROFILE = C:\ProgramData
RPE-02230: Debug Information: TMP = C:\Windows\TEMP
RPE-02230: Debug Information: CommonProgramFiles = C:\Program Files\Common Files
RPE-02230: Debug Information: PROMPT = $P$G
RPE-02230: Debug Information: PROCESSOR_LEVEL = 6
RPE-02230: Debug Information: JVM_OPTIONS = -Xmx768M
RPE-02230: Debug Information: LOCALAPPDATA = C:\Windows\system32\config\systemprofile\AppData\Local
RPE-02230: Debug Information: COMPUTERNAME = INT-A-MDM-01
RPE-02230: Debug Information: SystemRoot = C:\Windows
RPE-02230: Debug Information: ORA_HOME = C:\product\11.2.0\dbhome_3
RPE-02230: Debug Information: USERNAME = INT-A-MDM-01$
RPE-02230: Debug Information: APPDATA = C:\Windows\system32\config\systemprofile\AppData\Roaming
RPE-02230: Debug Information: ProgramData = C:\ProgramData
RPE-02230: Debug Information: PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
RPE-02230: Debug Information: ORACLE_HOME = C:\product\11.2.0\dbhome_3
RPE-02230: Debug Information: RTUSER = OWBSYS
RPE-02230: Debug Information: ProgramFiles(x86) = C:\Program Files (x86)
RPE-02230: Debug Information: TEMP = C:\Windows\TEMP
RPE-02230: Debug Information: OEM_HOME = C:\product\11.2.0\dbhome_3
RPE-02230: Debug Information: ProgramFiles = C:\Program Files
RPE-02230: Debug Information: JDK_HOME = C:\product\11.2.0\dbhome_3\jdk6
RPE-02230: Debug Information: OCM_HOME = C:\product\11.2.0\dbhome_3
RPE-02230: Debug Information: ProgramW6432 = C:\Program Files
RPE-02230: Debug Information: PROCESSOR_IDENTIFIER = Intel64 Family 6 Model 26 Stepping 5, GenuineIntel
RPE-02230: Debug Information: STARTUP_TYPE = -manual
RPE-02230: Debug Information: PROCESSOR_ARCHITECTURE = AMD64
RPE-02230: Debug Information: OS = Windows_NT
RPE-02230: Debug Information: FP_NO_HOST_CHECK = NO
RPE-02230: Debug Information: CommonProgramW6432 = C:\Program Files\Common Files
RPE-02230: Debug Information: ORACLE_SID = mdm
RPE-02230: Debug Information: DISCOVERER_ALLOW_DB_CONNECT_STRING = YES
RPE-02230: Debug Information: OWB_HOME = C:\product\11.2.0\dbhome_3
RPE-02230: Debug Information: NUMBER_OF_PROCESSORS = 2
RPE-02230: Debug Information: PUBLIC = C:\Users\Public
RPE-02230: Debug Information: PSModulePath = C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
RPE-02230: Debug Information: CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files
RPE-02230: Debug Information: ComSpec = C:\Windows\system32\cmd.exe
RPE-02235: The operating system has reported that it cannot execute the requested command. This may be because the command or the parameters are invalid, or that the command is shell command. Any result code return is specific to the operating system. Debug information has been produced.
Cannot run program "/usr/bin/perl": CreateProcess error=2, The system cannot find the file specified
OUBIWF_D_DEVICE_ACTIVITY_TYPE:EMAIL_FILEMGR 1 2012-07-04 16:57:40.0Parameters
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at "SYS.UTL_TCP", line 17
ORA-06512: at "SYS.UTL_TCP", line 267
ORA-06512: at "SYS.UTL_SMTP", line 161
ORA-06512: at "SYS.UTL_SMTP", line 197
ORA-06512: at line 8Hi There
Am experiencing the same issue. Did you manage to resolve it, is so can you advice what the resolution is. Thanks
Regards,
Kayode -
Hi
I have created a sample Fusion Web Application(ADF) and created a test.jsp in viewcontroller with few components. I have started the integrated weblogic server and started successfully, but when I run test.jsp it is giving me the below error
Error: Cannot run program "C:\Oracle\Middleware\jdk160_21\jre\bin\javaw.exe" (in directory "C:\Documents and Settings\chowdamr\Application Data\JDeveloper\system11.1.1.4.37.59.23\o.jdeveloper\DefaultWorkspace"): CreateProcess error=267, The directory name is invalid.
Initially this page is working successfuly.
Please tell me whats the problem.
Edited by: 858782 on May 13, 2011 5:28 AMThere are some problems when JDev's system directory (e.g. the \system11.1.1.4.37.59.23 directory) is in a path that contains spaces (as it is in your case - C:\Documents and Settings\...). Move the system directory to a path without spaces and try again. The simplest way to move it is to start JDeveloper in a "single user" mode (use <tt>jdeveloper.exe -singleuser</tt>) which will create the system directory within JDev's home directory. Of course, if your JDeveloper is installed in a path containing spaces, it will not work either (for example, if JDev is in C:\Program Files\...).
Have a look here for a more sophisticated approach for moving the system directory to another location:
http://technology.amis.nl/blog/8387/change-the-jdeveloper-system-directory
Dimitar -
RTMT 8.91 I can highlight but cannot right click on alarms to expand, highlight disappears after 30 seconds.
RTMT 8.91 I can highlight but cannot right click on alarms to expand, highlight disappears after 30 seconds.
-
Please help me about BBM can receive but cannot sent
Hye alls.. Who know about this metter.. My BBM can receive but cannot reply or send to alls friend cntct in BBM,when i sent that BBM show the "X" red colour.. What i have to do if like that.. I already uninstall My BBM then i rebooting My set then i reinstall back.. Still same.. Can i have same help from u alls.. Thank you..
Hello
Is it your BIS activated?
Without it you cannot use BBM, get emails or browse the internet.
Try going to options and to host routing table and press menu key and click register to resend your service books. Now remove your battery and replace it.
See if that helps. -
ICloud mail not working. I can send but cannot receive. Is the system down?
iCloud mail not working. I can send but cannot receive. Is the system down?
Same here. I can send mails from iCloud.com Webmail, but cannot receive.
A message that you sent could not be delivered to one or more of
its recipients. This is a permanent error. The following address
failed:
"[email protected]":
SMTP error from remote server after RCPT command:
host: mx1.icloud.com.akadns.net
5.1.1 unknown or illegal alias: [email protected]
On iOS 6 device I can't receive, neither send mails.
https://dl.dropbox.com/u/2234051/IMG_0001.PNG
However, if I change to @me.com, everything works fine. -
I can send but cannot receive my emails from gmail
I can send but cannot receive my emails on my ipad from gmail
iOS: Unable to send or receive email
http://support.apple.com/kb/TS3899
Can’t Send Emails on iPad – Troubleshooting Steps
http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
iPad Mail
http://www.apple.com/support/ipad/mail/
Try this: Delete the account in Mail and then set it up again.
Cheers, Tom -
I have one contact that I can call but cannot text. A return text states it is an invalid number. I have erased and re-entered the contact, changed phone identification and tried resetting the network - none have worked. What else can I try?
What kind of phone is this person using? If this is an iPhone, are you logged into iMessage. If this is not an iMessage, then I suggest you both contact AT&T. SMS which is what is used between non-iPhone devices or between an iPhone and non-iPhone device are a carrier function. There is no setting in iOS or on the iPhone that deals with SMS. If you are able to send iMessage and/or SMS to other people, then AT&T needs to either look into your account to ensure SMS is configured, or they need to look at this other person's phone to see what it is reporting as its number since it is coming back invalid for you.
Maybe you are looking for
-
Free of charge third party process.
Dear Gurus, I want to create a sales order with a third party material with zero price, create a PO and invoice the PO with zero value. Could you please tell me how this can be achieved and what are the necessary settings in config to be changed? Tha
-
Business Function for Business Context
Dear All, I have a technical question regarding business function FIN_SSC_AIC_1. This Business Function is activated on the ERP side, my doubt is if this business function is not activated can we use business context on the service request to add a F
-
Audio Level Broadcast quality in Final Cut ProX
At which volume level shall I keep the final video movie to broadcast? When it shows -6db to -12 db on the audio meter level is that OK? Basically what's the level above which I should not go? Thanks, Jacqui
-
Administrator password reset procedure failed on Weblogic 11g
We run a Weblogic Server 11g, the web console password for the user 'weblogic' is lost. The password reset procedure described "java weblogic.security.utils.AdminAccount newAdmin newPassword ." does not work, this java class is not found "Could not f
-
MWST condition type tax classification of material
Hi, we modified one user exit to change forcefully of tax classification of material in user exit MV45AFZZ . here code is working fine but later it is changing to 1 instead of 2 while changing the sale order . IF sy-tcode = 'VA01' OR sy-tcode = 'VA0