[jbosstools-issues] [JBoss JIRA] Commented: (JBIDE-3902) Project Archives error creating EAR

Rob Stryker (JIRA) jira-events at lists.jboss.org
Thu Mar 5 02:41:22 EST 2009


    [ https://jira.jboss.org/jira/browse/JBIDE-3902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12455555#action_12455555 ] 

Rob Stryker commented on JBIDE-3902:
------------------------------------

similar problem with me not knowing how to handle / expecting binary modules.  Luckily all the wtp code browsing I did last week showed me a few new APIs. 

### Eclipse Workspace Patch 1.0
#P org.jboss.ide.eclipse.archives.webtools
Index: src/org/jboss/ide/eclipse/archives/webtools/archivetypes/EarArchiveType.java
===================================================================
--- src/org/jboss/ide/eclipse/archives/webtools/archivetypes/EarArchiveType.java	(revision 13860)
+++ src/org/jboss/ide/eclipse/archives/webtools/archivetypes/EarArchiveType.java	(working copy)
@@ -17,6 +17,7 @@
 import org.eclipse.core.runtime.NullProgressMonitor;

 import org.eclipse.core.runtime.Path;

 import org.eclipse.jst.server.core.IEnterpriseApplication;

+import org.eclipse.jst.server.core.IJ2EEModule;

 import org.eclipse.wst.server.core.IModule;

 import org.jboss.ide.eclipse.archives.core.model.ArchivesModelException;

 import org.jboss.ide.eclipse.archives.core.model.IArchive;

@@ -93,16 +94,20 @@
 			IModule[] childModules = earModule.getModules();

 			for( int i = 0; i < childModules.length; i++ ) {

 				IModule child = childModules[i];

-				IArchiveType type = ModulePackageTypeConverter.getPackageTypeFor(child);

-				IArchive childPack;

-				if( type == null ) {

-					childPack = createGenericIArchive(child.getProject(), null, child.getProject().getName() + JAR_EXTENSION);

-				} else {

-					if( new Path(childModules[i].getName()).segmentCount() > 1 )

-						continue;

-					childPack = type.createDefaultConfiguration(child.getProject().getName(), new NullProgressMonitor());

+				IJ2EEModule j2eeChild = (IJ2EEModule)child.loadAdapter(IJ2EEModule.class, new NullProgressMonitor());

+				if( j2eeChild != null && !j2eeChild.isBinary()) {

+					IArchiveType type = ModulePackageTypeConverter.getPackageTypeFor(child);

+					IArchive childPack;

+					if( type == null ) {

+						childPack = createGenericIArchive(child.getProject(), null, child.getProject().getName() + JAR_EXTENSION);

+					} else {

+						if( new Path(childModules[i].getName()).segmentCount() > 1 )

+							continue;

+						childPack = type.createDefaultConfiguration(child.getProject().getName(), new NullProgressMonitor());

+					}

+					if( childPack != null )

+						topLevel.addChild(childPack);

 				}

-				topLevel.addChild(childPack);

 			}

 		}

 

Index: src/org/jboss/ide/eclipse/archives/webtools/archivetypes/WarArchiveType.java
===================================================================
--- src/org/jboss/ide/eclipse/archives/webtools/archivetypes/WarArchiveType.java	(revision 13860)
+++ src/org/jboss/ide/eclipse/archives/webtools/archivetypes/WarArchiveType.java	(working copy)
@@ -18,12 +18,14 @@
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jdt.core.IClasspathEntry;
 import org.eclipse.jdt.core.IJavaProject;
 import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jst.server.core.IJ2EEModule;
 import org.eclipse.jst.server.core.IWebModule;
 import org.eclipse.wst.common.componentcore.ComponentCore;
 import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
@@ -217,7 +219,10 @@
 			IModule[] childModules = webModule.getModules();
 			for (int i = 0; i < childModules.length; i++) {
 				IModule child = childModules[i];
-				lib.addChild(createGenericIArchive(child.getProject(), null, child.getProject().getName() + ".jar"));//$NON-NLS-1$
+				IJ2EEModule j2eeChild = (IJ2EEModule)child.loadAdapter(IJ2EEModule.class, new NullProgressMonitor());
+				if( j2eeChild != null && !j2eeChild.isBinary()) {
+					lib.addChild(createGenericIArchive(child.getProject(), null, child.getProject().getName() + ".jar"));//$NON-NLS-1$
+				}
 			}
 			return topLevel;
 		} catch( Exception e ) {

Applying to trunk and 3.0.x


> Project Archives error creating EAR
> -----------------------------------
>
>                 Key: JBIDE-3902
>                 URL: https://jira.jboss.org/jira/browse/JBIDE-3902
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: Archives
>    Affects Versions: 3.0.0.CR2
>         Environment: jbossTools-all-win32-3.0.0.GA-N200902101801-H1424, eclipse-3.4.2-snapshot-02-04-2009
>            Reporter: Matt Drees
>            Assignee: Rob Stryker
>             Fix For: 3.0.0.GA, 3.0.1.GA
>
>         Attachments: sample-project-fixed.zip, sample-project.zip
>
>
> I imported an existing EAR project of mine.  I am trying to set up Project Archives.  However, I get a Problem Occurred popup (org.eclipse.core.runtime.AssertionFailedException) when clicking "Next >" in the "New EAR" wizard.
> I've gutted the project will attach it.  After extracting, import the four projects.  Open the Project Archives view, select the "MpdStats-ear" project; right click in Project Archives view -> new Archive -> EAR -> Next.   The log snippet is below.
> During the process of trimming the project down to attach, i discovered this problem probably has to do with the javassist.jar file in EarContent.  If this jar file is removed, the wizard doesn't bomb.  It's the only jar file i've left in the project.
> !ENTRY org.eclipse.jface 4 2 2009-03-03 00:27:49.993
> !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
> !STACK 0
> org.eclipse.core.runtime.AssertionFailedException: null argument:
> 	at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:86)
> 	at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:74)
> 	at org.jboss.ide.eclipse.archives.core.model.internal.ArchiveNodeImpl.addChild(ArchiveNodeImpl.java:264)
> 	at org.jboss.ide.eclipse.archives.core.model.internal.ArchiveNodeImpl.addChild(ArchiveNodeImpl.java:255)
> 	at org.jboss.ide.eclipse.archives.webtools.archivetypes.EarArchiveType.fillDefaultConfiguration(EarArchiveType.java:105)
> 	at org.jboss.ide.eclipse.archives.webtools.ui.NewEARAction$EARPreviewPage.addToPackage(NewEARAction.java:90)
> 	at org.jboss.ide.eclipse.archives.webtools.ui.PreviewPage.pageEntered(PreviewPage.java:104)
> 	at org.jboss.ide.eclipse.archives.ui.wizards.WizardWithNotification.pageChanged(WizardWithNotification.java:72)
> 	at org.eclipse.jface.wizard.WizardDialog$5.run(WizardDialog.java:1459)
> 	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> 	at org.eclipse.core.runtime.Platform.run(Platform.java:880)
> 	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
> 	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
> 	at org.eclipse.jface.wizard.WizardDialog.firePageChanged(WizardDialog.java:1457)
> 	at org.eclipse.jface.wizard.WizardDialog.update(WizardDialog.java:1237)
> 	at org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDialog.java:1166)
> 	at org.eclipse.jface.wizard.WizardDialog.access$2(WizardDialog.java:1139)
> 	at org.eclipse.jface.wizard.WizardDialog$4.run(WizardDialog.java:1128)
> 	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
> 	at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:1126)
> 	at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:820)
> 	at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:369)
> 	at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
> 	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
> 	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> 	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> 	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
> 	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
> 	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
> 	at org.eclipse.jface.window.Window.open(Window.java:801)
> 	at org.jboss.ide.eclipse.archives.webtools.ui.NewEARAction.run(NewEARAction.java:38)
> 	at org.jboss.ide.eclipse.archives.webtools.ui.NewEARAction.run(NewEARAction.java:43)
> 	at org.jboss.ide.eclipse.archives.ui.providers.ArchivesActionProvider$ActionWrapper.run(ArchivesActionProvider.java:230)
> 	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
> 	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
> 	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
> 	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
> 	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> 	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> 	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
> 	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
> 	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2384)
> 	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348)
> 	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200)
> 	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495)
> 	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
> 	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490)
> 	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
> 	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
> 	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
> 	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
> 	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
> 	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
> 	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
> 	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.equinox.launcher.Main.invokeFramework(Main.java:549)
> 	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
> 	at org.eclipse.equinox.launcher.Main.run(Main.java:1236)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jbosstools-issues mailing list