apache error

Java Tomcat error: can not access a member of class with modifiers

Class org.apache.catalina.core.DefaultInstanceManager can not access a member of class with modifiers “” sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)

If you are on tomcat/or anyother webserver for J2EE and getting this error, then the most probable servlet you have would look like this


package package;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

class MyServletClass extends HttpServlet {
...
...
...
}

The fix:

You have missed the class modifier public

public class MyServletClass

Should solve the problem

Starting Tomcatv6.0 Server at localhost has encoutered a problem, Port 80 required by Tomcat v6.0 server at localhost already in use. the server may already running in another process, or a system process may be using the port,To start this server you will need to stop the other process or change the port number(s)

While working with tomcat, you might come across this glitch. Here is how to get rid of it easily.

1. Go to server tab in your eclipse. If you cant see it you can have it through window->show view->servers
2. double click on the tomcat server and you will be directed to page for tomcat configuration.
3. On the page you will see list of ports that the current server is using.
4. Change the HTTP/1.1 from 80 – or whatever it is complaining to new one like 9181.
5. what… you’re done… :)

Happy TomCatting.

Adding Java Project to new Java web application on Eclipse

I just wanted to add my existing Java project to the current java web project and here is the simple step actually [of course from Eclipse :) ]

1. Right click on the web project and select Properties
2. Select J2EE Module Dependencies
3. Here either you can select the project which resides in the eclipse workspace or you can import additional external jars.
4. Apply OK
5. Right click web project and select Build Path -> configure
6. On the projects tab, select the project tab
7. Click Add and select the project that you would like to add
8. OK.
You are done! It is advisable if you clean your project and build a new one

To to do this:

Go to project -> clean and select your project
Select start a build immediately
Select build only the selected projects

After this reboot your Application Server – and enjoy with your imported project.