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 115301 - Creation of Web App using Java 6 allowed when target server uses Java 5
Summary: Creation of Web App using Java 6 allowed when target server uses Java 5
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-12 04:19 UTC by John Baker
Modified: 2016-07-07 08:56 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Baker 2007-09-12 04:19:47 UTC
If the IDE is running on Java 6 and user creates a Web Application with target server
that runs on Java 5 execution can fail.

example error message:
"java.lang.UnsupportedClassVersionError: PWC1651: Class webapplication37.ApplicationBean1 has unsupported major or minor
version numbers, which are greater than those found in the Java Runtime Environment version 1.5.0_12 "

Better to prevent users from creating projects in the New Project dialog
Comment 1 Tomas Mysik 2007-09-20 13:25:20 UTC
Do you mean any kind of warning?
Comment 2 David Konecny 2007-10-05 12:59:10 UTC
This should be resolved similarly to Java platform selection in J2SE project (e.g. changing Java platform warns user
that source level is incompatible). In web project case whenever app server is chosen or changed we should make sure
that Java sources have compatible compilation target/source level. That of course has precondition that we know version
of Java runtime server is running in.

So if IDE runs 1.6 and target server runs in 1.5 we should tell user that choosing this server will result also in
changing Java source level and target to 1.5.
Comment 3 Tomas Mysik 2007-10-22 11:50:30 UTC
Sounds like an enhancement - or not?
Comment 4 John Baker 2007-10-22 16:40:41 UTC
No, users need to be warned or prevented from creating projects where the compilation target is Java 6 and the target
server uses Java 5. Applications will fail to execute:

"java.lang.UnsupportedClassVersionError: PWC1651: Class webapplication37.ApplicationBean1 has unsupported major or minor
version numbers, which are greater than those found in the Java Runtime Environment version 1.5.0_12 "
Comment 5 John Baker 2007-10-22 17:24:24 UTC
Why is the target release marked as future?
Comment 6 Tomas Mysik 2007-10-23 09:08:20 UTC
> Why is the target release marked as future?
That's because when you changed it back from ENHANCEMENT to DEFECT the TM staid.

And now the reasons why I think that this issue is enhancement:
- the Web application is not able to find out which JDK the target server is running on (no API)
- if such API would exist I still prefer just some simple warning dialog that there could be a *potential* problem 
while changing JDK version for Web application - but we definitely cannot forbid user to do so. Why potential? That's 
because user can start the target server from command line (with any JDK) or the target server registered in the IDE 
can be just the server for development and can be physically different from the production one (that will be the 
typical case I guess)

David, Petr - any comments?
Comment 7 David Konecny 2007-10-23 09:50:58 UTC
Re. "Why is the target release marked as future?" - we are past NB6beta2; there is missing API; this is minor issue

IMO, this is sort of theoretical issue. In practice you know what server you are going to deploy to and what JDK it is
running on as one of the prerequisites of your project. App server JDK is not a factor which changes quickly and often.

Comment 8 Petr Hejl 2007-10-23 14:20:20 UTC
Aside all of that - it is late UI change too, imo.
Comment 9 Martin Balin 2016-07-07 08:56:00 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss