0

I have all the java source codes, and I use ant builds to pack them into a .EAR file and deploy to local Web logic instance(localhost:7001) running on my windows machine, then can I use eclipse to debug it ?

If yes, please let me know how to do it.

curious _s
  • 13
  • 8
  • You can not debug on a deployed app – TuyenNTA Jul 12 '17 at 22:34
  • But I used to debug an app which is built using maven and deployed on weblogic. why can't I debug this one? Is it because of ant build or because it is ear? Is there any other alternative to debug the code then? – curious _s Jul 13 '17 at 14:00

2 Answers2

0

It would be easy to debug if you install weblogic server adapter and run the weblogic from eclipse. Else you will have to go for remote debugging for a deployed app which has already been answered on stack overflow. Pls follow below link

how to debug java web application in eclips with weblogic server

  • I have added weblogic server adapters, configured them and able to start weblogic from eclipse. I deployed the app onto my weblogic local instance, but when I try to insert a breakpoint on the code anywhere by starting the server in debug mode, it gives me an alert saying that "unable to install breakpoint in the class due to missing line number attributes. Modify compiler options to generate line number attributes". I checked the compiler options in windows->preferences->java->compiler, add lines number attributes to generated class files is being checked. Any idea of what the issue is? – curious _s Jul 13 '17 at 13:51
  • And coming to remote debugging, I tried the above link before and many other online help links, but still I am getting connection refused issue:-( – curious _s Jul 13 '17 at 13:52
  • with default eclipse & jdk settings , there shouldn't be any problem of line numbers while running server in debug mode. Make sure you have latest eclipse and also try with a fresh workspace with any sample webapp initially for testing debug process..hope this helps – Shrinu Namburu Jul 16 '17 at 13:11
  • and regarding connection refused problem which means either server is not listening on that debug port or if your server is a remote server then there might be some firewall issue. – Shrinu Namburu Jul 16 '17 at 13:13
  • I did clean up of my work space in eclipse, and tried to deploy some other project in eclipse in debug mode(built using maven), in my local weblogic instance and its working fine. But I am still having issues with this weblogic , ant and ear. Yup, coming to remote connection issue, I think its firewall problem – curious _s Jul 17 '17 at 21:44
0

Basically, I have to change the ant's build.xml to allow the debug at runtime. I have added the following code to the compile options in build.xml:

Add the debug="true" debuglevel="lines,vars,source" includeantruntime="true" to all the instances of javac in build.xml.

But still you might get the "line numbers not generated exception", you can safely ignore that as our debugger stops at the breakpoint.

curious _s
  • 13
  • 8