Hi Kyle ! Thanks for the reply .. It has been days and I just cannot figure this one out... Please help..
I was using j2ee to initially create this project. Once I completed it I want to move it to production which is on websphere.. but it just doesnt work there..
Just to give you a background.. I am using JSP,Servlets and Java Beans(not EJB). I have a bean which gives database connection to all jsp,servlets.
My bean access problem from jsp works but when I call a servlet it gives me 404 Error.
I have tried to create a war in a million different ways but that just does not work.
Some of thie things I tried
1. I am putting all servlets and the java bean in the folder VioSys under classes folder. All the jsps are in MyApp.ear/MyApp.war
I did this because the first statement of my servlets I have
package VioSys;
and the Java Bean has <jsp:useBean id="conBean" scope="request" class="VioSys.ConnectDB"/>
2. Tried to put all JSP in VioSys, All Servlets in clsses and bean in VioSys, bean in classes, jars etc ... nothing works... I have practicaly figured out every feature of websphere except how to do this...
Also I create a new war and new ear everytime I try anything different to avoid any mistakes..
Please help..
I am sending you the web.xml file.
Here are the steps I followed.
Directory where all files are C:\VioSys
Create new webmodule
1) Added all JSP files Login, LoginCheck, MainMenu,AddShow (selected them from C:\Viosys)
2) Added Servlet (selected as VioSys.Add_Ticket)
3) Servlet mapping for Servlet Add_Ticket
4)Added ConnectDB (THE JAVA BEAN) as a class file.
Save webmodule as myapp
New Application > myapp.ear .. Import myapp.war in the application..Give
my as the context root.. Didnt specify any jar or classpath nothing.
Save myapp.ear and generate code. Install using console and save it in C:\WebSphere\AppServer\config\server-cfg.xml
and stop server. Start server.
I access it using URL
http://localhost/my/Login.jsp That works and when I write the username and password it uses the Bean to get connection. I reach the Main Menu where I can add a ticket. But now when I call AddTicket (by clicking submit button )which is the servlet it gives me a 404 Not Found error.
On the default_server_stdout everything else looks fine but it gives:
[03.03.17 14:40:23:336 EST] 49b1120 WebGroup X Servlet Error-[Add_Ticket]: Failed to load servlet: java.lang.NoClassDefFoundError: Add_Ticket (wrong name: VioSys/Add_Ticket)
Since my servlet name is Add_Ticket I have Servlet mapping /AddTicket because that is what is called when form is submitted.
I am not sure where I can place my servlet... Is it that the jsp files can call the bean from classes\viosys\ConnectDB.class
but my servlets cant do that ? I tried removing the package VioSys statement from the servlets as well but didnt work..
The above example the servlet is getting its own connection and has no dependency on the java bean to get the connection.. Inspite of this the servlet is not found and I get the 404 error...
Please Please help...