JGoyer
asked on
trying to compile and run a servlet in eclipse - errors!
Hello, I am new (again) to java and trying to run some initial tests of servlets in eclipse. Getting the following errors and completely clueless on them:
Activation.main: warning: sun.rmi.activation.execPol icy system
property unspecified and no ExecPermissions/ExecOption Permission s
granted; subsequent activation attempts may fail due to unsuccessful
ExecPermission/ExecOptionP ermission permission checks. For
documentation on how to configure rmid security, refer to:
http://java.sun.com/j2se/1.4/docs/tooldocs/solaris/rmid.html
http://java.sun.com/j2se/1.4/docs/tooldocs/win32/rmid.html
Activation.main: an exception occurred: Port already in use: 1098; nested exception is:
java.net.BindException: Address already in use: JVM_Bind
java.rmi.server.ExportExce ption: Port already in use: 1098; nested exception is:
java.net.BindException: Address already in use: JVM_Bind
at sun.rmi.transport.tcp.TCPT ransport.l isten(Unkn own Source)
at sun.rmi.transport.tcp.TCPT ransport.e xportObjec t(Unknown Source)
at sun.rmi.transport.tcp.TCPE ndpoint.ex portObject (Unknown Source)
at sun.rmi.transport.LiveRef. exportObje ct(Unknown Source)
at sun.rmi.server.UnicastServ erRef.expo rtObject(U nknown Source)
at sun.rmi.registry.RegistryI mpl.setup( Unknown Source)
at sun.rmi.registry.RegistryI mpl.<init> (Unknown Source)
at java.rmi.registry.LocateRe gistry.cre ateRegistr y(Unknown Source)
at sun.rmi.server.Activation. main(Unkno wn Source)
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.s ocketBind( Native Method)
at java.net.PlainSocketImpl.b ind(Unknow n Source)
at java.net.ServerSocket.bind (Unknown Source)
at java.net.ServerSocket.<ini t>(Unknown Source)
at java.net.ServerSocket.<ini t>(Unknown Source)
at sun.rmi.transport.proxy.RM IDirectSoc ketFactory .createSer verSocket( Unknown Source)
at sun.rmi.transport.proxy.RM IMasterSoc ketFactory .createSer verSocket( Unknown Source)
at sun.rmi.transport.tcp.TCPE ndpoint.ne wServerSoc ket(Unknow n Source)
... 9 more
This is the code:
import java.io.IOException;
import javax.servlet.http.HttpSer vlet;
import javax.servlet.http.HttpSer vletReques t;
import javax.servlet.http.HttpSer vletRespon se;
import javax.servlet.ServletExcep tion;
public class TimeServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {
response.setContentType("t ext/plain" );
PrintWriter out = response.getWriter();
out.println("this is my first servlet");
}
}
Activation.main: warning: sun.rmi.activation.execPol
property unspecified and no ExecPermissions/ExecOption
granted; subsequent activation attempts may fail due to unsuccessful
ExecPermission/ExecOptionP
documentation on how to configure rmid security, refer to:
http://java.sun.com/j2se/1.4/docs/tooldocs/solaris/rmid.html
http://java.sun.com/j2se/1.4/docs/tooldocs/win32/rmid.html
Activation.main: an exception occurred: Port already in use: 1098; nested exception is:
java.net.BindException: Address already in use: JVM_Bind
java.rmi.server.ExportExce
java.net.BindException: Address already in use: JVM_Bind
at sun.rmi.transport.tcp.TCPT
at sun.rmi.transport.tcp.TCPT
at sun.rmi.transport.tcp.TCPE
at sun.rmi.transport.LiveRef.
at sun.rmi.server.UnicastServ
at sun.rmi.registry.RegistryI
at sun.rmi.registry.RegistryI
at java.rmi.registry.LocateRe
at sun.rmi.server.Activation.
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.s
at java.net.PlainSocketImpl.b
at java.net.ServerSocket.bind
at java.net.ServerSocket.<ini
at java.net.ServerSocket.<ini
at sun.rmi.transport.proxy.RM
at sun.rmi.transport.proxy.RM
at sun.rmi.transport.tcp.TCPE
... 9 more
This is the code:
import java.io.IOException;
import javax.servlet.http.HttpSer
import javax.servlet.http.HttpSer
import javax.servlet.http.HttpSer
import javax.servlet.ServletExcep
public class TimeServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {
response.setContentType("t
PrintWriter out = response.getWriter();
out.println("this is my first servlet");
}
}
>> java.net.BindException: Address already in use: JVM_Bind
It seems your webserver is already running and you are trying to start it again. Stop and terminate the running web-server, Start again and try.
It seems your webserver is already running and you are trying to start it again. Stop and terminate the running web-server, Start again and try.
Here's another basic guide :
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html
That can also be true the server might already be running.
Try to use netbeans for all your JSP and Servlets.
Netbeans has got a lot of features and it has a builtin compile and run option. It also has a built in debugger.
Netbeans has got a lot of features and it has a builtin compile and run option. It also has a built in debugger.
ASKER
Wonderful! Thanks All!
ASKER
I probably did not award the points properly. I will definitely use the netbean solution from here on out BUT the problem was most likely the issue with the server already being started and therefore that is the correct answer. I need to change the accepted answer and change the points around or award these points all to ldbkutty and ask a different q to award points to javatm and triguna. I am willing to do either so this is done properly.
Thanks again I greatly appreciate it!
JGoyer
Thanks again I greatly appreciate it!
JGoyer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks. :)
ASKER
I have added a new question for Javatm and triguna here: https://www.experts-exchange.com/questions/21308447/for-JavaTM-and-Triguna.html
You might be in trouble, this should be used by people who are experience
in jsp/servelts/xml in doing configurations.
If this is your 1st time it would be better to use netbeans instead (all are bundled including tomcat):
http://www.netbeans.org
If you need a tutorial here's where you should start :
www.netbeans.org/kb/articles/quickstart-40.html
Hope that helps . . .
Javatm