Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Error trying to use PDT in Eclipse RCP application
Error trying to use PDT in Eclipse RCP application [message #950704] Sat, 20 October 2012 03:55 Go to next message
Chad Retz is currently offline Chad RetzFriend
Messages: 6
Registered: July 2010
Junior Member
I am attempting to leverage the type inferencing engine in a headless RCP app. I have the latest Juno setup installed. I have included all the plugin dependencies in my app, yet when I try to use CodeAssistUtils, I get:

!ENTRY org.eclipse.core.jobs 4 2 2012-10-19 22:47:06.093
!MESSAGE An internal error occurred during: "Validating temppj".
!STACK 0
java.lang.ExceptionInInitializerError
	at org.eclipse.php.internal.core.validation.PHPTodoTaskValidator.populateTaskTags(PHPTodoTaskValidator.java:193)
	at org.eclipse.php.internal.core.validation.PHPTodoTaskValidator.validateFile(PHPTodoTaskValidator.java:75)
	at org.eclipse.php.internal.core.validation.PHPTodoTaskValidator.validate(PHPTodoTaskValidator.java:61)
	at org.eclipse.wst.validation.Validator$V2.validate(Validator.java:1159)
	at org.eclipse.wst.validation.internal.ValManager.validate(ValManager.java:704)
	at org.eclipse.wst.validation.internal.ValManager$1.visit(ValManager.java:665)
	at org.eclipse.wst.validation.internal.ValManager.accept(ValManager.java:810)
	at org.eclipse.wst.validation.internal.ValManager.validate(ValManager.java:669)
	at org.eclipse.wst.validation.internal.ValBuilderJob$Visitor.visit(ValBuilderJob.java:299)
	at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:126)
	at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:85)
	at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
	at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
	at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
	at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
	at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:127)
	at org.eclipse.core.internal.resources.Resource.accept(Resource.java:95)
	at org.eclipse.core.internal.resources.Resource.accept(Resource.java:52)
	at org.eclipse.core.internal.resources.Resource.accept(Resource.java:124)
	at org.eclipse.core.internal.resources.Resource.accept(Resource.java:108)
	at org.eclipse.wst.validation.internal.ValBuilderJob.fullBuild(ValBuilderJob.java:219)
	at org.eclipse.wst.validation.internal.ValBuilderJob.run(ValBuilderJob.java:178)
	at org.eclipse.wst.validation.internal.ValBuilderJob.runInWorkspace(ValBuilderJob.java:126)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.NullPointerException
	at org.eclipse.php.internal.core.preferences.TaskTagsProvider.<clinit>(TaskTagsProvider.java:44)
	... 25 more


I manually build the project w/ PHP and facet natures and that's it. My code looks like this:

@SuppressWarnings("restriction")
public class Application implements IApplication {

	public Object start(IApplicationContext context) throws Exception {
		IWorkspace workspace = ResourcesPlugin.getWorkspace();
		IWorkspaceRoot root = workspace.getRoot();
		IProject proj = root.getProject("temppj");
		proj.delete(true, null);
		proj.create(null);
		proj.open(null);
		IProjectDescription desc = proj.getDescription();
		List<String> natureIds = new ArrayList<String>(Arrays.asList(desc.getNatureIds()));
		natureIds.add(PHPNature.ID);
		natureIds.add(FacetedProjectNature.NATURE_ID);
		if (!workspace.validateNatureSet(natureIds.toArray(new String[0])).isOK()) {
			System.out.println("AHHHH!");
		}
		desc.setNatureIds(natureIds.toArray(new String[0]));
		proj.setDescription(desc, null);
		IFolder link = proj.getFolder("link");
		IPath linkLoc = new Path("c:\\work\\test");
		if (workspace.validateLinkLocation(link, linkLoc).isOK()) {
			link.createLink(linkLoc, IResource.NONE, null);
		} else {
			System.out.println("LINK NOT OK!");
		}
		workspace.save(true, null);
		IFile file = link.getFile("src/test.php");
		ISourceModule src = PHPToolkitUtil.getSourceModule(file);
		IType[] types = CodeAssistUtils.getFunctionReturnType(null, "myfunction", src, 0);
		return IApplication.EXIT_OK;
	}

	public void stop() {
		// nothing to do
	}
}


Again, it's the CodeAssistUtils that fails. Any ideas or pointers? If not, anywhere else that I should ask?
Re: Error trying to use PDT in Eclipse RCP application [message #952108 is a reply to message #950704] Sun, 21 October 2012 06:46 Go to previous message
Chad Retz is currently offline Chad RetzFriend
Messages: 6
Registered: July 2010
Junior Member
Ok, I couldn't figure out the problem, so I removed the org.eclipse.wst.validation.validationbuilder command from the project descriptions build spec programmatically and everything worked.
Previous Topic:eclips and java.exe no response
Next Topic:Adjust whitespace character opacity
Goto Forum:
  


Current Time: Mon Nov 24 15:34:55 GMT 2014

Powered by FUDForum. Page generated in 0.02509 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software