1

I'm working through examples in a Beginning Java EE7 book, and the first example calls for me to use Weld in a simple Maven project. I've copied all the files into a Maven project in Eclipse (Kepler). But the Main.java application has an import statement that's not working: import org.jboss.weld.environment.se.Weld Eclipse is red-flagging it with the message: "The import org.jboss cannot be resolved." I went to Eclipse Marketplace and downloaded the latest JBoss bundle, which I think is supposed to include Weld, but I'm still getting the error.

I right-clicked the line and selected "Fix project setup" and was able to choose a fix that helped some of the other errors that were popping up. But all it did for this particular problem was extend the message to say "The import org.jboss.weld.environment cannot be resolved." When I try running Fix project setup again, it offers no proposals for resolution.

I've dug around in the Build Path tools, but I can't seem to figure out how to make this import work.

Kyle Walker
  • 559
  • 3
  • 12
  • 25
  • `The import org.jboss cannot be resolved` means its a build path issue and that a jar is missing on the build path. Can you verify that you have the proper entry in the pom.xml for the jar that contains this particular package ? – Saif Asif Dec 01 '13 at 17:15
  • Here's what's in the pom.xml: ' org.jboss.weld.se weld-se ' – Kyle Walker Dec 01 '13 at 18:54
  • I think I see what's happening. Even though I installed the Eclipse IDE for Java EE Developers, it appears it still didn't give me all the libraries. Besides missing some of the Weld libraries, it's also missing the javax.interceptor.InterceptorBinding library. How do I go get these individual libraries? I've tried searching the Marketplace and going through Build Path, but I don't see anything that would allow me to do this. – Kyle Walker Dec 02 '13 at 03:14
  • Have you tried to 'clean' your project? Also verify that whether this issue persists in another workspace as well – Saif Asif Dec 02 '13 at 06:05
  • I just ran Clean and nothing changed. I only have one workspace that I know of. Do you suggest I create a separate workspace to test this? – Kyle Walker Dec 02 '13 at 12:32
  • Yes that is worth giving a shot. Also can you also post the method how you are creating the project and copying files.? – Saif Asif Dec 02 '13 at 12:36
  • I created a new workspace and switched to it, but it's still giving me the same errors. – Kyle Walker Dec 03 '13 at 13:37
  • To create this project I used File>New>Other to create a Maven project. I'm using the code examples from the book Beginning Java EE 7, so I'm not writing any of the code myself. It's the author's code. A recurring error message: "Non-resolvable parent POM: Failure to find org.agoncal.book.javaee7:chapter02:pom:1.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 12, column 11 ->" Where should this file be? – Kyle Walker Dec 03 '13 at 13:39
  • http://stackoverflow.com/questions/4322893/eclipse-error-the-import-xxx-cannot-be-resolved/25904575#25904575 – smali Sep 18 '14 at 05:13

0 Answers0