NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
Dix87
Joined: 04 Nov 2009 Posts: 2
|
Posted: Wed Nov 04, 2009 10:41 am Post subject: JSF grammar not found and EJB injection |
|
|
Hello everyone,
Anyway im creating project using JSF + Facelets using also ejb module. And I have 2 problems
1) During reading config faces-config I got exception, that document is invalid and grammar is not found. Googled it and the problem could be using JSF1.1 components in JSF1.2? Is it possible? Or where the problem could be? I have installed NB 6.7.1 with facelets plugin installed.
here is my faces-config.xml
<faces-config 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">
<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>
<managed-bean>
<managed-bean-name>info</managed-bean-name>
<managed-bean-class>cz.sh.shliga.web.mb.InfoMB</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</faces-config>
2) I cannot inject my EJB from module-ejb. Got NullPointerException, so it seems that container cannot initialize bean. Im calling it as usual with @EJB annotation (using ide option call enterprise bean)
javax.faces.FacesException: javax.el.ELException: /novinky.xhtml @48,61 value="#{info.lastMatches}": javax.faces.el.EvaluationException: cz.sh.shliga.web.mb.InfoMB
............ long. stack
Caused by: java.lang.NullPointerException
at cz.sh.shliga.web.mb.InfoMB.getLastMatches(InfoMB.java:63)
Thanks everyone who answers:-) |
|
| Back to top |
|
 |
nicephotog
Joined: 07 Nov 2009 Posts: 17 Location: Australia
|
Posted: Sat Nov 07, 2009 4:29 pm Post subject: |
|
|
Thats much what that should look like inside with accord bean spec. rules...?
| Code: |
VARIABLETYPE lastMatches; // this is would be the property
public VARIABLETYPE setLastMatches(VARIABLETYPE lastMatches){
this.lastMatches=lastMatches;
}
public VARIABLETYPE getLastMatches(){
//............whatever
return lastMatches;
}
|
? Do you need to init a property on the bean at initialisation with no processing (avoid calling a null reference)?
e.g. in managed bean in faces-config.xml
http://java.sun.com/javaee/5/docs/tutorial/doc/bnawq.html#bnawy
<managed-property>
<property-name>lastMatches</property-name>
<value>equals</value>
</managed-property>
Also use the NB right click context menu and do the two XML varification checks. |
|
| Back to top |
|
 |
Dix87
Joined: 04 Nov 2009 Posts: 2
|
Posted: Sat Nov 07, 2009 7:40 pm Post subject: |
|
|
| I found out that, if I create now pure JSF project (with default ViewHandler) and so on, calling ejb is ok and injection works. But if I create project and also add Facelets as framework, I', getting NullPointerException. Im using netbeans 6.7.1 and its plugin for Facelets support. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|