aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Error "Class sampleproject.remote.DvdDatabaseImpl not found "" Watch "Error "Class sampleproject.remote.DvdDatabaseImpl not found "" New topic
Author

Error "Class sampleproject.remote.DvdDatabaseImpl not found "

Rupi Kaur
Greenhorn

Joined: Mar 19, 2009
Posts: 20
Hi

I am trying to run the Denny's Dvd project.

I unzipped the java files into the directory : c:\dvd . I am able to compile the projects db, direct, gui, remote, sockets.

But - when i do 'rmic sampleproject.remote.DvdDatabaseImpl ' I get the following error:

"Class sampleproject.remote.DvdDatabaseImpl not found"

My compiled class lies here : C:\dvd\src\sampleproject\DvdDatabaseImpl

and my project directory structure is :

C:\dvd\src\sampleproject\db
C:\dvd\src\sampleproject\direct
C:\dvd\src\sampleproject\gui
C:\dvd\src\sampleproject\remote
C:\dvd\src\sampleproject\sockets


Can someone please suggest where am I doing something wrong.

Thanks.



Sean Keane
Ranch Hand

Joined: Nov 03, 2010
Posts: 581

Hi Rupi, this amazing post here should help you


SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5596
    
  15

Maybe you should set your classpath correctly? I would guess rmic -cp c:\dvd\src sampleproject.remote.DvdDatabaseImpl will do the job.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Rupi Kaur
Greenhorn

Joined: Mar 19, 2009
Posts: 20
Wow, what a prompt reply !!!

Thanks Roel and Sean - that 'amazing post' really helped and I can now run the dvd project.

However, I skipped the rmic step (as suggested in the book that if we are using >= version java5) and it went through fine.

For "rmic -cp c:\dvd\src sampleproject.remote.DvdDatabaseImpl" it said '-cp is an invalid option or argument' .

Thanks much,
Rupi

Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5596
    
  15

Rupi Kaur wrote:For "rmic -cp c:\dvd\src sampleproject.remote.DvdDatabaseImpl" it said '-cp is an invalid option or argument' .

Use -classpath instead of -cp
Rupi Kaur
Greenhorn

Joined: Mar 19, 2009
Posts: 20
it still didnt work for me, says that impl class not found. Looks like ihave messed up the classpath and path settings. will figure them out first. thanks !!

Regards.Rupi
Sean Keane
Ranch Hand

Joined: Nov 03, 2010
Posts: 581

Rupi Kaur wrote:Looks like ihave messed up the classpath


Did you use the list of commands in the post I linked to previously in the order listed. Did the rmic command specified not work?
Rupi Kaur
Greenhorn

Joined: Mar 19, 2009
Posts: 20
I have verified the classpath settings also.they look good.
Yes i ran the commands in the order specified in that link. No, the rmic command specified did not work.

Regards
Rupi
Sean Keane
Ranch Hand

Joined: Nov 03, 2010
Posts: 581

Rupi Kaur wrote:Yes i ran the commands in the order specified in that link. No, the rmic command specified did not work.i


Can you double check that you ran every single command listed and in the order listed? I double checked myself and the commands work for me. If they still don't work, then post up the commands and outputs as I have done below.

Here is my set up before I ran the commands:

Here are the commands I ran, as listed on the thread, and as you can see they all ran successfully:

F:\06-TEMP\JAVARANCH>mkdir classes

F:\06-TEMP\JAVARANCH>cd src

F:\06-TEMP\JAVARANCH\src>javac -cp ..\classes\ -d ..\classes sampleproject\db\*.java

F:\06-TEMP\JAVARANCH\src>javac -cp ..\classes\ -d ..\classes sampleproject\remote\*.java

F:\06-TEMP\JAVARANCH\src>javac -cp ..\classes\ -d ..\classes sampleproject\sockets\*.java

F:\06-TEMP\JAVARANCH\src>javac -cp ..\classes\ -d ..\classes sampleproject\direct\*.java

F:\06-TEMP\JAVARANCH\src>javac -cp ..\classes\ -d ..\classes sampleproject\gui\*.java

F:\06-TEMP\JAVARANCH\src>cd ..\classes

F:\06-TEMP\JAVARANCH\classes>rmic sampleproject.remote.DvdDatabaseImpl



As you will see from the result below the stub class does get created:

F:\06-TEMP\JAVARANCH\classes>cd sampleproject\remote

F:\06-TEMP\JAVARANCH\classes\sampleproject\remote>dir

Directory of F:\06-TEMP\JAVARANCH\classes\sampleproject\remote

16/09/2011 20:52 <DIR> .
16/09/2011 20:52 <DIR> ..
16/09/2011 20:51 1,400 DvdConnector.class
16/09/2011 20:51 279 DvdDatabaseFactory.class
16/09/2011 20:51 734 DvdDatabaseFactoryImpl.class
16/09/2011 20:51 2,175 DvdDatabaseImpl.class
16/09/2011 20:52 3,868 DvdDatabaseImpl_Stub.class
16/09/2011 20:51 192 DvdDatabaseRemote.class
16/09/2011 20:51 851 RegDvdDatabase.class
16/09/2011 20:51 1,672 RmiFactoryExample.class
16/09/2011 20:51 1,647 RmiNoFactoryExample.class
Rupi Kaur
Greenhorn

Joined: Mar 19, 2009
Posts: 20
Hi Sean

Attached is the output I got. Same again.

This time I replicated the way you said. Please see where I am doing wrong.

Thanks.



[Thumbnail for temp.JPG]

Sean Keane
Ranch Hand

Joined: Nov 03, 2010
Posts: 581

Your problem is with your classpath. If you don't set the classpath then the directory that you execute the command from will be searched for your file. If you do set the classpath the directory you execute the command from will not be searched, instead the classpath specified will be searched.
Rupi Kaur
Greenhorn

Joined: Mar 19, 2009
Posts: 20
It works now - without setting the classpath.

Thanks much.
Rupi
Sean Keane
Ranch Hand

Joined: Nov 03, 2010
Posts: 581

Super! Glad you got it working. Maybe update the thread with the problem in your set-up and the solution in case someone else stumbles upon this problem in the future, it may be of help to them?
Rupi Kaur
Greenhorn

Joined: Mar 19, 2009
Posts: 20
Hi all, the summary of my problem with solution is:

I was trying to run the steps to execute the application 'Denny's DVDs'.

While running the command ''rmic sampleproject.remote.DvdDatabaseImpl", I was getting the Error "Class sampleproject.remote.DvdDatabaseImpl not found ".

DvdDatabaseImpl.class was existing as required. But, the problem was that the Classpath was set and " If you do set the classpath the directory you execute the command from will not be searched, instead the classpath specified will be searched.If you don't set the classpath then the directory that you execute the command from will be searched for your file. "

So I remove the classpath setting and ran the command again. It worked !

Thanks to Sean for providing the solution.

Regards.Rupi

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error "Class sampleproject.remote.DvdDatabaseImpl not found "