| | |
Class.forName(String ClassName) throwing ClassNotFoundException
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
By the first one, you did not enter the classpath.
By the second one, you seem to have a line break in the classname (cut-n-paste error).
Don't just print the error, print the command you used as well, and make sure you get the command right.
By the second one, you seem to have a line break in the classname (cut-n-paste error).
Don't just print the error, print the command you used as well, and make sure you get the command right.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
Join Date: Jun 2009
Posts: 39
Reputation:
Solved Threads: 0
I mean to say, I tried -
Case I)
C:\>java -Xmx512m -cp C:\Harvester\build\classes\au.com.allhomes.listing.harvest
er.harness.ListingTestHarness --inputHtml /Harvester/build/classes/sample/data/r
search.html --listingType residentialSale --parserConfigImpl au.com.allhomes.lis
ting.harvester.parse.RealEstateCoParserConfiguration --urlConfigFile /Harvester/
build/classes/sample/data/local_url_map.properties --outputXml results-realestat
e.xml --pageType listingPage
Unrecognized option: --inputHtml
Could not create the Java virtual machine.
Case II)
C:\>cd C:\Harvester\build\classes
C:\Harvester\build\classes>java -Xmx512m -cp . au.com.allhomes.listing.harvester
.harness.ListingTestHarness --inputHtml /Harvester/build/classes/sample/data/rse
arch.html --listingType residentialSale --parserConfigImpl au.com.allhomes.listi
ng.harvester.parse.RealEstateCoParserConfiguration --urlConfigFile /Harvester/bu
ild/classes/sample/data/local_url_map.properties --outputXml results-realestate.
xml --pageType listingPage
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Uncompilable source code - cannot find sy
mbol
symbol : class HarvesterConfigurationStub
location: package au.com.allhomes.listing.harvester
at au.com.allhomes.listing.harvester.harness.ListingTestHarness.<clinit>
(ListingTestHarness.java:11)
Could not find the main class: au.com.allhomes.listing.harvester.harness.Listing
TestHarness. Program will exit.
Case I)
C:\>java -Xmx512m -cp C:\Harvester\build\classes\au.com.allhomes.listing.harvest
er.harness.ListingTestHarness --inputHtml /Harvester/build/classes/sample/data/r
search.html --listingType residentialSale --parserConfigImpl au.com.allhomes.lis
ting.harvester.parse.RealEstateCoParserConfiguration --urlConfigFile /Harvester/
build/classes/sample/data/local_url_map.properties --outputXml results-realestat
e.xml --pageType listingPage
Unrecognized option: --inputHtml
Could not create the Java virtual machine.
Case II)
C:\>cd C:\Harvester\build\classes
C:\Harvester\build\classes>java -Xmx512m -cp . au.com.allhomes.listing.harvester
.harness.ListingTestHarness --inputHtml /Harvester/build/classes/sample/data/rse
arch.html --listingType residentialSale --parserConfigImpl au.com.allhomes.listi
ng.harvester.parse.RealEstateCoParserConfiguration --urlConfigFile /Harvester/bu
ild/classes/sample/data/local_url_map.properties --outputXml results-realestate.
xml --pageType listingPage
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Uncompilable source code - cannot find sy
mbol
symbol : class HarvesterConfigurationStub
location: package au.com.allhomes.listing.harvester
at au.com.allhomes.listing.harvester.harness.ListingTestHarness.<clinit>
(ListingTestHarness.java:11)
Could not find the main class: au.com.allhomes.listing.harvester.harness.Listing
TestHarness. Program will exit.
•
•
Join Date: Jun 2009
Posts: 39
Reputation:
Solved Threads: 0
I think u mean -
java -XmX512m -cp C:\Harvester\build\classes au.com....
That is, space after C:\Harvester\build\classes to provide the classpath.
So for this i got below thing -
Also for 2nd one, i put -
C:\>cd C:\Harvester\build\classes
C:\Harvester\build\classes>java -Xmx512m -cp . au.com.allhomes.listing.harvester
.harness.ListingTestHarness --inputHtml /Harvester/build/classes/sample/data/rse
arch.html --listingType residentialSale --parserConfigImpl au.com.allhomes.listi
ng.harvester.parse.RealEstateCoParserConfiguration --urlConfigFile /Harvester/bu
ild/classes/sample/data/local_url_map.properties --outputXml results-realestate.
xml --pageType listingPage
I suppose there is a '.' to signify the current working directory as a classpath and I am getting this -
java -XmX512m -cp C:\Harvester\build\classes au.com....
That is, space after C:\Harvester\build\classes to provide the classpath.
So for this i got below thing -
•
•
•
•
C:\>java -Xmx512m -cp C:\Harvester\build\classes au.com.allhomes.listing.harvest
er.harness.ListingTestHarness --inputHtml /Harvester/build/classes/sample/data/r
search.html --listingType residentialSale --parserConfigImpl au.com.allhomes.lis
ting.harvester.parse.RealEstateCoParserConfiguration --urlConfigFile /Harvester/
build/classes/sample/data/local_url_map.properties --outputXml results-realestat
e.xml --pageType listingPage
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Uncompilable source code - cannot find sy
mbol
symbol : class HarvesterConfigurationStub
location: package au.com.allhomes.listing.harvester
at au.com.allhomes.listing.harvester.harness.ListingTestHarness.<clinit>
(ListingTestHarness.java:11)
Could not find the main class: au.com.allhomes.listing.harvester.harness.Listing
TestHarness. Program will exit.
C:\>cd C:\Harvester\build\classes
C:\Harvester\build\classes>java -Xmx512m -cp . au.com.allhomes.listing.harvester
.harness.ListingTestHarness --inputHtml /Harvester/build/classes/sample/data/rse
arch.html --listingType residentialSale --parserConfigImpl au.com.allhomes.listi
ng.harvester.parse.RealEstateCoParserConfiguration --urlConfigFile /Harvester/bu
ild/classes/sample/data/local_url_map.properties --outputXml results-realestate.
xml --pageType listingPage
I suppose there is a '.' to signify the current working directory as a classpath and I am getting this -
•
•
•
•
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Uncompilable source code - cannot find sy
mbol
symbol : class HarvesterConfigurationStub
location: package au.com.allhomes.listing.harvester
at au.com.allhomes.listing.harvester.harness.ListingTestHarness.<clinit>
(ListingTestHarness.java:11)
Could not find the main class: au.com.allhomes.listing.harvester.harness.Listing
TestHarness. Program will exit.
•
•
•
•
I think u mean -
java -XmX512m -cp C:\Harvester\build\classes au.com....
That is, space after C:\Harvester\build\classes to provide the classpath.
So for this i got below thing -
•
•
•
•
I suppose there is a '.' to signify the current working directory as a classpath and I am getting this -
You are now getting a different error. This problem is solved.
Start a new thread with this new problem.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
Join Date: Jun 2009
Posts: 39
Reputation:
Solved Threads: 0
Its just that we got rid of that exception, but in efforts to that we created a different problem.now we are playing to change the classpath in the command itself and the classloader can now create the object of 'RealEstateCoParserConfiguration' i.e. my implementation for the interface.
But in the process alters the classpath and cannot find the succeeding classes.
Is this right?or else i should post the new question for these classes can not find error...?Since now m getting cannot find symbol HarvesterConfigurationStub and getting exception at main
But in the process alters the classpath and cannot find the succeeding classes.
Is this right?or else i should post the new question for these classes can not find error...?Since now m getting cannot find symbol HarvesterConfigurationStub and getting exception at main
No we did not create a problem, simply got the code to run far enough for that already existing problem to be noticed. This thread is already too long IMHO, and this current error has nothing to do with the original error, so it is time for a new thread.
You are not "creating" any classpaths in your code, you are simply executing the program with a classpath so that it can find anything at all. It now looks as though you are attempting to compile some code within your code, which, as already said, is a new problem.
You are, however, in really very far over your head attemtping this SOS with the level of knowledge you've shown here for the basic tenants of the language that every programmer should learn as one of their first lessons.
You are not "creating" any classpaths in your code, you are simply executing the program with a classpath so that it can find anything at all. It now looks as though you are attempting to compile some code within your code, which, as already said, is a new problem.
You are, however, in really very far over your head attemtping this SOS with the level of knowledge you've shown here for the basic tenants of the language that every programmer should learn as one of their first lessons.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
Join Date: Jun 2009
Posts: 39
Reputation:
Solved Threads: 0
thnx masijade!
I taking this thing here -
http://www.daniweb.com/forums/post89...tml#post897723
And i know where i stand today and I have a dream about tomorow too!!zSo thnx a lot for helping around me and inspiring me.
And if somebody wont work just by the fear of people laughing at them then how he or she will learn.
I taking this thing here -
http://www.daniweb.com/forums/post89...tml#post897723
And i know where i stand today and I have a dream about tomorow too!!zSo thnx a lot for helping around me and inspiring me.
And if somebody wont work just by the fear of people laughing at them then how he or she will learn.
![]() |
Similar Threads
- java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver (Java)
- java.lang.ClassNotFoundException: com.mysql.jdbc.Driver (Java)
- error: The value for the useBean class attribute is invalid (JSP)
- JDBC Driver for SQL Server 2005, Class not found Exception (Java)
- org.apache.jasper.JasperException: Unable to load class for JSP (JSP)
- Help with displaying text through GUI interface (Java)
- resultset updatable (Oracle)
- MySQL drivers not loading? (Java)
- Trying to overload + for class to add to string 'is illegal' (C)
Other Threads in the Java Forum
- Previous Thread: null pointer exception problem
- Next Thread: How can login the remote system using java
| Thread Tools | Search this Thread |
-xlint add android api applet application array arrays automation bi binary blackberry bluetooth chat class classes client code compile compiler component converter database digit draw eclipse equation error event exception fractal freeze functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide idea image input int integer j2me java javame javaprojects jetbrains jni jpanel jtable julia learningresources linux list login loop main map method methods mobile myregfun netbeans newbie nonstatic notdisplaying oracle page pattern print problem program programming project qt recursion scanner screen server set size sms sort spamblocker sql string swing system thread threads time tree variablebinding windows xor






