简体   繁体   English

即使重新启动liferay,eclipse中我的Java代码更改也不会在应用程序中显示

[英]Changes in my java code in eclipse not show in application , even after liferay restart

I have a problem in Eclipse 4.7 (Oxygen) and Liferay IDE 3.1 When I alter my source code, my changes have no effect . 我在Eclipse 4.7(Oxygen)和Liferay IDE 3.1中有问题。更改源代码时,更改无效。

Earlier it was working if I restart liferay (was using liferay 2.6 and eclipse Mars and java7) from eclipse but now each time I have to do a dev ant-rebuild and then after starting server the changes reflect. 如果我从eclipse重新启动liferay(使用liferay 2.6以及eclipse Mars和java7),则可以正常工作,但是现在每次必须进行dev-ant-build,然后在启动服务器后,更改都会反映出来。

Have tried solution provided in other links like (Project -> Build Automatically) 尝试了其他链接(例如,“项目”->“自动构建”)中提供的解决方案

add project in Server but nothing seems to work. 在服务器中添加项目,但似乎无济于事。

Based off your answer to the previous comments I have determined that you are expecting to see something that is no supposed to happen. 根据您对先前评论的回答,我确定您期望看到不应该发生的事情。 If your server is running and you make a change to your Java files (any file ending in .java) you will not see the changes in your browser (on the GUI) until your save, compile, and deploy your changes. 如果服务器正在运行,并且您对Java文件(任何以.java结尾的文件)进行了更改,则在保存,编译和部署更改之前,将不会在浏览器中(在GUI上)看到更改。

So without any additional tools you will need to do the following for ever .java change. 因此,没有任何其他工具,您将需要对.java进行永久更改。

  1. Save changes 保存更改
  2. Run the ant compile target 运行ant 编译目标
  3. Run the ant direct deploy target 运行ant 直接部署目标

You should see the deployment happen in the console and you can now refresh the page and view your changes. 您应该在控制台中看到部署已完成,现在可以刷新页面并查看更改。 It is important to note that depending on your change you may need to restart the application container and clear temporary files. 重要的是要注意,根据您的更改,您可能需要重新启动应用程序容器并清除临时文件。

There are a few exceptions to this. 有一些例外。

  1. JSP changes. JSP更改。 You can view changes in your JSP automatically. 您可以在JSP中自动查看更改。
  2. JRebel. JRebel。 For 6.2 development I cannot stress this product enough. 对于6.2开发,我对这款产品不够重视。 Get a copy of My JRebel. 获取My JRebel的副本。 With JRebel you can save your Java changes and see them immediately. 使用JRebel,您可以保存Java更改并立即查看。 This is a 3rd party tool though which traditionally costed 500usd. 虽然这是传统上花费500美元的第三方工具。 It is now free though 现在它是免费的

Sorry, this was too long for a comment. 抱歉,这个评论太长了。 In the thrust of Olaf's comment though, you need to give more detail. 不过,在奥拉夫发表讲话的重点中,您需要提供更多细节。 Here are some shots in the dasrk and a question: 以下是达克斯的一些镜头和一个问题:

  1. Upgrade to Liferay 3.1.1 if you haven't. 如果还没有,请升级到Liferay 3.1.1。

  2. Do you see messages like the below ones in the log when you save an edited file? 保存编辑后的文件时,是否在日志中看到以下消息? How about when you drag the project onto the running server (the server is running, right)? 将项目拖到正在运行的服务器上(服务器正在运行)时怎么样?

21:28:01,514 INFO [pool-10-thread-2][BundleStartStopLogger:38] STOPPED com.liferay.docs.guestbook.service_1.0.0 [562] 21:28:01,588 INFO [Refresh Thread: Equinox Container: 40aeefb4-a286-0017-134c-c19af18a2252][BundleStartStopLogger:38] STOPPED com.liferay.docs.guestbook.portlet_1.0.0 [563] 21:28:01,661 INFO [pool-10-thread-3][BundleStartStopLogger:35] STARTED com.liferay.docs.guestbook.portlet_1.0.0 [563] 21:28:01,672 INFO [pool-10-thread-3][BundleStartStopLogger:35] STARTED com.liferay.docs.guestbook.service_1.0.0 [562]

  1. Have you tried restarting eclipse? 您是否尝试过重新启动Eclipse?

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

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