jQuery in Action, 3rd edition
The moose likes Websphere and the fly likes Unable To compile Servlets and Jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Unable To compile Servlets and Jsp" Watch "Unable To compile Servlets and Jsp" New topic

Unable To compile Servlets and Jsp

Yati Tan
Ranch Hand

Joined: May 28, 2005
Posts: 56

I am new to WebSphere and trying to compile simple Servlets and JSP files in my application already installed on WebSphere. Can anybody tell me how can I compile Simple Java file in Websphere Server ??

Pls reply soon.

SCJP 1.4<br />SCJA 1.0<br />SCWCD 1.4
Saurabh Deshpande
Ranch Hand

Joined: Aug 09, 2007
Posts: 33
hi what are you using to build the jsp and servlets?
any IDE? or you have build the application and deployed on the server?

Saurabh Deshpande.
Doing Part 2 now....
Yati Tan
Ranch Hand

Joined: May 28, 2005
Posts: 56
Hi Saurabh ,

I am learning Web Sphere on my own and therefore, modifying the existing Java files and JSPs in already installed application. I dont know which IDE should I use with WebSphere. I read somewhere, Eclipse go with WebSphere on IBM website.

Can you still help me in compiling Java files which are in existing application in my Websphere Server folder.
Saurabh Deshpande
Ranch Hand

Joined: Aug 09, 2007
Posts: 33
The Jsps get automatically compiled by the Websphere Server as far as my understanding goes.
Try to compile the java source files with our java commands as we would do for any standalone java application.
Include the lib folder in your classpath and the j2ee.jar and other jars you may require for your project.
Saurabh Deshpande
Ranch Hand

Joined: Aug 09, 2007
Posts: 33
Eclipse is an open-source IDE from Apache.
Websphere Studio Applicaiton Developer (WSAD) is a licensed IDE from IBM built on top of Eclipse with built-in Websphere Server
You can use eclipse to build(compile) the application and deploy using Websphere server.
Eclipse comes with built-in Tomcat and JBoss Servers. You can configure it to use different servers. But never did it with Wepshere.

Were you able to compile the jsps?
Yati Tan
Ranch Hand

Joined: May 28, 2005
Posts: 56
Hi Saurabh,

I am still h aving problem in compiling my java files which are in one of the packages on Websphere. The problem is that "javac" compiler is not identifying the packages mentioned on the top of class which I have imported. I have included all Jar's files in the classpath - Could you tell me where I went wrong.

My import statement looks like :
import java.io.IOException;
import java.rmi.NoSuchObjectException;
import java.util.Vector;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.ibm.websphere.samples.plantsbywebsphereejb.Catalog;
import com.ibm.websphere.samples.plantsbywebsphereejb.CatalogHome;
import com.ibm.websphere.samples.plantsbywebsphereejb.CustomerInfo;
import com.ibm.websphere.samples.plantsbywebsphereejb.OrderInfo;
import com.ibm.websphere.samples.plantsbywebsphereejb.OrderKey;
import com.ibm.websphere.samples.plantsbywebsphereejb.ShoppingCart;
import com.ibm.websphere.samples.plantsbywebsphereejb.ShoppingCartContents;
import com.ibm.websphere.samples.plantsbywebsphereejb.ShoppingCartHome;
import com.ibm.websphere.samples.plantsbywebsphereejb.StoreItem;
import com.ibm.websphere.samples.plantsbywebsphereejb.Util;

and After I am compiling my Java file, Iam getting problem as -

ShoppingServlet.java:238: cannot find symbol
symbol : variable Util
location: class com.ibm.websphere.samples.plantsbywebspherewar.ShoppingServlet
Util.debug("updatequantity: shopping cart ref must have timed out
, create a new one");

Where as I have imported the file Util through import statements.
I agree. Here's the link: http://aspose.com/file-tools
subject: Unable To compile Servlets and Jsp
It's not a secret anymore!