shared memeory problem while using XML with oracle [message #91514] |
Wed, 16 October 2002 03:06 |
reena
Messages: 29 Registered: November 2001
|
Junior Member |
|
|
Hi,
I am using XML with oarcle applications.
I have oracle ver 8.1.7 ,"Oracle XDK PL/SQL 9.2.0.2.0"
I pass a xml string ,parse it and travse through the document using XMLDOM.At the end freedocument and free parser.
The whole package workes fine upto 5000 records and then start giving shared memeory error
i.e. "ORA-04031: unable to allocate 4176 bytes of shared memory "
and
"ORA-29532: Java call terminated by uncaught Java exception:java.lang.ArrayIndexOutOfBoundsException: -2047 < 0"
We have suffieint shared memory and required java_pool_size.But still problem exist
What I think it is becoz freeparser and freedocument are not freeing the memory.
Can anyone pls, help on it.
it's urgent
Thanks,
Reena.
|
|
|
|
|
SOLUTION :-Re: Exception in thread "main" java.lang.NoClassDefFoundError [message #91529 is a reply to message #91514] |
Mon, 21 October 2002 12:36 |
Girish
Messages: 16 Registered: September 1998
|
Junior Member |
|
|
Hi All,
I was facing this problem and here is the step by step Information of ratifying this ERROR.
1) Check your CLASSPATH.
2) It should use two Important files/path in it (tools.jar , "." and rt.jar).CLASSPATH should look like this.
CLASSPATH=.;c:javalibtools.jar;c:xyzrt.jar
(Path should be according to your installation of javaSDK)
3) After having this change make sure that you should RESTART the Machine.
I hope your problem is resolved.
-Girish
|
|
|
|
HELP: Exception in thread "main" java.lang.NoClassDefFoundError [message #91630 is a reply to message #91610] |
Mon, 16 December 2002 07:03 |
claude comtois
Messages: 2 Registered: December 2002
|
Junior Member |
|
|
I have the same error and it seems that no one out there knows how to fix it.
Can anyone fix this problem!!!! I have been looking everywhere and no one has given an accurate way to fix the "Exception in thread "main" java.lang.NoClassDefFoundError:" ERROR. I have installed the JDK 1.3.1 version in a folder under my C:JDK 1.3.1 folder. I compile using "javac tryAgain.java" and run the program using "java tryAgain" here is my code:
import java.awt.*;
import javax.swing.*;
public class tryAnother extends JFrame
{
public static void main( String args[[]] )
{
System.out.println("hello");
}
}
This should work fantastically. I am running windows 2000. Why in the world does the compiler return the error Exception in thread "main" java.lang.NoClassDefFoundError: tryAgain. The name of my file is the same as the class name. My coding is by the book.
Does anyone know how to fix this error???????
E-mail me at comt00006@yahoo.com
Claude Comtois
|
|
|
|
|
|
Re: HELP: Exception in thread "main" java.lang.NoClassDefFoundError [message #91823 is a reply to message #91630] |
Fri, 07 March 2003 10:32 |
Mike
Messages: 417 Registered: September 1998
|
Senior Member |
|
|
Anyone found a solution to this? I got the same problem, running XP. I have a "classes" directory in my c:windowsjavaclasses, so I set the classpath to that (when I enter "echo classpath", i get a reply of c:windowsjavaclasses), but when I rerun my java HelloApplet.java, I still get the same error.
TIA
Mike
|
|
|
|
Re: HELP: Exception in thread "main" java.lang.NoClassDefFoundError [message #92017 is a reply to message #91630] |
Sat, 31 January 2004 04:32 |
siva krishna
Messages: 1 Registered: January 2004
|
Junior Member |
|
|
This problem is due to the wrong naming of the filename.In java,if we use the public keyword before class keyword ,we must make sure that the class name and file name are same to run the program.So to solve the above problem,better change the filename to tryAnother.java.Then compile it using javac tryAnother.java and run the above program using java tryAnother.pls reply me if it works or not.
Thanks and regards,
Shiva
|
|
|
|
HELP: Exception in thread "main" java.lang.NoClassDefFoundError [message #92133 is a reply to message #91630] |
Mon, 22 March 2004 16:41 |
Adrian
Messages: 16 Registered: May 2002
|
Junior Member |
|
|
I too have the same error.
I have been looking everywhere and no one has given an accurate way to fix the "Exception in thread "main" java.lang.NoClassDefFoundError:" ERROR. I have read these reply's about setting class paths. i am unsure how to do this.
I have installed the JDK 1.3.1 version in a folder under my C:JDK 1.3.1 folder. I compile using "javac question1.java" and run the program using "java question1.java" here is my code:
import java.io.*;
class question1{
public static void main( String[[]]args ) throws IOException
{BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter the first integer.> ");
int n1 = Integer.parseInt(stdin.readLine());
System.out.print("Enter the second integer.> ");
int n2 = Integer.parseInt(stdin.readLine());
int sum = n1 + n2;
System.out.println("The sum is: " +sum);
}
}
|
|
|
Re: HELP: Exception in thread "main" java.lang.NoClassDefFoundError [message #92137 is a reply to message #92133] |
Tue, 23 March 2004 01:10 |
Dominic Oyeniran
Messages: 1 Registered: March 2004
|
Junior Member |
|
|
There are two things you need to do,
1. go to the environment settings on your computer, create CLASSPATH variable and set the CLASSPATH variable to the location of your jsdk(version)tools.jar and and rt.jar e.g.
C:jsdk1.3.1_03libtools.jar;C:jsdk1.3.1_03jrtlibrt.jar
2. You have to include .; in front of these variable.
i.e. Your CLASSPATH is now:- .;C:jsdk1.3.1_03libtools.jar;C:jsdk1.3.1_03jrtlibrt.jar
This ask the java command to look at your question1.java in the current running directory if you run java question1 at the command prompt for example c:java question1
Hope this help, kindly mail me to let me know.
Dominic
|
|
|
|
Re: HELP: Exception in thread "main" java.lang.NoClassDefFoundError [message #92139 is a reply to message #92138] |
Tue, 23 March 2004 13:16 |
Adrian
Messages: 16 Registered: May 2002
|
Junior Member |
|
|
Hi Shawn,
Thanks for the reply although it still isnt working.
Lets go over the steps..
I have installed JDK version 1.4.1_07 in a directory called JDK hence the path is C:JDK.
When browsing this directory i have the following sub-directories...
bin, demo, include, jre, and lib.
Under the lib directory is the file tools.jar
Under jrelib directory is the file rt.jar.
Now i am at the environment variable section.
There are two sections you can set the classpath
Do you set the class path "User Variables for Administrators" or the bottom part of the screen which is "System Variables".
I wasnt too sure but i chose "System Variables".
Anyway i clicked the new button and it comes up with "Variable name" and "Variable Value".
Under "Variable name i enetered the following... CLASSPATH
Under "Variable Value" i enetered the following...
.;C:jdklibtools.jar;C:jdkjrelibrt.jar.
I restarted my PC and now i do the following.
Copied the file question1.java file to c:jdkbin.
Open a command prompt and go to that directory.
i type... javac question1.java and it compiles successfully.
I then tupe... java question1.java and it returns the error message that i have always been getting.
I have just started learning Java as a something to do in my spare time alhtough i cant get past this error message. Am i doing something wrong?
Thanks again
Adrian
|
|
|
Re: HELP: Exception in thread "main" java.lang.NoClassDefFoundError [message #92140 is a reply to message #92137] |
Tue, 23 March 2004 13:17 |
Adrian
Messages: 16 Registered: May 2002
|
Junior Member |
|
|
Hi Dom,
Thanks for the reply although it still isnt working.
Lets go over the steps..
I have installed JDK version 1.4.1_07 in a directory called JDK hence the path is C:JDK.
When browsing this directory i have the following sub-directories...
bin, demo, include, jre, and lib.
Under the lib directory is the file tools.jar
Under jrelib directory is the file rt.jar.
Now i am at the environment variable section.
There are two sections you can set the classpath
Do you set the class path "User Variables for Administrators" or the bottom part of the screen which is "System Variables".
I wasnt too sure but i chose "System Variables".
Anyway i clicked the new button and it comes up with "Variable name" and "Variable Value".
Under "Variable name i enetered the following... CLASSPATH
Under "Variable Value" i enetered the following...
.;C:jdklibtools.jar;C:jdkjrelibrt.jar.
I restarted my PC and now i do the following.
Copied the file question1.java file to c:jdkbin.
Open a command prompt and go to that directory.
i type... javac question1.java and it compiles successfully.
I then tupe... java question1.java and it returns the error message that i have always been getting.
I have just started learning Java as a something to do in my spare time alhtough i cant get past this error message. Am i doing something wrong?
Thanks again
Adrian
|
|
|
The solution I found to the error: Exception in thread "main" java.lang.NoClassDefFoundError [message #92144 is a reply to message #91630] |
Wed, 24 March 2004 23:39 |
Mounir Mhamdi
Messages: 1 Registered: March 2004
|
Junior Member |
|
|
Claude,
I had the same error (Exception in thread "main" java.lang.NoClassDefFoundError) generated when I run java command to execute a simple Java application that simply prints "Hello World".
I am having JDK 1.4 installed over XP in a folder called "Java" in C: drive.
In case you have same OS, the solution I found is that no need for CLASSPATH variable, (what I did is that I delete it) but you need just to modify you PATH system variable by adding the path to your "bin" folder;meaning: add to the right side of the PATH varibale something lik: ;C:xyzbin.Where xyz is the path specific to your installation. To check that you have done it correctly, open a DOS window and type JAVAC. You should get the response of the JAVAC compiler and not a system error.A frequent mistake is that people keeps testing with the same DOS window while making variable changes.You should open a new DOS window once you made a change to be sure about the results of your tests. For XP, no need for restarting the machine at every system variable change.Moreover, make sure that your class name is the same as your file name where your java class is defined.
After doing this I guess you will be able to run you application without this Exception in thread "main" java.lang.NoClassDefFoundError.
Hope this helps.
Mounir Mhamdi
|
|
|
Re: The solution I found to the error: Exception in thread "main" java.lang.NoClassDefFoundError [message #92147 is a reply to message #92144] |
Thu, 25 March 2004 13:01 |
Adrian
Messages: 16 Registered: May 2002
|
Junior Member |
|
|
Hi Mounir,
Thanks for the information about how to get the bin directory commands working from any directory in a dos prompt. Although i too am getting the same error (in thread "main" java.lang.NOClassDefFoundError" even though i have followed your steps.
Lets go over the steps..
I have installed JDK version 1.4.1_07 in a directory called JDK hence the path is C:JDK.
When browsing this directory i have the following sub-directories...
bin, demo, include, jre, and lib.
Under the lib directory is the file tools.jar
Under jrelib directory is the file rt.jar.
Now i am at the environment variable section.
There are two sections you can set the classpath
Do you set the class path "User Variables for Administrators" or the bottom part of the screen which is "System Variables".
I wasnt too sure but i chose "System Variables".
Anyway i clicked the new button and it comes up with "Variable name" and "Variable Value".
Under "Variable name i enetered the following... CLASSPATH
Under "Variable Value" i enetered the following...
.;C:jdklibtools.jar;C:jdkjrelibrt.jar.
I restarted my PC and now i do the following.
Copied the file question1.java file to c:jdkbin.
Open a command prompt and go to that directory.
(with your steps i dont need to go to the bin directory anymore but lets just do it this way for now)
i type... javac question1.java and it compiles successfully.
I then type... java question1.java and it returns the error message that i have always been getting.
I have just started learning Java as a something to do in my spare time alhtough i cant get past this error message. Am i doing something wrong?
My code is the following...
import java.io.*;
class question1{
public static void main( String[[]]args) throws IOException
{BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter the first integer.> ");
int n1 = Integer.parseInt(stdin.readLine());
System.out.print("Enter the second integer.> ");
int n2 = Integer.parseInt(stdin.readLine());
int sum = n1 + n2;
System.out.println("The sum is: " +sum);
}
}
Thanks again
Adrian
|
|
|
|
HELP: Exception in thread "main" java.lang.NoClassDefFoundError [message #92154 is a reply to message #91630] |
Fri, 26 March 2004 23:10 |
Janek
Messages: 1 Registered: March 2004
|
Junior Member |
|
|
I am TOO having problems with this error!!! :(
This has made me depressed. I created a few java programs at university campus (using unix OS) which work FINE. However, when I try to run the programs over a remote network on my windowsXP at home they come up with Exception in thread "main" java.lang.NoClassDefFoundError:
I have read through the solutions posted but I HAVE NO IDEA what to do. What is the actually reasoning behind the error? Is it because of windowsXP or is it because of being on remote host?
Thanks for you time :)
|
|
|
|
|
|
|
Re: HELP: Exception in thread "main" java.lang.NoClassDefFoundError (answer) [message #92171 is a reply to message #92163] |
Wed, 31 March 2004 17:07 |
Adrian
Messages: 16 Registered: May 2002
|
Junior Member |
|
|
Although i too am getting the same error (in thread "main" java.lang.NOClassDefFoundError"
Lets go over the steps..
I have installed JDK version 1.4.1_07 in a directory called JDK hence the path is C:JDK.
When browsing this directory i have the following sub-directories...
bin, demo, include, jre, and lib.
Under the lib directory is the file tools.jar
Under jrelib directory is the file rt.jar.
Now i am at the environment variable section.
There are two sections you can set the classpath
Do you set the class path "User Variables for Administrators" or the bottom part of the screen which is "System Variables".
I wasnt too sure but i chose "System Variables".
Anyway i clicked the new button and it comes up with "Variable name" and "Variable Value".
Under "Variable name i enetered the following... CLASSPATH
Under "Variable Value" i enetered the following...
.;C:jdklibtools.jar;C:jdkjrelibrt.jar.
I restarted my PC and now i do the following.
Copied the file question1.java file to c:jdkbin.
Open a command prompt and go to that directory.
(with your steps i dont need to go to the bin directory anymore but lets just do it this way for now)
i type... javac question1.java and it compiles successfully.
I then type... java question1.java and it returns the error message that i have always been getting.
I have just started learning Java as a something to do in my spare time alhtough i cant get past this error message. Am i doing something wrong?
My code is the following...
import java.io.*;
class question1{
public static void main( String[[]]args) throws IOException
{BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter the first integer.> ");
int n1 = Integer.parseInt(stdin.readLine());
System.out.print("Enter the second integer.> ");
int n2 = Integer.parseInt(stdin.readLine());
int sum = n1 + n2;
System.out.println("The sum is: " +sum);
}
}
I dont really understand what you were saying about the Set classpath. Can you please explain in step detail where and what i need to do.
Thanks again
Adrian
|
|
|
|
|
|
Re: HELP: Exception in thread "main" java.lang.NoClassDefFoundError [message #92218 is a reply to message #91630] |
Fri, 23 April 2004 07:07 |
Anthony
Messages: 48 Registered: September 2000
|
Member |
|
|
To fix this problem you have to place the directory where your application is locate in the path. If you are running Xp go to control panel and then go into systems, at systems click on the advance tap then click on the Environment Variable. From here you can add your application's directory to the path(along with the other defined paths), also add the path for java and javac example.
java javac path=c:j2sdk1.4.2_04bin;
your applicatin path=c:MyAppDir;
That it :)
|
|
|
Re: HELP: Exception in thread "main" java.lang.NoClassDefFoundError [message #92219 is a reply to message #91630] |
Fri, 23 April 2004 07:11 |
Anthony
Messages: 48 Registered: September 2000
|
Member |
|
|
To fix this problem you have to place the directory where your application is locate in the path. If you are running Xp go to control panel and then go into systems, at systems click on the advance tap then click on the Environment Variable. From here you can add your application's directory to the path(along with the other defined paths), also add the path for java and javac (The programs used to conpile your java application). After doing this you will not have to type out the paths for these compilers or for your application just type javac myapp.java and java myapp at the command promp.
Examples for putting directorys into the path:
java javac path=c:j2sdk1.4.2_04bin;
your applicatin path=c:MyAppDir;
That it :)
|
|
|
|
Re: HELP: Exception in thread "main" java.lang.NoClassDefFoundError(Another Question) [message #92264 is a reply to message #92163] |
Tue, 11 May 2004 22:06 |
sai krishna
Messages: 8 Registered: July 2001
|
Junior Member |
|
|
Hi every 1,
Initially i was getting the java.lang.NoClassDefFoundError
Then i changed my classpath...and every thing is working fine.
Thanks to you all.
But,
When i say javac *.java
It says,
>javac *.java
ListOfNumbersWOHandler.java:7: class ListOfNumbers is public, should be declared in a file named ListOfNumbers.java
public class ListOfNumbers {
^
testBR.java:9: class BookRegistration is public, should be declared in a file named BookRegistration.java
public class BookRegistration
^
2 errors
I don't understand, what is wrong if the class is public ??
But if i individually compile each of the files in the directory...
it is working fine...
I am curious to know why this error had come...
Regards,
SK.
|
|
|
|
Exception in thread "main" java.lang.NoClassDefFoundError [message #92275 is a reply to message #92148] |
Fri, 14 May 2004 06:54 |
BIndi
Messages: 4 Registered: March 2003
|
Junior Member |
|
|
import java.io.*;
import java.lang.*;
public class k extends Thread {
public static void main (String[[]] args) throws IOException, InterruptedException {
String[[]] cmdArray = {"c:\wtk20\bin\emulator","-classpath audiodemo.jar", "-Xdescriptor:audiodemo.jad"};
Process proc = Runtime.getRuntime().exec("a.bat");
System.out.println("hello");
Thread.currentThread().join();
}
}
the above is my code n i m trying to run it but i m not able to do it successfully can u please send me the solution
my file is oc c:
and my jdk is as under C:j2sdk1.4.2_01bin
i have made a batch file on c:/
which is as underPATH=c;j2sdk1.4.2_01bin
set CLASSPATH=c;bindi
can u please reply as soon as possible
|
|
|
|
|
Re: HELP: Exception in thread "main" java.lang.NoClassDefFoundError (answer) [message #92294 is a reply to message #92256] |
Thu, 20 May 2004 07:45 |
AL
Messages: 24 Registered: October 2000
|
Junior Member |
|
|
Wonderful mate this helped loads. Any idea why this worked when other methods such as setting classpaths etc. didn't? Using Eclipse it spits out errors about my packages being incorrect (alpha.src.alpha.common.utils.jars) even though it compiles using ant with a build.xml file...
Weird.
But thanks again this solved problem and impressed my boss who was also suffering :D
Al.
|
|
|
|