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 83114 - Opening project without DD throws IAE
Summary: Opening project without DD throws IAE
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Martin Krauskopf
URL:
Keywords:
: 80086 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-08-21 20:21 UTC by Martin Krauskopf
Modified: 2006-08-23 20:34 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch to review (13.04 KB, text/plain)
2006-08-22 11:34 UTC, Martin Krauskopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Krauskopf 2006-08-21 20:21:25 UTC
See issue 81154, comment:

------- Additional comments from tslota Mon Aug 21 17:45:39 +0000 2006 -------

Steps to reproduce are the same, but just opening the EJB project is enough.
Andrei is on vacation, right? I will try to handle this. If you are here Andrei
and want to handle it yourself, just reassign ;)
Comment 1 Martin Krauskopf 2006-08-21 21:03:38 UTC
Actually this might be bug in the j2eeserver according to stacktrace. This bug
is easily reproduced also with application client (and probably with web project
as well). The problem is that in ProjectOpenedHooks project types call
J2eeModuleProvider.ConfigSupport.ensureConfigurationReady().
So it depends under what conditions is JMP.CS.eCR() supposed to be called.
Javadoc is not clear. Please evaluate and possibly fix or reassign back and it
will get fixed in all project-types. Thanks.
Comment 2 _ pcw 2006-08-21 23:13:31 UTC
I'm not certain there is a j2eeserver bug here, though there might be. 
ensureConfigurationReady() is being called correctly.  It's that
initConfiguration() is being called with invalid values down line due to the
issue with the configuration folder.

Blueprints would like that NetBeans support projects that do not even have a
configuration folder (let alone any configuration files).  Note that the project
still must define where this folder would go, if it did exist (e.g. the
"meta.inf" property for ejb jar projects).

I don't see a problem with this in general, though I know there are a number of
areas that are coded with the expectation that the directory does exist and that
is what the popup message is trying to say.
Comment 3 Petr Jiricka 2006-08-22 08:46:28 UTC
Weird, this works for me. Does anyone have *reliable* steps to reproduce?

Could this be related to the recent changes in config handling made by Libor?
Comment 4 Sherold Dev 2006-08-22 09:31:13 UTC
No, this issue has nothing to do with Libor's fix.

Peter is right, I think. The App Server plug-in needs to know where the server
specific DD should go, no matter whether the config folder exists or not. The
problem thus seems to be in the EjbJarProvider.getDeploymentConfigurationFile()
method.

Reassigning back to the ejbproject component.
Comment 5 Martin Krauskopf 2006-08-22 10:20:56 UTC
Thanks for evaluation Stepane. You are right - even javadoc says so. Application
client is broken (copy-pasted) as well. I'll check also web project.
Comment 6 Martin Krauskopf 2006-08-22 11:34:17 UTC
Created attachment 33148 [details]
patch to review
Comment 7 Martin Krauskopf 2006-08-22 11:36:15 UTC
Review of the patch is welcome if anybody has better insight. This will still
throw a minor exception (from "Sun J2EE DD GUI") which I'll file after fixing
this one.
Comment 8 Sherold Dev 2006-08-22 12:06:58 UTC
The fix seems to me clear and straightforward.
Comment 9 Petr Jiricka 2006-08-22 12:26:42 UTC
Could the "minor exception from Sun J2EE DD GUI" be fixed when Peter integrates
his fix for issue 75710?

Regarding the patch, I don't understand this part:
return (ejbJar == null) ? EjbJar.VERSION_2_1 /* fallback */ :
ejbJar.getVersion().toString();

Don't we want to assume that if there is no DD, then this is EJB 3? 
Comment 10 Martin Krauskopf 2006-08-22 13:44:08 UTC
> Could the "minor exception from Sun J2EE DD GUI" be fixed when Peter
> integrates his fix for issue 75710?

I've did a very fresh build and there is no exception anymore.

> Regarding the patch, I don't understand this part:
> return (ejbJar == null) ? EjbJar.VERSION_2_1 /* fallback */ :
> ejbJar.getVersion().toString();
> Don't we want to assume that if there is no DD, then this is EJB 3? 

See EjbJarProvider.getEjbJar(), dd == null && version != 5.0

So fixed. Let's open another bugs if they appear since this scenario seems to be
not tested so thoroughly.

clientproject/nbproject/project.properties; 1.1.4.15 -> 1.1.4.16;
clientproject/AppClientProvider.java; 1.1.4.12 -> 1.1.4.13;
clientproject/test/unit/AppClientProjectTest.java; 1.1.2.5 -> 1.1.2.6;
clientproject/test/unit/AppClientProviderTest.java; 1.1.2.2 -> 1.1.2.3;
clientproject/test/unit/test/TestUtil.java; 1.1.2.11 -> 1.1.2.12;
ejbjarproject/EjbJarProvider.java; 1.23.36.6.2.6 -> 1.23.36.6.2.7;
ejbjarproject/test/unit/EjbJarProviderTest.java; 1.2.4.1.2.4 -> 1.2.4.1.2.5;

....forgot to check the webproject, leaving open....
Comment 11 Martin Krauskopf 2006-08-22 14:01:25 UTC
webproject seems to have a little different logic but is also wrong. Issue 83177.
Comment 12 Tomasz Slota 2006-08-22 16:53:53 UTC
Is the fix only available as a patch?? I still cannot open the test project from issue 81154! 
Comment 13 Martin Krauskopf 2006-08-22 19:02:55 UTC
> Is the fix only available as a patch??

No. See commit log above. For webproject see issue 83177.

> I still cannot open the test project from issue 81154!

I can. Also written test passes. Could you attach a new exception here?
Comment 14 Martin Krauskopf 2006-08-23 09:46:02 UTC
We talked with Tomasz -> filed 83257. Since this issue may reveal more code
which depends on src/conf and/or DD existence, let's fill a new issue according
to importance of the found bug.
Comment 15 Pavel Buzek 2006-08-23 20:34:00 UTC
*** Issue 80086 has been marked as a duplicate of this issue. ***