This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Where to store class file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Where to store class file?" Watch "Where to store class file?" New topic
Author

Where to store class file?

sachin shinde
Greenhorn

Joined: Jul 05, 2001
Posts: 27
Hello friends,
I wrote a bean file and compiled it.(ex. xxx.java)
It compiles with no error.
But when i called that bean in other servlet file while compiling that servlet file,
error shows 'class xxx not found.'
Pl advice me where to store that class file
and dose i have to make any changes in servlet cofiguration.
Reply soon.
sachin
kichu kichu
Ranch Hand

Joined: May 10, 2001
Posts: 59
Hi,
Which webserver are you using sachin?
regards,
kichu
sachin shinde
Greenhorn

Joined: Jul 05, 2001
Posts: 27
I am using JavaWebServer2.0
sachin
kichu kichu
Ranch Hand

Joined: May 10, 2001
Posts: 59
Hi sachin,
Create a folder inside classes\sunexamples.
eg classes\sunexamples\sachin.
save your java file inside this folder.
See that in the java file you save here,you should specify the package as
package foldername(sachin in this case).
hope that helps,
kichu
sachin shinde
Greenhorn

Joined: Jul 05, 2001
Posts: 27
Hello sir,
Thank you for reply!
I did accourding to yr suggession but Still it is showing same errer message.
If I run simple servlet file it works properly,but while creating instance of bean in that servlet file it shows class not found of that bean error.
Regards,
sachin
ruijin yang
Ranch Hand

Joined: Apr 29, 2001
Posts: 96
sachin,
1> Every class should be in the same package.So,the line "package sachin;" should be in every class;
2> Did you import your bean class in your servlet?
See the error message again and Keep trying!
ruijin yang

SUN Certified Business Component Developer Java EE Platform 5 (2008)<br />SUN Certified Developer for Java Web Services (2007)<br />IBM WebSphere Portal V5.1 Application Development (2006)<br />SUN Certified Web Component Developer (2001)<br />SUN Certified Java 2 Programmer (2001)
sachin shinde
Greenhorn

Joined: Jul 05, 2001
Posts: 27
Hello friends,
Thanks for ur reply!
I got the output. The actual problem was classpath is not proprealy set. and instead od saving class file in public_html i was saving it in Classes folder.
It is correct or because of class path it is taking it from public_html.
I am trying for both.
Pl reply your suggessions.
Thanks for your favourable reply.

regards,
sachin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Where to store class file?
 
Similar Threads
JSP - BEAN Error ???
invoking a servlet
setProperty tag in jsp:useBean
JSP +Bean/EJB
Using a Java constant in EL?