The Source for Java Technology Collaboration

Home » java.net Forums » GlassFish » GlassFish

Thread: JSF1033: Resource injection is DISABLED

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 7 - Last Post: Sep 5, 2006 6:41 AM by: slepage
slepage

Posts: 9
JSF1033: Resource injection is DISABLED
Posted: Aug 30, 2006 8:58 AM
  Click to reply to this thread Reply

We following the Netbeans 5.5 tutorial on JPA and attempting to use the JSF generated by the wizard the following is written into the app server log as the app is being deployed:

Initializing Sun's JavaServer Faces implementation (1.2_02-b03-FCS) for context '/ZooApp'
JSF1033: Resource injection is DISABLED.
Completed initializing Sun's JavaServer Faces implementation (1.2_02-b03-FCS) for context '/ZooApp'

This fact of course leads to NPE when the JSF is looking for the EntityManagerFactory. My question is, does resource injection require some explicit enabling? And if so, where would one do this? This does appear that the app server is making this choice and is not app specific.

Thank you.

ss141213

Posts: 499
Re: JSF1033: Resource injection is DISABLED
Posted: Aug 30, 2006 8:55 PM   in response to: slepage
  Click to reply to this thread Reply

Can you check version of your web.xml? You must use 2.5 (this is the latest) version of web.xml inorder to use resource injection in a web application.

Sahoo

slepage

Posts: 9
Re: JSF1033: Resource injection is DISABLED
Posted: Aug 31, 2006 6:57 AM   in response to: ss141213
  Click to reply to this thread Reply

The web.xml is in fact 2.5.
<web-app version="2.5" 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-app_2_5.xsd">
<context-param>
<param-name>com.sun.faces.verifyObjects</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>ResourceServlet</servlet-name>
<servlet-class>com.servlet.ResourceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ResourceServlet</servlet-name>
<url-pattern>/ResourceServlet</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
<env-entry>
<description>Hello World from env-entry!</description>
<env-entry-name>welcomeMessage</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>Hello World from env-entry!</env-entry-value>
</env-entry>
</web-app>

edburns

Posts: 14
Re: JSF1033: Resource injection is DISABLED
Posted: Aug 31, 2006 8:31 AM   in response to: slepage
  Click to reply to this thread Reply

I have seen this before. I will ask the Sun JSF Impl team leader about it, but in the meantime, I am confident that the following will solve your problem.

Please try updating the JSF impl in your app server to be the latest 1.2_02 release. Here's how.

1. Download https://javaserverfaces.dev.java.net/files/documents/1866/39540/jsf-sun-appserver-updater-1.2_02-FCS.jar

2. Run java -jar <JARNAME> <PATH TO APPSERVER>

3. Verify that the JSF Impl was indeed updated by looking in your log file for the string 1.2_02.

Ed

slepage

Posts: 9
Re: JSF1033: Resource injection is DISABLED
Posted: Aug 31, 2006 8:56 AM   in response to: edburns
  Click to reply to this thread Reply

Thank you for this answer.

I am a bit embaressed. The appserver is Sun App Server PE 9 and not Glassfish proper. Is it possible this fix work for Sun App Server PE 9 as well?

Thanks again for the help!

slepage

Posts: 9
Re: JSF1033: Resource injection is DISABLED
Posted: Aug 31, 2006 9:22 AM   in response to: slepage
  Click to reply to this thread Reply

By the way does this qualify as 1.2_02 or higher?

1.2_02-b03-FCS

If you notice in the original post that is what the server is reporting...

rlubke

Posts: 93
Re: JSF1033: Resource injection is DISABLED
Posted: Aug 31, 2006 12:45 PM   in response to: slepage
  Click to reply to this thread Reply

If you're updating a 9.0 PE or GlassFish V1 installation,
you need to follow an additional step that is outlined in the JSF 1.2_02 release notes [1]:


- This step is not necessary if you're using a milestone build of GlassFish UR1 or GlassFish V2. Edit your APPSERV_HOME/domains/<domain-name>/config/default-web.xml and add the following context init parameter:

* Param Name: com.sun.faces.injectionProvider -- Param Value: com.sun.faces.vendor.GlassFishInjectionProvider

<context-param>
<param-name>com.sun.faces.injectionProvider</param-name>
<param-value>com.sun.faces.vendor.GlassFishInjectionProvider</param-value>
</context-param>


- Restart the modified domain.


[1] https://javaserverfaces.dev.java.net/nonav/rlnotes/1.2_02/releasenotes.html

slepage

Posts: 9
Re: JSF1033: Resource injection is DISABLED
Posted: Sep 5, 2006 6:41 AM   in response to: rlubke
  Click to reply to this thread Reply

Thank you for this information. I did not see that instruction in the release notes prior to my posting. :)




 XML java.net RSS