Exception when I try to run a liferay portlet on my tomcat server

佐手、 提交于 2019-12-24 09:49:01

问题


This is what I get:

Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 8099; nested exception is: java.net.BindException: Address already in use: JVM_Bind.

I have to mention that I use liferay 7.0 ga3 and tomcat 8.0.32, my ide is eclipse luna.

I tried to run in command line start rmiregistry some_port, but it didn't do nothing, just popped up a window and did effectively nothing. Thank you!


回答1:


In general, Tomcat uses the port 8099 to JMX communication (which is crucial for debugging). There is already another process using this port. Here are some possibilities:

  • In general it is more practical to just finish the other process. A LOT OF TIMES, the other process is Spotify. Are you using Spotify? If so, just finish it, start Liferay and then reopen Spotify. Annoying but straightforward.

  • You started another Tomcat bundle. In this case, you just have to turn it down.

  • A previous Liferay execution just crashed and let a rogue Java process running on the port. In this case, go to the terminal and execute jps:

    $ jps
    28058 org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
    1787 Bootstrap
    14207 Jps
    

    Kill the process that is labelled Bootstrap:

    $ kill -9 1787
    
  • Technically, you could change the port on Tomcat. Open the server configuration, click on "Open Launch Configuration." Then, go to the "Arguments" tab and look for 8099. Basically, follow the GIF below:

    However, I do not know all the consequences of it. I used to do it with Tomcat servers witout LDS, not sure what problems it could bring with LDS.




回答2:


Please check whether the shutdown port mentioned in the server.xml file under liferay-dxp-(version)-ga1\tomcat-(version)\conf folder.

Use the below command to find the ports running in your windows machine:

netstat /nao | findstr "80"

then change the shutdown port to any available ports, say 8010:

<Server port="8010" shutdown="SHUTDOWN">

restart the server.

Please try this step if the shutdown port is already in use.



来源:https://stackoverflow.com/questions/40237096/exception-when-i-try-to-run-a-liferay-portlet-on-my-tomcat-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!