Back Forum Reply New

Problem with JDT weaving in STS

I downloaded STS 2.1.0.SR01 and created a project using Roo (followed the instructions here). I create a couple of JPA entities and close Roo to create the eclipse project files using 'mvn eclipse:eclipse'. So far so good.

When I try to open the project in STS I get the message about enabling JDT weaving (Turn Weaving Service on?). I select 'Yes' after checking the box that says (Don't ask again until next upgrade). STS restarts, and shows me the same message again . In summary, I'm not able to turn the weaving service on. Anybody knows what's going on? I'm running on MacOS X (Leopard) the Carbon version with groovy support. Thanks.

The most common reason for this is that you are running with the -clean option to start your STS/eclipse.

If that is not the case, then let me know and we can explore further.

I don't believe I'm using the -clean option. This is the content of the STS.ini file:

-startup
../../../plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.carbon.macosx_1.0.200  .v20090520-1835
-product
com..sts.ide
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:MaxPermSize=256m
-Xms40m
-Xmx768m
-Xdock:icon=../Resources/STS.icns

.aspectj.weaver bundle instead (this version is already in a good state, so no need to start it). Also, you may get some exceptions here. They can be ignored.
8. Now go to Preferences-gt;JDT Weaving and click enable. Follow the prompts and restart.

Please let me know if this works for you.  Also, let me know if you have multiple versions of org.eclipse.equinox.weaving.aspectj installed.

Tried your suggestion. It stopped the previous problem, meaning the dialog doesn't show up anymore, but JDT weaving is disabled. I went to Preferences -gt; JDT Weaving and it says quot;JDT Weaving is currently DISABLEDquot;. Another problem that is happening now is that I no longer have the AspectJ Editor. The plugin org.aspectj.ajde depends on org.aspectj.weaver and as a result of disabling the later there's no syntax highlighting, code assist, anything for aspects.

There is only one version of the org.eclipse.equinox.weaving.aspectj plugin.

Any other ideas?

OK, so that didn't work...

Please re-enable the org.aspectj.weaver bundle.  

Some things I forgot to ask earlier:

1. Now when you try to re-enable weaving (with org.aspectj.weaver enabled), are you getting any error messages in the error log?
2. In the file: sts-2.1.0.RELEASE/configuration/config.ini
there should be a line: osgi.framework.extensions=...,reference\:file\rg  .eclipse.equinox.weaving.hook_1.0.0.200905261348.j  ar,...
(the ... are areas that I cut off.  I just want to make sure that the line contains the weaving.hook fragment)
3. Did you install any other plugins, or is this just a vanilla STS?

I wish I could be of more help here.  I'm just trying to figure out some potential causes of this behavior.

The only warning that appears in the log, when I try to enable JDT weaving, is about Key bindings.
eclipse.buildId=I20090611-1540
java.version=1.5.0_19
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86, WS=carbon, NL=en_US
Framework arguments:  -product com..sts.ide -keyring /Users/alex/.eclipse_keyring -showlocation
Command-line arguments:  -os macosx -ws carbon -arch x86 -product com..sts.ide -keyring /Users/alex/.eclipse_keyring -showlocationWarning
Sat Aug 08 12:04:02 EDT 2009
Keybinding conflicts occurred.  They may interfere with normal accelerator operation.

When I go to the Plug-in registry view I get:
eclipse.buildId=I20090611-1540
java.version=1.5.0_19
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86, WS=carbon, NL=en_US
Framework arguments:  -product com..sts.ide -keyring /Users/alex/.eclipse_keyring -showlocation
Command-line arguments:  -os macosx -ws carbon -arch x86 -product com..sts.ide -keyring /Users/alex/.eclipse_keyring -showlocationError
Sat Aug 08 12:06:36 EDT 2009
Unhandled event loop exception

org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.swt.SWTException: Widget is disposed)
at org.eclipse.swt.SWT.error(SWT.java:3884)
at org.eclipse.swt.SWT.error(SWT.java:3799)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessa  ges(Synchronizer.java:137)
at org.eclipse.swt.widgets.Display.runAsyncMessages(D  isplay.java:3342)
at org.eclipse.swt.widgets.Display.readAndDispatch(Di  splay.java:3071)
at org.eclipse.ui.internal.Workbench.runEventLoop(Wor  kbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.  java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workben  ch.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.  java:500)
at org.eclipse.core.databinding.observable.Realm.runW  ithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWork  bench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Pl  atformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplica  tion.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.  run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseA  ppLauncher.runApplication(EclipseAppLauncher.java:  110)
at org.eclipse.core.runtime.internal.adaptor.EclipseA  ppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.ru  n(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.ru  n(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ  e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native  MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De  legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(  Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.ja  va:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:13  11)
Caused by: org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:3884)
at org.eclipse.swt.SWT.error(SWT.java:3799)
at org.eclipse.swt.SWT.error(SWT.java:3770)
at org.eclipse.swt.widgets.Widget.error(Widget.java:6  96)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.  java:340)
at org.eclipse.swt.widgets.Widget.getData(Widget.java  :805)
at org.eclipse.jface.viewers.AbstractTreeViewer.updat  eChildren(AbstractTreeViewer.java:2620)
at org.eclipse.jface.viewers.AbstractTreeViewer.inter  nalRefreshStruct(AbstractTreeViewer.java:1863)
at org.eclipse.jface.viewers.TreeViewer.internalRefre  shStruct(TreeViewer.java:716)
at org.eclipse.jface.viewers.AbstractTreeViewer.inter  nalRefresh(AbstractTreeViewer.java:1838)
at org.eclipse.jface.viewers.AbstractTreeViewer.inter  nalRefresh(AbstractTreeViewer.java:1794)
at org.eclipse.jface.viewers.AbstractTreeViewer.inter  nalRefresh(AbstractTreeViewer.java:1780)
at org.eclipse.jface.viewers.StructuredViewer$7.run(S  tructuredViewer.java:1457)
at org.eclipse.jface.viewers.StructuredViewer.preserv  ingSelection(StructuredViewer.java:1392)
at org.eclipse.jface.viewers.TreeViewer.preservingSel  ection(TreeViewer.java:402)
at org.eclipse.jface.viewers.StructuredViewer.preserv  ingSelection(StructuredViewer.java:1353)
at org.eclipse.jface.viewers.StructuredViewer.refresh  (StructuredViewer.java:1455)
at org.eclipse.jface.viewers.ColumnViewer.refresh(Col  umnViewer.java:537)
at org.eclipse.ui.dialogs.FilteredTree$NotifyingTreeV  iewer.refresh(FilteredTree.java:1205)
at org.eclipse.jface.viewers.StructuredViewer.refresh  (StructuredViewer.java:1414)
at org.eclipse.ui.dialogs.FilteredTree$NotifyingTreeV  iewer.refresh(FilteredTree.java:1195)
at org.eclipse.pde.internal.runtime.registry.Registry  Browser.deferredRefresh(RegistryBrowser.java:664)
at org.eclipse.pde.internal.runtime.registry.Registry  Browser.refresh(RegistryBrowser.java:713)
at org.eclipse.pde.internal.runtime.registry.Registry  BrowserModelChangeListener.update(RegistryBrowserM  odelChangeListener.java:138)
at org.eclipse.pde.internal.runtime.registry.Registry  BrowserModelChangeListener$1.run(RegistryBrowserMo  delChangeListener.java:26)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableL  ock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessa  ges(Synchronizer.java:134)
... 22 more

Subsequently STS hangs when I bring up the view. My installation is a vanilla install, and I have the quot;hookquot; in the config.ini.

arod,
while we are trying to get to bottom of this problem, can you please reinstall STS 2.1.0.SR01 and open a new clean workspace. Before importing any project please enable the JDT weaving service from the Preferences and restart as promted. Verify that the weaving service is enabled again in the preferences.
I tried to re-create the problem this way and wasn't able. This should get you going again.
Thanks for your patience.
Christian

Thanks Cristian,

Followed you instructions and JDT Weaving is enabled. When I import my project into the workspace I get the following error
Sun Aug 09 09:55:19 EDT 2009
An internal error occurred during: quot;Validation posquot;.

java.lang.NoSuchMethodError: org.eclipse.ajdt.core.parserbridge.AJCompilationUn  itProblemFinder.getCompilerOptions(Ljava/util/Map;ZZ)Lorg/eclipse/jdt/internal/compiler/impl/CompilerOptions;
at org.eclipse.ajdt.core.parserbridge.AJCompilationUn  itProblemFinder.processAJ(AJCompilationUnitProblem  Finder.java:218)
at org.eclipse.ajdt.ui.AJDTNameEnvironmentProvider.pr  oblemFind(AJDTNameEnvironmentProvider.java:79)
at org.eclipse.contribution.jdt.itdawareness.ITDAware  nessAspect.ajc$around$org_eclipse_contribution_jdt  _itdawareness_ITDAwarenessAspect$4$8b05d765(ITDAwa  renessAspect.aj:223)
at org.eclipse.jdt.internal.core.CompilationUnitProbl  emFinder.process(CompilationUnitProblemFinder.java  :163)
at org.eclipse.jdt.internal.core.CompilationUnit.buil  dStructure(CompilationUnit.java:179)
at org.eclipse.jdt.internal.core.Openable.generateInf  os(Openable.java:258)
at org.eclipse.jdt.internal.core.JavaElement.openWhen  Closed(JavaElement.java:515)
at org.eclipse.jdt.internal.core.CompilationUnit.make  Consistent(CompilationUnit.java:1099)
at org.eclipse.jdt.internal.core.CompilationUnit.make  Consistent(CompilationUnit.java:1079)
at org.eclipse.jst.jsp.core.internal.java.JSPTranslat  ion.reconcileCompilationUnit(JSPTranslation.java:5  56)
at org.eclipse.jst.jsp.core.internal.validation.JSPJa  vaValidator.performValidation(JSPJavaValidator.jav  a:319)
at org.eclipse.jst.jsp.core.internal.validation.JSPBa  tchValidator.performValidation(JSPBatchValidator.j  ava:386)
at org.eclipse.jst.jsp.core.internal.validation.JSPBa  tchValidator.validateFile(JSPBatchValidator.java:4  43)
at org.eclipse.jst.jsp.core.internal.validation.JSPBa  tchValidator$2.run(JSPBatchValidator.java:513)
at org.eclipse.jdt.internal.core.BatchOperation.execu  teOperation(BatchOperation.java:39)
at org.eclipse.jdt.internal.core.JavaModelOperation.r  un(JavaModelOperation.java:728)
at org.eclipse.core.internal.resources.Workspace.run(  Workspace.java:1800)
at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:46  94)
at org.eclipse.jst.jsp.core.internal.validation.JSPBa  tchValidator.validate(JSPBatchValidator.java:525)
at org.eclipse.wst.validation.Validator$V2.validate(V  alidator.java:1120)
at org.eclipse.wst.validation.internal.ValManager.val  idate(ValManager.java:699)
at org.eclipse.wst.validation.internal.ValManager$1.v  isit(ValManager.java:663)
at org.eclipse.wst.validation.internal.ValManager.acc  ept(ValManager.java:803)
at org.eclipse.wst.validation.internal.ValManager.val  idate(ValManager.java:667)
at org.eclipse.wst.validation.internal.ValBuilderJob$  Visitor.visit(ValBuilderJob.java:298)
at org.eclipse.core.internal.resources.Resource$2.vis  it(Resource.java:108)
at org.eclipse.core.internal.resources.Resource$1.vis  itElement(Resource.java:60)
at org.eclipse.core.internal.watson.ElementTreeIterat  or.doIteration(ElementTreeIterator.java:82)
at org.eclipse.core.internal.watson.ElementTreeIterat  or.doIteration(ElementTreeIterator.java:86)
at org.eclipse.core.internal.watson.ElementTreeIterat  or.doIteration(ElementTreeIterator.java:86)
at org.eclipse.core.internal.watson.ElementTreeIterat  or.doIteration(ElementTreeIterator.java:86)
at org.eclipse.core.internal.watson.ElementTreeIterat  or.iterate(ElementTreeIterator.java:127)
at org.eclipse.core.internal.resources.Resource.accep  t(Resource.java:70)
at org.eclipse.core.internal.resources.Resource.accep  t(Resource.java:106)
at org.eclipse.core.internal.resources.Resource.accep  t(Resource.java:90)
at org.eclipse.wst.validation.internal.ValBuilderJob.  fullBuild(ValBuilderJob.java:218)
at org.eclipse.wst.validation.internal.ValBuilderJob.  run(ValBuilderJob.java:177)
at org.eclipse.wst.validation.internal.ValBuilderJob.  runInWorkspace(ValBuilderJob.java:125)
at org.eclipse.core.internal.resources.InternalWorksp  aceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.j  ava:55)

When I open some source files in the editor i get the following 2 errors:
Sun Aug 09 10:02:11 EDT 2009
Problems occurred when invoking code from plug-in: quot;org.eclipse.jdt.uiquot;.

java.lang.NoSuchMethodError: org.eclipse.ajdt.core.parserbridge.AJCompilationUn  itProblemFinder.getCompilerOptions(Ljava/util/Map;ZZ)Lorg/eclipse/jdt/internal/compiler/impl/CompilerOptions;
at org.eclipse.ajdt.core.parserbridge.AJCompilationUn  itProblemFinder.processAJ(AJCompilationUnitProblem  Finder.java:218)
at org.eclipse.ajdt.ui.AJDTNameEnvironmentProvider.pr  oblemFind(AJDTNameEnvironmentProvider.java:79)
at org.eclipse.contribution.jdt.itdawareness.ITDAware  nessAspect.ajc$around$org_eclipse_contribution_jdt  _itdawareness_ITDAwarenessAspect$4$8b05d765(ITDAwa  renessAspect.aj:223)
at org.eclipse.jdt.internal.core.CompilationUnitProbl  emFinder.process(CompilationUnitProblemFinder.java  :163)
at org.eclipse.jdt.internal.core.CompilationUnitProbl  emFinder.process(CompilationUnitProblemFinder.java  :258)
at org.eclipse.jdt.internal.core.ReconcileWorkingCopy  Operation.makeConsistent(ReconcileWorkingCopyOpera  tion.java:190)
at org.eclipse.jdt.internal.core.ReconcileWorkingCopy  Operation.executeOperation(ReconcileWorkingCopyOpe  ration.java:89)
at org.eclipse.jdt.internal.core.JavaModelOperation.r  un(JavaModelOperation.java:728)
at org.eclipse.jdt.internal.core.JavaModelOperation.r  unOperation(JavaModelOperation.java:788)
at org.eclipse.jdt.internal.core.CompilationUnit.reco  ncile(CompilationUnit.java:1264)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcil  ingStrategy.reconcile(JavaReconcilingStrategy.java  :126)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcil  ingStrategy.access$0(JavaReconcilingStrategy.java:  108)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcil  ingStrategy$1.run(JavaReconcilingStrategy.java:89)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner  .java:42)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcil  ingStrategy.reconcile(JavaReconcilingStrategy.java  :87)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcil  ingStrategy.initialReconcile(JavaReconcilingStrate  gy.java:178)
at org.eclipse.jdt.internal.ui.text.CompositeReconcil  ingStrategy.initialReconcile(CompositeReconcilingS  trategy.java:114)
at org.eclipse.jdt.internal.ui.text.JavaCompositeReco  ncilingStrategy.initialReconcile(JavaCompositeReco  ncilingStrategy.java:133)
at org.eclipse.jface.text.reconciler.MonoReconciler.i  nitialProcess(MonoReconciler.java:105)
at org.eclipse.jdt.internal.ui.text.JavaReconciler.in  itialProcess(JavaReconciler.java:398)
at org.eclipse.jface.text.reconciler.AbstractReconcil  er$BackgroundThread.run(AbstractReconciler.java:17  3)

and...
Sun Aug 09 10:02:11 EDT 2009
Error in JDT Core during reconcile

java.lang.NoSuchMethodError: org.eclipse.ajdt.core.parserbridge.AJCompilationUn  itProblemFinder.getCompilerOptions(Ljava/util/Map;ZZ)Lorg/eclipse/jdt/internal/compiler/impl/CompilerOptions;
at org.eclipse.ajdt.core.parserbridge.AJCompilationUn  itProblemFinder.processAJ(AJCompilationUnitProblem  Finder.java:218)
at org.eclipse.ajdt.ui.AJDTNameEnvironmentProvider.pr  oblemFind(AJDTNameEnvironmentProvider.java:79)
at org.eclipse.contribution.jdt.itdawareness.ITDAware  nessAspect.ajc$around$org_eclipse_contribution_jdt  _itdawareness_ITDAwarenessAspect$4$8b05d765(ITDAwa  renessAspect.aj:223)
at org.eclipse.jdt.internal.core.CompilationUnitProbl  emFinder.process(CompilationUnitProblemFinder.java  :163)
at org.eclipse.jdt.internal.core.CompilationUnitProbl  emFinder.process(CompilationUnitProblemFinder.java  :258)
at org.eclipse.jdt.internal.core.ReconcileWorkingCopy  Operation.makeConsistent(ReconcileWorkingCopyOpera  tion.java:190)
at org.eclipse.jdt.internal.core.ReconcileWorkingCopy  Operation.executeOperation(ReconcileWorkingCopyOpe  ration.java:89)
at org.eclipse.jdt.internal.core.JavaModelOperation.r  un(JavaModelOperation.java:728)
at org.eclipse.jdt.internal.core.JavaModelOperation.r  unOperation(JavaModelOperation.java:788)
at org.eclipse.jdt.internal.core.CompilationUnit.reco  ncile(CompilationUnit.java:1264)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcil  ingStrategy.reconcile(JavaReconcilingStrategy.java  :126)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcil  ingStrategy.access$0(JavaReconcilingStrategy.java:  108)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcil  ingStrategy$1.run(JavaReconcilingStrategy.java:89)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner  .java:42)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcil  ingStrategy.reconcile(JavaReconcilingStrategy.java  :87)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcil  ingStrategy.initialReconcile(JavaReconcilingStrate  gy.java:178)
at org.eclipse.jdt.internal.ui.text.CompositeReconcil  ingStrategy.initialReconcile(CompositeReconcilingS  trategy.java:114)
at org.eclipse.jdt.internal.ui.text.JavaCompositeReco  ncilingStrategy.initialReconcile(JavaCompositeReco  ncilingStrategy.java:133)
at org.eclipse.jface.text.reconciler.MonoReconciler.i  nitialProcess(MonoReconciler.java:105)
at org.eclipse.jdt.internal.ui.text.JavaReconciler.in  itialProcess(JavaReconciler.java:398)
at org.eclipse.jface.text.reconciler.AbstractReconcil  er$BackgroundThread.run(AbstractReconciler.java:17  3)

After that, if I restart STS, JDT Weaving is no longer enabled.

arod,

we figured out what is causing the problem: the new Groovy Plugin modifies JDT core in a way that the AspectJ Development Tools can't do its job anymore.

At this point the only work-around is to use the STS Groovy version only for normal java or groovy projects. If you want to evaluate Roo and also do Java and AspectJ development you need to stick to the STS version without Groovy.

I'm very sorry for this and hope that you can continue or rather start your Roo experience now.

I'll report back as soon as we have a better solution.

Christian
¥
Back Forum Reply New