NetBeans 12.2 not connecting to Xdebug version 3 - netbeans

Got a problem I need to get working. I'm having difficulty getting NetBeans 12.2 to connect to Xdebug. When I try to debug I get the dreaded "Waiting For Connection (netbeans-xdebug)" which never connects. I'm running the following:
PHP version 8.0.2
Apache 2.4.46
Xdebug 3.0.3
I've read some of the other threads e.g.
netbeans shows "Waiting For Connection (netbeans-xdebug)"
Netbeans waiting for connection to XDEBUG
but they are for older versions of Xdebug and the solutions don't seem to work/commands are not the same. Having read the documentation and reading a solution in another threat my php.ini file has this at the end:
[xdebug]
zend_extension = C:\xampp\php\ext\php_xdebug-3.0.3-8.0-vs16-x86_64.dll
xdebug.client_port = 9003
xdebug.remote_handler = "dbgp"
xdebug.client_host = "localhost"
xdebug.mode=debug
xdebug.start_with_request=yes
When I click debug and run netstat I can see port 9003 is listening, but for some reason this just won't connect. I need this for work so I'm hoping someone can help a noob out? Best regards.

I had the same problem, and these are the steps how i solved it:
I reinstalled XAMPP, because I ruined my php.ini file due to configurate it too many times.
Then I followed the steps from the Xdebug homepage. You can overread it fast if you don't focus.
2.1 Download the .dll File and place it in your "Xampp/php extension directory" (C:\xampp\php\ext)
2.2 Name it to: "php_xdebug.dll"
2.3 Open the php.ini File (C:\xampp\php\php.ini)
2.4 Implement following line: "zend_extension = xdebug"
Note: I don't know if the order is important but for just in case put this Line under the following line: ";extension=shmop"
2.5 Activate the step debugger with implementing following lines:
"xdebug.mode=debug" (tells that
"xdebug.start_with_request=default"
Note: Here the same, put these lines under the following line: "extension=php_ftp.dll" (You can search for it, with the right editor)
Now you are finished with the php.ini file and can start with the Netbeans configuration.
The debug configuration in Netbeans (Tools > Options > PHP > Debugging):
Netbeans configuration
The project properties in Netbeans (right-click on project > properties):
Sources
For Source and Project Folder I entered the same directory, in this case my Project.
(right-click on project > properties > Run Configuration):
Run Configuration
Links:
https://xdebug.org/docs/step_debug
https://xdebug.org/wizard
My PHP xdebug config:
myphpinfo() - xdebug_config
Note: Step Debugger has to be enabled
PS: I tested this config. with PHP-8 and xdebug-3 and as "localhost" on Windows 10. It doesn't work for older versions!
I hope it solves your problem, i would be happy about a feedback!

There can be many reasons:
1.Missing php ini config
xdebug.idekey=netbeans-xdebug (or the value from netbeans settings - Session Id)
~ I think that form a specific version of netbeans 12.* this has been removed, but still you can give it a try
try to configure the path mapping
Map the xamp simulated server path to the real path on your computer
To see your server path you could try to do a var_dump($_SERVER['DOCUMENT_ROOT').
It must be written as in linux format using '/' sepparator.
3.Optional If you are debugging with chrome check if the netbeans connector addon is enabled. Try to debug also with other browsers like firefox or edge to see if there is a difference.

Related

Tomcat Server not starting with in 45 seconds

Server Tomcat v7.0 Server at localhost was unable to start within 101 seconds. If the server requires more time, try increasing the timeout in the server editor.
This is my error. I changed time from 45 secs to 101 secs, but the problem remains. I removed eclipse and tomcat and I re-installed again but the same problem occurs; how can I fix this?
Try remove all breakpoints.Also you can increase start up time.
Open the Servers view -> double click tomcat -> drop down the Timeouts section
I got the solution for your requirement.
I'm also getting the same error in my eclipse Luna.
Go to Window -> Preferences.
Then General -> Network Connections.
Then select the Active Provider as Manual.
Then restart the tomcat and run. It will work.
Hope it will help you.
Open servers view, open Timeouts and set up Start
Open the Servers view -> double click tomcat -> drop down the Timeouts section
you can increase the startup time for each particular server. like 45 to 450
I know it's a bit late, but I've tried everything above and nothing worked. The real problem was that I'm using hibernate, so it was trying to connect to mysql but was not able, thats why it showed time out.
Just to let u guys know, I'm using RDS(Amazon), so just to make a test I changed to my local mysql and it worked perfectly.
Hope that this answer helps somebody.
Thanks.
In my case I was using spring+hibernate and forgot to run my MYSQL server due to which hibernate was not getting loaded and thus was throwing error
Disabling my antivirus does the trick for me ...
I also had the issue of the Eclipse Tomcat Server timing out and tried every suggestion including:
increasing timeout seconds
deleting various .metadata files in workspace directory
deleting the server instance in Eclipse along with the Run Config
Nothing worked until I read a comment on a related issue and realized that I had added a breakpoint in an interceptor class after a big code change and had forgotten to toggle it off. I removed it and all other breakpoints and Tomcat started right up as it usually did.
Just go with below points.
Open Eclipse Windows -> show View -> server -> double click tomcat/press Fn + F3 -> Timeouts -> increase start time
Save setting and Restart eclipse also delete .metadata folder from work space if you don't need
Check Now... All The Best
Folks, I had this same problem and tried raising the timeout, deleting the server and creating again and did not work. I was running Eclipse Kepler in Linux. The solution proposed by #Phoenix is what worked for me:
Window -> Preferences -> General -> Network Connections
Set Active Providers in manual and then configure or not the proxy. I had this option in "Native".
Then I realized I had the variable http_proxy set. It was set in the ~/.bashrc file. This environment variable is the culprit of many problems.
Once I set http_proxy to empty
export http_proxy=
to check it:
echo $http_proxy
I was able to leave option "Active Provider" in "Native" and solve the timeout problem. This is useful because Eclipse adopts the native configuration, in case you change it often.
In my case, where I had configured http_proxy in ~./bashrc, I had to close Eclipse and even log out and log in again.
Below worked for me.
Removed all Breakpoints. Then did a clean on server as below.
Right click on server-->Click clean.
I had tried increasing the Server Start up time for tomcat server, removed server and created new server, removed server and changed run-time environment configurations. Those thing didn't work for me. At last, i found deployment descriptor(url pattern of servlet-mapping) is the one that making the trouble.
Just remove or delete the server from eclipse and reconfigure it or add it again to Eclipse.
I had the same problem I deleted the server from the server tab, and also the server folder under your eclipse workspace, restarted eclipse, set up a new server, and it appears to be running OK now.
Just for knowledge..
Also had the same issue and solved it stopping and starting again the mysql service... I think that was some conflict between mysql-service and tomcat.
Good Luck
If some one had the same issue like me about the timeout of the server where you can found it. This response can help you.
Click on window > Show View > Server.
When you are on the server, you will see the server that you have configured before.
After that, right click on your server configuration, go to Properties > General and click on Switch Location.
After you clicking on "Switch Location", the server configuration will be appear on the Package Explorer of eclipse.
Then Double click on the server file in the package explorer you will see where the timeout located.
Thank you.
None of the above worked for me but this -
1. Remove any project if configured already while installing Tomcat.
2. Right click on configured server -> clean and -> Clean tomcat working directory
Did couple of times and the issue resolved.
Thanks.
In my case tomcat was configured to start not on localhost(guess it came from servers.xml connector entry) so Eclipse fails to find it running after start. Changed Host name on Servers tab to my 192.168.xxx.yyy ip.
Had the same error message, though tomcat did start sucessfully, but then Eclipse shuts it down.
try clean Tomcat working directory,it works for me
Well, I tried all the solutions:
increasing timeout seconds;
deleting the server instance in Eclipse along with the Run Config.
None of them worked.
And:
there was no breakpoint in my code;
I don't use any antivirus.
I realized that some people - who had the same problem - were using Eclipse Helios (so was I).
I switched to Eclipse Kepler and it worked perfectly.
Maybe it can be a solution. I wanted to use Helios, but Kepler is okay.
I was too facing similar issue and here I found another solution for it.
I have just started Eclipse Luna and not developed/deployed any project yet. I tried adding Tomcat v7.0 Server and got same error.
In order to resolve the issue I went to Server Perspective (it's actually server tab next to the console tab located below Project code). Double click on Server which is added to Eclipse. It will open up Overview page. Look for Server Location and select Use workspace metadata(does not modify Tomcat location). Now restart the Server and error will go away.
Server > (double click) Tomcat v7.0 Server at localhost > (Overview page) Server Location > Select -- Use workspace metadata(does not modify Tomcat location).
URL pattern of <servlet-mapping>:
Check project explorer → Deployment descriptor → Servlet Mapping → check that all mapping present in controller package. ref. image as below:
if there is any mapping not available, Then remove that <servlet> and <servlet-mapping> tag in web.xml.
Is your browser making calls to the server while it is starting? if yes, you probably should close it
e.g. if your browser is currently set to http://localhost, close it before attempting to start the server.
If you are trying to debug the application on server, just check out the breakpoints. You might had include the whole class as breakpoint. So remove that breakpoint.
This thing worked in my case when i was trying to debug.
Nothing of the above helped me but setting:
-Djava.net.preferIPv4Stack=true
as VM Argument in the VM Arguments tab of the Tomcat Server Debug Configuration Settings
solved the problem.
(Tomcat 8, Windows 10, Eclipse Mars)
Tomcat Server not starting with in 45 seconds
right click on the configured server go to properties->select monitoring -> Add ->HTTP protocol 8080
after run server it will deploy.
I stoped the tomcat on the computer and started the service (tomcat) using the eclipse IDE.
Turns out that MySQL wasn't running in my case. I've started MySQL service, and it worked.
Timeouts:
Start: 200
Stop: 45
..and then Window → Preferences → General → Network Connection.
Set "Active Provider" = Manual (to mark all the checkboxes).
If you are running into this on Mac and you installed Tomcat using brew, one good way to get round that is to install Tomcat using a zip file instead.
Go here, download a zip file, unzip it, and in Eclipse, create a new server and specify "Tomcat installation directory" as the unzipped file.

CREDENTIAL_ERROR Starting GLASSFISH Internal Server

SOLVED - See bottom of post
Firstly, I will state that I have read all the existing posts regarding this problem and none of the suggested solutions have worked.
After upgrading eclipse to Indigo SR2 and to java 7, I was not able to start Glassfish, either embedded or separate installation.
After a week of this and because my PC was getting sluggish, I decided a full rebuild of my PC was required, so I reset the PC back to factory settings and started again.
My spec now looks like this...
Windows XP SP3 - Firewall Disabled as 3rd Party solution installed
Java 7 - jdk1.7.0_03 + jre
Eclipse Indigo SR2
hosts file...
127.0.0.1 localhost
I installed the latest Glassfish Plugin from: http://download.java.net/glassfish/eclipse/indigo
However, just as before the rebuild, when I try and start the server, I get the CREDENTIAL_ERROR.
I'm now super frustrated as I would have expected this completely clean install to just work.
I disabled the firewall, but that made no difference.
I then tried to start the embedded server manually. e.g. asadmin start-domain, and it started fine. I can stop it from Eclipse, but as soon as I try and start it again I get the CREDENTIAL_ERROR. Grrrrhhh!!!
I also spotted this entry in the eclipse .log file...
!MESSAGE GlassFish: error reading one jmx portjava.lang.NumberFormatException: For input string: "${JMX_SYSTEM_CONNECTOR_PORT}"
...which may be relevant as the final line of a verbose manual startup of the server looks like this...
[#|2012-04-09T15:33:16.625+0100|INFO|glassfish3.1.2|javax.enterprise.system.jmx.org.glassfish.admin.mbeanserver|_ThreadID=41;_Thre
adName=Thread-23;|JMX005: JMXStartupService had Started JMXConnector on JMXService URL service:jmx:rmi://HOME:8686/jndi/rmi://HOME
:8686/jmxrmi|#]
Many thanks
Chris
SOLVED
Darn it. Just after posting this, I stumbled upon this link...
http://java.net/jira/browse/GLASSFISHPLUGINS-72
...which suggested that the Anti-Virus (not the firewall) being the culprit and lo and behold, it was. I removed port 8080 from scanning and the server fired up without a problem.
Now I need to work out if I've opened up a security hole.
UPDATE
I decided to install a separate Glassfish instance and the problem started over again. In then end I discovered that I had to disable the NOD32 HTTP Scanner entirely to allow the server to start. Re-enabling it got the CREDENTIAL_ERROR again. There didn't seem to be any configuration setting that would get around this. I'll have to fire an email off to ESET to see what they suggest.
I'm working with about the same configuration. Only my eclipse is Version: Indigo Service Release 1, and I work in an environment where it isn't allowed to disable a firewall.
In my case it helped to switch to a previous version of Java (jdk6-u30), which wasn't what I intended. So I installed the newest version of the JDK at this moment: jdk1.7.0_04, and used this as the -vm value in de eclipse.ini.
This still left some complains about a Currentversion of 1.7 when 1.6 was expected by our version of Glassfish's asadmin. Which were worked around by changing the registry back to 1.6, instead of the 1.7 version added by the installation of the jdk1.7.0_04.
After these changes I could start and stop Glassfish from within eclipse without the CREDENTIAL_ERROR.

Eclipse: Glassfish and Tomcat don't work

I have reinstalled java JDK 6.0.25,(after some problems installing java, finally succeeded). I have set paths (JAVA_HOME points to C:\Program Files\Java\jdk1.6.0_25 and in Path also added C:\Program Files\Java\jdk1.6.0_25\bin).
In eclipse I have pointed everything to this new JDK, also in servers. When I have installed Glassfish 3.1, after installation the domain wasn't created. So when I add this server in Eclipse, the domain wasn't found.
So I did extract an ZIP version of Glassfish and in Eclipse configure the server to this ZIPPED Glassfish. Also I have installed tomcat 7.0.14 again and add to eclipse but both did not work.
Main problem: When I start Tomcat or Glassfish in Eclipse they don't start. Tomcat is starting but after 45 seconds it says, that the time is run out. I have read the forums to increase starting time, I have putted it to 240 sec, but it does not work, because it pop out error in which sazs, that the port is already used by a different server.
By Glassfish, when I start it, its starting, but after few minutes gives me error: Failed to start. It looks like some ports or something is blocking this servers. I have turned off firewall also and antivirus but nothing.
I have looked all the forum about "not starting Glassfish or Tomcat" but didn't found the solution. I don't want to reinstall windows for this.
So if anyone know anything about this problem, please HELP.
Update:
I've tried to change the ports in domain.xml and checked with netstat -b (everything was established), but the server (Glassfish) didn't start. It shows an error "Server GlassFish Server Open Source Edition 3 (Java EE 6) at localhost failed to start.". I've also tried install "built in Eclipse" Glassfish from marketspace and from "Install new software" from eclipse, but it comes out with the same error. Currently, for needs I'm using XP Mode in Windows 7, there servers work, without any problems.
It seems your installation odyssey messed up your system.
But you should get it working without reinstalling Windows. Maybe the fragment of an old server installation blocks the ports Glassfish and Tomcat need for operation.
Try the following:
Check which ports your "new" servers try to access (should be something like 8080 and should be written in server logs during startup)
Use netstat -b (from cmd started with admin rights) to check which application blocks this / these ports (could be java.exe if there is an old installation still hanging)
Remove the old installation (uninstall or disable service)
Try again to start your new server(s).
Try tell to GF or TC to bind the default web listener other port than 8080, because this is a root of problem.
I doesn't know well TC, but in GF case, this is very easy. Simply edit $GLASSFISH_HOME/domains/domain1/config/domain.xml and find something similar:
<network-listener port="8080" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool"></network-listener>
And replace 8080 with other port (but not same with TC). In your case I could choose 8888 which is easy to remember but you can pretty sure this is differs from TC's port.
Note: Edit this file before you start GF!

Debugging PHP files on browser with Eclipse and xDebug

I have been reading online about debugging with PHP for Developers on Eclipse and xDebug.
I have installed all the necessary files for xDebug, and now when I am in Eclipse I can run the debugger with a script and it works just fine.
The issue is that i am using AppServ (Apache, PHP and MySQL) on my Windows machine, and what I would like to do is to debug my PHP files in Eclipse when I am loading the PHP pages in my browser (instead of running them as scripts in Eclipse).
Is that possible?
Joel
In Eclipse, go to 'Preferences' then 'PHP' 'Debug' 'Installed Debuggers', 'XDebug', then 'Configure'
For 'Accept remote session' change this to 'localhost'
This will tell XDebug in Eclipse to debug whenever anyone connects with xdebug cookies or URL params set - using this with Easy Xdebug or xDebug Helper then makes debugging from realistic in-browser contexts a doddle.
I'm assuming you have Eclipse PDT for this, I'm not sure if the steps are different otherwise.
I'm not sure if this is what you ask for, but you can take a look and decide.
Easy Xdebug with Firefox https://addons.mozilla.org/en-US/firefox/addon/easy-xdebug/
Here at Oodles Technologies, we work with PHP on an extensive basis and hope this answer helps.
After opening your the php.ini file, add the following lines:
Note : (php.ini file contains in both the folders that is apache and php, it is advisable to configure the file which is present in apache folder)
<span style="font-size:16px;"><span style="font-family:arial,helvetica,sans-serif;">zend_extension = "c:/wamp/bin/php/php5.4.3/zend_ext/php_xdebug-2.2.0-5.4-vc9.dll"(use zend_extension_ts as variable name if you are using php version below 5.3)
xdebug.remote_enable = 1
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
</span></span>
After this, Make sure that "c:/wamp/tmp" exist in file system, if not then create that directory.
Then Restart your apache services.
Lastly, open your NetBeans or eclipse IDE and configure xdebug in settings.
I hope you find it useful.

ColdFusion debugging problem in Eclipse (Break points not hit)

I am trying to get the debugger (CF extension for Eclipse) working for last few hours. And struck in strange situation.
My settings are listed below
ColdFusion 8
Eclipse 3.4
I set up the RDS & modified the JVM.config settings and verified the connection & debugger, both returns successful in test run. But When i attach a debugger to the site, breakpoints are not hit.
My Eclipse workbench & site virtual directory pointing to the same path. It is in a remote server.
I left Eclipse-CF mapping blank since both pointing the same remote path.
And i am using WYSE thin client emulator.. does it anything to do with this..?
Can someone help me to resolve this problem?
Cheers
If your eclipse configuration is ok, could be that something is not confgured right on server side. Check if Line Debugger Settings > Allow Line Debugging feature is enabled and that Debugger Port (5005) is opened and accessible form client machine.
Articles that should walk you through proper setup:
http://eclipse.sys-con.com/node/382427
http://www.adobe.com/devnet/coldfusion/articles/debugger.html
Also you could try using CF Builder and/or FusionDebug http://www.fusion-debug.com/fd/ .
You do need to specify at least one mapping. Eclipse needs to know what folder in your project maps to the http root. Even if the mapping is / -> /, you need to specify that. The only time you can leave mapping blank is when the CF server is on the same machine as Eclipse.