Community
Participate
Working Groups
MTJ 0.9M1 Testing Installation : eclipse-SDK-3.4.0 (I20080617-2000) MTJ install : mtj-runtime java.runtime : Java(TM) SE Runtime Environment (build 1.6.0_07-b06) os.name: : Windows XP Professional, Service Pack 3 Overview: Problem while importing projects without devices on workspace Steps to Reproduce: 1) Try to import many projects without the device on the workspace Actual Results: Some projects are not imported (do not appear on the package explorer) and the error (additional information) is present on the error log Expected Results: Import the projects without problem. Build Date & Platform: Build id: 200808291424 / Windows XP Additional Builds and Platforms: ... Additional Information: ERROR on Error Log java.lang.NullPointerException at org.eclipse.mtj.core.internal.JavaMEClasspathContainer.<init>(JavaMEClasspathContainer.java:53) at org.eclipse.mtj.core.internal.JavaMEClasspathContainerInitializer.initialize(JavaMEClasspathContainerInitializer.java:66) at org.eclipse.jdt.internal.core.JavaModelManager.initializeContainer(JavaModelManager.java:2220) at org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer(JavaModelManager.java:1546) at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore.java:1571) at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2558) at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:1848) at org.eclipse.jdt.internal.core.JavaProject.computeExpandedClasspath(JavaProject.java:449) at org.eclipse.jdt.internal.core.JavaProject.getExpandedClasspath(JavaProject.java:1453) at org.eclipse.jdt.internal.core.builder.NameEnvironment.computeClasspathLocations(NameEnvironment.java:93) at org.eclipse.jdt.internal.core.builder.NameEnvironment.<init>(NameEnvironment.java:41) at org.eclipse.jdt.internal.core.builder.JavaBuilder.initializeBuilder(JavaBuilder.java:590) at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:166) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:624) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:166) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:197) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:246) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:249) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:302) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:334) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:137) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Created attachment 113041 [details] JavaMEClasspathContainerInitializer fixes I found that the problem was in the JavaMEClasspathContainerInitializer. The method : public void initialize(IPath containerPath, IJavaProject project) uses an instance of device, but didn't check if the instance was null. I'm attaching a patch that fix this issue.
Created attachment 113199 [details] JavaMEClasspathContainerInitializer fixes V2 New version of the patch. The behavior is: 1) import the project; 2) set the JavaMEClasspathContainer to null 3) add a marker to the project to inform that the JavaMEClasspathContainer could not be resolved 3) add a marker to the project to inform that there is no device associated to it I also added a quick fix to the missing device marker that will open the projects property page where the user can import a device to the project. I'm also including some screen shots that shows this behavior.
Created attachment 113200 [details] error markes in project
Created attachment 113201 [details] Quick fix option for "No device definition is associated to this project." marker
Created attachment 113202 [details] project preference page
I've tested the patch on comment #2 and it is working fine for me. I'm voting +1 to include this fix in 0.9 release
also tested new patch and i'm ok to commit it (In reply to comment #6) > I've tested the patch on comment #2 and it is working fine for me. > > I'm voting +1 to include this fix in 0.9 release >
Fixed
all bugs we integrated and release on MTj 0.9