This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 75032 - Big issue with Refactoring and Code Completion
Summary: Big issue with Refactoring and Code Completion
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: issues@java
URL:
Keywords:
: 70055 71325 72839 74219 74970 (view as bug list)
Depends on:
Blocks: 73679
  Show dependency tree
 
Reported: 2006-04-13 19:24 UTC by pramodkc
Modified: 2007-09-26 09:14 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The Message Log (121.81 KB, text/plain)
2006-04-13 19:25 UTC, pramodkc
Details
Another messages.log from psuchomel (236.57 KB, text/plain)
2006-04-26 08:03 UTC, Jan Becicka
Details
Another log from rstrobl (86.33 KB, text/plain)
2006-04-26 09:50 UTC, Jan Becicka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pramodkc 2006-04-13 19:24:17 UTC
This is an exception that I get almost every day and I have no idea what do
about this. This also prevents me from standardizing my team on netbeans instead
of eclipse. I do not understand why nobody seems to do anything about this bug.
I love netbeans but once this exception happens the whole refactoring module,
code completion module just give wrong results and this has been a huge issue.
If anyone actually starts working on this bug, you can contact me at
pramod@pravaah.com and I can send across a whole bunch of log files, right now
it seems there is no point.


Pramod.



javax.jmi.reflect.InvalidObjectException: Object with MOFID
681F75A0-A1C2-11DA-9AC6-8DE81326AA77:0000000000002A6E no longer exists, class:
org.netbeans.jmi.javamodel.JavaClass$Impl
	at
org.netbeans.mdr.handlers.BaseObjectHandler._getDelegate(BaseObjectHandler.java:359)
	at
org.netbeans.mdr.handlers.InstanceHandler.getInstanceDelegate(InstanceHandler.java:48)
	at org.netbeans.mdr.handlers.InstanceHandler._handleGet(InstanceHandler.java:193)
	at org.netbeans.jmi.javamodel.JavaClass$Impl.getName(Unknown Source)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.JavaClassImpl.getSuperClass(JavaClassImpl.java:326)
	at org.netbeans.jmi.javamodel.JavaClass$Impl.getSuperClass(Unknown Source)
	at
org.netbeans.modules.javacore.parser.MDRParser.getSuperClass(MDRParser.java:1452)
	at org.netbeans.modules.javacore.parser.Scope.getSuperClass(Scope.java:339)
	at
org.netbeans.modules.javacore.parser.Scope.constructMemberTypeScope(Scope.java:130)
	at org.netbeans.modules.javacore.parser.Scope.createMemberTypeScope(Scope.java:120)
	at
org.netbeans.modules.javacore.parser.Scope.constructMemberTypeScope(Scope.java:140)
	at org.netbeans.modules.javacore.parser.Scope.createMemberTypeScope(Scope.java:120)
	at org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:483)
	at org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:373)
	at org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:335)
	at org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:313)
	at org.netbeans.modules.javacore.parser.MDRParser.enterMembers(MDRParser.java:243)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.directUpdate(ResourceImpl.java:733)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.checkUpToDate(ResourceImpl.java:644)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.checkUpToDate(ResourceImpl.java:587)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.checkUpToDate(SemiPersistentElement.java:263)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.checkUpToDate(SemiPersistentElement.java:267)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.JavaClassImpl.getContents(JavaClassImpl.java:411)
	at org.netbeans.jmi.javamodel.JavaClass$Impl.getContents(Unknown Source)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.FeaturesList.toArray(FeaturesList.java:101)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ParameterizedTypeImpl$WrapperList.toArray(ParameterizedTypeImpl.java:367)
	at org.netbeans.modules.editor.java.JMIUtils.findFeatures(JMIUtils.java:835)
	at org.netbeans.modules.editor.java.JMIUtils.findFeatures(JMIUtils.java:399)
	at
org.netbeans.modules.editor.java.NbJavaJMICompletionQuery$Context.findFieldsMethodsAndInnerClasses(NbJavaJMICompletionQuery.java:1057)
	at
org.netbeans.modules.editor.java.NbJavaJMICompletionQuery$Context.resolveExp(NbJavaJMICompletionQuery.java:285)
	at
org.netbeans.modules.editor.java.NbJavaJMICompletionQuery.getResult(NbJavaJMICompletionQuery.java:57)
	at
org.netbeans.editor.ext.java.JavaCompletionQuery.query(JavaCompletionQuery.java:139)
	at
org.netbeans.editor.ext.java.JavaCompletionQuery.query(JavaCompletionQuery.java:74)
	at
org.netbeans.modules.editor.java.JavaCompletionProvider$Query.query(JavaCompletionProvider.java:108)
	at
org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:189)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:493)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:926)
Comment 1 pramodkc 2006-04-13 19:25:57 UTC
Created attachment 29850 [details]
The Message Log
Comment 2 Jiri Prox 2006-04-13 21:02:07 UTC
It's probably caused by some incosistency in metadata. Deleting
{userdir}/var/chace/mdrcache should help. But before deleting it, you can zip it
and attach the archive (or post it to my mail if the archive is too big). It may
help us to find the bug. There are already several reports about this strange
behaviour, unfortunately we can not find the moment when the metadata gets
corrupted, which makes bugfinding difficult. So any steps how to reproduce it
from a fresh userdir are wellcome.

Reassignig to java/javacore
Comment 3 pramodkc 2006-04-13 21:08:10 UTC
Another time the issue just happened
javax.jmi.reflect.InvalidObjectException: Object with MOFID
681F75A0-A1C2-11DA-9AC6-8DE81326AA77:0000000000002B31 no longer exists, class:
org.netbeans.jmi.javamodel.JavaClass$Impl
	at
org.netbeans.mdr.handlers.BaseObjectHandler._getDelegate(BaseObjectHandler.java:359)
	at
org.netbeans.mdr.handlers.InstanceHandler.getInstanceDelegate(InstanceHandler.java:48)
	at org.netbeans.mdr.handlers.InstanceHandler._handleGet(InstanceHandler.java:193)
	at org.netbeans.jmi.javamodel.JavaClass$Impl.super_getTypeParameters(Unknown
Source)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.JavaClassImpl.getTypeParameters(JavaClassImpl.java:425)
	at org.netbeans.jmi.javamodel.JavaClass$Impl.getTypeParameters(Unknown Source)
	at
org.netbeans.modules.editor.java.NbJavaJMISyntaxSupport.getType(NbJavaJMISyntaxSupport.java:343)
	at
org.netbeans.modules.editor.java.NbJavaJMISyntaxSupport.findType(NbJavaJMISyntaxSupport.java:145)
	at
org.netbeans.modules.editor.java.NbJavaJMICompletionQuery$Context.resolveItem(NbJavaJMICompletionQuery.java:493)
	at
org.netbeans.modules.editor.java.NbJavaJMICompletionQuery$Context.resolveExp(NbJavaJMICompletionQuery.java:258)
	at
org.netbeans.modules.editor.java.NbJavaJMICompletionQuery.getResult(NbJavaJMICompletionQuery.java:57)
	at
org.netbeans.editor.ext.java.JavaCompletionQuery.query(JavaCompletionQuery.java:139)
	at
org.netbeans.editor.ext.java.JavaCompletionQuery.query(JavaCompletionQuery.java:74)
	at
org.netbeans.modules.editor.java.JavaCompletionProvider$Query.query(JavaCompletionProvider.java:108)
	at
org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:189)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:493)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:926)
Comment 4 pramodkc 2006-04-13 21:11:51 UTC
Another datapoint that might help, if you have the kind of setup I am talking
about (multiple projects with large jar files) the only way for me to make
things work for sometime is to
   1. delete the "var" directory.
   2. start netbeans let it parse the classpath and then once it is done, exit
out so that it saves the classpath ( If I work in the session which creates the
new var directory I mess up the MOF repository)
   3. start netbeans again and then let it reread the MOF repository and then work.
Pramod. 
Comment 5 pramodkc 2006-04-13 21:31:42 UTC
Easy way to consistently reproduce this issue from a new userdir( I just did it
4 times in quick succession)

1. Delete old userdir.
2. Start Netbeans
3. New Project -> General (Java Application)
4. Any temp name/dir. Make sure you ask netbeans to create a main class.
5. This is very important - Before netbeans finishes parsing the classpath.
Inside the main(String[] args) method of the new class enter
   "Class.forName(" - At this point hit Ctrl-Spacebar for code completion but
before the code completion window appears hit enter and type any junk. Hit enter
again and type some valid java code ( You have to be fast and do all this before
the classpath parsing is done.
6. The little red error dot starts flashing indicating that you managed to mess
up the MOF repository.

If you have any issues reproducing this let me know at pramod@pravaah.com

Thanks
Pramod.

Comment 6 pramodkc 2006-04-13 21:55:52 UTC
Let me also state that after you follow the steps I outlined previously and
messed up your MDR you cannot even get code completion to give you a list of
methods for the java.lang.String object in perfectly valid java code. such as

   String str = "ABC";
   str. - At this point hit ctrl spacebar and you will not get anything.

Pramod.
Comment 7 Jan Becicka 2006-04-14 08:35:33 UTC
This looks like the root cause of issue 73679. We saw similar traces from Roman
Strobl. The most strange Exceptions are these:

java.lang.Exception: Class not found in index: java.util.HashMap.EntryIterator.
Recovering...

java.lang.Exception: Class not found in index: java.util.HashMap.EntrySet. 

java.lang.Exception: Class not found in index: java.lang.Class.MethodArray.
Recovering...

This is really strange, that classes from rt.jar (readonly) are not found in
index. This needs to be evaluated.
CCing Martin and Tomas, they could help.
Comment 8 Jan Becicka 2006-04-14 10:47:58 UTC
We suspect, that prebuilt storage is somehow corrupted. Please try to delete
netbeans/ide6/mdrstorage and let us know, if it helps.
Thanks
Comment 9 pramodkc 2006-04-14 19:03:39 UTC
deleting the prebuilt mdrstorage seems to have been the answer. Things work
pretty well after that. I have not been able to simulate the issue following the
steps I outlined and while using the system I have not had the issue again. I am
just very gaurded in my response as I do not know if it will reappear. I report
back in a week if I have any issues.


Comment 10 Jan Becicka 2006-04-26 08:03:49 UTC
Created attachment 30056 [details]
Another messages.log from psuchomel
Comment 11 Jan Becicka 2006-04-26 09:50:57 UTC
Created attachment 30058 [details]
Another log from rstrobl
Comment 12 _ tboudreau 2006-05-02 11:10:21 UTC
I'm running into similar issues, that started with installing NetBeans 5.5 and 
then trying to use 5.0.  However, deleting var/cache/* does not solve the 
problem - I get InvalidObjectExceptions immediately on startup.

One curious log message - what does this mean?

Using 'jar:file:/C:/Program%20Files/Java/jdk1.5.0_06/src.zip!/1.4.1' pre-
parsed database!
Comment 13 Pavel Flaska 2006-05-03 15:58:57 UTC
This means it uses pre-parsed database created by installer. I did not look at
it in detail but the mix of jdk1.5.0_06 directory and 1.4.1 version are strange.
jar:file:/C:/Program%20Files/Java/jdk1.5.0_06/src.zip!/1.4.1'.

Questions:
- Did you install NetBeans from installer and did you use J2SDK 1.4.1.
- Now do you run on JDK 1.5.0_06?

If it is true, what exact builds of JDK did you use? (I have idea what can be
wrong but I do not believe in it, just want to try to ensure it is not the case
I think.)
Comment 14 Jan Becicka 2006-05-04 14:52:26 UTC
*** Issue 74970 has been marked as a duplicate of this issue. ***
Comment 15 Jan Becicka 2006-05-05 12:59:09 UTC
*** Issue 71325 has been marked as a duplicate of this issue. ***
Comment 16 Jan Becicka 2006-06-07 08:04:33 UTC
Thanks to psuchome a thurka we have reproducoble test case:
1. Install NetBeans from installer in Pacific Timezone
2. Open several project do Find Usages, open several files
3. Shut down the IDE
4. Switch to Prague Timezone
5. Start the IDE do Find Usages, open several files - IOEs will be thrown

Comment 17 Jan Becicka 2006-06-07 12:19:40 UTC
Problem with class not found in index fixed:

Checking in ClassUpdater.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/scanning/ClassUpdater.java,v
 <--  ClassUpdater.java
new revision: 1.13; previous revision: 1.12
done

Rest if this report is duplicate of issue 73679
Comment 18 Jan Becicka 2006-06-07 13:05:20 UTC
*** Issue 70055 has been marked as a duplicate of this issue. ***
Comment 19 Jan Becicka 2006-06-07 13:10:33 UTC
*** Issue 72839 has been marked as a duplicate of this issue. ***
Comment 20 Jan Becicka 2006-06-07 13:11:14 UTC
*** Issue 74219 has been marked as a duplicate of this issue. ***
Comment 21 Jiri Prox 2006-06-12 15:31:55 UTC
Verified in 200606081800, can be merged to 5.5 branch.
Comment 22 Jan Becicka 2006-06-14 10:12:05 UTC
Checking in ClassUpdater.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/scanning/ClassUpdater.java,v
 <--  ClassUpdater.java
new revision: 1.11.34.1; previous revision: 1.11
done
Comment 23 Jiri Prox 2006-06-19 14:58:31 UTC
Verified. NB 5.5 200606160200 
Comment 24 Quality Engineering 2007-09-20 09:45:11 UTC
Reorganization of java component