問題描述
Netbeans 運行我所有的項目 (Netbeans runs all my projects)
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.
參考解法
方法 1:
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...
方法 2:
This sounds like a NetBeans bug. You could trying using NB 6.7 RC 3 to see if the problem has been fixed already.
方法 3:
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.
(by Enyel、James Schek、Zian Choy、Rigo Vides)