MyFaces CODI within EAR

2012-09-06 Thread Christian Beikov

Hello!

I am trying to package the codi jsf 2 bundle 1.0.5 within my ear but I 
am getting some exceptions like:


java.lang.NoClassDefFoundError: javax/faces/bean/ViewScoped

I have placed the bundle in EAR/lib since I have 2 Webapps that use CODI.
Is it even possible to use CODI in such a scenario? Could you please 
provide some details on how CODI is supposed to be packaged within an EAR?


Regards,
Christian


Re: MyFaces CODI within EAR

2012-09-06 Thread Mark Struberg
Hi christian!

Yes, this is perfectly possible. You just have to move all your JSF deps which 
are needed by CODI to a shared jarĀ  (in an EAR lib).
myfaces-api.jar myfaces-impl.jar, el, etc. All the stuff which is 
(transitively) required on the classpath.

I have this scenario running over here with 12 webapps in an EAR (with 
ClassLoader isolation).


LieGrue,
strub




- Original Message -
 From: Christian Beikov christian.bei...@gmail.com
 To: MyFaces Discussion users@myfaces.apache.org
 Cc: 
 Sent: Thursday, September 6, 2012 10:06 PM
 Subject: MyFaces CODI within EAR
 
 Hello!
 
 I am trying to package the codi jsf 2 bundle 1.0.5 within my ear but I am 
 getting some exceptions like:
 
 java.lang.NoClassDefFoundError: javax/faces/bean/ViewScoped
 
 I have placed the bundle in EAR/lib since I have 2 Webapps that use CODI.
 Is it even possible to use CODI in such a scenario? Could you please provide 
 some details on how CODI is supposed to be packaged within an EAR?
 
 Regards,
 Christian



Re: MyFaces CODI within EAR

2012-09-06 Thread Christian Beikov
I am working on JBoss AS 7, so do I really need to package the jsf api 
and impl within the EAR/lib?


If I understand you right, I should have something like:

EAR
 - lib
   - jsf-api.jar
   - jsf-impl.jar
   - myfaces-extcdi-jsf2-bundle.jar
 - WAR1
 - WAR2

Regards,
Christian

Am 06.09.2012 22:29, schrieb Mark Struberg:

Hi christian!

Yes, this is perfectly possible. You just have to move all your JSF deps which 
are needed by CODI to a shared jar  (in an EAR lib).
myfaces-api.jar myfaces-impl.jar, el, etc. All the stuff which is 
(transitively) required on the classpath.

I have this scenario running over here with 12 webapps in an EAR (with 
ClassLoader isolation).


LieGrue,
strub




- Original Message -

From: Christian Beikov christian.bei...@gmail.com
To: MyFaces Discussion users@myfaces.apache.org
Cc:
Sent: Thursday, September 6, 2012 10:06 PM
Subject: MyFaces CODI within EAR

Hello!

I am trying to package the codi jsf 2 bundle 1.0.5 within my ear but I am
getting some exceptions like:

java.lang.NoClassDefFoundError: javax/faces/bean/ViewScoped

I have placed the bundle in EAR/lib since I have 2 Webapps that use CODI.
Is it even possible to use CODI in such a scenario? Could you please provide
some details on how CODI is supposed to be packaged within an EAR?

Regards,
Christian





Regarding JSF page becoming inaccessible

2012-09-06 Thread Yogeen Honnavar

Dear users,

We are using myfaces-1.2.9 with apache-tomcat-6.0.35. We have a JSF  
page which works fine most of the time.


However, recently all of a sudden, the JSF page became unavailable. On  
checking the logs following lines are observed.


Any idea what is the likely cause ? Please let us know. We cannot  
share the JSF code, but please note that we have one JSP scriptlet  
%  % within the JSF page for accessing backend database and  
pre-processing. Is this likely cause for the problem ? Please advice.


regards
-yogeen




Sep 2, 2012 11:32:04 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet Faces Servlet threw exception
java.lang.NullPointerException
	at  
javax.faces.component.UIData.restoreDescendantComponentStates(UIData.java:600)
	at  
javax.faces.component.UIData.restoreDescendantComponentStates(UIData.java:612)

at javax.faces.component.UIData.setRowIndex(UIData.java:551)
	at  
org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:292)
	at  
org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:143)
	at  
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:627)
	at  
org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:528)
	at  
org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:231)
	at  
org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:102)

at 
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:649)
	at  
org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:534)
	at  
org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren(RendererUtils.java:511)
	at  
org.apache.myfaces.shared_impl.renderkit.html.HtmlGroupRendererBase.encodeEnd(HtmlGroupRendererBase.java:92)

at 
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:649)
	at  
org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:534)
	at  
org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:231)
	at  
org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:102)

at 
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:649)
	at  
org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:534)
	at  
org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:231)
	at  
org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:102)

at 
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:649)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:261)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
	at  
org.apache.myfaces.application.jsp.JspViewHandlerImpl.actuallyRenderView(JspViewHandlerImpl.java:427)
	at  
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:383)
	at  
org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)

at 
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:187)
	at  
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at  
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at  
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
	at  
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at  
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at  
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at  
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615)
	at  
org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:316)

at 
org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:81)
	at  
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at  
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at  

Re: Regarding JSF page becoming inaccessible

2012-09-06 Thread Leonardo Uribe
Hi

I remember that problem, it is an old issue: MYFACES-3398. It was
caused by some improvements done in that part. Please try with the
latest version (1.2.12), which has that one fixed and is considered
the most stable one.

regards,

Leonardo Uribe

2012/9/6 Yogeen Honnavar yog...@isac.gov.in:
 Dear users,

 We are using myfaces-1.2.9 with apache-tomcat-6.0.35. We have a JSF page
 which works fine most of the time.

 However, recently all of a sudden, the JSF page became unavailable. On
 checking the logs following lines are observed.

 Any idea what is the likely cause ? Please let us know. We cannot share the
 JSF code, but please note that we have one JSP scriptlet %  % within
 the JSF page for accessing backend database and pre-processing. Is this
 likely cause for the problem ? Please advice.

 regards
 -yogeen


 

 Sep 2, 2012 11:32:04 PM org.apache.catalina.core.StandardWrapperValve invoke
 SEVERE: Servlet.service() for servlet Faces Servlet threw exception
 java.lang.NullPointerException
 at
 javax.faces.component.UIData.restoreDescendantComponentStates(UIData.java:600)
 at
 javax.faces.component.UIData.restoreDescendantComponentStates(UIData.java:612)
 at javax.faces.component.UIData.setRowIndex(UIData.java:551)
 at
 org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:292)
 at
 org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:143)
 at
 javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:627)
 at
 org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:528)
 at
 org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:231)
 at
 org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:102)
 at
 javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:649)
 at
 org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:534)
 at
 org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren(RendererUtils.java:511)
 at
 org.apache.myfaces.shared_impl.renderkit.html.HtmlGroupRendererBase.encodeEnd(HtmlGroupRendererBase.java:92)
 at
 javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:649)
 at
 org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:534)
 at
 org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:231)
 at
 org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:102)
 at
 javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:649)
 at
 org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:534)
 at
 org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:231)
 at
 org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:102)
 at
 javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:649)
 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:261)
 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
 at
 org.apache.myfaces.application.jsp.JspViewHandlerImpl.actuallyRenderView(JspViewHandlerImpl.java:427)
 at
 org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:383)
 at
 org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
 at
 org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:187)
 at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at
 org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
 at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
 at
 

Re: Regarding JSF page becoming inaccessible

2012-09-06 Thread Yogeen Honnavar

Hi Leonardo,

Thank you for your suggestion. Have you got any idea under what  
condition this problem manifests ?


Anyways, we will upgrade to latest version as suggested.

Thanks once again.

regards
-yogeen

Quoting Leonardo Uribe lu4...@gmail.com:


Hi

I remember that problem, it is an old issue: MYFACES-3398. It was
caused by some improvements done in that part. Please try with the
latest version (1.2.12), which has that one fixed and is considered
the most stable one.

regards,

Leonardo Uribe

2012/9/6 Yogeen Honnavar yog...@isac.gov.in:

Dear users,

We are using myfaces-1.2.9 with apache-tomcat-6.0.35. We have a JSF page
which works fine most of the time.

However, recently all of a sudden, the JSF page became unavailable. On
checking the logs following lines are observed.

Any idea what is the likely cause ? Please let us know. We cannot share the
JSF code, but please note that we have one JSP scriptlet %  % within
the JSF page for accessing backend database and pre-processing. Is this
likely cause for the problem ? Please advice.

regards
-yogeen




Sep 2, 2012 11:32:04 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet Faces Servlet threw exception
java.lang.NullPointerException
at
javax.faces.component.UIData.restoreDescendantComponentStates(UIData.java:600)
at
javax.faces.component.UIData.restoreDescendantComponentStates(UIData.java:612)
at javax.faces.component.UIData.setRowIndex(UIData.java:551)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:292)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:143)
at
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:627)
at
org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:528)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:231)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:102)
at
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:649)
at
org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:534)
at
org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren(RendererUtils.java:511)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlGroupRendererBase.encodeEnd(HtmlGroupRendererBase.java:92)
at
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:649)
at
org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:534)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:231)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:102)
at
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:649)
at
org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:534)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:231)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:102)
at
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:649)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:261)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
at
org.apache.myfaces.application.jsp.JspViewHandlerImpl.actuallyRenderView(JspViewHandlerImpl.java:427)
at
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:383)
at
org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
at
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:187)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at

Re: MyFaces CODI within EAR

2012-09-06 Thread Christian Beikov
Well, it took me some time, but I figured out that JBoss AS does not add 
the JSF stuff to the classpath when starting CODI. The solution for 
JBoss AS7 to get CODI working when located in EAR/lib finally is:


Add a jboss-deployment-structure.xml file to EAR/META-INF that looks 
like this:


?xml version=1.0 encoding=UTF-8?
jboss-deployment-structure
!-- Make sub deployments isolated by default, so they cannot see 
each others

classes without a Class-Path entry --
ear-subdeployments-isolatedtrue/ear-subdeployments-isolated
!-- This corresponds to the top level deployment. For a war this 
is the

war's module, for an ear --
!-- This is the top level ear module, which contains all the 
classes in

the EAR's lib folder --
deployment
!-- This allows you to define additional dependencies, it is 
the same

as using the Dependencies: manifest attribute --
dependencies
module name=org.w3c.css.sac /
module name=net.sourceforge.cssparser /
module name=com.sun.jsf-impl /
module name=javax.api /
module name=javax.faces.api /
module name=javax.xml.bind.api /
module name=javax.xml.jaxp-provider /
module name=com.google.guava /
/dependencies
/deployment
/jboss-deployment-structure

This will make everything that is somehow jsf specific available for the 
CODI jar. Hope this might help someone else.


Regards,
Christian

Am 06.09.2012 22:29, schrieb Mark Struberg:

Hi christian!

Yes, this is perfectly possible. You just have to move all your JSF deps which 
are needed by CODI to a shared jar  (in an EAR lib).
myfaces-api.jar myfaces-impl.jar, el, etc. All the stuff which is 
(transitively) required on the classpath.

I have this scenario running over here with 12 webapps in an EAR (with 
ClassLoader isolation).


LieGrue,
strub




- Original Message -

From: Christian Beikov christian.bei...@gmail.com
To: MyFaces Discussion users@myfaces.apache.org
Cc:
Sent: Thursday, September 6, 2012 10:06 PM
Subject: MyFaces CODI within EAR

Hello!

I am trying to package the codi jsf 2 bundle 1.0.5 within my ear but I am
getting some exceptions like:

java.lang.NoClassDefFoundError: javax/faces/bean/ViewScoped

I have placed the bundle in EAR/lib since I have 2 Webapps that use CODI.
Is it even possible to use CODI in such a scenario? Could you please provide
some details on how CODI is supposed to be packaged within an EAR?

Regards,
Christian