[JBoss Seam] - Conversation and Manual Flush Mode
by dapeng
Hi,
I hope that I understand everything in the right way. Seam always starts and commits 2 Tx for each request. By default flush type of AUTO, hibernate entity manager will also commit the 2 txs. (Is there an optimization to handle the second tx for render response phase in a read-only mode? Don't think it is always reasonable, but just curious to know) In a long-running conversation over several request, this commitment of tx leads to a database flush, which is actually not wished. So the right strategy is to use the manual flush mode and flush explicitly at the end of conversation.
I hope I got the right understanding so far. It will be great if you guys can give a short conformation.
Now my question: I am using Seam in a layered architecture, in which the I would not like to expose the entity manager into the JSF layer. I know this is not the Seam philosophy, but it is a fact. Do you have a suggestion, how I can handle this manual flush at the end of the conversaton in a elegant way.
Option 1 is to define corresponding methods in "service backend" (for @End), which always invoke entityManager.flush(). This could limit the reusability of these methods, because they can be used in environments where auto flush is more appropriate.
Option 2 is to introduce a FlushService, which can be used by JSF beans to start the flush. But I don't like this idea either, because it is really not natural.
I am really keen to know whether you have better ideas.
Thx in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103743#4103743
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103743
18 years, 8 months
[JBoss Seam] - Re: Using an EJB3 in seam
by german.castro
The way of use an ejb or resources is the same of other kind of projects??
I also was trying to use a datasource from a seam action and this returns null (ds is null):
@Resource (mappedName="jndi") DataSource ds;
The deploy structure is this:
ClientPortal.ear
|-- ClientPortalWeb.war
| |-- META-INF
| | `-- MANIFEST.MF
| |-- WEB-INF
| | |-- classes
| | | |-- ClientPortalWeb-ds.xml
| | | |-- META-INF
| | | | `-- persistence.xml
| | | |-- ..... actions
| | | |-- components.properties
| | | |-- import.sql
| | | |-- messages_en.properties
| | | |-- seam.properties
| | | `-- security.drl
| | |-- components.xml
| | |-- faces-config.xml
| | |-- jboss-web.xml
| | |-- lib
| | | |-- jboss-seam-debug.jar
| | | |-- jboss-seam-ui.jar
| | | |-- jsf-facelets.jar
| | | |-- richfaces-impl.jar
| | | `-- richfaces-ui.jar
| | |-- pages.xml
| | `-- web.xml
| |-- error.xhtml
| |-- home.xhtml
| |-- img
| | |-- cal-next.png
| | |-- cal-prev.png
| | |-- dtpick.gif
| |-- index.html
| |-- layout
| | |-- display.xhtml
| | |-- edit.xhtml
| | |-- loginout.xhtml
| | |-- menu.xhtml
| | `-- template.xhtml
| |-- login.page.xml
| |-- login.xhtml
| |-- stylesheet
| | `-- theme.css
|-- META-INF
| |-- MANIFEST.MF
| `-- application.xml
|-- jboss-seam.jar
|-- lib
| |-- antlr-runtime.jar
| |-- commons-beanutils.jar
| |-- commons-digester.jar
| |-- drools-compiler.jar
| |-- drools-core.jar
| |-- ejb-api.jar
| |-- el-api.jar
| |-- janino.jar
| |-- jboss-el.jar
| |-- jboss-seam-gen.jar
| |-- jboss-seam-ioc.jar
| |-- jboss-seam-mail.jar
| |-- jboss-seam-pdf.jar
| |-- jboss-seam-remoting.jar
| |-- jbpm-jpdl.jar
| |-- jsf-api.jar
| |-- jsf-impl.jar
| |-- mvel14.jar
| `-- richfaces-api.jar
`-- servicesClientPortal.jar
|-- META-INF
| |-- MANIFEST.MF
| `-- ejb-jar.xml
`-- cl
`-- ..... ejbs
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103742#4103742
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103742
18 years, 8 months
[JBoss Seam] - Re: EntityQuery restriction help
by dloebbe
| 16:35:00,307 ERROR [SeamPhaseListener] uncaught exception
| javax.el.ELException: java.lang.IllegalArgumentException: argument type mismatch
| at javax.el.BeanELResolver.setValue(BeanELResolver.java:116)
| at javax.el.CompositeELResolver.setValue(CompositeELResolver.java:68)
| at com.sun.faces.el.FacesCompositeELResolver.setValue(FacesCompositeELResolver.java:93)
| at org.jboss.el.parser.AstPropertySuffix.setValue(AstPropertySuffix.java:73)
| at org.jboss.el.parser.AstValue.setValue(AstValue.java:84)
| at org.jboss.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:249)
| at org.jboss.seam.core.Expressions$1.setValue(Expressions.java:117)
| at org.jboss.seam.navigation.Pages.applyConvertedValidatedValuesToModel(Pages.java:779)
| at org.jboss.seam.navigation.Pages.postRestore(Pages.java:402)
| at org.jboss.seam.jsf.SeamPhaseListener.postRestorePage(SeamPhaseListener.java:528)
| at org.jboss.seam.jsf.SeamPhaseListener.afterRestoreView(SeamPhaseListener.java:374)
| at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:211)
| at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:184)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
| 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.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:164)
| at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
| at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
| at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:406)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
| at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
| at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
| 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:432)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| 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:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:619)
| Caused by: java.lang.IllegalArgumentException: argument type mismatch
| 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.el.BeanELResolver.setValue(BeanELResolver.java:108)
| ... 58 more
| 16:35:00,339 ERROR [CachedConnectionValve] Application error: Faces Servlet did not complete its transaction
|
That is all.
Thanks, Daniel
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103736#4103736
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103736
18 years, 8 months
[Beginners Corner] - How can I be a good J2EE container citizen while creating fi
by tachoknight
Hi everyone-
I am writing an image processing tool that will take input and a file from a web page, process it using my software (sometimes taking many many minutes), and make available another file to the submitter. The end file (typically a jpeg) is then available to the person to bring into another program, etc.
I was reading in the J2EE container spec that you're not supposed to use java.io.*; inside an EJB (which my program is, basically). Experimenting with JBoss shows that this is still possible...I can create a file using JBossAS, but I want to be a good "J2EE citizen" and do things the right (and presumably more portable) way.
So what is the "proper" way to handle file reading/creation in a J2EE container? I suppose I can just keep using java.io.* on JBoss, but I'm afraid that someday this will not be possible and I'll have to come up with something else.
Thanks,
Ron
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103731#4103731
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103731
18 years, 8 months
[Installation, Configuration & DEPLOYMENT] - Re: Random problem (Access is denied) while starting default
by kranjcec
Lucky me with vista nad java6 :-)
I tried with latest java 5 jdk with same result.
This is an example:
| ===============================================================================
|
| JBoss Bootstrap Environment
|
| JBOSS_HOME: C:\devtools\servers\jboss\jboss-4.2.2.GA
|
| JAVA: C:\devtools\jdks\jdk1.5.0_13\bin\java
|
| JAVA_OPTS: -Dprogram.name=run_java5.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval
| =3600000
|
| CLASSPATH: C:\devtools\jdks\jdk1.5.0_13\lib\tools.jar;C:\devtools\servers\jboss\jboss-4.2.2.GA\bin\run.jar
|
| ===============================================================================
|
| 16:14:05,034 INFO [Server] Starting JBoss (MX MicroKernel)...
| 16:14:05,037 INFO [Server] Release ID: JBoss [Trinity] 4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)
| 16:14:05,041 INFO [Server] Home Dir: C:\devtools\servers\jboss\jboss-4.2.2.GA
| 16:14:05,043 INFO [Server] Home URL: file:/C:/devtools/servers/jboss/jboss-4.2.2.GA/
| 16:14:05,046 INFO [Server] Patch URL: null
| 16:14:05,048 INFO [Server] Server Name: default
| 16:14:05,051 INFO [Server] Server Home Dir: C:\devtools\servers\jboss\jboss-4.2.2.GA\server\default
| 16:14:05,054 INFO [Server] Server Home URL: file:/C:/devtools/servers/jboss/jboss-4.2.2.GA/server/default/
| 16:14:05,056 INFO [Server] Server Log Dir: C:\devtools\servers\jboss\jboss-4.2.2.GA\server\default\log
| 16:14:05,059 INFO [Server] Server Temp Dir: C:\devtools\servers\jboss\jboss-4.2.2.GA\server\default\tmp
| 16:14:05,062 INFO [Server] Root Deployment Filename: jboss-service.xml
| 16:14:05,328 INFO [ServerInfo] Java version: 1.5.0_13,Sun Microsystems Inc.
| 16:14:05,330 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.5.0_13-b05,Sun Microsystems Inc.
| 16:14:05,333 INFO [ServerInfo] OS-System: Windows Vista 6.0,x86
| 16:14:05,653 INFO [Server] Core system initialized
| 16:14:08,584 INFO [WebService] Using RMI server codebase: http://127.0.0.1:8083/
| 16:14:08,589 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml
| 16:14:09,417 INFO [TransactionManagerService] JBossTS Transaction Service (JTA version) - JBoss Inc.
| 16:14:09,419 INFO [TransactionManagerService] Setting up property manager MBean and JMX layer
| 16:14:09,750 INFO [TransactionManagerService] Starting recovery manager
| 16:14:09,841 INFO [TransactionManagerService] Recovery manager started
| 16:14:09,843 INFO [TransactionManagerService] Binding TransactionManager JNDI Reference
| 16:14:11,658 ERROR [MainDeployer] Could not make local copy for file:/C:/devtools/servers/jboss/jboss-4.2.2.GA/server/default/deploy/jboss-b
| ean.deployer/jboss-microcontainer.jar
| java.io.FileNotFoundException: C:\devtools\servers\jboss\jboss-4.2.2.GA\server\default\tmp\deploy\tmp29818jboss-microcontainer.jar (Access is denied)
| at java.io.FileOutputStream.open(Native Method)
| at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
| at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
| at org.jboss.deployment.MainDeployer.copy(MainDeployer.java:1242)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103727#4103727
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103727
18 years, 8 months