I am writing a test client for a web service. This is NetBeans 6.9.1 WebApplication using the JSF framework. I have one managed bean that calls a web service.
Everything worked fine until I noticed a typo in my bean class. It was a serviceBean, and I renamed it a ServiceBean with an uppercase first letter. I used the Netbeans secure rename function, and both the file name and class signature changed as expected.
But since then I have had many problems running the application on Glassfish 3.0.1.
I can create my application from Netbeans without errors (even "Clean and Build"). But if I turn around, the following message appears in the server log:
WARNUNG: Error in annotation processing: java.lang.NoClassDefFoundError: jsf/serviceBean (wrong name: jsf/ServiceBean) WARNUNG: WEB9052: Unable to load class jsf.ServiceBean, reason: java.lang.ClassNotFoundException: jsf.ServiceBean INFO: Mojarra 2.0.2 (FCS b10) fΓΌr Kontext '/PidClient' wird initialisiert. SCHWERWIEGEND: Unable to load annotated class: jsf.serviceBean, reason: java.lang.NoClassDefFoundError: jsf/serviceBean (wrong name: jsf/ServiceBean) INFO: Loading application PidClient at /PidClient
I have a form on the front page that will be sent to my managed bean. The form will be loaded despite the above error, but if I try to submit it, I get the following error:
WARNUNG: /index.xhtml @19,94 value="#{serviceBean.fldLname}": Target Unreachable, identifier 'serviceBean' resolved to null javax.el.PropertyNotFoundException: /index.xhtml @19,94 value="#{serviceBean.fldLname}": Target Unreachable, identifier 'serviceBean' resolved to null at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:93) at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:95) at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1008)
Thus, it will only be a subsequent error caused by the NoClassDefFoundError above.
And now for the weird part: If I create my project, it creates the ServiceBean.class file, but if I pull the project out of Netbeans and then look in my deployment directory, the class will be renamed to serviceBean.class.
The deployment process seems to be renaming the file.
What is the problem? (Netbeans 6.9.1, Glassfish 3.0.1, Windows 7)
UPDATE:. This is even better: renamed ServiceBean.java to ServiceBean2.java. Result: if "Clean and Build", the war file contains only ServiceBean2.class. If I deploy from NB, the build directory contains ServiceBean2.class and serviceBean.class. How to get rid of this ghost?