Community
Participate
Working Groups
Build Identifier: Indigo (Build id: 20110615-0604) Import existing project with aspects. Review code with that refereces woven code from the AJ files in the main class. IE in a roo project all the bean methods are woven from aj files so mybean.getName(); shows "The method getName() is undefined for type MyBean" Reproducible: Always Steps to Reproduce: Steps: 1) download indigo 2) start indigo and install the following plugins: http://download.eclipse.org/tools/ajdt/37/update http://subclipse.tigris.org/update_1.6.x http://dist.springsource.org/release/GRECLIPSE/e3.7/ 3) import an existing project with aspectj files (.aj) files 4) Answer yes to the weaving prompt (I'm pretty sure I got prompted to enable weaving). 5) review code referencing the weaved in aspects. You'll see they are not resolved. 6) checked the JDT weaving is enabled and it says it is. This website yeilded some good tips: http://wiki.eclipse.org/JDT_weaving_features But when I try to follow the simple instructions for turning on Weaving manually, the plugin entry is not right-clickable. Incidentally it also has a blank provider and the signed icon indicates the plugin is unsigned. The version for equinox weaving is 1.0.1.HEAD
Seems like an issue with JDT weaving from the AJDT project, therefore re-assigning to that project.
Hi Matt, Here are some questions/things we should look into further: 1. Can you attach your file eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info? 2. Did you install your eclipse into a read-only directory? (ie- is it a shared install?) 3. Did you check the error log on startup and after trying to re-enable JDT weaving? Hopefully, this will help determine why JDT weaving is not enabled.
Created attachment 200323 [details] bundles.info see attached
(In reply to comment #2) > Hi Matt, > > Here are some questions/things we should look into further: > > 1. Can you attach your file > eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info? > 2. Did you install your eclipse into a read-only directory? (ie- is it a > shared install?) > 3. Did you check the error log on startup and after trying to re-enable JDT > weaving? > > Hopefully, this will help determine why JDT weaving is not enabled. Attached in previous response. No I did not install eclipse into a readonly directory. I just un-tar'd it and click the eclipse executable. I don't see any logs.
Error logs are available by doing Window -> Show View -> Error Log. If you see any relevant entries there, can you paste them here? Now, it may also be something wrong with your project itself (eg- maybe it doesn't have the AspectJ nature). Are you seeing error messages in the Problems view, or is it only in the editor? This will determine whether or not it is the project or the workspace.
(In reply to comment #5) > Error logs are available by doing Window -> Show View -> Error Log. If you see > any relevant entries there, can you paste them here? > > Now, it may also be something wrong with your project itself (eg- maybe it > doesn't have the AspectJ nature). Are you seeing error messages in the > Problems view, or is it only in the editor? This will determine whether or not > it is the project or the workspace. Here's the log: eclipse.buildId=I20110613-1736 java.version=1.6.0_24 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US Framework arguments: -product org.eclipse.epp.package.jee.product Command-line arguments: -data /home/solid/src/workspace3.7 -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product !ENTRY org.eclipse.jdt.core 4 2 2011-07-26 20:23:33.157 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jdt.core". !STACK 0 java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.AbstractStringBuilder.delete(AbstractStringBuilder.java:698) at java.lang.StringBuilder.delete(StringBuilder.java:255) at org.eclipse.jst.ws.jaxws.dom.runtime.persistence.sync.OnEventModelSynchronizer.guessPrimaryTypeName(OnEventModelSynchronizer.java:414) at org.eclipse.jst.ws.jaxws.dom.runtime.persistence.sync.OnEventModelSynchronizer.handleRemovedCompilationUnit(OnEventModelSynchronizer.java:388) at org.eclipse.jst.ws.jaxws.dom.runtime.persistence.sync.OnEventModelSynchronizer.handleChangedContentCompilationUnit(OnEventModelSynchronizer.java:314) at org.eclipse.jst.ws.jaxws.dom.runtime.persistence.sync.OnEventModelSynchronizer.recursevilyHandleCompilationUnits(OnEventModelSynchronizer.java:292) at org.eclipse.jst.ws.jaxws.dom.runtime.persistence.sync.OnEventModelSynchronizer.recursevilyHandleCompilationUnits(OnEventModelSynchronizer.java:302) at org.eclipse.jst.ws.jaxws.dom.runtime.persistence.sync.OnEventModelSynchronizer.recursevilyHandleCompilationUnits(OnEventModelSynchronizer.java:302) at org.eclipse.jst.ws.jaxws.dom.runtime.persistence.sync.OnEventModelSynchronizer.handleChangedProject(OnEventModelSynchronizer.java:176) at org.eclipse.jst.ws.jaxws.dom.runtime.persistence.sync.OnEventModelSynchronizer.elementChanged(OnEventModelSynchronizer.java:86) at org.eclipse.jdt.internal.core.DeltaProcessor$4.run(DeltaProcessor.java:1670) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:1660) at org.eclipse.jdt.internal.core.DeltaProcessor.firePostChangeDelta(DeltaProcessor.java:1494) at org.eclipse.jdt.internal.core.DeltaProcessor.fire(DeltaProcessor.java:1470) at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:2082) at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:470) at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:291) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285) at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149) at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:395) at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1530) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:45) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) !ENTRY org.eclipse.jdt.core 4 4 2011-07-26 20:23:33.171 !MESSAGE Exception occurred in listener of Java element change notification !STACK 0 java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.AbstractStringBuilder.delete(AbstractStringBuilder.java:698) at java.lang.StringBuilder.delete(StringBuilder.java:255) at org.eclipse.jst.ws.jaxws.dom.runtime.persistence.sync.OnEventModelSynchronizer.guessPrimaryTypeName(OnEventModelSynchronizer.java:414) at org.eclipse.jst.ws.jaxws.dom.runtime.persistence.sync.OnEventModelSynchronizer.handleRemovedCompilationUnit(OnEventModelSynchronizer.java:388) at org.eclipse.jst.ws.jaxws.dom.runtime.persistence.sync.OnEventModelSynchronizer.handleChangedContentCompilationUnit(OnEventModelSynchronizer.java:314) at org.eclipse.jst.ws.jaxws.dom.runtime.persistence.sync.OnEventModelSynchronizer.recursevilyHandleCompilationUnits(OnEventModelSynchronizer.java:292) at org.eclipse.jst.ws.jaxws.dom.runtime.persistence.sync.OnEventModelSynchronizer.recursevilyHandleCompilationUnits(OnEventModelSynchronizer.java:302) at org.eclipse.jst.ws.jaxws.dom.runtime.persistence.sync.OnEventModelSynchronizer.recursevilyHandleCompilationUnits(OnEventModelSynchronizer.java:302) at org.eclipse.jst.ws.jaxws.dom.runtime.persistence.sync.OnEventModelSynchronizer.handleChangedProject(OnEventModelSynchronizer.java:176) at org.eclipse.jst.ws.jaxws.dom.runtime.persistence.sync.OnEventModelSynchronizer.elementChanged(OnEventModelSynchronizer.java:86) at org.eclipse.jdt.internal.core.DeltaProcessor$4.run(DeltaProcessor.java:1670) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:1660) at org.eclipse.jdt.internal.core.DeltaProcessor.firePostChangeDelta(DeltaProcessor.java:1494) at org.eclipse.jdt.internal.core.DeltaProcessor.fire(DeltaProcessor.java:1470) at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:2082) at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:470) at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:291) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285) at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149) at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:395) at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1530) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:45) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Created attachment 200409 [details] Sample project where IDT weaving fails This is the most simple project created by spring roo. Roo creates ITDs (aj files) for proving getters/setters, jpa finders, json, tostring etc. All I did, create an entity bean, then I generated all the ITDs for my 3 properties on my person object. You can see the failure by simply mvn eclipse:eclipse on the project, then import it. The getters and setters in the test do not work even though they are so brain dead simple.
The problem is that this is not an AspectJ project. Select the project, right click -> Configure -> Convert to AspectJ project. All the problems go away. Is there any reason why you are not using SpringSource Tool Suite for this? STS would have recognized this as a Roo project and you probably would have avoided the whole issue.
(In reply to comment #8) > The problem is that this is not an AspectJ project. Select the project, right > click -> Configure -> Convert to AspectJ project. All the problems go away. > > Is there any reason why you are not using SpringSource Tool Suite for this? > STS would have recognized this as a Roo project and you probably would have > avoided the whole issue. 1) Convert to AspectJ project is not an option for config. Besides I know it is already an aspectj project. The pom includes ajdt natures as well as others. 2) This did work with regular eclipse and AJDT prior to 3.7. 3) I don't use STS for 2 reasons, 1) it conflicts with other plugins I install 2) it still relies on AJDT for aspect weaving so I don't know how that would help.
(In reply to comment #9) > (In reply to comment #8) > > The problem is that this is not an AspectJ project. Select the project, right > > click -> Configure -> Convert to AspectJ project. All the problems go away. > > > > Is there any reason why you are not using SpringSource Tool Suite for this? > > STS would have recognized this as a Roo project and you probably would have > > avoided the whole issue. > 1) Convert to AspectJ project is not an option for config. Besides I know it > is already an aspectj project. The pom includes ajdt natures as well as > others. > 2) This did work with regular eclipse and AJDT prior to 3.7. > 3) I don't use STS for 2 reasons, 1) it conflicts with other plugins I install > 2) it still relies on AJDT for aspect weaving so I don't know how that would > help. (In reply to comment #8) > The problem is that this is not an AspectJ project. Select the project, right > click -> Configure -> Convert to AspectJ project. All the problems go away. > > Is there any reason why you are not using SpringSource Tool Suite for this? > STS would have recognized this as a Roo project and you probably would have > avoided the whole issue. Also, even if it didn't have an aspect nature, the aspect weaving shouldn't be throwing null pointers all over.
The stack traces that you attached are not coming from AJDT, AspectJ, or Equinox weaving. They are coming from org.eclispe.jst (part of the WTP project). So, unless there are additional exceptions, I don't think that AJDT or anything related is misbehaving. When I imported the maven project you attached, it was not automatically converted to an AJDT project, but I do see that the aspectJ nature is included in the pom.xml, but it just looks like the project was not properly configured for me on import. It looks like that's not the problem that you are having. There are two general possibilities: 1. You are seeing error messages in the editor, but the files are being properly compiled in the workspace. 2. Your files are not being sent to the weaver, and so you see errors both in the editor and in the Problems view. #1 is a JDT Weaving/AJDT problem and #2 is a project configuration problem. I am still not sure which one you are seeing. There is no indication that JDT weaving is *not* enabled. There are no related exceptions being thrown and the preferences page indicates that JDT Weaving is on. Please let me know if you are seeing #1 or #2 above (try doing a full project build just to make sure).
(In reply to comment #11) I am seeing this error in ui. The method setName(String) is undefined for the type Person BTW you didn't import the sample project correctly. you first have to build the project from the pom.xml file. Cd into jdttest folder and execute "mvn eclipse:eclipse" that builds the .project file with all of the natures applied from the pom. Then you can import it. BTW the stacktrace above has multiple references to org.eclipse.jdt.internal.core in the stacktrace. If I try to run my unit test it just hangs. It never returns.
BTW I just did a clean on the project and tried to run my unit test. And the test ran fine but the UI still says "The method getName() is undefined for type Person"
(In reply to comment #12) > (In reply to comment #11) > I am seeing this error in ui. > The method setName(String) is undefined for the type Person OK...that indeed does indicate that the compiler is working, but that weaving is not enabled. > BTW you didn't import the sample project correctly. > you first have to build the project from the pom.xml file. Cd into jdttest > folder and execute "mvn eclipse:eclipse" that builds the .project file with > all of the natures applied from the pom. Yes, you're right. It probably would have been better to do it that way, but the end result is the same. The project was compiling and working fine in my workspace. > BTW the stacktrace above has multiple references to > org.eclipse.jdt.internal.core > in the stacktrace. > If I try to run my unit test it just hangs. It never returns. Part of the stack trace is from JDT (not AJDT) and the problem is ultimately caused by the JST portion of WTP (lots of acronyms). So, the stack traces are unrelated to AJDT. Unfortunately, I still don't have a handle on why you are getting this problem. I'll have to think some more on this.
Apologies for the long silence. Are you still having this problem? I am still not able to reproduce this. I ran mvn eclipse:eclipse from the command line and imported. Everything builds fine and there are no errors in the editor. Make sure that the following is true: 1. your project is marked as an AspectJ project (you should be able to right click on the project and see the "AspectJ Tools" menu item). 2. Make sure that your Person class has the correct AspectJ markers in the gutter, indicating a successful build. Let me know if you are still having issues.
I tried once more to reproduce the problem described here and could not. When I ran mvn eclipse:eclipse on the command line, the generated project had 2 entries for the ajbuilder. I don't think that would cause the problem described in this bug, but I do wonder why I saw it. I am resolving this bug, but feel free to comment again if you are still having the problem.