Showing posts with label Netbeans. Show all posts
Showing posts with label Netbeans. Show all posts

Tuesday, January 12, 2010

Netbeans and Tomcat: Shared Memory Realm problems when Tomcat is started in Debug Mode

Tomcat and Netbeans don't play nice. Everything starts out well, but the situation goes downhill every time the application is deployed, usually necessitating killing of Tomcat's JVM after a few deploys.

Finally I ran into a show stopper. It always goes away, yet I don't know what action causes it to go away, and then it comes back again later. The exact error was:

ERROR: transport error 202: failed to accept shared memory connection: stream closed

It only happens when Tomcat is started via Netbeans in debug mode. Sometimes there would be no error but no breakpoints were ever triggered.

How to fix it? Don't use a shared memory realm for debugging. The Netbeans and Tomcat JVM need some way to communicate during debugging and Netbeans provides two methods.

Go to services. Expand Servers and right click on Tomcat. Choose properties and select the startup tab. Change the radio button from Shared Memory Name to Socket Port. Kill Tomcat and start it in debug mode. Voila.

Thursday, September 17, 2009

Running Wordpress Locally and Editing with Netbeans

NetBeans
  1. Open Netbeans
  2. Tools>Plugins>Available tab
  3. Choose PHP plugin and install it
  4. File>New Project
  5. Expand the PHP Folder
  6. Choose PHP Project From Existing Source and press Next
  7. Find the root directory of your Wordpress files
  8. Give the project a name and import it
Debugging
  1. Install XAMPP as detailed in another post
  2. Point XAMPP's Apache to your Wordpress files by editing
    xampp\apache\conf\httpd.conf
  3. Search the document for htdocs -- there will be two occurences.
  4. Replace the two paths to point to your wordpress code.
Wordpress uses absolute URLs, so it will load pages from the internet if you try to view the local copy of Wordpress
So whenever you need to debug:
  1. Open your hosts file
  2. Add the following entry:
    127.0.0.1 your_domain_name
    (you can comment it out with a # at the beginning of a line)
  3. Start Mysql using XAMPP control panel
  4. Start Apache
  5. Point your browser at http://localhost

Labels

Blog Archive

Contributors