working on imported project (java web app, created with 7.2.1), when i open the jpql query and try to run a query i get:
java.lang.Exception: You project either have no sources or you need to rebuild your project
BUT no matter how many times y do "build" or "clean and build" i get the same error... build before opening the jpql query window, build after opening the window but before trying the query, same result.
i had another imported project (also java web app, created with 7.2.1) with NO db support on it, i added the persistence unit, generated some entities from the same database i'm using on my other project, tried the jpql query and it works.
not sure if bug? missing config? missing refactoring to some file inside my project? i'll appreciate any help
Editor tries to check is there is any valid build source path, may be some project configuration, may be with custom build script may be handled incorrectly in this case. I'm not sure it can be fixed automatically if it's the case, may be an option 'try to run anyway' can be added.
It's nice if you can share sample project with a problem for evaluation.
also as you said you have two projects from 7.2.1 and it isn't related to failure.
do you have nay unresolved references, warnings etc on "bad" project?
is clean on the project working as expected (clean everything)?
one more, do you use the same jdk for both projects in 7.2.1 and in 7.3?
Thank you for the response Sergey... answering your questions:
- the project builds and runs without errors (in 7.2.1 and 7.3rc2) and pretty much everuthing works except the jpql query on that particular project.
- i upgraded the jdk from 1.7.0_09 to 1.7.0_13 before installing the RC because the 7.3 installer told me that an upgrade was needed.
- no unresolved references.
- i can query the database from the "classic" sql command window, the persistence... so, i'm assuming no connection problem
- the persistence.xml are identical in both projects
is there any difference between projects?
can you try last comment from issue 219805? unfortunately if it will work it may be hard to fix/evaluate as it's heavily dependent on specific cache state.
not sure whats the equivalent on osx but i removed
/Applications/NetBeans/NetBeans 7.3 RC2.app/Contents/Resources/NetBeans/nb/var/cache
the projects are indeed different, on the one i'm getting the error i have my full app, entities, controllers, utility classes, etc.
on the one where jpql query works i only have the persistence unit and the entities.
Is it proprietary project? can you remove some extra parts except entities and try if the issue is reproducible and if the issue is reproducible attach the project to the issue?
indeed it is proprietary, i'll ask my client if i can sent it to you guys, i hope there's no problem with that.
in the meantime let me tell you about something i found... to do what you suggested i copied the project folder to ~/trash/myproyect, first i removed all items from "web pages", build, run jpql query and it ran like a charm, i know that makes no sense AT ALL, i deleted the folder and copied it again from it's original location, then i did a build without removing anything, and the jpql query ran w/o problem again.
tried to run the query on the original folder and still ERROR (java.lang.Exception: You project either have no sources or you need to rebuild your project).
the only noticeable difference was that the path where my project is located has one space in it, i doubted that was the cause (it's silly, right?)... so i made a new test:
- created two folders under /tmp, named "test1" and "test 1" (notice the space on second one
- copied the project to each folder
- build and tried jpql query (the same query on both cases)
- query ran on the folder w/o spaces in it's name, got error on project with a space in it's path.
TLDR... looks like spaces in the path are the cause for this, so renaming my folder will solve this issue for me but idk if this is supposed do be this way or there's something broken/missing somewhere.
thanks, will try your suggestion regarding spaces and if I'll be able to reproduce no project is needed
as all project with spaces are affected it may be P2.