- This topic has 7 replies, 2 voices, and was last updated 19 years, 3 months ago by
Riyad Kalla.
-
AuthorPosts
-
fparrottMemberHi,
I hope this is the right forum for this question. Please excuse if not.
Using MYEclipse4.1.1 with Eclipse3.1.2 on linux.
We have a web framework boilerplate application in CVS. When the user checksout the framework, he also gets the .project and .classpath files. Here’s my problem. With a brand new workspace, I’m able to checkout the framework, and get the MyEclipse perspective prompt. I answer the prompt “yes”, and the web framework project is loaded and sucessfully built. So assume the name of the first project as test1. Now within the same workspace, I checkout the same web framework again, with name test2. The project appears in the package explorer of the MyEclipse perspective, but it has error markers on it. The errors indicate that in can’t find the jar s that are listed in the .classpath file. To “fix” the error, we found if we close project (test2) and reopen it, from the Projects menu bar, the errors get corrected, since I assume the “open” action has some how read the .classpath file. Has anyone seen this type of error or symptom before? This is repeatable. The first project build is alays sucessful, and every project created afterwards initially fails.
Honestly, I’m not sure if this a MyEclipse problem. We wrote our owned custom wizard to create the project. I’ve included some code snippets, in case someone can see what I might be coding wrong. In the boilerplate wizard’s finishPage() method, we do this:
IProject lProject = lNewProjectWizardPage.getProjectHandle();
// uncompress boileplate property files.
uncompress(lProject);IJavaModel lJavaModel = JavaCore.create(lProject.getWorkspace().getRoot());
IJavaElement lJavaElementArray[] = new IJavaElement[] {lJavaModel.getJavaProject(lProject.getName())};
lJavaModel.refreshExternalArchives(lJavaElementArray, aProgressMonitor);// this forces a refresh of the project in the package explorer
RefreshAction lRefreshAction = new RefreshAction(getShell());
lRefreshAction.refreshAll();I can’t understand why the very first web project opens and successfully builds (and deploys), and more than one project in the same workspace fails.
Any ideas are greatky appreciated.
FrankApril 5, 2006 at 6:29 pm #249872
Riyad KallaMemberFrank,
When I asked one of our devleopers about this, he asked these questions:First, are the project names as listed in the .project file, unique? Second, if closing and opening fixes the project, do the .project or .classpath file get modified by that in some way?
Do these help shed some light on the issue?
April 6, 2006 at 10:13 am #249907
fparrottMemberHi,
thanks for your quick response.
I was incorrect about the .project and .classpath coming from CVS. The .classpath is contained within project boilerplate zip file. The .project file is created by MyEclipse, and therefore contains unique project names.Basically the problems boils down to this:
– If I create the project via our boilerplate wizard, and I’m not in the MyEclipse perspective, when prompted for the MyEclipse perspective, I switch to it, and the project is sucessfully created with no classpath errors.
– If I create the project , via our boilerplate wizard, within the MyEclipse perspective, then the project fails to build, and has flaged classpath errors.I’ve compared the .classpath file in the workspace between a sucessful project and failing project, before and after the project close/open, and I see no difference.
Do you what could be the diference between creating the project and switching to MyEclipse perspective VS. attempting to create the project within the Myeclipse perspecitive?
I can’t figure out what code we might be missing in our wizard code. I would have thought the “refresh” method would fix this.
Here’s the finishPage method we have coded:
protected void finishPage(IProgressMonitor aProgressMonitor) throws InterruptedException, CoreException {super.finishPage(aProgressMonitor);
// expand the zip file for the chosen boilerplate to the new project
NewWebProjectWizardPage lNewProjectWizardPage = (NewWebProjectWizardPage)this.getPages()[0];
IProject lProject = lNewProjectWizardPage.getProjectHandle();
uncompress(lProject);IJavaModel lJavaModel = JavaCore.create(lProject.getWorkspace().getRoot());
IJavaElement lJavaElementArray[] = new IJavaElement[] {lJavaModel.getJavaProject(lProject.getName())};
lJavaModel.refreshExternalArchives(lJavaElementArray, aProgressMonitor);RefreshAction lRefreshAction = new RefreshAction(getShell());
lRefreshAction.refreshAll();
}Thanks for any help you can provide.
frank================== .project =========================================
<?xml version=”1.0″ encoding=”UTF-8″?>
<projectDescription>
<name>test2</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.ibm.etools.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.ibm.sse.model.structuredbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.genuitec.eclipse.j2eedt.core.webnature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>April 6, 2006 at 12:40 pm #249916
Riyad KallaMemberIf you create both projects back to back in the MyEclipse perspective without switching, do they both fail?
April 7, 2006 at 10:21 am #250004
fparrottMemberHi Riyad,
I open a fresh (new) workspace. I get into the MyEclipse J2EE Develo[pment perspective. I create two projects, via our boilerplate wizard, test1 and test2. It looks to be interrmittent. Generally, they both fail. Today I tried several iterations of opening two projects and then delete (delete file system option) the projects. Here’s my results:
– most of the time, they both fail.
– sometimes the 1st project fails, but the second project is ok.
– Yesterday, I had the first project passing, but the 2nd failed, more consistently.It looks to be a stange race condition. Is there a .options file I can use to provide more debugging info?
thanks for your help,
FrankApril 7, 2006 at 2:22 pm #250015
Riyad KallaMemberFrank,
Did you say that simply cleaning the projects after the failure fixes the issue? I don’t know how often your team is creating projects in their workspace, but past that initial hump, since there is no longer an issue is it safe for me to assume that you are able to work successfully, it’s just this initial annoying conflict case?Also I can’t pull any developers away to look into this right now (MyEclipse 5.0 is top priority). I might suggest trying this when we release MyEclipse 5.0 Milestone 1 which will be based on Eclipse 3.2 and see if the issue resolves itself… you are right, it might be some weird race condition.
April 12, 2006 at 9:52 am #250350
fparrottMemberHi Rkalla,
Yes, if you do a project->close, and then Project->open, will clear the error.
Will MyEclipse5.0 be compatable with Eclipse3.1.2? Our version of Eclipse toolset has other vendors tools, so we might not go to Eclipse 3.2 right away.
I understand, but disappointed I can’t get this resolved now.
Thanks anyways.
FrankApril 12, 2006 at 1:14 pm #250369
Riyad KallaMemberWill MyEclipse5.0 be compatable with Eclipse3.1.2?
No, it will be based on Eclipse 3.2, lot’s of underlying API changes and enhancements.
-
AuthorPosts