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 83475

Summary: Error in browser for JSF pages on SJAS8.2
Product: javaee Reporter: Jaroslav Pospisil <jpospisil>
Component: JSFAssignee: Pavel Buzek <pbuzek>
Status: RESOLVED WONTFIX    
Severity: blocker CC: kganfield, ludo, mschovanek, mvatkina, pjiricka, raccah
Priority: P3 Keywords: RELNOTE
Version: 5.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: exception
server.log
Error in browser
Appserver admin console
server.log

Description Jaroslav Pospisil 2006-08-25 15:10:48 UTC
Build 200608240000,JDK1.6.0

1)Create web module on SJAS 8.2 with JSF support(uncheck Set source level to 1.4)
2)Invoke New File|Persistence|Entity Classes from Database wizard
3)For datasource select jdbc.../sample and add only MANUFACTURER (due to other
issues it's the table I know didn't cause any exceptions).
4)On next page enter Package name and click on Create Persistence unit
button|O.K. later in the dialog.
5)Click Finish
6)Invoke New File|Persistence|JSF Pages from Entity Class wizard,click Next and
select Manufacturer.
7)Click Next,Finish and Run project

It opens in the browser,but when you click on List of Manufacturer link, you get
exception I attached. I tried more scenarios for another tables from samples
database and although some of them worked properly,more throwed exceptions
similar to this one (not the same - classes mentioned in them were different).
Comment 1 Jaroslav Pospisil 2006-08-25 15:11:42 UTC
Created attachment 33279 [details]
exception
Comment 2 Pavel Buzek 2006-08-25 18:20:43 UTC
Ok, I'll test w/8.2. If you have the full stack trace from app server log can
you attach it? Thanks.
Comment 3 Jaroslav Pospisil 2006-09-19 14:31:31 UTC
Created attachment 34158 [details]
server.log
Comment 4 Pavel Buzek 2006-09-20 02:56:00 UTC
I see a space in class problem from app server. Can you create a project in a
different location w/o space and verify this? Thanks.
Comment 5 Pavel Buzek 2006-09-22 17:36:31 UTC
again, can you please test as I suggested? thanks
Comment 6 Jaroslav Pospisil 2006-09-25 08:15:50 UTC
There's bigger problem now - I tested it also with non-space path and result was
the same - in last build deploying of web application with JSF pages from entity
class results in Http status 404 error.I used NB5.5 dev build 200609240000 and
all  other remained the same.Web module is deployed,according to Output tab and
even Appserver admin console,when I open it in browser.Still,I see in browser
error page and there's plenty of exceptions in server.log. I'm attaching
server.log, along with screenshots of error in browser and admin console of
appserver.
I think this issue was caused by some last time changes,maybe issue 82048 fix.

NOTICE: I tried to run web module with basic support - only welcomeJSF page and
it worked O.K.
Comment 7 Jaroslav Pospisil 2006-09-25 08:16:19 UTC
Created attachment 34442 [details]
Error in browser
Comment 8 Jaroslav Pospisil 2006-09-25 08:16:43 UTC
Created attachment 34443 [details]
Appserver admin console
Comment 9 Jaroslav Pospisil 2006-09-25 08:17:08 UTC
Created attachment 34444 [details]
server.log
Comment 10 Petr Jiricka 2006-09-25 12:15:26 UTC
This last problem is caused by the fact that after unchedking the "Set source
level to 1.4" checkbox in the wizard, the source level is set to 1.6 - should be
1.5. I filed a separate issue 85672 for that (should that be a P2 or P3?).

The workaround is to change source level to 1.5 in project properties and then
Clean & Build the project - after that I am getting the original FacesException.

Comment 11 Petr Jiricka 2006-09-25 12:21:35 UTC
After applying the workaround for issue 85672 on an application without space in
path, the problem still happens.
Comment 12 Martin Schovanek 2006-09-25 13:19:13 UTC
I guess the original (java.lang.RuntimePermission createClassLoader) is caused
by default SUN server policy settings which does not allow classloaders within
webapplications. See e.g.: http://www.w4toolkit.com/forum/read.php?21,6482,13821 .
Comment 13 Jaroslav Pospisil 2006-09-25 13:43:07 UTC
This workaround works fine.
Comment 14 Jaroslav Pospisil 2006-09-25 13:45:10 UTC
Mentioned workaround is to replace original contains of server.policy file with
this:

grant {
// Allow everything for now
permission java.security.AllPermission;
}; 
Comment 15 Petr Pisl 2006-09-25 14:42:52 UTC
So, what should be the right fix? I think we cannot changed automatically the
server.policy file.
Comment 16 Petr Jiricka 2006-09-25 16:16:59 UTC
Ludo, any ideas?
Comment 17 _ ludo 2006-09-25 16:36:39 UTC
If I  understand correctly, you are foing EJB3 JPA apps in a web app for AS 8.2

I am not sure many people tried that, but I guess the JPA runtime is doing
things that by default are not allowed by the 8.2 security manager. 
8.2 is by default very conservative and secured by default.
We remove this constraint for 9.0
If you google this subject 81, 82 and security manager, you'll se that many Web
frameworks need extended security seeting in order to run on 8.2.

So I guess this is the same for JPA framework and AS 8.2. 
I'll also ask the JPA group, but if this is the case, this bug can be fixed via
release notes. Changing server.policy has to be a user decision and we do not
offer AS admin api for that.
Comment 18 Petr Pisl 2006-09-26 10:39:27 UTC
I also think, that there is not a way how to fix it correctly. Which module will
alter the server.policy file? Persistence, jsf support or the server plugin? I
think it should be done by the servlet plugin, but as Ludo wrote, there is no
api how to do it now?
Comment 19 Petr Jiricka 2006-09-26 15:23:45 UTC
There was a suggestion from Marina how to fix this:

> I need to see the stack trace of the classloader exception, but they
> probably need to add toplink.weaving property and set it to false. 

However, when I added the following line into persistence.xml, it did not help
and I got the same exception:

<property name="toplink.weaving" value="false"/>

I suggest we waive this issue for NetBeans 5.5.
Comment 20 Petr Jiricka 2006-09-26 16:34:50 UTC
Changing priority to P3 per team agreement.
Comment 21 Petr Jiricka 2006-09-26 16:36:06 UTC
Closing as WONTFIX, needs to be documented in FAQ.