Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 148705 - SecurityException: Prohibited package name: java
SecurityException: Prohibited package name: java
Product: javaee
Classification: Unclassified
Component: Code
All All
: P3 (vote)
: 6.x
Assigned To: Vadiraj Deshpande
Depends on:
  Show dependency treegraph
Reported: 2008-09-30 08:23 UTC by Martin Fousek
Modified: 2009-02-20 17:17 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT

stacktrace (1.50 KB, text/plain)
2008-09-30 08:23 UTC, Martin Fousek
Proposed patch. (812 bytes, text/plain)
2008-12-04 07:10 UTC, Vadiraj Deshpande
Incorporated Erno's comments. (1.66 KB, text/plain)
2008-12-08 09:48 UTC, Vadiraj Deshpande

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Fousek 2008-09-30 08:23:39 UTC
Build: NetBeans IDE Dev (Build 200809300201)
VM: Java HotSpot(TM) Client VM, 11.0-b13, Java(TM) SE Runtime Environment, 1.6.0_10-rc-b26
OS: Linux, 2.6.24-19-generic, i386

User Comments:
marfous: 1, I create a new web app with hybernate
2, use reverse eng. from the database
3, type into package "java"
4, there is no error message
5, then invoke HQL Query and type and run some query 
-> exception appears

java.lang.SecurityException: Prohibited package name: java
        at java.lang.ClassLoader.preDefineClass(
        at java.lang.ClassLoader.defineClass(
Comment 1 Martin Fousek 2008-09-30 08:23:47 UTC
Created attachment 70871 [details]
Comment 2 Vadiraj Deshpande 2008-11-18 10:43:02 UTC
Will be taken up in 7.0.
Comment 3 Vadiraj Deshpande 2008-12-04 07:06:59 UTC
This issue belongs to j2ee.core.utilities module, since Hibernate module is using the API provided by that module. 
The API has this bug. 
According to Java Language specification,
'java' is a reserved package names for JDK itself and hence cannot be used for other applications.
Comment 4 Vadiraj Deshpande 2008-12-04 07:10:15 UTC
Created attachment 74509 [details]
Proposed patch.
Comment 5 Vadiraj Deshpande 2008-12-04 11:09:37 UTC
Moving to j2ee>code (I guess this is the issuezilla component/subcomponent for j2ee.core.utilities mercurial module)

Please could somebody review the attached patch for this issue ?
Comment 6 Vadiraj Deshpande 2008-12-08 09:47:48 UTC
Comments from Erno :

Hi Vadiraj,
You might want to check for exact string 'java'.. and for 'java.something'..
Please update the unit tests.
Comment 7 Vadiraj Deshpande 2008-12-08 09:48:40 UTC
Created attachment 74680 [details]
Incorporated Erno's comments.
Comment 8 Vadiraj Deshpande 2008-12-08 10:09:07 UTC
Erno says : LGTM..

Comment 9 Vadiraj Deshpande 2008-12-08 10:09:35 UTC
Fixed :

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo