Eclipse Luna debug slow only up to the very first breakpoint - java

Reading through Eclipse debug topics I did not find an answer to my specific problem. I wonder if anybody else has seen it. I only experience this since switching to Luna, I used Kepler and Indigo before.
I usually debug Tomcat, but it happens for any one-class test app. When the app hits the first breakpoint, Debug view is shown, then I have to wait 20-30 seconds for the debugger to initialize, and only then is the code line highlighted in the editor. From that point on every break is immediate. Other kind of slowness is not experienced. In Tomcat any subsequent request stops quickly. The problem is that it's restarted often when hot code replacement is not feasible.
Anybody knows how to tweak it? There is no building or validating process going on at that time, and I tried to allocate various amounts of memory to Eclipse. -Xms256m, -Xmx2048m usually works very well for me.

Clearing all breakpoints worked for me too. Probably it was because of that breakpoint in jar files it would be taking more time for generating line numbers for those files.

I don't know how to tweak it, but in experiencing the same problem I found an Eclipse bug ticket already created for this along with duplicates: 440470 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=440470).
Starting Eclipse with "-consolelog -debug" hasn't showed any additional errors related to this.
I am working with a large core Java project and have also installed EMF (Eclipse Modeling Framework) and GEF (Graphical Editor Framework) plugin packages and dependencies via update site. I have installed these in previous versions of Eclipse without the debug delay issue. I tried closing this project and created a new test project with a simple Java class. There was no delay when debugging this class.

I found this post trying solve my issue: Very very slow to initialize tomcat, hibernate, etc. If you fall down here for similar problem I would suggest you what resolved to me. Try:
Clear all breakpoints, mainly those in API's, clear expressions too.
That's what worked for me.

My issue was fixed in Luna SR1.

Related

Debugging simple Dropwizard application in Eclipse

I am trying to debug a simple DropWizard application in Eclipse, in an attempt to familiarise myself with it. I can start the jvm from the command line like this:
java -Xdebug -agentlib:jdwp=transport=dt_socket,address=9999,server=y,suspend=n -jar dropwizard-0.0.1-SNAPSHOT.jar server config.yaml
And then connect to it as a remote java app.
Or I can find the application class (containing the main method) in eclipse and launch the application in debug that way.
Both these methods appear to successfully start the application in debug, and sure enough, if I set a break point somewhere, it gets hit.
My problem, however, is that Eclipse would normally at this point give me some control over the application but in this case is rather oddly not allowing me to resume, or use any step commands. I can't do anything other than terminate the application.
Perhaps I am having a stupid morning, but I cannot fathom why this is happening.
Can anyone shed any light on this and how I can gain the control required to debug?
I cannot be certain, but I believe this may have been due to an unintended mix of 32bit and 64bit components.
I had the same problem with a project I was much more familiar with a few days later, and in that case it was resolved by changing the buildpath to use the 64bit JDK. I was previously deploying it to a 64bit tomcat with the 32bit jdk on the build path when this happened.
Clearly the situation is a little different with dropwizard as its deployment is self-contained, but similarly altering the build path there seemed to resolve this for me.

How to troubleshoot JRebel?

I've an application (some wars) on JBoss 5 but it isn't always getting deployed correctly with JRebel. Sometimes it works, and sometimes it doesn't. The times JRebel doesn't start I've no clue to why. There are no errors anywhere (in the console, logs, eclipse problems, etc) and the JRebel-logs are very cryptic and give no hints at all. After numerous restarts, rebuilds, eclipse refreshes and publishes to JBoss: it is starting and everything is working fine.
So, my question is, how do I troubleshoot JRebel ? Obvisouly I want to have a more stable development envirionment.
Eclipse Helios with JRebel version 5.1.0
I'm affiliated to JRebel team. Generally, the first aid guide is intended for problems like "it doesn't work" or "why it doesn't work". However, from your description I read that it works for you but sometimes you encounter a behavior that you don't expect. For this, it is the best to ask from JRebel support - if you provide the detailed description of your environment and the problem, the guys will be able to provide you with hints of what might be wrong.
Reading JRebel logs on your own doesn't really make sense. It only will make sense to JRebel engineers.
I think that in my case having deployment errors makes JRebel just stop (without any logging about why). I need to do a normal deploy without Jrebel to resolve issues before using JRebel effeciently.
And by the way, JRebel a great product that saves a lot of time.

Issues with Eclipse constantly performing clean/build

We recently started using Eclipse to develop our java application and have been running into some issues. It should be known that we do not use any version tracker, or build software which probably is not best practice, although I was hoping to find an alternative solution to our problem. We have up to 4-5 developers who could be editing a particular project at one time. Throughout our work days, we constantly run into Eclipse wanting to clean/build the project as certain files are edited. We were previously developing using TextPad and compiling at the command line, and would ideally like to use Eclipse in a similar fashion to make coding easier. Is there anyway to setup Eclipse to do what we're trying to do, or will we need to start using some kind of version tracker?
You should definitely use version control, for many reasons, not just this issue.
If you're all editing the code in the same location on a share, that'd cause this issue. You can avoid that by everyone having a local copy, which would require version control of some kind.
De select Project -> Build Automatically in your eclipse. You need to manually build your project when you want to. Think this is what you are expecting

Server is not loading/compiling the latest version of code in Eclipse?

A few days back, while the built-in server (Tomcat v5.5) in eclipse was running, and while I was modifying the code, the server used to recompile and restart itself. I've gotten into a problem from the last day, where, the server DOESN'T load the LATEST version of the code I'm writing, instead, (I'm assuming) it compiles its own internal cache. Yesterday evening, I fixed that problem by (as I can remember) by clearing some cache or something. But, I did the same today, and its malfunctioning in both ways -- by not compiling the latest version and -- not auto restarting when I modify the code. I've even tried restarting eclipse but the server is still compiling its own code which CAN'T be seen in the workspace.
[EDIT]
I've now resolved the problem which was with something with importing the right add-on library to the working directory.
While the embedded Tomcat in Eclipse should recompile the classes/JSP:s/whatever it falls victim of its own caching which causes it to load old versions of the classes after reloading. So yes, the new classes actually exist in the embedded Tomcat but since the cache isn't cleaned properly (or maybe not at all) it won't reload classes automatically and thus has to be restarted every single time you've made a change.
Additionally it seems that there's some bugs in the Eclipse Server controller which causes the auto-reloading to just stop working at times. Basically it's a bit of a mess and all you can do is to restart it continuously. Or use Jetty which is a lot faster to use when developing.
Use Jetty instead?
I have occasionally found that Eclipse gets confused about something, and frequently the easiest way is just to dump the current Eclipse tree, and unpack a new one, in which you rebuild your workspace.
We use projectSet.psf's in our source repository which makes the above process something that can be done in about a minute.

Eclipse Web Tools Platform (WTP) vs NetBeans - IDE for Java Web Development

When going to Java Web Development such as JSP, JSPX & others.
What IDE do you consider Eclipse or NetBeans?
What are its advantages and disadvantages?
Which is better preferred in-terms of developing Web Applications such as Websites, Web Services and more. I am considering NetBeans because it has already bundled some features that will allow you to create and test web applications. But is there a good reason why choose Eclipse WTP?
From a micro perspective, Netbeans is a more consistent product with certain parts more polished such as the update manager. I am sure you will find all everything you need in there.
Eclipse is sometimes a little less stable simply because there is still alot of work going on and the plugin system is usable at best. Eclipse will be faster because it uses SWT which creates the UI using native code (so, it will look prettier as well).
At a macro perspective thought, I'm sure you've heard on the news of the recent acquisition of Sun by Oracle. Well, let's just say I'm pretty sure Netbeans is pretty low on Oracle's priorities. On the other hand, Eclipse has big blue (IBM) backing it. So, in the long run, if you don't want to end up in a dead end, go for Eclipse.
I used both Eclipse and NetBeans. I like NetBeans more than Eclipse. From Java editor point of view, both have excellent context sensitive help and the usual goodies.
Eclipse sucks when it comes to setting up projects that other team members can open and use. We have a big project (around 600K lines of code) organized in many folders. Eclipse won't let you include source code that is outside the project root folder. Everything has to be below the project root folder. Usually you want to have individual projects and be able to establish dependencies among them. Once it builds, you would check them into your source control. The problem with Eclipse is that a project (i.e .classpath file) dependencies are saved in user's workspace folder. If you care to see this folder, you will find many files that read like org.eclipse.* etc. What it means is that you can't put those files in your source control. We have 20 step instruction sheet for someone to go through each time they start a fresh checkout from source control. We ended up not using its default project management stuff (i.e. classpath file etc). Rather we came up with an Ant build file and launch it from inside Eclipse. That is kludgy way. If you had to jump through these many hoops, the IDE basically failed.
I bet Eclipse project management was designed by guys who never used an IDE. Many IDES let you have different configurations to run your code (Release, Debug, Release with JDK 1.5 etc). And they let you save those things as part of your project file. Everyone in the team can use them without a big learning curve. You can create configurations in Eclipse, but you can't save them as part of your project file (i.e it won't go into your source control). I work on half dozen fresh checkouts in a span of 6 months. I get tired to recreate them with each fresh checkout.
On the other hand, NetBeans works as expected. It doesn't have this project management nightmare.
I heard good things about IntelliJ. If you are starting fresh, go with NetBeans.
My 2cents.
I use Netbeans mostly for development, and can say it's pretty good in providing most of the features I need. Code completion, one click compiling and deployment, even version control. If you need a feature not found in the core, you can also choose from a good variety of plugins. As far as I am concerned, Eclipse have a very similar feature set, though I did not work with it in detail.
However, netbeans have serious memory problems, and is very demanding on available memory, and I have seen it eat up 400-500MB of ram after repeatly deploying my app for debugging. Other than that, I say Netbeans is quite fast (if memory is adequate).
Aptana for Eclipse was I using some months ago but changed to NetBeans. It has less feature but the out-of-the-box things were nearly the same as Aptana after 2 hours customization.
Each software has some slowdowns and memory leaks, some annoying code validating bugs.
But NetBeans is better in code completing, rarely slows down, can manage 1 mb javascript files. That's why I changed from Aptana for Eclipse to NetBeans.
Other Eclipse tools I used before was lacking the things which are in Aptana and NetBeans by default. And although I am using some plugins, I don't like hacking on the IDE for days to achive a usable program.
For me:
NetBeans +
Eclipse -
From my own experience, while Eclipse provides you with tons of plugins, that is not always guaranteed to meet your expectation. I had so many problem with Eclipse plugins, ranging from different versions of Eclipse itself to the multiple plugins prerequisite for a plugin.
Plugins in NetBeans is so easy to install, but yea, it is not as many as Eclipse's.
Feeling clunky while using Eclipse also led me to move to NetBeans. While SWT is nice GUI, its load time takes considerably a long period of time compared to NetBeans Swing. But, be warned, NetBeans feels good if and only if you are using Windows platform. Apparently Swing in Linux (at least on Ubuntu 10.10) blows. Each time I click on a file in Project Manager, it tries to rename it. But this happens only if you use NetBeans in Linux.
Another point of me moving to NetBeans is the project management window. In Eclipse it sucks and does not work as what I expected. If you had ever use Visual Studios IDE project/solution view, NetBeans is the closest one resembling it.
Both consumes a lot of memory. Even worse, the Swing GUI takes a long time to load after you wake up your machine from Hibernate/Sleep. No joke. Happens to me all time.
Anyway, this is purely my opinion. Hope this helps.
Go for eclipse for unlimited plugins(free).
I was a fan of Eclipse for long time. Specially when I developed plugin and Android program.
Now I have to work with some project with maven build system and tomcat (web app), and found Eclipse too much complicated to load and debug and changes to take effece from any jsp file. And Netbeans is so smart in this regard. Even debugging with Tomcat webapp is so easy with Netbeans. So I moved to Netbeans.
At least for now, for web app development, Netbeans is the best, I guess.
Also auto completion in Eclipse for Mac, is a nightmare to me. I could not make it work with Ctrl+Space, since its a shortcut for Sptolight/Keyboard change by default. I did not use netbeans with mac yet, but I shall try.
For GUI, the WindowBuilder or Jigloo, always crush in Mac. Netbeans GUI designer was better in that sense.

Categories

Resources