Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

NetBeans project does not start browser  RSS feed

 
Ryan McClain
Ranch Hand
Posts: 153
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created a simple Maven Webapplication in NetBeans. I chose a server for this project.
When I run the application (F6/green Run button), nothing much happens except for this output:




When I click the Run button, my project is supposed to start the server it belongs to, deploy the web app and launch the browser at the URL of the web application, no?
Well, none of that happens.
I tried following a 'basic glassfish application tutorial' on Youtube, but when asked to run the web application, mine doesn't run. It just builds. However, in the video you see the web app running successfully, starting up the server and deploying the web app.
On my laptop, nothing happens except for the build output, even though I specifically chose the project options 'Run browser', 'Deploy on Save' and I chose the correct server as well.

! When I create a regular Java Web Application (not Maven), choosing a server etc. and I run it, it runs correctly: it launches the server, deployes the application and launches the browser at the correct URL.

What is going on here?... Is this Maven related?..






 
Ryan McClain
Ranch Hand
Posts: 153
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All right, so after three years of having this problem, I finally fixed it.

Here is the solution:

The cause of this problem was very specific: I had a custom AutoRun value in my registry, with values "cd \ && color 0a" so that my commandline would look fancier. I always repeated this step with every operating system I had, but the consequence of this was that every program first implicitly navigated to the root of a drive by executing the command "cd \" before it would execute other commands.

In the same way, Netbeans first executed "cd \" followed by its Maven commands, ending up not finding Maven, but because I had configured Maven as a global variable (in Windows 7), then the OS still found my Maven executable after all and executed its command. This is not the case in my Windows 8 system, so NetBeans showed me a subtle warning in the right hand corner of its IDE, showing 'NullPointerException'. I assume it had something to do with the missing Maven executable.

In any case, I deleted the AutoRun key value out of that specific registry folder and now all my Maven web applications run correctly.

I marked the answer of stackoverflow user 'Johan' as the correct one:
http://stackoverflow.com/questions/18936076/netbeans-7-x-maven-creates-my-project-in-the-wrong-directory/19741905#19741905

So if anyone is having Maven path problems in NetBeans, try to look in your registry if there is an AutoRun key in your CommandProcessor registry key!

I am glad this has been finally solved after three years!

Regards to everyone.
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This post emphasis the fact that people can do really strange things to their environment that can cause all kinds of unexpected issues. I have gathered a few of those in my time on this forum, but this is a completely new one to me (and I'll add it to my list of possible things that can go wrong). Sometimes it helps to have a clean virtual machine with no special configuration to try things out, then you can tell if it's just your environment (at work, I ask colleagues to send me their non-working app, then I try it on my system to see if there is just a problem with their PC's config, which quit often is the case).

Thanks, Ryan, for the additional insight and for posting it here!
 
Narayanan Madaswamy
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Open tomcat_users.xml as administrator, you can find it under conf folder like in my case C:\Program Files\Apache Software Foundation\Tomcat 8.0\conf\tomcat_users.xml and find tag and add role manager-script in roles attribute like this



But make sure tomcat is not running.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!