简体   繁体   中英

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 .

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.

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.

So without any additional tools you will need to do the following for ever .java change.

  1. Save changes
  2. Run the ant compile target
  3. Run the ant direct deploy target

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. You can view changes in your JSP automatically.
  2. JRebel. For 6.2 development I cannot stress this product enough. Get a copy of My JRebel. With JRebel you can save your Java changes and see them immediately. This is a 3rd party tool though which traditionally costed 500usd. 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.

  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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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