Link to home
Start Free TrialLog in
Avatar of srikanthradix
srikanthradixFlag for United States of America

asked on

compiling error

Hi i need to modify only one java class file from the project. so i have copied that into my local machine and tried to compile , then it says. org.apache.* package does not exist. In my current class, there is no code related to org.apache package. So i commented that and compiled then worked fine. So i have replaced the existed class in the proj with the newly generated .class ,giving some errors... like-> its missing some of the required it wrong way of doing?
Avatar of mrcoffee365
Flag of United States of America image

If a class doesn't need a package imported, then it doesn't have to be imported, regardless of where you run it -- unless it's used by reflection, in which case you won't see the error until runtime.

However, you can get exceptions from lots of things.  Please post the exceptions and your class, so we can see how they relate.

It's hard to speculate what the problem is without a lot more information.  Maybe you didn't really replace the class.  Maybe there's more than one class generated by the .java file and you didn't replace them all.  Maybe another class entirely is getting the exceptions, cause by something else, and it looks as if it's related to removing unneeded imports.  Maybe you replaced the class, but didn't reload the Web server, and it isn't getting the latest class file from disk.
Avatar of srikanthradix


here is the class.. below.. this is actullay called by some other class.

package mypack;

import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.*;  
import com.oreilly.servlet.MultipartRequest;  

public class UploadFile extends HttpServlet {
      public MultipartRequest doPost(HttpServletRequest request)
                                                throws ServletException, IOException {
      MultipartRequest multi = null;
            try {
            multi = new MultipartRequest(request, "\dir",100*1024);  

            } catch (IOException IOe) {  
                  System.out.println("File Upload Class IOEx: "+ IOe);
            } catch (Exception e) {
                  System.out.println("File Upload Class Ex: "+ e);
            return multi;

see the error below....its just some part of the error...

Error 404: SRVE0203E: Servlet [/callingupload.jsp]: org.apache.jsp._callingupload was found, but is missing another required class. SRVE0206E: This error typically implies that the servlet was originally compiled with classes which cannot be located by the server. SRVE0187E: Check your classpath to ensure that all classes required by the servlet are present.SRVE0210I: This problem can be debugged by recompiling the servlet using only the classes in the application's runtime classpath SRVE0234I:
The error message seems fairly clear.  Since you didn't compile the class within the Web server's environment, it would be easy for you to have used jars that are different from those in the Web server's environment.

I would compile the class in the Web server's environment, using the jars from that environment, to try to solve the problem. problem solved when i compiled in the RAD6.0. Now, the only problem is the session timeout.
i am using websphere app server and websphere portal server.
Avatar of mrcoffee365
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial