how do you setup apache web server in netbeans 6.8? - netbeans

I'd like to debug PHP apps, but I want to setup Apache web server (httpd.exe).
I right clicked SERVERS, Add Server..., then noticed there is no option for httpd.exe, just for Glashfiish, JBoss, Apache Tomcat, and some other servers.
So, how can I add Apache Web Server (right from within the IDE just like other servers), and then properly debug PHP apps?

NetBeans does not have a plugin to integrate the IDE with the Apache HTTP server directly.
The servers that are listed in the 'Add Server' dialog are all Java EE servers. Since Apache is not a Java EE server, it is appropriate that it does not appear in that list.
That said, there are a number of articles about the ins and outs of doing PHP development with NetBeans and Apache.
It looks like you do not need to 'register' the httpd in NetBeans. The PHP development plugins are supposed to take care of doing the right thing for you.

Check it here

Related

GWT Deployment to JBoss

I am currently working on a project which has a GWT frontend and a seperate Java module with servlets and a REST interface on the backend. The project when deployed runs on a single JBoss server.
I am running into difficulties though as when I run the GWT app in hosted mode (in eclipse) the jetty server does not have a deployed Java module to interact with.
My idea was to setup a JBoss server which eclipse could deploy into for development purposes, the problem with this is that the installer for the product sets up a JBoss server with a GWT app already embedded in it, so redeploying into this JBoss instance might cause problems?
My other idea would be to create a second JBoss server to host the GWT app, with some sort of url redirect for the rest calls which would redirect to the first JBoss instance. Is this possible?
EDIT: Can I do this with the built in jetty server in eclipse and not have to worry about using a seperate JBoss server. In other words can I somehow get the jetty server in eclipse to redirect particular requests to a different URL?

Integrating JBOSS and Eclipse

I have JBOSS server. I used to make web applications using just notepad++. I used to create the necessary folders like web-inf and files like web.xml. For larger projects doing all this and manually compiling has become cumbersome. I want to use eclipse for that. I saw this tutorial - http://www.eclipse.org/webtools/community/tutorials/BuildJ2EEWebApp/BuildJ2EEWebApp.html . But I don't understand how to make a server. I already have a server. What I want to do is write JSPs and Servlets in eclipse and the build should automatically be deployed in jboss server.
How to to this?
Install JBoss Tools
After that follow the instructions from here to get started and deploy apps to JBoss Server.
To automatically deploy apps after the build you could use a build tool such as ANT or Maven.
I wrote a tutorial for this some time ago: Setting up web development environments with Eclipse
It shows how to setup JBoss within Eclipse (in addition, it also shows how to setup Tomcat and Weblogic), and also shows how to build a simple sample Servlet to verify the proper installation.
If you already use JBoss on the server side, then have a look at the client side as well: http://www.jboss.org/developer
(I haven't tried it myself, but...)
Just open eclipse then go to:
"Help-> Check For Updates" It will check for eclipse updates and installs new availables.
Now "Help -> Eclipse Market Place" Search for "Jboss tools" from search result select one(as your eclipse version) and install it. It will add adapter for new jboss versions.
Now add new server from server view select Jboss version then next add your Home directory of jboss. Then finish.
Step 1 is optional but it sometime it helps.

Debugging GWT server side code using a TomCat instance

I'm setting up a project to use MySQL as the datasource and I'm running into a couple problems.
It appears the MySQL drivers for the Java side are incompatible with the built in GWT Jetty instance. Really?
I can configure a TomCat instance and get MySQL Driver working, but I can't debug inline (Client & server together) like I normally would be able to do using the Jetty instance in dev mode, according to Google Docs.
I spent quite a while deciding between a PHP or Java backend, and one of the main advantages besides the GWT RPC mechanism was the fact that GWT provides a nice Development environment if you use Java.
Has anyone encountered the need to use a data source other than appEngine? How did you setup dev environment?
I do believe the MySQL JDBC driver is "compatible" with the embedded Jetty; but maybe you were in an AppEngine project, in which case the embedded Jetty server forbids the use of classes that are not compatible with AppEngine (so you have at dev time a behavior as similar as possible with the production environment on Google's servers).
To debug your server code running in Tomcat, you either need to launch it (the server code) using Eclipse WTP (or equivalent if you don't use Eclipse), or launch your Tomcat instance with the appropriate debug arguments e.g. -agentlib:jdwp=transport=dt_socket,address=8788,server=y,suspend=y, and then debug it as a "Remote Java Application" (in Eclipse, I don't now how they name it in other IDEs).
You can then launch your DevMode in -noserver mode (and in debug) to debug your server and client at the same time (yes, you'll actually have 2 debug sessions).
Note that the doc you refer to (whose latest version can be found here) doesn't deal with debugging the server-side code, as it's highly dependent on the server you use, how and where it's deployed, etc. GWT code on the server side is just a standard servlet, so there's nothing specific to GWT re. how to debug the server-side code.
FYI, we do use a standalone Jetty instance (not the embedded Jetty server) for more than a year using the above setup.
You can use GWT and Tomcat and still be able to debug both client and server side. Look at the jetty startup parameters in Eclipse.
I have been in a similar position few years ago and decided to use Jetty for development and tomcat for testing.

I am downloading Eclipse. But what else do I need to develop Java EE applications?

I am downloading this version of Eclipse. I want to know what else I should download and install before I can start working on Java EE applications.
Previously I used to work with NetBeans. Back then, I used to install these:
JRE
JDK
NetBeans
Tomcat
Then I could develop Java EE applications.
Is the same set of steps required when I download that Eclipse too? Or do some of the things come bundled with it? Please help me out with setting up the development environment.
Eclipse doesn't bundle JRE/JDK or app servers. Make sure you download "Eclipse IDE for Java EE Developers" package (as others will not have the plugins you need). You will need to download JDK and Tomcat separately. Note that there is no need to also download a JRE as JDK install has a JRE in it.
Note that Eclipse does have en embedded Jetty server that can be used for previewing your app without a separate app server, but most non-trivial apps still require downloading and installing the specific app server you intend to deploy in production on.
Take a look at the official website:
http://www.oracle.com/technetwork/indexes/downloads/index.html
I had installed my enviroment from these website and work properly, the server is up and running.
Tomcat is a software implementation, you need to install it separately. Take a look at the official tomcat's website at: http://tomcat.apache.org/
If you're working on a web site, my suggestions would be:
JRE/JDK, Apache Tomcat Application Server, Freemarker templating language (for page-building), Apache Web Server (for proxying, rewriting, mod_jk to load balance tomcat worker(s)), Varnish or Squid Cache, MySQL (to host UGC data (user generated content), and some kind of open source CMS system (Drupal or others) to host data that's web site editor created.

Tomcat issues inside eclipse

I am very new to Tomcat and web development in general and apologize for what may be a very silly question.
Consider 2 situations:
1.
I start Tomcat outside of Eclipse.
I use eclipse to create a war file.
I deploy it via admin console.
All is ok
2.
I start Tomcat via Eclipse
I can't access admin console
http://localhost:8080/manager/html greets me with 404 error
Same page is behaving properly when Tomcat is started outside of Eclipse
Please advise
Why might the issue be?
Why might the issue be?
You need to configure Eclipse to take control of your Tomcat installation. To do so:
double click on the Tomcat Server in the Servers view
under Server Locations, select Use Tomcat installation
This is illustrated on the screenshot below:
Eclipse creates a new Tomcat configuration separate to your Tomcat installation, in the 'Servers' project. This allows Eclipse to deploy webapps without interfering with anything you've done in your installation (via the manager app or by editing config files manually).
You can reconfigure Eclipse so that it uses the config from your Tomcat installation (see Pascal's answer), or to re-enable the manager app - but read the WTP Tomcat FAQ first as there are good reasons for it working the way it does. I don't recall ever needing to do this - the 'Servers' tab in Eclipse lets you deploy/start/stop/debug/configure apps as required.