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.
Summary: | Cannot deploy Web application using JSF or VW JSF framework on Tomcat 6 with Java EE5 | ||
---|---|---|---|
Product: | serverplugins | Reporter: | Yousuf Haider <yousufh> |
Component: | Infrastructure | Assignee: | Sherold Dev <sherold> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | jungi, pbuzek, pjiricka, potingwu, sjangity |
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
Server log
tomcat console output Faces-config.xml Validation errors in simple JSF app Faces Config for jsf app |
Description
Yousuf Haider
2007-04-19 06:27:23 UTC
Created attachment 41217 [details]
Server log
Created attachment 41218 [details]
tomcat console output
Update: Just tested a web application which uses JavaServer Faces framework with Java EE5 and the same exception comes up. Seems like this is not restricted to Visual Web pack. Just follow the same steps given above but select JavaServer Faces in step 6 to recreate the issue. Once again this problem does not appear when using J2ee 1.4 in both cases. NB build: Build070419_1 From Tomcat server log: SEVERE: Parse Error at line 9 column 116: Document root element "faces-config", must match DOCTYPE root "null". org.xml.sax.SAXParseException: Document root element "faces-config", must match DOCTYPE root "null". Can you try to validate you faces-config.xml? I try the following scenario in the latest NB 6.0 build: 1) register external Tomcat and use base dir due issue #95700 2) create new JavaEE5 Web project with JSF framework and Tomcat target server 3) due issue #101902 add JSF 1.1 and JSTL on project classpath 4) run application and get welcome screen Created attachment 41359 [details]
Faces-config.xml Validation errors in simple JSF app
Same validation error for a visual web JSF app. Can you attach the faces-config.xml file? Are you able to reproduce this also with new Web project with Visual web only? Without any additional steps? We should find which action broke the faces-config.xml. Thanks Created attachment 41368 [details]
Faces Config for jsf app
Yes, if i create a project with Visual Web only the same thing happens. Validation of the faces-config.xml in that project throws the same error as attached above. FYI: If you do not copy the jar files in the Tomcat/lib folder before creating a visual web project you might encounter this problem: http://www.netbeans.org/issues/show_bug.cgi?id=101671 Also I tried the steps you mentioned above for a simple JSF web project and I am still getting the same problem. I try to remove and add back the params part of <faces-config> tag: version="1.2" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"> and seeing the following in the console: [DTM] removing DE (28968689)["<" (error) <300-300> ''] [DMT] removed element DE (28968689)["<" (error) <300-300> ''] ;parent = DE (6542348)["faces-config" (tag) <41-1248> '<faces-con...'] [DTM] removing DE (4196701)["..." (content) <301-322> 'managed-be...'] [DMT] removed element DE (4196701)["..." (content) <301-322> 'managed-be...'] ;parent = DE (6542348)["faces-config" (tag) <41-1248> '<faces-con...'] Is that possible the cause? The problem is how jsf 1.2 is added to the Tomcat, which is the reason why the parser is not able to find needed dtds and schemas. When you look at the binary distribution of JSF 1.2_04 (which you can download from https://javaserverfaces.dev.java.net/) you can see that in the lib folder there are two jars (jsf api and implementation), 4 dtds and 2 tlds. All these files has to be on the web application classpath to get the web application work. jstl.jar is needed as well. The easiest way is to copy all the files from lib folder from JSF 1.2 distribution into the "$tomcat6/lib/" folder. You have to copy the jstl.jar there as well. Now you can create new web application with jsf framework ( I haven't tried the visual jsf framework) and the application should work. The second way, how to do it, is to put the needed jars and files (dtds, tlds) directly into the web application. You can add the jsf api, jsf implementation and jstl.jar as a libraries (context menu over Libraries node - Add Jar/Folder ... ). Copy the dtds and tlds into a folder and add this folder as new library as well. It means that these files will be putted in the default package. Then try to run the application. I'm changing the priority to P2. The right solution for this issue can be done through bundling jsf 1.2 with NetBeans or convince people from Tomcat to include an implementation of jsf 1.2. I just tried a visual web app using the instructions above and it works fine. NBI Build :200704230000 Tomcat is not certified Java EE server because it is only a web container and thus it does not have to include all the components of Java EE (including JSF) and IMO intentionally wants to leave the decision which JSF implementation to use on the user. But users will want to use 2.5 web apps on tomcat 6. Bundling JSF 1.2 would work, but if we do not bundle tomcat then I think we should just add a note in UI, for example when adding tomcat 6 to IDE, that will direct the user to get and install JSF. *** Issue 102400 has been marked as a duplicate of this issue. *** What about pointing users to http://developers.sun.com/web/swdp/ which contains also JSF 1.2_03 in its latest versoin (R2)? Once this pack is installed into Tomcat 6 everything works out of box. And this pack is already required for users who wants to try REST stuff (but this might change in the future). We already bundle JSF 1.2 anyway. Since both JSF and Visual Web JSF frameworks bundle JSF 1.2 RI libraries if the target servers don't support JSF, I no longer seeing this issue. Please change it as fixed after verifying. Issue fixed. Verified on build: 200706110000 Fix Verified on build: 200706110000 |