Community
Participate
Working Groups
I20100307-2000 I got this error just after startup, while the "initializing java" job was running. I did "Open Type", but it was blocked. After awhile I gave up, closed the dialog, and did "Open Resource" instead to open the file. Around the time the editor opened on the file this error popped up. !ENTRY org.eclipse.core.jobs 4 2 2010-03-08 14:24:55.375 !MESSAGE An internal error occurred during: "Items filtering". !STACK 0 java.lang.IllegalArgumentException: Attempted to beginRule: MultiRule[P/org.eclipse.releng.basebuilder,P/.org.eclipse.jdt.core.external.folders], does not match outer scope rule: MultiRule[P/org.eclipsecon.ebots.client,P/.org.eclipse.jdt.core.external.folders] at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63) at org.eclipse.core.internal.jobs.ThreadJob.illegalPush(ThreadJob.java:136) at org.eclipse.core.internal.jobs.ThreadJob.push(ThreadJob.java:326) at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJobs.java:63) at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManager.java:285) at org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:117) at org.eclipse.core.internal.resources.Workspace.prepareOperation(Workspace.java:1914) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1970) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:793)
Created attachment 161339 [details] Log file
Jay, please investigate.
Created attachment 161463 [details] Log running on I20100309-0100 This error happened again today after upgrading to the latest build. There are several more errors in the log this time so I'm attaching the new log for reference.
Szymon, Did something changed lately related to the rules scheduling?
(In reply to comment #3) > Created an attachment (id=161463) [details] > Log running on I20100309-0100 > > This error happened again today after upgrading to the latest build. There are > several more errors in the log this time so I'm attaching the new log for > reference. Thanks for the log, John. This is helpful. While looking at the exception and the JDT/Core code, it looked like the most likely scenario is that there was some problem resolving the JRE library. The following log message (from the second log) seems to substantiate that somewhat: !SUBENTRY 2 org.eclipse.jdt.compiler.tool 2 0 2010-03-09 09:34:25.718 !MESSAGE Missing Constraint: Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Can you tell me if you get a valid JRE library in your workspace? (In reply to comment #4) > Szymon, > > Did something changed lately related to the rules scheduling? Olivier, the schedule rules in question here are introduced by bug 289560. However, this happens only in the scenario that I just mentioned. I will investigate further.
John is using a EE 1.5 so all bundles that require 1.6 won't resolve. This is expected and should not cause grief.
(In reply to comment #4) > Szymon, > > Did something changed lately related to the rules scheduling? I don't think it is a problem with scheduling itself. The first rule just doesn't contain the second one. You should investigate the code that creates these MultiRules and it seems that Jay is investigating this code already.
Interestingly, although I have many projects in my workspace, the error occurred in the same two projects both times. Jay asked me to look at the build paths on these projects, and it turns out they both have build path errors; org.eclipse.ebots.client: build path has JavaSE-1.6 container on the build path, but I have not Java 1.6 JRE installed on my system so the container is unbound. org.eclipse.releng.basebuilder: its build path has an entry "j2ee.jar" that is missing
What's interesting here is if you search for ".org.eclipse.jdt.core.external.folders" you'll see a lot of bugs appearing, and, in my opinion, they all have the same root cause - some process is creating this ".org.eclipse.jdt.core.external.folders" folder in the "{workspace}/.metadata/.plugins/org.eclipse.core.resources/.projects" folder and this is NOT a good place for it be created. I too, am hitting issues where the rule doesn't match the outer scope due to this folder being created. Who's creating this folder here, and why? This is just plain WRONG.
.org.eclipse.jdt.core.external.folders is actually a project in your workspace. It is hidden from view for the end user because it is for internal use by JDT to track entries on your build path that are outside your workspace. From an end user perspective you shouldn't know or care about the existence of this project. Jay can correct me, but I don't think that project is the source of the problem in this case - it just happens to be involved in the classpath initialization process, and in this case there is a nested classpath initialization happening that shouldn't.
Ok, but why am I only recently seeing breakage all around this, such as errors stating that the project metadata (.project) can't be located for the project, and the WorkspaceJobManager complaining because the outer scope doesn't contain the project but the inner one does (i.e. "this workspace has changed!")? These seem unrelated, which lead me to assume that the creation of this "project" folder was a recent change. I've never seen the project before in my filesystem, but am seeing it now, and colleagues who say they have seen related issues say they can't locate the project in any workspace. So, are you telling me that this is unchanged and related functionality in seemingly-varied other areas has changed? If so, then I stand corrected, and will log more appropriate issues elsewhere. Right now, I have 97 JUnit test errors and failures because of the workspace job rule scope issue, where I didn't before.
(In reply to comment #10) > > Jay can correct me, but I don't think that project is the source of the problem > in this case - it just happens to be involved in the classpath initialization > process, and in this case there is a nested classpath initialization happening > that shouldn't. Yes, we didn't add anything to the creation of the external project folder project itself in this milestone. To my knowledge, only change that has happened around this is the new schedule rule for the container set operation. (In reply to comment #11) > Ok, but why am I only recently seeing breakage all around this, such as errors > stating that the project metadata (.project) can't be located for the project, > and the WorkspaceJobManager complaining because the outer scope doesn't contain > the project but the inner one does (i.e. "this workspace has changed!")? Can you please add the details about the rules scope problem here? It will be interesting to see if it's the same scenario as John's or a different one. > So, are you telling me that this is unchanged and related functionality in > seemingly-varied other areas has changed? If so, then I stand corrected, and > will log more appropriate issues elsewhere. Right now, I have 97 JUnit test > errors and failures because of the workspace job rule scope issue, where I > didn't before. As mentioned earlier, add the details of the rule scope problem here.
There seems to be a couple of places where one SetContainerOperation can be invoked within another but under exceptional conditions. While one way of fixing this bug would be to get rid of such possibilities, I feel that the long term solution would be to allow operations to find out about the outer rules if any in that thread so that they can add the new rules to the existing multi rule. John can probably comment on or add to this part.
(In reply to comment #13) > I feel that the long > term solution would be to allow operations to find out about the outer rules if > any in that thread so that they can add the new rules to the existing multi > rule. By design, a thread that owns a scheduling rule is not allowed to obtain another rule because of the deadlock risk. For example if thread 1 was doing classpath intialization in the order A -> B and thread 2 had the order B -> A then you would deadlock.
Here's an example of what I am seeing a lot - it seems one WorkspaceJob "sees" the hidden folder, while another doesn't, resulting in the IllegalArgumentException. java.lang.IllegalArgumentException: Attempted to beginRule: MultiRule[P/testCreateFromELExpression_FileReferencesWebProject_,P/.org.eclipse.jdt.core.external.folders], does not match outer scope rule: P/testCreateFromELExpression_FileReferencesWebProject_ at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63) at org.eclipse.core.internal.jobs.ThreadJob.illegalPush(ThreadJob.java:136) at org.eclipse.core.internal.jobs.ThreadJob.push(ThreadJob.java:326) at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJobs.java:63) at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManager.java:285) at org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:117) at org.eclipse.core.internal.resources.Workspace.prepareOperation(Workspace.java:1918) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1974) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:793) at org.eclipse.jdt.core.JavaCore.setClasspathContainer(JavaCore.java:4833) at org.eclipse.jdt.internal.launching.JREContainerInitializer.initialize(JREContainerInitializer.java:69) at org.eclipse.jdt.internal.core.JavaModelManager.initializeContainer(JavaModelManager.java:2695) at org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer(JavaModelManager.java:1842) at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore.java:2699) at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2664) at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2802) at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:1946) at org.eclipse.jst.jsp.core.taglib.ProjectDescription.ensureUpTodate(ProjectDescription.java:994) at org.eclipse.jst.jsp.core.taglib.ProjectDescription.getAvailableTaglibRecords(ProjectDescription.java:1085) at org.eclipse.jst.jsp.core.taglib.TaglibIndex.internalGetAvailableTaglibRecords(TaglibIndex.java:847) at org.eclipse.jst.jsp.core.taglib.TaglibIndex.getAvailableTaglibRecords(TaglibIndex.java:506) at org.eclipse.jst.jsf.core.metadata.internal.TaglibMetaDataLocator.locateMetaDataModelProviders(TaglibMetaDataLocator.java:69) at org.eclipse.jst.jsf.common.metadata.internal.DomainLoadingStrategy.locateMetaDataSourceInstances(DomainLoadingStrategy.java:143) at org.eclipse.jst.jsf.common.metadata.internal.DomainLoadingStrategy.load(DomainLoadingStrategy.java:54) at org.eclipse.jst.jsf.common.metadata.internal.MetaDataModel.load(MetaDataModel.java:80) at org.eclipse.jst.jsf.common.metadata.internal.MetaDataModelManager.loadMetadata(MetaDataModelManager.java:220) at org.eclipse.jst.jsf.common.metadata.internal.MetaDataModelManager.getModel(MetaDataModelManager.java:150) at org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper.getMDModel(TaglibDomainMetaDataQueryHelper.java:197) at org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper.getModel(TaglibDomainMetaDataQueryHelper.java:73) at org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper.getEntities(TaglibDomainMetaDataQueryHelper.java:111) at org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper.getEntity(TaglibDomainMetaDataQueryHelper.java:89) at org.eclipse.jst.jsf.common.metadata.query.TaglibDomainMetaDataQueryHelper.getTrait(TaglibDomainMetaDataQueryHelper.java:210) ...snip...
An observation: Looking at the stack trace, there are two invocations of the JavaModelManager#initializeAllContainers in the same stack. This could be because JavaModelManager#batchContainerInitializations returns true even if the state is BATCH_INITIALIZATION_IN_PROGRESS. This makes multiple calls to initializeAllContainers (not necessarily in the same thread) possible. I am not quite sure if that is the intended behavior. I am investigating further.
(In reply to comment #15) > Here's an example of what I am seeing a lot - it seems one WorkspaceJob "sees" > the hidden folder, while another doesn't, resulting in the > IllegalArgumentException. > > java.lang.IllegalArgumentException: Attempted to beginRule: > MultiRule[P/testCreateFromELExpression_FileReferencesWebProject_,P/.org.eclipse.jdt.core.external.folders], > does not match outer scope rule: > P/testCreateFromELExpression_FileReferencesWebProject_ > at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63) > at org.eclipse.core.internal.jobs.ThreadJob.illegalPush(ThreadJob.java:136) > at org.eclipse.core.internal.jobs.ThreadJob.push(ThreadJob.java:326) > at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJobs.java:63) > at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManager.java:285) > at > org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:117) > at Ian, Can you please attach the complete log file, which has this stack trace?
(In reply to comment #17) > Ian, > > Can you please attach the complete log file, which has this stack trace? It would help to have the log file with the following debug options turned on: org.eclipse.jdt.core/debug=true org.eclipse.jdt.core/debug/javamodel=true org.eclipse.jdt.core/debug/javamodel/cache=true org.eclipse.jdt.core/debug/cpresolution=true org.eclipse.jdt.core/debug/cpresolution/advanced=true org.eclipse.jdt.core/debug/cpresolution/failure=true The first one is enabled by default. Just make sure it is 'true' and also the -debug command line option is passed on to eclipse.
*** Bug 305869 has been marked as a duplicate of this bug. ***
Created attachment 162454 [details] Log File from ian.trimble As requested.
Created attachment 162455 [details] Console Output from ian.trimble As requested.
(In reply to comment #21) > Created an attachment (id=162455) [details] > Console Output from ian.trimble > > As requested. Thanks, Ian. Finally I am able to reproduce the problem consistently. The issue manifests (but not limited to) when we have two or more projects using JavaSE-1.6 Execution Environment but we don't have a compatible JRE (i.e. 1.6 or above). I will soon post a patch and perhaps a plug-in patch too, so that Ian/John can verify the fix.
Created attachment 162531 [details] Proposed Fix Proposed fix. Tests will be added once plug-in patch with fix is verified. The fix is to not allow multiple invocations of initializeAllContainers simultaneously. When the batch initialization is already in progress (i.e. state BATCH_INITIALIZATION_IN_PROGRESS), JavaModelManager#batchContainerInitializations returns false.
Created attachment 162536 [details] Plug-in Patch Ian/John, Could you please test if this plug-in patch addresses the bug. By the way, I don't see bug 305869 getting fixed with this one. I will take another look at it and if required re-open the bug.
(In reply to comment #24) > Created an attachment (id=162536) [details] > Plug-in Patch > Ian/John, > Could you please test if this plug-in patch addresses the bug. > By the way, I don't see bug 305869 getting fixed with this one. I will take > another look at it and if required re-open the bug. Could you please advise how to test a "plug-in patch"? I tried the obvious (place the file in plugins, place the file in dropins, -clean each time, even remove older plugin JAR), but nothing I do will show the newer plug-in as being active, and the fix behaviour is not present.
*** Bug 306784 has been marked as a duplicate of this bug. ***
(In reply to comment #25) > Could you please advise how to test a "plug-in patch"? I tried the obvious > (place the file in plugins, place the file in dropins, -clean each time, even > remove older plugin JAR), but nothing I do will show the newer plug-in as being > active, and the fix behaviour is not present. That should do it. Can you please tell me what version of the JDT plug-in you have. I can provide one with the same version.
(In reply to comment #27) > That should do it. Can you please tell me what version of the JDT plug-in you > have. I can provide one with the same version. I didn't realize the version was the issue, my mistake. I hacked the version to 3.6.0.v_A32a and verified the plug-in was active, but there was no overall change in behaviour. I see now that what I am experiencing is a change in scheduling rules - what is being compared is a single project and a workspace root (I'm not sure what used to be compared; perhaps some process used to run without any rule at all). So I'm not even sure I am testing for the same issue that you are fixing any longer. That is, your fix may be fine, I'm just not sure how to test it (your fix does nothing to affect my scheduling rule conflicts).
(In reply to comment #28) > (In reply to comment #27) > > That should do it. Can you please tell me what version of the JDT plug-in you > > have. I can provide one with the same version. > > I didn't realize the version was the issue, my mistake. I hacked the version to > 3.6.0.v_A32a and verified the plug-in was active, but there was no overall > change in behaviour. I see now that what I am experiencing is a change in > scheduling rules - what is being compared is a single project and a workspace > root (I'm not sure what used to be compared; perhaps some process used to run > without any rule at all). So I'm not even sure I am testing for the same issue > that you are fixing any longer. That is, your fix may be fine, I'm just not > sure how to test it (your fix does nothing to affect my scheduling rule > conflicts). Can you please post your new error message and the exception from the log? The patch should address the issue reported in comment #15. The fix was not to change any schedule rules but simply avoid the nested calls to the SetContainerOperation.
Hi Ian, Jay, I agree, I think we're now looking at a different issue. This appears to be a conflict caused by a change to the SetContainerOperation class. It now overrides getSchedulingRule() returning the MultiRule that includes the external folder. Previously, the parent class, ChangeClasspathOperation, just returned null so there where no scheduling rule conflicts. Jay pointed out bug 289560. So now, if a thread has a scheduling rule such as a project, and there is a JDT call that invokes the SetContainerOperation (as in the case of calling the JSFAppConfigManager), it will try to get/resolve a class path for the project and the Java Model will run a workspace runnable with the operation and the MultiRule from the operation. This causes the rule conflict. Maybe the operation could check to see if the current job already has a rule and if there is a conflict while creating the MultiRule. I have a simple test that will cause the IllegalArgumentException without going through the initializeAllContainers() discussed here. java.lang.IllegalArgumentException: Attempted to beginRule: MultiRule[P/testBug_SerializationTestProject_,P/.org.eclipse.jdt.core.external.folders], does not match outer scope rule: P/testBug_SerializationTestProject_ at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63) at org.eclipse.core.internal.jobs.ThreadJob.illegalPush(ThreadJob.java:136) at org.eclipse.core.internal.jobs.ThreadJob.push(ThreadJob.java:326) at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJobs.java:63) at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManager.java:285) at org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:117) at org.eclipse.core.internal.resources.Workspace.prepareOperation(Workspace.java:1914) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1970) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:793) at org.eclipse.jdt.core.JavaCore.setClasspathContainer(JavaCore.java:4833) at org.eclipse.jdt.internal.launching.JREContainerInitializer.initialize(JREContainerInitializer.java:69) at org.eclipse.jdt.internal.core.JavaModelManager.initializeContainer(JavaModelManager.java:2695) at org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer(JavaModelManager.java:1842) at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore.java:2699) at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2639) at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2777) at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:1946) at org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigUtils.getConfigFileJARsFromClasspath(JSFAppConfigUtils.java:326) at org.eclipse.jst.jsf.core.jsfappconfig.RuntimeClasspathJSFAppConfigLocater.locateProviders(RuntimeClasspathJSFAppConfigLocater.java:64) at org.eclipse.jst.jsf.core.jsfappconfig.RuntimeClasspathJSFAppConfigLocater.startLocating(RuntimeClasspathJSFAppConfigLocater.java:45) at org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager.startConfigLocaters(JSFAppConfigManager.java:284) at org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager.initialize(JSFAppConfigManager.java:247)
(In reply to comment #30) > Maybe the > operation could check to see if the current job already has a rule and if there > is a conflict while creating the MultiRule. > Yes, that would eliminate this and other similar bugs (bug 305869 and bug 306784). However, we won't be able to address scenarios such as bug 289560. Besides, operations such as SetContainerOperation and SetClasspathOperation (which also has a rule) would want to have their own rules.
Not sure if it helps in this case, but I want to call your attention to new API in Eclipse 3.6M6. JobManager.currentRule() (which tells you what active rule, if any is present) and JobManager.currentJob().yieldRule() (which will temporarily pause the running job to let another conflicting job to run)
I tried something similar to the following code and doesn't seem to help. I am wondering if yielding makes a difference to nested jobs at all or if the following code is missing something. Job baseJob = Job.getJobManager().currentJob(); ISchedulingRule baseRule = baseJob.getRule(); // == Job.getJobManager().currentRule() ? boolean conflicting = false; ... if (!conflicting && baseRule != null && baseRule.isConflicting(rules[length])) conflicting = true; ISchedulingRule newRule = new MultiRule(rules); if (conflicting) baseJob.yieldRule(this.progressMonitor); The ThreadJob that is throwing IAE doesn't seem to check for the status of the base job (whether it's WAITING or not) at all. And hence yielding the base job may not make a difference and I continue to see the error. Investigating further.
Created attachment 164188 [details] Reversal of fix to bug 289560 The bug 289560 (whose fix caused this one) perhaps has been fixed by 260968. Hence rolling back those changes, which should take care of this one.
Released the changes in HEAD for 3.6M7.
*** Bug 310070 has been marked as a duplicate of this bug. ***
Verified for 3.6M7 using build I20100424-2000
Verified.
Appreciate the fix Jay - we've verified that this works for us as well.