Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » [Plugin Dev]Get source folder of the Dynamic Web Project
[Plugin Dev]Get source folder of the Dynamic Web Project [message #191060] Wed, 04 April 2007 13:50 Go to next message
Eclipse UserFriend
Originally posted by: naqalone.googlemail.com

Hello everyone,

I am writting a Eclipse plugin which uses WTP.
The plugin is used to create Portlet Project (extending Dynamic Web
Project).

I know how to get the WebContent/WEB-INF folder by these code:
---
getDir("WEB-INF");
...
public static IFolder getDir(final IProject project,final String path) {
final IVirtualComponent vc = ComponentCore.createComponent( project );

final IVirtualFolder vf = vc.getRootFolder().getFolder( path );

return (IFolder) vf.getUnderlyingFolder();

}

--
But I don't know how to get the source folder (src) which is outside the
WebContent folder.

Any help is highly appreciated !

AnhQuan
Re: [Plugin Dev]Get source folder of the Dynamic Web Project [message #191069 is a reply to message #191060] Wed, 04 April 2007 14:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kosta.bea.com

import org.eclipse.jdt.core.*;

IJavaProject jproj = JavaCore.create( <IProject> );

for( IClasspathEntry entry : jproj.getRawClasspath() )
{
if( entry.getEntryKind() == IClasspathEntry.CPE_SOURCE )
{
// do something; note that a project can have multiple source dirs
}
}
Runtime Error [message #191117 is a reply to message #191069] Thu, 05 April 2007 09:36 Go to previous message
Eclipse UserFriend
Hello,

I tryed to export my Web Services to WAR file, but it fails, any idea?


org.eclipse.core.runtime.CoreException: Extended Operation failure:
org.eclipse.jst.j2ee.internal.web.archive.operations.WebComp onentExportOperation
at
org.eclipse.wst.common.frameworks.internal.datamodel.ui.Data ModelWizard.performFinish(DataModelWizard.java:182)
at
org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDi alog.java:680)
at
org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDi alog.java:355)
at org.eclipse.jface.dialogs.Dialog$3.widgetSelected(Dialog.jav a:660)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:90)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2968)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:820 )
at org.eclipse.jface.window.Window.open(Window.java:796)
at
org.eclipse.ui.actions.ExportResourcesAction.run(ExportResou rcesAction.java:180)
at
org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEv ent(BaseSelectionListenerAction.java:168)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:539)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:400)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2968)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:95)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
org.eclipse.core.runtime.CoreException[0]:
org.eclipse.core.commands.ExecutionException: Error exportingWar File
at
org.eclipse.jst.j2ee.internal.archive.operations.J2EEArtifac tExportOperation.execute(J2EEArtifactExportOperation.java:78 )
at
org.eclipse.wst.common.frameworks.internal.datamodel.DataMod elPausibleOperationImpl$1.run(DataModelPausibleOperationImpl .java:376)
at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1737)
at
org.eclipse.wst.common.frameworks.internal.datamodel.DataMod elPausibleOperationImpl.runOperation(DataModelPausibleOperat ionImpl.java:400)
at
org.eclipse.wst.common.frameworks.internal.datamodel.DataMod elPausibleOperationImpl.runOperation(DataModelPausibleOperat ionImpl.java:352)
at
org.eclipse.wst.common.frameworks.internal.datamodel.DataMod elPausibleOperationImpl.doExecute(DataModelPausibleOperation Impl.java:242)
at
org.eclipse.wst.common.frameworks.internal.datamodel.DataMod elPausibleOperationImpl.executeImpl(DataModelPausibleOperati onImpl.java:214)
at
org.eclipse.wst.common.frameworks.internal.datamodel.DataMod elPausibleOperationImpl.cacheThreadAndContinue(DataModelPaus ibleOperationImpl.java:89)
at
org.eclipse.wst.common.frameworks.internal.datamodel.DataMod elPausibleOperationImpl.execute(DataModelPausibleOperationIm pl.java:202)
at
org.eclipse.wst.common.frameworks.internal.datamodel.ui.Data ModelWizard$1$CatchThrowableRunnableWithProgress.run(DataMod elWizard.java:211)
at
org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:113)
Caused by:
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.Sa veFailureException:
Error opening archive for export..
at
org.eclipse.jst.j2ee.internal.web.archive.operations.WebComp onentExportOperation.export(WebComponentExportOperation.java :44)
at
org.eclipse.jst.j2ee.internal.archive.operations.J2EEArtifac tExportOperation.execute(J2EEArtifactExportOperation.java:71 )
... 10 more
Caused by: java.lang.NullPointerException
at
org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.Loa dStrategyImpl.getLoadedMofResources(LoadStrategyImpl.java:33 6)
at
org.eclipse.jst.j2ee.internal.archive.operations.ComponentLo adStrategyImpl.getLoadedMofResources(ComponentLoadStrategyIm pl.java:444)
at
org.eclipse.jst.j2ee.commonarchivecore.internal.impl.Archive Impl.getLoadedMofResources(ArchiveImpl.java:687)
at
org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.Sav eStrategyImpl.saveMofResources(SaveStrategyImpl.java:186)
at
org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.Sav eStrategyImpl.save(SaveStrategyImpl.java:99)
at
org.eclipse.jst.j2ee.commonarchivecore.internal.impl.Archive Impl.save(ArchiveImpl.java:1083)
at
org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ModuleF ileImpl.save(ModuleFileImpl.java:161)
at
org.eclipse.jst.j2ee.commonarchivecore.internal.impl.Archive Impl.saveAsNoReopen(ArchiveImpl.java:1178)
at
org.eclipse.jst.j2ee.internal.web.archive.operations.WebComp onentExportOperation.export(WebComponentExportOperation.java :40)
... 11 more
Previous Topic:Source Not Found and JDOMException
Next Topic:Web Service pure java client
Goto Forum:
  


Current Time: Sat Feb 08 07:56:14 GMT 2025

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

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

Back to the top