[JBoss Seam] - deployment issues
by hun1997
Hi - I'm looking at using Seam as a solution for a large-scale web application, however I am growing increasingly frustrated by two errors that keep coming up:
1. "NoClassDefFoundError" for beans I have created and definitely exist in the EAR
2. "value of context variable is not an instance of the component bound to the context variable: ..."
Usually, redeploying once (sometimes more) will fix these problems when they crop up.
What are causing these? It doesn't seem like it's my code, since a redeployment fixes them. What can I do so that these stop becoming an issue?
(I'm using JBoss 4.2.1 and Seam 1.2.1)
Here's an example stacktrace of simply calling my authenticator bean from a login form. Thanks in advance!
13:03:55,841 ERROR [SeamLoginModule] Error invoking login method
| java.lang.IllegalArgumentException: value of context variable is not an instance of the component bound to the context variable: authenticator
| at org.jboss.seam.Component.getInstance(Component.java:1655)
| at org.jboss.seam.Component.getInstance(Component.java:1610)
| at org.jboss.seam.Component.getInstance(Component.java:1604)
| at org.jboss.seam.jsf.SeamELResolver.getValue(SeamELResolver.java:49)
| at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
| at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
| at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:45)
| at org.apache.el.parser.AstValue.getTarget(AstValue.java:42)
| at org.apache.el.parser.AstValue.invoke(AstValue.java:127)
| at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
| at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
| at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
| at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
| at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:148)
| at org.jboss.seam.security.jaas.SeamLoginModule.login(SeamLoginModule.java:104)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
| at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
| at javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
| at java.security.AccessController.doPrivileged(Native Method)
| at javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
| at javax.security.auth.login.LoginContext.login(LoginContext.java:575)
| at org.jboss.seam.security.Identity.authenticate(Identity.java:247)
| at org.jboss.seam.security.Identity.authenticate(Identity.java:240)
| at org.jboss.seam.security.Identity.login(Identity.java:170)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.apache.el.parser.AstValue.invoke(AstValue.java:131)
| at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
| at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
| at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
| at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
| at javax.faces.component.UICommand.broadcast(UICommand.java:383)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
| at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| 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:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
| at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:381)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:619)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069764#4069764
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069764
17Â years, 3Â months
[JBoss Seam] - Re: Seam 1.2.1, AS 4.2.1, @Restricted method gives NoClassDe
by tynor
I am seeing exactly the same bizzare behavior. My app works fine (s:hasRole() apparently working since my menu.xhtml is evaluating ok), until I click on a Save button (though oddly, I can click Delete on the same form without any trouble). Exception at the bottom of this post.
I have a Seam 1.2.1GA based app (originally created via seamgen) that I'm trying to run on AS 4.2.1 and have made the following changes thus far:
Added files:
lib/jsf-impl.jar
| lib/jsf-api.jar
|
Removed files:
lib/el-api.jar
| lib/myfaces-impl-1.1.4.jar
| lib/myfaces-api-1.1.4.jar
|
and various edits:
Index: build.properties
| ===================================================================
| --- build.properties (revision 186)
| +++ build.properties (working copy)
| @@ -1 +1,2 @@
| -jboss.home = C:/Program Files/jboss-4.0.5.GA
| +jboss.home = C:/Program Files/jboss-4.2.1.GA
| Index: build.xml
| ===================================================================
| --- build.xml (revision 203)
| +++ build.xml (working copy)
| @@ -211,7 +212,11 @@
| <include name="drools-*.jar"/>
| <include name="janino-*.jar"/>
| <include name="antlr-*.jar"/>
| + <include name="commons-beanutils-*.jar"/>
| + <include name="commons-collections-*.jar"/>
| + <include name="commons-digester-*.jar"/>
| <include name="commons-jci-*.jar"/>
| + <include name="commons-lang-*.jar"/>
| <include name="stringtemplate-*.jar"/>
| </fileset>
| </copy>
| Index: resources/WEB-INF/faces-config.xml
| ===================================================================
| --- resources/WEB-INF/faces-config.xml (revision 186)
| +++ resources/WEB-INF/faces-config.xml (working copy)
| @@ -1,9 +1,8 @@
| <?xml version='1.0' encoding='UTF-8'?>
| -<!DOCTYPE faces-config PUBLIC
| - "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
| - "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
| -
| -<faces-config>
| +<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>
| <message-bundle>messages</message-bundle>
| @@ -11,6 +10,7 @@
| <!--
| <view-handler>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</view-handler>
| -->
| + <el-resolver>org.jboss.seam.jsf.SeamELResolver</el-resolver>
| </application>
|
| <!-- Seam transaction management -->
| Index: resources/WEB-INF/web.xml
| ===================================================================
| --- resources/WEB-INF/web.xml (revision 186)
| +++ resources/WEB-INF/web.xml (working copy)
| @@ -63,11 +63,11 @@
| <url-pattern>/seam/resource/*</url-pattern>
| </servlet-mapping>
|
| - <!-- MyFaces -->
| -
| +<!-- required for jboss prior to 4.2.x
| <listener>
| <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
| </listener>
| +-->
|
| <!-- Facelets development mode (disable in production) -->
|
| Index: resources/META-INF/application.xml
| ===================================================================
| --- resources/META-INF/application.xml (revision 186)
| +++ resources/META-INF/application.xml (working copy)
| @@ -21,9 +21,11 @@
| <module>
| <java>jboss-seam.jar</java>
| </module>
| +<!-- disable for Sun RI / JBoss 4.2.x
| <module>
| <java>el-api.jar</java>
| </module>
| +-->
| <module>
| <java>el-ri.jar</java>
| </module>
| @@ -56,6 +58,18 @@
| <java>commons-jci-janino-2.4.3.jar</java>
| </module>
| <module>
| + <java>commons-digester-1.6.jar</java>
| + </module>
| + <module>
| + <java>commons-collections-3.1.jar</java>
| + </module>
| + <module>
| + <java>commons-beanutils-1.7.0.jar</java>
| + </module>
| + <module>
| + <java>commons-lang-2.1.jar</java>
| + </module>
| + <module>
| <java>stringtemplate-2.3b6.jar</java>
| </module>
Here's the exception:
javax.faces.FacesException: javax.el.ELException: /WEB-INF/facelets/templates/mainmenu.xhtml @17,87 rendered="#{s:hasRole('ROLE_INVESTMENTS')}": Function 's:hasRole' not found
| at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:373)
| at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:276)
| at org.richfaces.renderkit.html.ToolBarGroupRenderer.encodeChildren(ToolBarGroupRenderer.java:68)
| at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
| at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:282)
| at org.richfaces.renderkit.html.ToolBarRendererBase.encodeChildren(ToolBarRendererBase.java:81)
| at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
| at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
| at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
| at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:571)
| at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
| at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
| at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
| at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| 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:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: javax.el.ELException: /WEB-INF/facelets/templates/mainmenu.xhtml @17,87 rendered="#{s:hasRole('ROLE_INVESTMENTS')}": Function 's:hasRole' not found
| at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
| at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:370)
| ... 53 more
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069761#4069761
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069761
17Â years, 3Â months
[JBoss Seam] - Re: show me the right way to access row of datatable with Se
by tim_ph
Haven't gone far on this. I made it @Factory as you suggest, Smith. Also add @Out for datamodel, otherwise it won't see personnels value on the page.
| @DataModel
| @Out(required=false)
| private List<Personnel> personnels;
|
then stumble on this error:
| 12:51:49,243 ERROR [STDERR] Aug 1, 2007 12:51:49 PM com.sun.facelets.FaceletView
| Handler handleRenderException
| SEVERE: Error Rendering View[/policy/ApplicationEdit.xhtml]
| java.lang.ClassCastException: java.util.ArrayList
| at org.jboss.seam.databinding.DataModelBinder.isDirty(DataModelBinder.ja
| va:14)
| at org.jboss.seam.Component.outjectDataModel(Component.java:1417)
| at org.jboss.seam.Component.outjectDataModels(Component.java:1402)
| at org.jboss.seam.Component.outject(Component.java:1357)
| at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterc
| eptor.java:47)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
| Context.java:68)
| at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInv
|
BTW, I work on latest Seam 2.0.0.Beta1 with JBoss 4.2.0GA. I know it's beta, but I want to use the framework.
Thanks for the help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069758#4069758
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069758
17Â years, 3Â months