[JBoss Seam] - Seam and IceFaces problem
by jmiguel77
Hi:
I am trying to work with seam and icefaces. I have the following:
- jboss 4.0.5GA
- seam 1.1.0
- icefaces 1.5.1
this is my web.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<session-config>
<session-timeout>3</session-timeout>
</session-config>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/navigation.xml</param-value>
</context-param>
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>com.icesoft.faces.actionURLSuffix</param-name>
<param-value>.seam</param-value>
</context-param>
<context-param>
<param-name>com.icesoft.faces.synchronousUpdate</param-name>
<param-value>true</param-value>
</context-param>
<filter-name>Seam Exception Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
<filter-mapping>
<filter-name>Seam Exception Filter</filter-name>
<url-pattern>*.seam</url-pattern>
</filter-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<servlet-name>Blocking Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.xmlhttp.BlockingServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>*.iface</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>/xmlhttp/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Blocking Servlet</servlet-name>
<url-pattern>/block/*</url-pattern>
</servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.seam</url-pattern>
</servlet-mapping>
</web-app>
this is my faces-config.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config
PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<locale-config>
<default-locale>es</default-locale>
<supported-locale>en</supported-locale>
</locale-config>
<view-handler>com.icesoft.faces.facelets.D2DFaceletViewHandler</view-handler>
<!-- Select one of the standard transaction models for the Seam application -->
<phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
</faces-config>
As you see, everything is just as it is supossed to be, but when i try to run a xhtml page, i get this exception:
17:45:50,770 ERROR [SeamExceptionFilter] uncaught exception handled by Seam
javax.servlet.ServletException: Cannot remove ServletRequest Parameter
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
17:45:50,771 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
java.lang.UnsupportedOperationException: Cannot remove ServletRequest Parameter
at org.apache.myfaces.context.servlet.RequestParameterMap.removeAttribute(RequestParameterMap.java:50)
at org.apache.myfaces.context.servlet.AbstractAttributeMap.remove(AbstractAttributeMap.java:121)
at com.icesoft.faces.application.D2DViewHandler.restoreView(D2DViewHandler.java:180)
at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:141)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3996540#3996540
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3996540
19 years, 4 months
[JBoss AOP] - How to access intercepted methods in JSF?
by ykrishnaprasad
1) If there is a return in the intercepted method(call or execution), the interceptor doesn't work.
Is there anything i am missing?
2) I have an AOP "Project1" with interceptor on a method in a class.
I do not have a problem running the Project1 by itself(unless i use a return in my intercepted method).
But if a take the Project1 jar(without jboss-aop.xml in the jar) file for
this project along with its jboss-aop.xml(2 files in total)
and drop it in JBoss deploy directory, and try to use the intercepted method of Project1 class
in JSF of "Project2", it doesn't intercept.
Am i deploying correctly?
Project1:
Calltest.java
HelloAOPInterceptor.java
jboss-aop.xml
Project2:
JSF, faces-config.xml and web.xml
(The reason for seperating the jar and jboss-aop.xml(of Project1)
is that i can reference the deploy directory project1.jar in my Project2 library
list to use its classes.If i include the jboss-aop.xml
in the jar itself, then it has to be named as project1.jar.aop(according to JBoss AOP framework doc chapter 10)
which i cannot add to my library list in Project 2.)
My mbean(faces-config.xml) in project2 looks like this:
| </managed-bean>
| <managed-bean>
| <managed-bean-name>
| callTest
| </managed-bean-name>
| <managed-bean-class>
| jbossaop.callTest
| </managed-bean-class>
| <managed-bean-scope>
| request
| </managed-bean-scope>
| </managed-bean>
|
where i declared callTest class in my jbossaop package( which i got from Project1).
My jsf(jsp) in project 2 looks like:
| <f:view>
| <h:form id="helloForm" >
| <%@ page import="jbossaop.*" %>
| <h2>Hi. My name is Duke. I'm thinking of a number from
| <h:outputText value="#{callTest.callme1}"/> to
| <h:outputText value="#{UserNumberBean.maximum}"/>.
| Can you guess it?
| </h2>
| ............
| </h:form>
| </f:view>
|
UserNumberBean is a bean within Project 2 and callTest is from the aop jar i added to the library list of Project2.
The callTest.callme1 corresponds to the getCallme1() method in callTest class.
The callTest class in Project1 looks like:
| package jbossaop;
|
| public class callTest {
| private long callme = 1;
| private long callme1 = 2;
| public callTest(){
|
| }
| public void getCallme() {
| //return (this.callme);
| }
| public void setCallme(long callme) {
| this.callme = callme;
| }
|
| public long getCallme1(){
| getCallme();
| return callme1;
| }
| }
|
The interceptor is on getCallme() method and jboss-aop.xml looks like:
| <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
| <aop>
| <bind pointcut="call(public void jbossaop.callTest->getCallme())">
| <interceptor class="jbossaop.HelloAOPInterceptor"/>
| </bind>
| <bind pointcut="execution(public void jbossaop.callTest->getCallme())">
| <interceptor class="jbossaop.HelloAOPInterceptor"/>
| </bind>
| </aop>
|
The interceptor class is:
| public class HelloAOPInterceptor implements Interceptor{
| public String getName(){
| return "HelloAOPInterceptor";
| }
| public Object invoke(Invocation invocation) throws Throwable{
| FileWriter writer = new FileWriter( "c:/temp/log.txt", true );
|
| if (invocation instanceof MethodCalledByMethodInvocation){
| writer.write( "Method Called By Method Invocation " + new Date() + "\n");
| } else {
| writer.write( "JSF Invocation " + new Date()+ "\n");
| }
|
| writer.close();
|
| return invocation.invokeNext();
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3996538#3996538
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3996538
19 years, 4 months
[JBoss Seam] - Showing updated entity on postback
by nbhatia
I have created a seam application using seam-gen. I have a page that displays a master entity and its children. The page also allows the user to add a new child. However, when I click the submit button on the page to add the new child, the finally rendered page does not show this child. The reason is that the database is queried BEFORE the child is inserted. See below:
| 17:22:47,702 INFO [STDOUT] before - RESTORE_VIEW(1)
| 17:22:47,749 INFO [STDOUT] after - RESTORE_VIEW(1)
| 17:22:47,765 INFO [STDOUT] before - APPLY_REQUEST_VALUES(2)
| 17:22:47,780 INFO [STDOUT] Hibernate: select thread0_.ID as ID161_0_, thread0_.TITLE as TITLE161_0_, thread0_.FORUM_FKas FORUM3_161_0_ from chalktalk.thread thread0_ where thread0_.ID=?
| 17:22:47,780 INFO [STDOUT] Hibernate: select posts0_.THREAD_FK as THREAD4_1_, posts0_.ID as ID1_, posts0_.ID as ID160_0_, posts0_.BODY as BODY160_0_, posts0_.THREAD_FK as THREAD4_160_0_, posts0_.DATE_CREATED as DATE3_160_0_ from chalktalk.post posts0_ where posts0_.THREAD_FK=?
| 17:22:47,812 INFO [STDOUT] after - APPLY_REQUEST_VALUES(2)
| 17:22:47,812 INFO [STDOUT] before - PROCESS_VALIDATIONS(3)
| 17:22:47,859 INFO [STDOUT] after - PROCESS_VALIDATIONS(3)
| 17:22:47,859 INFO [STDOUT] before - UPDATE_MODEL_VALUES(4)
| 17:22:47,905 INFO [STDOUT] after - UPDATE_MODEL_VALUES(4)
| 17:22:47,905 INFO [STDOUT] before - INVOKE_APPLICATION(5)
| 17:22:48,015 INFO [STDOUT] Hibernate: insert into chalktalk.post (BODY, THREAD_FK, DATE_CREATED, ID) values (?, ?, ?, ?)
| 17:22:48,046 INFO [STDOUT] after - INVOKE_APPLICATION(5)
| 17:22:48,093 INFO [STDOUT] before - RENDER_RESPONSE(6)
| 17:22:48,249 INFO [STDOUT] after - RENDER_RESPONSE(6)
|
How do I solve this issue/ I would like the newly rendered page to show the inserted child.
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3996537#3996537
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3996537
19 years, 4 months