
| View previous topic :: View next topic |
| Author |
Message |
John C. Turnbull Posted via mailing list.
|
Posted: Wed Dec 10, 2008 12:49 pm Post subject: Errors building a project even though editor reports no errors |
|
|
I have a class which has the following import:
import org.w3c.dom.xpath.XPathResult;
This package and class exist in the Java 6 JDK/JRE so it should not have any trouble in finding them. However, when I build the project I get syntax errors complaining that the package does not exist and the symbol cannot be found. But, when I open the source for the class in the editor, no errors are highlighted and if I type in the “import org.w3c.dom.xpath” part and then type a ‘.’ I get a code completion list that includes the class XPathResult and all the other classes in that package. So it would seem that the source editor knows about these classes but the IDE is unable to build the project. The same thing happens if I just choose to compile this file.
Why do I get errors when I build the project or compile the individual class? I have tried to clean and build the project and also deleting the cache directory in the NetBeans user directory.
Thanks,
-JCT |
|
| Back to top |
|
 |
John C. Turnbull Posted via mailing list.
|
Posted: Wed Dec 10, 2008 12:58 pm Post subject: Errors building a project even though editor reports no errors |
|
|
I should add that there are no red markers on any of the classes in the project concerned in the Projects tree.
From: John C. Turnbull [mailto:address-removed]
Sent: Wednesday, 10 December 2008 23:49
To: address-removed
Subject: [nbusers] Errors building a project even though editor reports no errors
I have a class which has the following import:
import org.w3c.dom.xpath.XPathResult;
This package and class exist in the Java 6 JDK/JRE so it should not have any trouble in finding them. However, when I build the project I get syntax errors complaining that the package does not exist and the symbol cannot be found. But, when I open the source for the class in the editor, no errors are highlighted and if I type in the “import org.w3c.dom.xpath” part and then type a ‘.’ I get a code completion list that includes the class XPathResult and all the other classes in that package. So it would seem that the source editor knows about these classes but the IDE is unable to build the project. The same thing happens if I just choose to compile this file.
Why do I get errors when I build the project or compile the individual class? I have tried to clean and build the project and also deleting the cache directory in the NetBeans user directory.
Thanks,
-JCT |
|
| Back to top |
|
 |
marc.farrow
Joined: 15 Aug 2008 Posts: 107 Location: South Carolina
|
Posted: Wed Dec 10, 2008 12:59 pm Post subject: Errors building a project even though editor reports no errors |
|
|
I have seen this before and I cannot readily duplicate it. However, I did delete the entire VAR directory and that seemed to have fixed the problem.
I have noticed that when NetBeans is creating it's cache it will use all the deploy jars to the Tomcat server (i.e. jars in the shared/lib and/or common/lib or lib folders of tomcat). It indexes all of those jars and I have seen cases where I did not have a jar on the classpath of my project, yet NetBeans will pick up the jar from these indexes and use it.
On Wed, Dec 10, 2008 at 7:49 AM, John C. Turnbull <address-removed ([email]address-removed[/email])> wrote:
| Quote: |
I have a class which has the following import:
import org.w3c.dom.xpath.XPathResult;
This package and class exist in the Java 6 JDK/JRE so it should not have any trouble in finding them. However, when I build the project I get syntax errors complaining that the package does not exist and the symbol cannot be found. But, when I open the source for the class in the editor, no errors are highlighted and if I type in the "import org.w3c.dom.xpath" part and then type a '.' I get a code completion list that includes the class XPathResult and all the other classes in that package. So it would seem that the source editor knows about these classes but the IDE is unable to build the project. The same thing happens if I just choose to compile this file.
Why do I get errors when I build the project or compile the individual class? I have tried to clean and build the project and also deleting the cache directory in the NetBeans user directory.
Thanks,
-JCT
|
|
|
| Back to top |
|
 |
John C. Turnbull Posted via mailing list.
|
Posted: Wed Dec 10, 2008 6:24 pm Post subject: Errors building a project even though editor reports no errors |
|
|
Marc, I tried your suggestion but unfortunately it didn’t help.
I think I know why the problem is happening, well sort of. I originally defined the project to use an external JAR which had a definition of the classes in question but now that I have removed the dependency on that JAR it seems that the project is not smart enough to realise that it can get a definition of those classes from somewhere else on the class path, namely the JRE itself. The project concerned uses sources from an SVN repository but I am not sure if that is relevant or not.
Actually, I have now just recreated the project from scratch and the problem remains. It must be something in the SVN metadata that is specifying that the classes concerned come from the library JAR I have removed from the project. Is there any way to redefine this so it can use the JRE classes instead?
Thanks,
-JCT
From: Marc Farrow [mailto:address-removed]
Sent: Wednesday, 10 December 2008 23:59
To: address-removed
Subject: Re: [nbusers] Errors building a project even though editor reports no errors
I have seen this before and I cannot readily duplicate it. However, I did delete the entire VAR directory and that seemed to have fixed the problem.
I have noticed that when NetBeans is creating it's cache it will use all the deploy jars to the Tomcat server (i.e. jars in the shared/lib and/or common/lib or lib folders of tomcat). It indexes all of those jars and I have seen cases where I did not have a jar on the classpath of my project, yet NetBeans will pick up the jar from these indexes and use it.
On Wed, Dec 10, 2008 at 7:49 AM, John C. Turnbull <address-removed ([email]address-removed[/email])> wrote:
I have a class which has the following import:
import org.w3c.dom.xpath.XPathResult;
This package and class exist in the Java 6 JDK/JRE so it should not have any trouble in finding them. However, when I build the project I get syntax errors complaining that the package does not exist and the symbol cannot be found. But, when I open the source for the class in the editor, no errors are highlighted and if I type in the "import org.w3c.dom.xpath" part and then type a '.' I get a code completion list that includes the class XPathResult and all the other classes in that package. So it would seem that the source editor knows about these classes but the IDE is unable to build the project. The same thing happens if I just choose to compile this file.
Why do I get errors when I build the project or compile the individual class? I have tried to clean and build the project and also deleting the cache directory in the NetBeans user directory.
Thanks,
-JCT |
|
| Back to top |
|
 |
marc.farrow
Joined: 15 Aug 2008 Posts: 107 Location: South Carolina
|
Posted: Wed Dec 10, 2008 6:27 pm Post subject: Errors building a project even though editor reports no errors |
|
|
You try to edit the project properties and make a small change and click OK. Then edit the properties again and undo that change and click ok again. This should recreate the project only files and it may or may not (probably not) help. I am out of ideas. sorry.
On Wed, Dec 10, 2008 at 1:23 PM, John C. Turnbull <address-removed ([email]address-removed[/email])> wrote:
| Quote: |
Marc, I tried your suggestion but unfortunately it didn't help.
I think I know why the problem is happening, well sort of. I originally defined the project to use an external JAR which had a definition of the classes in question but now that I have removed the dependency on that JAR it seems that the project is not smart enough to realise that it can get a definition of those classes from somewhere else on the class path, namely the JRE itself. The project concerned uses sources from an SVN repository but I am not sure if that is relevant or not.
Actually, I have now just recreated the project from scratch and the problem remains. It must be something in the SVN metadata that is specifying that the classes concerned come from the library JAR I have removed from the project. Is there any way to redefine this so it can use the JRE classes instead?
Thanks,
-JCT
From: Marc Farrow [mailto:address-removed ([email]address-removed[/email])]
Sent: Wednesday, 10 December 2008 23:59
To: address-removed ([email]address-removed[/email])
Subject: Re: [nbusers] Errors building a project even though editor reports no errors
I have seen this before and I cannot readily duplicate it. However, I did delete the entire VAR directory and that seemed to have fixed the problem.
I have noticed that when NetBeans is creating it's cache it will use all the deploy jars to the Tomcat server (i.e. jars in the shared/lib and/or common/lib or lib folders of tomcat). It indexes all of those jars and I have seen cases where I did not have a jar on the classpath of my project, yet NetBeans will pick up the jar from these indexes and use it.
On Wed, Dec 10, 2008 at 7:49 AM, John C. Turnbull <address-removed ([email]address-removed[/email])> wrote:
I have a class which has the following import:
import org.w3c.dom.xpath.XPathResult;
This package and class exist in the Java 6 JDK/JRE so it should not have any trouble in finding them. However, when I build the project I get syntax errors complaining that the package does not exist and the symbol cannot be found. But, when I open the source for the class in the editor, no errors are highlighted and if I type in the "import org.w3c.dom.xpath" part and then type a '.' I get a code completion list that includes the class XPathResult and all the other classes in that package. So it would seem that the source editor knows about these classes but the IDE is unable to build the project. The same thing happens if I just choose to compile this file.
Why do I get errors when I build the project or compile the individual class? I have tried to clean and build the project and also deleting the cache directory in the NetBeans user directory.
Thanks,
-JCT
|
|
|
| Back to top |
|
 |
John C. Turnbull Posted via mailing list.
|
Posted: Wed Dec 10, 2008 6:53 pm Post subject: Errors building a project even though editor reports no errors |
|
|
Sadly no, it doesn’t work. I think the link between those classes and the removed JAR is in the SVN metadata of the file system itself and this does not get overwritten by NetBeans. I may be out of luck L
-JCT
From: Marc Farrow [mailto:address-removed]
Sent: Thursday, 11 December 2008 05:27
To: address-removed
Subject: Re: [nbusers] Errors building a project even though editor reports no errors
You try to edit the project properties and make a small change and click OK. Then edit the properties again and undo that change and click ok again. This should recreate the project only files and it may or may not (probably not) help. I am out of ideas. sorry.
On Wed, Dec 10, 2008 at 1:23 PM, John C. Turnbull <address-removed ([email]address-removed[/email])> wrote:
Marc, I tried your suggestion but unfortunately it didn't help.
I think I know why the problem is happening, well sort of. I originally defined the project to use an external JAR which had a definition of the classes in question but now that I have removed the dependency on that JAR it seems that the project is not smart enough to realise that it can get a definition of those classes from somewhere else on the class path, namely the JRE itself. The project concerned uses sources from an SVN repository but I am not sure if that is relevant or not.
Actually, I have now just recreated the project from scratch and the problem remains. It must be something in the SVN metadata that is specifying that the classes concerned come from the library JAR I have removed from the project. Is there any way to redefine this so it can use the JRE classes instead?
Thanks,
-JCT
From: Marc Farrow [mailto:address-removed ([email]address-removed[/email])]
Sent: Wednesday, 10 December 2008 23:59
To: address-removed ([email]address-removed[/email])
Subject: Re: [nbusers] Errors building a project even though editor reports no errors
I have seen this before and I cannot readily duplicate it. However, I did delete the entire VAR directory and that seemed to have fixed the problem.
I have noticed that when NetBeans is creating it's cache it will use all the deploy jars to the Tomcat server (i.e. jars in the shared/lib and/or common/lib or lib folders of tomcat). It indexes all of those jars and I have seen cases where I did not have a jar on the classpath of my project, yet NetBeans will pick up the jar from these indexes and use it.
On Wed, Dec 10, 2008 at 7:49 AM, John C. Turnbull <address-removed ([email]address-removed[/email])> wrote:
I have a class which has the following import:
import org.w3c.dom.xpath.XPathResult;
This package and class exist in the Java 6 JDK/JRE so it should not have any trouble in finding them. However, when I build the project I get syntax errors complaining that the package does not exist and the symbol cannot be found. But, when I open the source for the class in the editor, no errors are highlighted and if I type in the "import org.w3c.dom.xpath" part and then type a '.' I get a code completion list that includes the class XPathResult and all the other classes in that package. So it would seem that the source editor knows about these classes but the IDE is unable to build the project. The same thing happens if I just choose to compile this file.
Why do I get errors when I build the project or compile the individual class? I have tried to clean and build the project and also deleting the cache directory in the NetBeans user directory.
Thanks,
-JCT |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|
|
|