views:

245

answers:

3

Hi! I'm using Netbeans 6.5.1 (tomcat 6.0.18 included)

I've developed many webapp projects on netbeans. I created a contextlistener for each webapp which prints "Hello World! this is <>" in contextInitialized method.

Whenever I click "Run main project" button (or click-right-mouse-button over a project and select "Run") I can see in tomcat's output window all my other projects are running as well.

I mean, when I run a project (any project) I can see that all my webapps call their respective context listener! the worst scenario is when a webapp uses hibernate: each webapp do all the related hibernate initialization work.

Is there any way to run only the project I want?

I already tried closing the other projects but that doesn't work.

A: 

This sounds like a NetBeans bug. You could trying using NB 6.7 RC 3 to see if the problem has been fixed already.

Zian Choy
A: 

Really strange indeed... I don't think this can be a NetBeans Bug since 6.5 it's an stable version. Please, double check these:

  • Did you actually tried to set a main project explicitly? (Right click on the project and Set as main project)
  • Are you sure that there are no class or package dependencies/relations on your projects?
  • Did you create every single one of your web apps with the new project wizard, or they are actually classes within your project?
  • You mention that Apache wasn't included with your NetBeans. Did you installed the app server by yourself? If so, you should check your server documentation and try to check the configuration files.
Rigo Vides
Hi rigovides* Yes, I did set a main project.* There are not dependencies between any of my webapps projects. Some webapp projects have a dependency with a java application project (a library I created). I think this library isn't the root of the problem, because even when I set as main project any webapp that doesn't use this library, even so all the webapps get to run when running main project :(* Tomcat was included with netbeans, it was install when netbeans did.Thx, any other idea?
Enyel
Then try undeploying your apps (if they are all-deployed by default) as James Schek suggest; If this doesn't then let's assume it's a NetBeans Bug (-Zian Choy), so try reinstalling NetBeans from scratch, the newer the better and with tomcat included
Rigo Vides
+3  A: 

From what I recall, Netbeans does not always un-deploy your other web applications from the development tomcat server.

To remove the other projects, go to the Services (formerly Runtime) tab. Expand the Servers group. Right click the Tomcat Server instance and select Start (if it's not already running). Expand the Tomcat Server group--it should list all of the deployed application. Right click each application and select Undeploy.

I'm going from memory so please forgive me if my instructions are off...

James Schek
Hi JamesThx, undeploy did the work!I thought that if I undeploy a webapp in netbeans it could get deleted because when used to use tomcat whithout netbeans and I undeployed an app tomcat deleted all my src files :SHowever, I think there should be some other way to say Netbeans to start only the webapp I'm running, isn't it? like some sort of auto-undeploy. Any way, thx for the tip :) I'll use it every day
Enyel