aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes MissingProjectException by Maven in Netbeans 7.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "MissingProjectException by Maven in Netbeans 7.2" Watch "MissingProjectException by Maven in Netbeans 7.2" New topic
Author

MissingProjectException by Maven in Netbeans 7.2

Ryan McClain
Ranch Hand

Joined: Nov 27, 2010
Posts: 110
Hello,

I am desperate to solve this problem because it's crucial to solve it and I've been trying to fix it for a week.

When I try to either Build, Clean and Build or Run (play button) my 'Maven Webapplication' in NetBeans, I get the following output:



This is what I have tried to fix the problem:

- Googled about 30 threads on this exact subject and tried their solutions to no avail
- Uninstalled NetBeans 7.2, removed .m2 directory, removed .nbi directory (I don't know if this belongs to NetBeans), rebooted and reinstalled NetBeans 7.2
- Uninstalled NetBeans 7.2 and installed NetBeans 7.0.1
- modified the POM file of the project
- modify the context.xml file in META-INF/ folder of my project to point it to a different path.
- Correctly install Maven by adding the proper environment variables (works)

My projects used to build and run perfectly with no problems when I was using NetBeans 7.0.1, until I installed NetBeans 7.2. That's when I started getting this error.
The error doesn't go away no matter what I try.

Other strange behavior:
- When I try to create a new Maven Webapplication in NetBeans, it always creates it under the root of my drive E:\ in a folder even though I explicitly tell it to install it under my projects folder.

What works:

-The only time when my projects successfully build and run is when I run them in my Windows XP SP3 virtual machine.
So I don't know what to think here. What application or configuration is at fault? I find it very difficult to troubleshoot.

-Running this command: https://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
thus using an explicit path to my project
I don't want to do this every time. I want it to work like it's supposed to.

I can't get rid of this error.
If anyone can help, I would be very thankful.

Thank you

Specs:
JDK 1.7
Sourcecode java version: 1.6
OS: Windows 7 x64
Server used: Tomcat 7.x

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39791
    
  28
Real path on previous post replaced by ??? at the OP’s request.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

This is a NetBean problem, not a Maven problem. I assume that if you opened a command prompt, cd'ed to your project's folder and ran 'mvn install' that it would work, correct? Thus the issue is that NetBeans seems to be screwing things up (typical for most IDEs).

I would try digging through the project configuration information in NetBeans (right-click the project and select Properties), and also through the global config settings (Tools > Options) - something somewhere is telling NetBeans to use 'e:/' instead of the project's base directory. (By the way, when you reinstalled Netbeans, did you let it re-read your old configuration? If so, you might want to try an reinstall again but this time wipe out the configuration settings.)

Meanwhile. I'll move this post to the proper forum where you can get NetBeans help.


JBoss In Action
Ryan McClain
Ranch Hand

Joined: Nov 27, 2010
Posts: 110
I tried looking everywhere in Tools->Options and in the project's properties and POM file to no avail. It continues to generate this error and it continues to create new projects in C: for some reason unknown to me. Someone wrote to me:
"I had the same problem, I got a new working station (with Windows 8 64bit). I tried to build my EJB and got the same exception you did.
I knew my projects dir was in the My Documents dir, I also knew that this dir was actually redirected to the server. This seemed to be the problem I have my projects somewhere local now and everything builds OK."

I tried this as well. My projects are already local (though the last project I created was pulled from a public svn:// server of my university).
Didn't work.

I also tried running Maven with the -f parameter from commandline. That worked, but that doesn't fix my problem. Here's the output:



I'm out of ideas.

Ryan McClain
Ranch Hand

Joined: Nov 27, 2010
Posts: 110
The strange thing is that NetBeans 7.2 keeps creating my Maven Webapplications in C:\, regardless of where I tell it to create my project. It ignores my specified project path.
When I create a regular Java application however, NetBeans creates it in the location specified and I get no problems with it.

So why is it only creating Maven Webapplications in a folder directly under C:\?
Could this have anything to do with the Archetype plugin?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

When you create a Maven Web Application, step 2 of the New Project dialog asks for the Project Location and Project Folder. What are those values when you create a project?

I doubt the archetype plugin is causing this - it is very difficult to get any Maven plugin to place files outside the project directory. (I assume you mean a Maven plugin and not a NetBeans plugin)
Ryan McClain
Ranch Hand

Joined: Nov 27, 2010
Posts: 110
Project location: E:\Dev\Java
Project name: mavenproject1
ArtifactId: mavenproject1
groupId: org.me
version: 1.0-SNAPSHOT
package: org.me.mavenproject1
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

You do have an E: drive, correct?
Ryan McClain
Ranch Hand

Joined: Nov 27, 2010
Posts: 110
Yes, I have an E: drive. It's where I put my projects (E:\Dev\Java). How do I wipe out my NetBeans configuration?
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3611
    
  60

Search for folders named NetBeans in your user profile folder. The name of that folder is in the USERPROFILE variable, if you're unsure where it is located on you computer, type SET on command promt (it will display all environment variables, the USERPROFILE will be towards the end of the list). NetBeans configuration is stored in that folder.

On my Windows 7 computer, it is located in C:\Users\<username>\AppData\Roaming\NetBeans. This folder contains subfolders for various versions of NetBeans. Quit NetBeans, move the subfolder (in my case, it is 7.2.1) elsewhere (so that you have a backup) and restart NetBeans -- they'll rebuild the configuration. If there are configurations for older versions, NetBeans will probably offer to import older settings, if you really want brand fresh configuration, don't import the old settings.

Note: older versions have put the folder to slightly different locations, eg. C:\Users\<username>\.netbeans\7.0. Search for all folders containing "netbeans" to make sure you've found the correct folder.
Ryan McClain
Ranch Hand

Joined: Nov 27, 2010
Posts: 110
I deleted all of that but it didn't resolve my problem.
Ryan McClain
Ranch Hand

Joined: Nov 27, 2010
Posts: 110
Anyone have any other ideas? I need to fix this problem urgently..
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

Sorry, I'm completely out of ideas. Something is seriously screwed up on your system, but I can't think of what, especially since you deleted the NetBean configuration directory.

But as a last shot, you could try uninstalling NetBeans, then delete these directories in your home directory: .nbi, .nbprofiler, .netbeans, .netbeans-derby (and anything else with 'nb' or 'netbeans' in it), then delete the NetBean directory in one of the Program Files directories. Then move your NetBeans project directory (zip it up, backup it up, and then remove it). The idea is to not leave around anything that might be picked up later.

Reboot (probably not necessary, but do it anyway). Then reinstall NetBeans. Create a new Maven project and see if it behaves now. If it does, create a new project with the same options as your old project, then using Explorer copy only the source files from your backed up project to your new project. Hopefully, this will fix the issue.

Just an aside: The above process is a heck of a lot easier with Eclipse - since Eclipse uses "xcopy installation" you can install Eclipse in numerous locations (I usually have two or three copies installed) and use each to edit numerous workspaces. Each installation maintains its own copy of its settings within it installation directory, or in the workspace directory. Often fixing an issue is as simple as downloading and unzipping a new copy of Eclipse and creating a new workspace (no need to uninstall anything). I really dislike Netbeans requirement to install using the Windows installer, and then its use of the home directory to store config info; this prevents me from installing multiple copies of NetBeans like I can with Eclipse.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MissingProjectException by Maven in Netbeans 7.2