Is there a way to set a timeout period on a Minecraft client when connecting to a server? This is due to Eclipse debugging - eclipse

I recently set up Eclipse debugging for developing Bukkit plugins. It's really awesome being able to see what variables are changing and on what breakpoints, but my main concern is, when debugging with clients connected to my test Minecraft server, they timeout. This is due to Eclipse, when encountering a breakpoint, pauses the servers main thread and timeouts the clients after 30 seconds. I've set the server so it doesn't shut down after 60 seconds, but the clients always disconnect. Is there a client-side option to set timeout periods? Or is it embedded in the way TCP packets work? - Or just another workaround to this?

I know this is 3+ years later but I've been struggling with this myself (Using Intellij Idea instead of Eclipse though) and I've found a solution to this, which I'll post here in case anyone else comes across this. Since the readTimeout was not behaving as I wanted it to do, what I did is the following:
a) To set timeout on the client side:
Install Forge for the spigot server version you are developing (You can still join spigot based servers for plugin development).
Install RandomPatches mod (allows you to edit hard-coded vanilla minecraft variables)
Edit RandomPatches config file (randompatches.toml) and set "read_timeout_seconds" based on your liking (This should only happen for the client-side when debugging a plugin. You should not change it for production servers ofcourse).
b) To set timeout on the server side:
Edit spigot.yml file and set "timeout-time" based on your liking. If you only change the client-side, server is going to crash once this value is surpassed and you'll need to start the server again.
c) Voila! Enjoy debugging for as long as you like!

Related

PhpStorm - debug on local, deploy on remote server

I'm working on a website using PhpStorm. For a long time I developed it locally, but then I got hosting and a remote ftp server.
I created a new project in PhpStorm with the settings for remote host, and I found that deploying code takes long time (over a minute) before I can see the result, which is quite uncomfortable when debugging.
Is there any possibility to work with code on a local server, and, when I think that the project is ready for deploy, just send it to the server.
I understand, that I can just work in two different projects and just deploy the "ready" version to server via FTP, but maybe there is some more comfortable way?
There is several answers to this question, and most of them opinion based but i will try and keep it objective.
Case 1
A big corporation gives every developer a sandbox, to test their code from, the corp requires every developer to keep their code on the sandbox.
Using mounted drives could be extremely slow. Especially when PhpStorm is indexing.
Case 2
An easy way to keep an auto backup of your code it to use the build in (s)ftp(s) upload/deploy.
Solution
In both cases you could use the auto deploy feature that saves every changes to the server, that way the deploy doesn't take over a minute, but is usually already there before you know it.
I cannot recommend to use the deployment for Production as it will not pass through your version control, SAT, security setups etc. In that case I would suggest something like rocketeer etc.
EDIT:
As for 2 projects, well you can define 2 different deployment servers, and use the default one for your testing, with auto upload or something, and then the other one can be selected from the deployment menu.

Connection times using Java Mission Control and Wildfly 8.2

I'm starting to move from visualvm to java mission control. I use wildfly 8.2, which doesn't work with JMC out of the box, but have modified the JMC ini to include the required class path as per my answer in the jboss community https://developer.jboss.org/message/955742#955742
I've been able to connect successfully, however the time it takes to connect is ridiculous. Often waiting 1-10 minutes (during which time jmc often becomes unresponsive) when connecting to a local wildfly instance, it's almost instant, the delay happens only when connecting to a remote instance.
Does anyone know what would cause this to be so slow, and if anything can be done to sort it?

Eclipse IDE remote rebug and remote edit a legacy webapp

I am in a bind here, what's happening is I have a legacy webapp which uses an in-memory database. The app requires 64GB of RAM just to launch and it takes at least 30 minutes to start.
I have to make updates/fixes to this application. Obviously it is impossible to launch it on my PC so everything has to be done on the server. I have considered setting up an Eclipse IDE on the Linux server where this app runs, but that introduces a set of new issues. I really would like to continue using my PC's Eclipse IDE and make edits to the app.
I am able to use the remote debugging capabilities of Eclipse IDE and launch this app from the linux server no problem. However this is not enough. After I make an edit, I need to be able to save/compile the file, and load this change into the server relatively quickly. I can't wait 30 minutes every time I make some updates to the app.
Can anyone recommend ideas on what to do in this scenario? Ideally I would love to be able to launch the app in DEBUG mode inside the Linux Eclipse IDE on the server and connect to this instance using remote debugging from my local/Windows IDE. I would like to make changes in my Windows Eclipse IDE and then quickly copy the files over to the linux server, pick them up in the Linux Eclipse IDE, compile them in the Eclipse IDE instance running in debug mode, and effectively "hot swapping" the changes, thereby avoiding the need to wait 30 minutes for the app to start back up... However when I try to do this, there is a caveat... I can't seem to be able to launch the webapp in Linux Eclipse IDE in both DEBUG mode and also remote-debug-connect to it, the error I am getting in Eclipse is:
"Cannot load this JVM TI agent twice"
I get what is going on: the local debugger is launching tomcat with the -agentlib:jdwp parameter and on top of it, I am trying to force it to also start up with the same arguments and so it complains, but is there some way to trick it into allowing me to remote connect into this debug session from my Windows server?
I managed to solve this issue by updating Tomcat's context.xml to support reloadable mode:
<Context reloadable="true">
And in the app to set it to reloadable in WEB-INF/web.xml:
<web-app reloadable="true">
Now I am able to make edits in my local windows Eclipse IDE, Save them, and they automatically get updated on the server side.

Why wont the Zed Attack Proxy (ZAP) start

I have ZAP installed on a build server (Windows 2008 R2) and on my Windows 7 desktop, and Zap only occasionally starts. I click on the program and my cursor shows it is waiting for a second or 2 and then nothing. Attempting to run from the command line will also not show any signs of running.
Then just out of the blue the program may launch.
Is it possible it just takes forever to start. I left my computer running and the next day when I came to work there was the UI.
I get the same results if I try to run the program in the headless state. with the -daemon flag. it never starts, it never shows up in the task manager, as an application or a process
thanks Noel
Turns out there were 2 issues. The first was that the tool was taking 4-5 minutes to start (I timed it several times at around 4m 30s). I did not have the patience to wait, so I would try to start it again. Attempting to start the application when one had started, but no UI was showing invariable caused the application to hang.
Secondly if you start it as a headless application there is no way to stop it. So if you have it headless and then try to start the application it will cause it to hang. THe easiest way to tell if it is running is to follow the log information being written out as suggested by Psiion above in his link.
To kill the process, look in the task manager for the java process and kill it.
Just in case anyone stumbles across this post, my problem was I didn't have Java installed. I had removed it a few months ago due to security considerations.
You can stop your browsesr using Java easily by using the Java control panel http://www.java.com/en/download/help/disable_browser.xml
I was facing a similar issue, the ZAP tool was working fine on my local machine but was displaying erratic behavior on the Virtual Machine. I tried all the previously mentioned suggestions but none of them could mitigate the issue. Upon checking the log files i found out that the HSQLDB files were being locked even after closing the tool or even if the tool did not start. I eventually figured out that the difference between the 2 environments was just the operating system. My local had Windows 10 pro while the VM had Windows 10 enterprise. So in case if any one else is facing similar, kindly check the operating system.

Proxy problems with Eclipse

I'm experiencing some weird problems on using web stuff in Eclipse (Indigo, Indigo SR2 and Juno). My proxy configurations seems to be messed when Eclipse tries to do sth on web.
My browsers stop to communicate and I have to restart my machine in order to restore my Internet access again (or close Eclipse and browser and force the browser to reload proxy configurations). In Eclipse, the communication is unstable, working/not working sometimes.
My "NetWork Connections" are set to Manual, where proxy address, port, auth, user and passord are set to HTTP and HTTPS schemas (I didn't use it for SOCKS due to update issues - see this question).
I have no idea of what is happening and why, and how to fix it. Thanks for helping.
It is very unlikely that Eclipse influences your global settings. If anything outside of Eclipse does not work, should look there for the problem first. Eclipse can either use your system wide settings, or it's own overrides.
I understand your frustration - hard to know what is going wrong.. I really don't see what Eclipse can be doing to cause this though. I can suggest some further troubleshooting steps though.
Can you test the proxy config on any other machine?
Can you browse normally on this machine at other times?
Can you go to the same URL in browser that Eclipse is going to?
Perhaps do you have Eclipse checking all sites for updates (Help > Software) and this is just network slowdown?
When you are experiencing this effect, can you ping outside sites?