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.
Build: NetBeans IDE Dev (Build 200802120006) VM: Java HotSpot(TM) Client VM, 1.5.0_13-121 OS: Mac OS X, 10.4.11, i386 User comments: exception when using jsf from entity classes wizard STACKTRACE: (first 10 lines) java.lang.IllegalArgumentException: Type mm.DiscountCodeController cannot be found at org.netbeans.modules.web.jsf.wizards.JSFClientGenerator$TreeMakerUtils.createType(JSFClientGenerator.java:2697) at org.netbeans.modules.web.jsf.wizards.JSFClientGenerator$TreeMakerUtils.createMethod(JSFClientGenerator.java:2633) at org.netbeans.modules.web.jsf.wizards.JSFClientGenerator$TreeMakerUtils.addMethod(JSFClientGenerator.java:2605) at org.netbeans.modules.web.jsf.wizards.JSFClientGenerator$14.run(JSFClientGenerator.java:1228) at org.netbeans.modules.web.jsf.wizards.JSFClientGenerator$14.run(JSFClientGenerator.java:841) at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:910) at org.netbeans.modules.web.jsf.wizards.JSFClientGenerator.generateControllerClass(JSFClientGenerator.java:840) at org.netbeans.modules.web.jsf.wizards.JSFClientGenerator.generateJSFPages(JSFClientGenerator.java:220) at org.netbeans.modules.web.jsf.wizards.PersistenceClientIterator.instantiate(PersistenceClientIterator.java:114) at org.openide.loaders.TemplateWizard.handleInstantiate(TemplateWizard.java:595)
"JSF Pages from Entity Class" wizard issue.
Please provide steps and, if possible, the project.
Just use a different package than entity classes. Ken can you attach your project?
steps 1. create JSF web project 2. create entity classes from db with wizard and put entity classes in package mm 3. create jsf from entity classes with wizard and enter pp as package name [default is mm]. Click finish. Clicking finish brings up error dialog. If you dismiss dialog, clicking Finish brings up another error dialog. [in this case the IDE actually creates 2 more controllers, eg CustomerController_1.java] The only thing to do is cancel the wizard. Wizard creates 2 controllers in package pp even though I clicked Cancel. No converters or web pages are created. Attaching project
Created attachment 56642 [details] web application zip archive
*** Issue 127010 has been marked as a duplicate of this issue. ***
This issue has already 5 duplicates
There seem to be several issues that are affecting the JSF CRUD wizard, and there seems to be some confusion regarding the reported issues. I posted a comment on the NetBean's user list, however I think it would be useful to explain the issues here, as well as providing steps to reproduce them. To reproduce the issue (some of the steps might not be relevant to the issue at hand, however I'm providing the exact steps I followed): Creating the project: 1. Create a new web application project, using GlassFish V2 as the server and Java EE 5 (I'm using the version of GlassFish that is included with NB) 2. Not sure if it matters, but I clicked on the "Project Shared With Other Users" checkbox, and left all other fields with their default values on this step of the new project wizard. 3. Select Java Server Faces as a framework for the project, other fields on this screen left intact. 4. Click Finish Generating JPA Entities: 1. Right click on the project, select New->Entity Classes from database 2. Select the jdbc/sample data source (included "out of the box" with NetBeans 3. Click "Add All>>", followed by "Next>" 4. Enter "com.mycompany.entity" as the package 5. Click "Create Persistence Unit...", take all defaults and click "Create" 6. Click "Finish" Up to this point everything is fine, now, on to create the JSF CRUD application: 1. Right click on the project, select "New->JSF Pages from Entity Class" 2. Click "Add All>>", followed by "Next" 3. Enter "jsf" as the value of "JSF Pages Folder" 4. Package defaults to the package used to create the JPA entities (com.mycompany.entity in this case). Change it to "com.mycompany.managedbeans" 5. Click finish. Issue number 1: JSF managed beans are placed in a single directory called "com.mycompany.managedbeans", they should be placed in the following directory structure: "com/mycompany/managedbeans". After manually creating the correct directory structure and moving the managed beans there, another issue become apparent: Some of the generated managed beans (all are controllers) are missing imports: CustomerController.java is missing import com.mycompany.entity.DiscountCode ProductController.java is missing imports com.mycompany.entity.Manufacturer and com.mycompany.entity.ProductCode PurchaseOrderController.java is missing imports com.mycompany.entity.Customer and com.mycompany.entity.Product After moving the JSF managed beans to the correct folder, and adding the missing imports, the project can be built and executed properly. ps. I was going through the steps while typing, to make sure I didn't miss anything. In a previous attempt, I was using com.ensode.managedbeans as the package for the generated JSF managed beans, in that case some (or all, I can't recall exactly) of the generated managed beans had an incorrect package declaration, it was "com.ensode", where it should have been "com.ensode.managedbeans", however, when using "com.mycompany.managedbeans" as the package I was unable to reproduce this particular issue. I hope that this comments helps the dev team reproduce the issues and come up with a solution. David R. Heffelfinger
This should be fixed soon, as scenario is just typical. So increasing priority.
Fixed. C:\dev\nb\src\main>hg out comparing with https://mbohm:***@hg.netbeans.org/main/ searching for changes changeset: 74223:4c91693af0be user: mbohm@netbeans.org date: Wed Mar 19 21:27:46 2008 -0700 summary: JSF CRUD: 127291 (IllegalArgumentException: Type mm.DiscountCodeCon troller can), 129163 (JSF Pages from Entity Classes can't be successfuly runned) changeset: 74437:b42a85497346 tag: tip parent: 74223:4c91693af0be parent: 74436:b2ff9ef3dbe8 user: mbohm@netbeans.org date: Wed Mar 19 21:30:52 2008 -0700 summary: Automated merge with http://hg.netbeans.org/main/
I just downloaded the latest nightly, netbeans-trunk-nightly-200803211205-linux.sh and verified that the JSF CRUD functionality works as expected. Thanks for taking care of this, I have been looking forward to both using this functionality and "showing it off" to other developers
BTW, one way to show it off is using the database schema I have been using in my development effort, the consulting agency database. See http://wiki.netbeans.org/JsfCrudGenerator.
*** Issue 130863 has been marked as a duplicate of this issue. ***
*** Issue 130864 has been marked as a duplicate of this issue. ***
Works fine. V. Product Version: NetBeans IDE Dev (Build 200809180201) Java: 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b11 System: Linux version 2.6.24-19-generic running on i386; UTF-8; en_US (nb)