This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 95432 - mevenide has issues with j2ee projects
Summary: mevenide has issues with j2ee projects
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-13 15:36 UTC by schrepfler
Modified: 2009-04-08 10:34 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description schrepfler 2007-02-13 15:36:38 UTC
I'm using Netbeans 6 IDE DEV 200701150200 (M6 I think)
I've tried opening my project using this release and mevenide plugin daily from
http://deadlock.nbextras.org/hudson/job/mevenide/ build #48

It had an exception. I've tried tehn creating a web module using the web
archetype and had again an exception. I'm pasting the 2 logs here:

java.lang.NullPointerException
	at
org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider.getServerInstanceID(J2eeModuleProvider.java:456)
	at
org.codehaus.mevenide.netbeans.j2ee.web.WebModuleProviderImpl.getServerInstanceID(WebModuleProviderImpl.java:205)
	at
org.codehaus.mevenide.netbeans.j2ee.web.WebModuleProviderImpl.loadPersistedServerId(WebModuleProviderImpl.java:72)
	at
org.codehaus.mevenide.netbeans.j2ee.web.WebModuleProviderImpl.<init>(WebModuleProviderImpl.java:64)
	at
org.codehaus.mevenide.netbeans.j2ee.J2eeLookupProvider$Provider.checkJ2ee(J2eeLookupProvider.java:93)
	at
org.codehaus.mevenide.netbeans.j2ee.J2eeLookupProvider$Provider.<init>(J2eeLookupProvider.java:65)
	at
org.codehaus.mevenide.netbeans.j2ee.J2eeLookupProvider.createAdditionalLookup(J2eeLookupProvider.java:52)
	at
org.netbeans.spi.project.support.LookupProviderSupport$DelegatingLookupImpl.doDelegate(LookupProviderSupport.java:146)
	at
org.netbeans.spi.project.support.LookupProviderSupport$DelegatingLookupImpl.<init>(LookupProviderSupport.java:119)
	at
org.netbeans.spi.project.support.LookupProviderSupport$DelegatingLookupImpl.<init>(LookupProviderSupport.java:111)
	at
org.netbeans.spi.project.support.LookupProviderSupport.createCompositeLookup(LookupProviderSupport.java:73)
	at org.codehaus.mevenide.netbeans.NbMavenProject.getLookup(NbMavenProject.java:431)
	at org.netbeans.api.project.ProjectUtils.getInformation(ProjectUtils.java:53)
	at org.netbeans.modules.project.ui.OpenProjectList.doOpen(OpenProjectList.java:260)
	at
org.netbeans.modules.project.ui.OpenProjectList.access$000(OpenProjectList.java:81)
	at org.netbeans.modules.project.ui.OpenProjectList$2.run(OpenProjectList.java:213)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:541)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:963)

------------------------

java.lang.IllegalArgumentException: Project mavenproject3 Maven Webapp (war) is
not open and cannot be set as main.
	at
org.netbeans.modules.project.ui.OpenProjectList.setMainProject(OpenProjectList.java:431)
[catch] at
org.netbeans.modules.project.ui.actions.NewProject$2.run(NewProject.java:175)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
	at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Comment 1 Milos Kleint 2007-02-13 15:41:21 UTC
a p2 I guess.
Comment 2 Milos Kleint 2007-02-14 10:10:24 UTC
Stepane, I'm not sure how to fix this on the mevenide side.
The getServerInstanceID() method claims it always has to return something, never
null. But in this case the J2eeModuleProvider.getServerInstanceID() fallback to
finding the default server fails because there is no server defined. 
so returning null here cannot be avoided even if I don't fallback to the
j2eeModuleprovider method to find the default server.
Comment 3 Sherold Dev 2007-02-14 14:50:28 UTC
This seems to me as a bug in javadoc. Returning null should be definitely valid
in this case, since there are use cases when you cannot provide any other
reasonable value. I suppose that our j2ee projects return null from this methods
in some cases even if it violates the API contract.

My patch for the issue 83934 should fix this problem by allowing the null return
value - this patch is targeted for 6.0.

If you want to get rid of this issue ASAP, I would recommend you to return null
and see if there won't be any NPE. I guess it should be OK.
Comment 4 Milos Kleint 2007-02-14 18:02:54 UTC
ok, should be fixed now. (http://deadlock.nbextras.org/hudson/job/mevenide/49/)
i put an arbitrary string there, seems to work then. When running/deploying the
app, I check against this string and print a warning that no server could be found.
Comment 5 Jaroslav Pospisil 2009-04-08 10:34:19 UTC
v.