Tomcat does not start - java

When I try to startup my embedded tomcat my application will run until tomcat reaches following lines:
"Dez 11, 2012 3:28:06 PM org.apache.coyote.AbstractProtocol start
Information: Starting ProtocolHandler ["http-bio-8080"]"
Can anyone help me with embeddedTomcat?
Best regards

Try this. Run this from the command line:
netstat -a -n
Look through there and see what ports are in the LISTEN state. Do you see your port open? From the logs it looks like it's running on port 8080 (ie ["http-bio-8080"]). If you see it running on port 8080 then hit this URL:
http://localhost:8080
Did you get some sort of response from apache? Even a 404 shows it's running.
Read this: http://www.copperykeenclaws.com/embedding-tomcat-7/

Related

Tomcat not starting after modifying a xml file

I modified the web.xml file from a dynamic web project in Eclipse EE and now I can't start the Tomcat server.
Error shows:
Server Tomcat v8.0 Server at localhost failed to start.
and in the console:
SEVERE: Failed to destroy end point associated with ProtocolHandler ["ajp-nio-8009"]
How can i fix this ?
The service is already running on port 8009. You should kill it and try tomcat restart.
Try this :
Terminate the tomcat, restart it from command prompt and then first undeploy and then redeploy your web application.

Could not start GlassFish 4.0 (Windows) - port 1527 - Address already in use

I'm a newbie in Java EE 7.
I have Netbeans 7.4 with GlassFish 4.0 and Java EE 7. In a 64-bit Windows 8.1 Pro machine. I want to start the GlassFish 4.0 Server, so I clicked on the services tab in Netbeans and then in the Servers option I right-clicked GlassFish Server 4.0 and then clicked Start.
When I did that I got the following message: "Could not start GlassFish Server 4.0: HTTP or HTTPS listener port is occupied while server is not running". I have also the IIS server, but I stopped it. After stopping IIS I tried to start again the GlassFish but it showed me the same message.
Also there is a window in Netbeans called Output - Java DB Database Process and it showed me the following:
Tue May 06 22:03:11 GMT-05:00 2014 : Security manager installed using the Basic server security policy.
Tue May 06 22:03:11 GMT-05:00 2014 Thread[main,5,main] java.io.FileNotFoundException: D:\Users\Juan Jose\.netbeans-derby\derby.log (Access is denied)
Tue May 06 22:03:12 GMT-05:00 2014 : Could not listen on port 1527 on host localhost:
java.net.BindException: Address already in use: JVM_Bind
Tue May 06 22:03:12 GMT-05:00 2014 : Could not listen on port 1527 on host localhost:
java.net.BindException: Address already in use: JVM_Bind
I ran a netstat -a in Windows to see what was happening with the 1527 port and that port is in LISTENING mode.
So how can I know what application or process is ocuppying the 1527 port?
Thanks for your help !!
To find the process1 that keeps the busy port, try the following command:
netstat -ano | find "1527"
This will show a line with the port and the identifier of the process. e.g.:
TCP 127.0.0.1:1527 0.0.0.0:0 LISTENING 2268
Once you have the process ID (e.g. 2268), run the following command for release the port (this will kill the process):
taskkill /F /PID 2268
Now, try to start Glassfish.
On Linux:
lsof -Pnl +M -i6 | grep 1527
Produces:
java 31139 1001 32u IPv6 114916062 0t0 TCP 127.0.0.1:1527 (LISTEN)
Killed with:
kill -9 31139
1 If you want to know the associated program, see How do I find out what service is using a certain port?
If the above doesn't work for anyone pls follow the below steps.. Sure It will work..
Go to C:\Program Files\glassfish-4.1\glassfish\domains\domain1\config
Open "domain.xml" in a xml editor or u can use notepad++
Find "8080"(below highlighted for ur reference)
network-listener port="8080" protocol="http-listener-1"
transport="tcp" name="http-listener-1" thread-pool="http-thread-pool"
Replace "8080" with any open port. If you don't know how to find out open port try to use port no "3702" then save your file
now run your project
After running the project please have an eye on the URL
http://localhost:8080/...... should be http://localhost:3702/.....
To get open ports follow the below steps
open cmd.exe
execute cmd "netstat -ano"
Pick any one which you find is free(Like inside the green box above )
This is not an error you need to worry about. When you start GlassFish, NetBeans will also start the JavaDB (aka, Derby) database, which listens on port 1527 by default. When you shut down NetBeans, it will shut down GlassFish but will not shut down JavaDB. Therefore, when you start NetBeans a second time, NetBeans will try to start JavaDB again and fail because it is already running and listening on port 1527.
To shut down the database, you can use the NetBeans Services(Tab)->Databases->JavaDB(right click->Stop Server. To shut down from the command line use $NETBEANS_HOME/glassfish-4.0/javadb/bin/stopNetworkServer, where $NETBEANS_HOME is the top-level directory where NetBeans is installed (at least on Mac/Linux/Unix).

Tomcat is not shutting down

I am unable to shutdown tomcat. When I do ./shutdown.sh, I don't see any error, but the process still seems to be running. When I kill the process (kill -9), the process gets killed. After this, if I do a startup, and shutdown again, I see the same problem. How do I gracefully shut it down? Why is this happening in the first place? Please help me.
devServer:bin dev$ ps -ef|grep tomcat
501 34933 1 0 11:24PM test 0:02.02 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Djava.util.logging.config.file=/Users/dev/admin/runtime/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/Users/dev/admin/runtime/endorsed -classpath /Users/dev/admin/runtime/bin/bootstrap.jar:/Users/dev/admin/runtime/bin/tomcat-juli.jar -Dcatalina.base=/Users/dev/admin/runtime -Dcatalina.home=/Users/dev/admin/runtime -Djava.io.tmpdir=/Users/dev/admin/runtime/temp org.apache.catalina.startup.Bootstrap start
501 34982 33786 0 11:45PM test 0:00.00 grep tomcat
devServer:bin dev$ ./shutdown.sh
Using CATALINA_BASE: /Users/dev/admin/runtime
Using CATALINA_HOME: /Users/dev/admin/runtime
Using CATALINA_TMPDIR: /Users/dev/admin/runtime/temp
Using JRE_HOME: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Using CLASSPATH: /Users/dev/admin/runtime/bin/bootstrap.jar:/Users/dev/admin/runtime/bin/tomcat-juli.jar
devServer:bin dev$ ps -ef|grep tomcat
501 34933 1 0 11:24PM test 0:02.03 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Djava.util.logging.config.file=/Users/dev/admin/runtime/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/Users/dev/admin/runtime/endorsed -classpath /Users/dev/admin/runtime/bin/bootstrap.jar:/Users/dev/admin/runtime/bin/tomcat-juli.jar -Dcatalina.base=/Users/dev/admin/runtime -Dcatalina.home=/Users/dev/admin/runtime -Djava.io.tmpdir=/Users/dev/admin/runtime/temp org.apache.catalina.startup.Bootstrap start
501 34992 33786 0 11:45PM test 0:00.00 grep tomcat
devServer:bin dev$
Also, I see my catalina.out is rather too short. There is no port number info getting written to it at all. This is all I see everytime I startup.
Feb 15, 2014 11:24:23 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
Here is my log file -
devServer:logs dev$ cat catalina.2014-02-15.log
Feb 15, 2014 11:24:23 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
Something seems to be terribly messed up. I can't understand what. Please advise.
I am running tomcat 7.0.50 on Mac OS.
Judging by the logs, it is evident that tomcat is not starting up at all as it should be. I can advise a couple of other tests as well like to
Verify whether or not the ports are getting bound by the tomcat service or not. You can do this by issueing the command netstat -tuplen on the terminal and check to see if port 8080 is getting bound by the tomcat instance or not.
Check to see if you can ping the instance. Try to ping the tomcat instance from a local machine. Then try to ping the public ip of the server to verify whether that server is responding correctly or not
Verify that you have, infact, the complete tomcat template as is used by your other servers. Verify the tomcat installtion folder and compare it with the other tomcat templates as used in rest of your servers. Make sure all folders are there, all configuration (default tomcat config) files are present.
(Just a hunch) Verify read/write/execute privileges as well
Remove your application, shutdown tomcat, empty the logs, and then restart tomcat and re-deploy your application and then view the logs to see if you get some error
Point 3 seems more likely that you have an incomplete tomcat instance, so I advise you to make a copy of the tomcat instance used in any other server and use it in this server to make sure that the server environment is infact how it should be

Jenkins headless linux slave connection error

I get java.net.SocketException: Connection reset when trying to connect a headless debian slave to my main Jenkins master. It's been running good for a couple of weeks without error and suddenly I can't get it to connect.
I can telnet into the master on port 6256.
Slave output:
#> java -jar ~/slave.jar -jnlpUrl https://test.tv/jenkins/computer/debian_slave_node_1/slave-agent.jnlp
Aug 12, 2013 10:10:46 AM hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Hudson agent is running in headless mode.
Aug 12, 2013 10:10:46 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [https://test.tv/jenkins/, http://test.tv/jenkins/]
Aug 12, 2013 10:10:46 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to test.tv:6256
Aug 12, 2013 10:10:46 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
Aug 12, 2013 10:10:46 AM hudson.remoting.jnlp.Main$CuiListener error
SEVERE: Connection reset
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:189)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
at hudson.remoting.ClassicCommandTransport.create(ClassicCommandTransport.java:98)
at hudson.remoting.Channel.<init>(Channel.java:391)
at hudson.remoting.Channel.<init>(Channel.java:387)
at hudson.remoting.Channel.<init>(Channel.java:348)
at hudson.remoting.Channel.<init>(Channel.java:344)
at hudson.remoting.Channel.<init>(Channel.java:332)
at hudson.remoting.Engine.run(Engine.java:238)
Jenkins Master output:
java.io.IOException: Unexpected termination of the channel
at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:50)
Caused by: java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2596)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1316)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at hudson.remoting.Command.readFrom(Command.java:92)
at hudson.remoting.ClassicCommandTransport.read(ClassicCommandTransport.java:72)
at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48)
Hard to say what happens before knowing more. In particular:
does it fail at every connection request ? If so please check your auth.log on your server as it seems the failure happens after "status INFO: Handshaking" and before "Connected"
are your clock properly synchronized ?
what OSes are you using ? Which java version on your slaves ? check your PATH and JAVA_HOME
have you updated jenkins lately ? If so, have you updated the slave(s) ? Also have you tried reverting the update ? Which version are you using ? 1.520 took out support for JDK 1.5.
how do you run your java command ? From a terminal in an SSH session ? Is this scripted from the master ?
See also Jenkins slave jobs failing on "Unexpected termination of channel"
I've run into the same issue, which seemed to be worked-around by running jenkins-slave as root. Now, the thing periodically disconnects with that very same error, which I'm wondering is due to a LB keepalive. I'll update this answer as soon as I get more info.
In my case everything was working under root account. But under user account, node client failed to connect to server with message "failed Unexpected termination of the channel".
The problem was with access-or-write to working folder. As soon as I've reassigned owner throug "chown -R", node starts successfully.

Launching Jade In Ubuntu10.04 Linux

When I run the below command in terminal of ubuntu linux and also I set the ClassPath properly but I wasn't successful.
java jade.Boot -gui
I got following errors in terminal window:
15 Jun, 2011 6:33:10 PM jade.core.Runtime beginContainer
INFO: ----------------------------------
This is JADE snapshot - revision 6357 of 2010/07/06 16:27:34
downloaded in Open Source, under LGPL restrictions,
at http://jade.tilab.com/
----------------------------------------
Retrieving CommandDispatcher for platform null
15 Jun, 2011 6:33:11 PM jade.imtp.leap.CommandDispatcher addICP
WARNING: Error adding ICP jade.imtp.leap.JICP.JICPPeer#ae506e[Error: Not possible to launch JADE on a remote host (127.0.1.1). Check the -host and -local-host options.].
15 Jun, 2011 6:33:11 PM jade.core.AgentContainerImpl joinPlatform
SEVERE: Communication failure while joining agent platform: No ICP active
jade.core.IMTPException: No ICP active
at jade.imtp.leap.LEAPIMTPManager.initialize(LEAPIMTPManager.java:138)
at jade.core.AgentContainerImpl.init(AgentContainerImpl.java:316)
at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:482)
at jade.core.Runtime.createMainContainer(Runtime.java:165)
at jade.Boot.main(Boot.java:89)
15 Jun, 2011 6:33:11 PM jade.core.Runtime$1 run
INFO: JADE is closing down now.
help me to recover from this error.
I am so tired of this problem. It is one of many quirks and problems with JADE.
The problem you are facing is that you need to supply correct host information in the command line. Example
java jade.Boot -gui -local-host
This is all described here: http://jade.tilab.com/doc/tutorials/JADEAdmin/startJade.html
In many cases you don't have this problem and then it is sufficient to use the -gui option only. However I have discovered that Jade does not work very well when your resolves to 127.0.1.1. You can fix this by setting your IP address in or if you are on Linux edit your /etc/hosts file for a more permanent solution.
just type in JADE path..
java -cp lib/jade.jar jade.Boot -gui -local-host 127.0.0.1
(JADE has some problems to set local host adress)
The problem might be is previous java process might be still running on the local port , Make sure to check if port is in use or not if in use kill the java process before you rerun.
It's simple.
Modify /etc/hosts
Modify the line for the address 127.0.0.1, as follows:
127.0.0.1 localhost.localdomain localhost <machine_name>
Remove or comment the line with 127.0.1.1:
# 127.0.1.1 <machine_name>
and you're done.
The error isn't in the jade. It's a bug used by jade to start the default parameters with a bugged java method that should be fixed.
When jade runs the java method, it will retrieve 127.0.1.1 instead the loop-back 127.0.0.1.
I'm saying it because I tested. I read the JADE src that do this and I executed the java method that I didn't remember now.
Unfortunately it's happening in a few linux machines. In windows I didn't see it happens.
What I did to solve this problem was to edit the /etc/hosts file, like this:
Original file:
127.0.0.1 localhost
127.0.1.1 machine-name
Modified file:
127.0.0.1 localhost machine-name
127.0.1.1 machine-name
What I did was to put an alias of the machine-name on the loop-back ip address. This will bypass the bug.

Categories