简体   繁体   English

tomcat7一直在说它正在运行,应用程序不起作用(Raspberry Pi)

[英]tomcat7 keeps saying it's running, application not working (Raspberry Pi)

So to explain everything... 所以要解释一切...

I had a perfectly working instance of tomcat7 working with an application in one of my directories. 我在一个目录中有一个完全正常的tomcat7实例与一个应用程序一起工作。 There were no problems. 没有问题。

I then switched it to wifi rather than the ethernet, and it stopped working. 然后我将其切换为wifi而不是以太网,并且它停止工作。 So I fixed my networking issue (set a static wifi ip), and tried but it still wouldn't work. 因此,我修复了网络问题(设置了静态wifi ip),并尝试了一下,但仍然无法正常工作。 Switched it back to ethernet and it didn't go back. 将其切换回以太网,并且没有返回。 So I went and sudo rm -r my-apache-folder and tried to reinstall. 所以我去了sudo rm -r my-apache-folder并尝试重新安装。 Nothing. 没有。 Decided to then use apt-get to install tomcat7 and still nothing. 决定然后使用apt-get安装tomcat7,但仍然没有执行任何操作。 Before it was due to JRE_HOME and JAVA_HOME not being set, and that might still be a problem but tomcat says it's running when it definitely isn't. 在此之前,由于未设置JRE_HOMEJAVA_HOME ,这可能仍然是一个问题,但是tomcat表示它在肯定没有运行时正在运行。

I don't want to flood you with server.xml or something like that until I'm asked to, so please help me and I'll respond efficiently, been working on this small problem for a week or 2 now, been using every aid on the internet to no avail. 在不被要求之前,我不想用server.xml或类似的东西充斥您,所以请帮助我,我会高效地响应,现在已经解决了这个小问题一两个星期,并且一直在使用互联网上的帮助无济于事。

port 8080 isn't running tomcat: 端口8080没有运行tomcat:

pi@raspberrypi:/$ sudo netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State            PID/Program name
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN          15286/apache2
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      2334/vsftpd
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2293/sshd

Tomcat7 is "running": Tomcat7正在“运行”:

pi@raspberrypi:/$ sudo service tomcat7 restart
[ ok ] Stopping Tomcat servlet engine: tomcat7.
[ ok ] Starting Tomcat servlet engine: tomcat7.

My java directories set in /etc/environment : 我的Java目录在/etc/environment

pi@raspberrypi:/etc/tomcat7$ $JRE_HOME
-bash: /usr/lib/jvm/java-6-openjdk-armhf/: Is a directory
pi@raspberrypi:/etc/tomcat7$ $JAVA_HOME
-bash: /usr/lib/jvm/java-6-openjdk-armhf/jre/: Is a directory

when i ran ps -ef|grep catalina : 当我运行ps -ef|grep catalina

pi@raspberrypi:/etc/tomcat7$ ps -ef|grep catalina
pi       28778  2542  0 22:36 pts/0    00:00:00 grep catalina

last 26 lines of 'catalina.out': 'catalina.out'的最后26行:

04-Mar-2015 21:58:47 org.apache.catalina.startup.Catalina start
INFO: Server startup in 57199 ms
04-Mar-2015 21:58:47 org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[localhost:8005]: 
java.net.BindException: Cannot assign requested address
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:353)
    at java.net.ServerSocket.bind(ServerSocket.java:336)
    at java.net.ServerSocket.<init>(ServerSocket.java:202)
    at org.apache.catalina.core.StandardServer.await(StandardServer.java:427)
    at org.apache.catalina.startup.Catalina.await(Catalina.java:757)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:703)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:622)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:451)
04-Mar-2015 21:58:47 org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8081"]
04-Mar-2015 21:58:49 org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
04-Mar-2015 21:58:50 org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8081"]
04-Mar-2015 21:58:52 org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8081"]

/etc/hosts: / etc / hosts中:

127.0.0.1   localhost
::1     localhost ip6-localhost ip6-loopback
fe00::0     ip6-localnet
ff00::0     ip6-mcastprefix
ff02::1     ip6-allnodes
ff02::2     ip6-allrouters

127.0.1.1   raspberrypi

Ok so I "started from the bottom, now I'm here". 好的,所以我“从头开始,现在我在这里”。 haha I took the application and tested it on a separate computer, got it to work again, brought it back to the server, and got it back to where it was when I had this problem. 哈哈我拿了该应用程序,并在另一台计算机上对其进行了测试,使其再次正常工作,将其带回服务器,然后又恢复到出现此问题时的状态。 In this case, however, I KNOW tomcat7 is running, and I can access the page. 但是,在这种情况下,我知道tomcat7正在运行,并且可以访问该页面。 Now I feel that the issue of inactivity is most likely a problem with the address and how it's posted. 现在我觉得闲置问题很可能是地址及其发布方式的问题。

I'll update until it's solved! 我会更新直到解决!

NEW Catalina.out 新Catalina.out

8-Mar-2015 20:10:19 org.apache.catalina.startup.Catalina initDirs
SEVERE: Cannot find specified temporary folder at /usr/share/tomcat7/temp
08-Mar-2015 20:10:20 org.apache.catalina.startup.Catalina load
WARNING: Unable to load server configuration from [/usr/share/tomcat7/conf/server.xml]
08-Mar-2015 20:10:20 org.apache.catalina.startup.Catalina initDirs
SEVERE: Cannot find specified temporary folder at /usr/share/tomcat7/temp
08-Mar-2015 20:10:20 org.apache.catalina.startup.Catalina load
WARNING: Unable to load server configuration from [/usr/share/tomcat7/conf/server.xml]
08-Mar-2015 20:10:20 org.apache.catalina.startup.Catalina start
SEVERE: Cannot start server. Server instance is not configured.

update: fixed the above configuration issue, so it seems like I have everything working but the actual site. 更新:修复了上面的配置问题,所以看起来除了实际站点之外,我都可以正常工作。 I have the correct IP and the correct port, meaning its a problem with the configuration. 我有正确的IP和正确的端口,这意味着其配置有问题。 I tried using a non apt-get install (used a binary distro) and runs fine just like the apt-get package, but not working for my page. 我尝试使用非apt-get安装(使用了二进制发行版),并且像apt-get包一样运行良好,但不适用于我的页面。 it goes to the "it works!" 转到“有效!” page on 8080, then I put a socket to listen to port 8080 and it doesn't respond. 8080上的页面,然后我放置了一个套接字来监听端口8080,但它没有响应。 I check my router and everything is fine. 我检查路由器,一切正常。 This is driving me crazy. 这真让我抓狂。

update: port 8080 is closed externally but functions fine internally, most likely a problem with tomcat configuration/security 更新:端口8080在外部关闭,但在内部运行良好,很可能是tomcat配置/安全性问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM