Forums Register Login
Servlets classes and borkers classes not compiling!
hello everyone,
I am using servlets and jsp to publish a database to an intranet . My problem is that my servlets are not compiling. I am having this error when I complile my servlet :

C:\Tomcat\Tomcat\webapps\CoreData\WEB-INF\classes\ProjectServlet.java:38: package broker does not exist
private broker.RelationBroker rb = broker.RelationBroker.getRelationBroker();
And when I compile a broker class I have this error:
C:\Tomcat\Tomcat\webapps\CoreData\WEB-INF\classes\broker\ProjectBroker.java:157: package core does not exist
core.Project dr = new core.Project();

I have a package called "broker" for my brokers and anpther package called "core' for my bean classes in my classes package. i don't know why it's not compiling.
As a result I can't test my program since when I call my servlet class from my jsp page, the servlet class is not found because it has not been compiled.
I hope I am in the write forum for this.
Please help.Thanks
You need to add the base directory of your project, the directory above core and broker, to the classpath. If you add the base directory of your source tree as well, the compiler will find and compile out-of-sync source files. Check this article in the FAQ
how do i add the source directory?
My code looks like this in my servlet:

public class ProjectServlet extends HttpServlet

private String pass;
private String url;
private String driver;
private broker.RelationBroker rb = broker.RelationBroker.getRelationBroker();
private Connection con = rb.getConnection();
I've addded the source like this:
private classes.borker.RelationBroker rb= classes.broker.Relation....
but it still doesn't work..

Originally posted by Marcy KL:
how do i add the source directory?
My code looks like this in my servlet:

Not to your code. To the classpath. Check the article.

Originally posted by Joe Ess:
Check this article in the FAQ


This thread has been viewed 782 times.

All times above are in ranch (not your local) time.
The current ranch time is
Nov 19, 2018 09:02:12.