I have 3 projects. One is a Servlet (made inside a Dynamic Web Project), the other is a socket project (also a Dynamic Web Project) and the last is a real Dynamic Web Project that I want to use to unify the other 2 project and can upload both on my Apache Tomcat Server (it not my idea, is my boss idea).
I have added the Servlet and Socket project to the Unify Project using "java built path" option on eclipse.
I have run the Unify Project inside Eclipse/Tomcat and when I made a Telnet Command to the Socket, it works!.
But the Servlet Project is not working because Tomcat it can't found the Listener Servlet Class.
I think that the problem is on web.xml of the Unify Project
For me the problem is this line:
<servlet-class>
com.ninatec.fnet3.bussiness_servlet.web.ListenerServlet
</servlet-class>
So, how can reference that class from the Servlet Project on the Unify Project?
You'd need to put that class (com.ninatec.fnet3.bussiness_servlet.web.ListenerServlet
) in the same project as the servlet because that is where's it's used.
If you're unable to do this due to design constraints from your boss then you'd either have to add the other project as a dependency of the servlet project; put the built jar file in the /lib folder of the created war file (or use dependency management such as maven). Or the other solution would be to add it as a Tomcat dependency. To do this when you have a tomcat server instance in eclipse you'd do:
com.ninatec.fnet3.bussiness_servlet.web.ListenerServlet
in itBut the last solution is probably the worst ideally you'd have the listener class in the servlet project as I doubt it would be used anywhere else, or is it?