[JBoss Seam] - Re: iText PDF not working with DocumentStore and SeamServlet
by wquraishi
Actually, the page is throwing an error, here's the stacktrace:
10:40:46,001 ERROR [ExceptionFilter] exception root cause
java.lang.IllegalStateException: No active event context
at org.jboss.seam.core.Manager.instance(Manager.java:248)
at org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:48)
at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
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:82)
at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:149)
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:156)
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:613)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079206#4079206
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079206
18Â years, 8Â months
[JBoss Seam] - Why does a Seam 1.2.GA POJO app need javax.ejb.ApplicationEx
by soza
Greetings
The Seam 1.2 POJO app we have fails with this following exception. We deploy on Websphere 6.1, which is J2EE1.4, hence the exception. I was wondering why would a POJO app have a dependency on javax.ejb? Thanks.
Caused by:
java.lang.TypeNotPresentException: Type javax.ejb.ApplicationException not present
at com.ibm.oti.reflect.AnnotationHelper.getAnnotation(AnnotationHelper.java:38)
at com.ibm.oti.reflect.AnnotationHelper.getDeclaredAnnotations(AnnotationHelper.java:50)
at java.lang.Class.getDeclaredAnnotations(Class.java:1583)
at java.lang.Class.getAnnotations(Class.java:1544)
at java.lang.Class.getAnnotation(Class.java:1524)
at java.lang.Class.isAnnotationPresent(Class.java:1611)
at org.jboss.seam.interceptors.RollbackInterceptor.isRollbackRequired(RollbackInterceptor.java:72)
at org.jboss.seam.interceptors.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:46)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:47)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
at org.jboss.seam.interceptors.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:31)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:151)
at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:87)
at com.churchmutual.rms.action.impl.InspectionSearchActionImpl_$$_javassist_15.search(InspectionSearchActionImpl_$$_javassist_15.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at com.sun.el.parser.AstValue.invoke(AstValue.java:174)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:286)
at org.jboss.seam.ui.facelet.MethodExpressionHelper.invokeTheExpression(MethodExpressionHelper.java:102)
at org.jboss.seam.ui.facelet.ParamMethodExpression.invoke(ParamMethodExpression.java:62)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
... 45 more
Caused by:
java.lang.ClassNotFoundException: javax.ejb.ApplicationException
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:164)
at com.ibm.oti.reflect.AnnotationHelper.getAnnotation(AnnotationHelper.java:33)
... 73 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079204#4079204
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079204
18Â years, 8Â months
[JBoss Seam] - iText PDF not working with DocumentStore and SeamServletFilt
by wquraishi
Hello all,
I'm relatively new to SEAM and was experiencing a problem using the iText library. I was able to successfully get a PDF to render by putting the pdf (p:XXXX) code directly inline into my .xhtml page. I wanted this to work by generating links and allowing the user to download the PDF.
Looking at the docs this is what I did.
In my web.xml, I added:
<filter-name>Seam Servlet Filter</filter-name>
<filter-class>
org.jboss.seam.servlet.SeamServletFilter
</filter-class>
<filter-mapping>
<filter-name>Seam Servlet Filter</filter-name>
<url-pattern>*.pdf</url-pattern>
</filter-mapping>
<servlet-name>Document Store Servlet</servlet-name>
<servlet-class>
org.jboss.seam.pdf.DocumentStoreServlet
</servlet-class>
<servlet-mapping>
<servlet-name>Document Store Servlet</servlet-name>
<url-pattern>*.pdf</url-pattern>
</servlet-mapping>
In components.xml, I added:
<pdf:documentStore useExtensions="true" />
In my .xhtml page, I places a link as such:
<s:link id="agent-pdf" view="/agent-pdf.xhtml">PDF</s:link>
I created an agent-pdf.xhtml page as such:
<p:document xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:p="http://jboss.com/products/seam/pdf"
xmlns:h="http://java.sun.com/jsf/html">
<f:facet name="header">
<p:font size="12">
<p:footer borderWidthTop="1" borderColorTop="blue" borderWidthBottom="0" alignment="center">Why Seam? [<p:pageNumber />]</p:footer>
</p:font>
</f:facet>
<p:paragraph spacingAfter="200" />
<p:font size="24"><p:paragraph spacingBefore="100" alignment="center">Ten Good Reasons To Use Seam</p:paragraph></p:font>
<p:image alignment="center" value="#{agent.photo.data}" />
<p:chapter number="1">
<p:title>
<p:font size="18"><p:paragraph>It's the quickest way to get "rich"</p:paragraph></p:font>
</p:title>
<p:paragraph alignment="justify" spacingBefore="5">AJAX fundamentally changes the interaction model of the web. The synchronous, coarse-grained requests used by traditional web clients let many server-side applications get away with minimal caching and no session-level concurrency. The "stateless" architecture is in many cases a viable solution. But not anymore! AJAX clients hit the server with many asynchronous, concurrent, fine-grained requests, which could easily bring your database to its knees. When state is held in memory between requests, it is highly vulnerable to concurrency-related bugs, since the Java EE platform provides no constructs for dealing with session-level concurrency.</p:paragraph>
<p:paragraph alignment="justify" spacingBefore="5">Seam's totally unique concurrency model and state-management model was conceived and designed with AJAX in mind. </p:paragraph>
<p:paragraph alignment="justify" spacingBefore="5">Seam 1.1 integrates open source JSF-based AJAX solutions like ICEfaces and Ajax4JSF with Seam's state and concurrency management engine. You can add AJAX to your applications with ease, without the need to learn JavaScript, and you will be protected from potential bugs and performance problems associated with the switch to AJAX. </p:paragraph>
</p:chapter>
<p:chapter number="2">
<p:title>
<p:font size="18"><p:paragraph>It's the easiest way to get started with EJB 3.0 </p:paragraph></p:font>
</p:title>
<p:paragraph alignment="justify" spacingBefore="5">EJB 3.0 is a great component model for transactional business components, the highlight being the brand new Java Persistence API (JPA). But Java web and application frameworks designed before the release of EJB 3.0 lack support for the new component model, leaving you to write your own integration code, and in many cases forcing you into the use of a layered architecture that may not be right for your application. </p:paragraph>
<p:paragraph alignment="justify" spacingBefore="5">Seam was designed for use with EJB 3.0 and lets you use the new component model everywhere. Since any class in a Seam application can be an EJB component, there is no need to introduce extra unwanted layers just to keep your frameworks happy. And, of course, there is no need to write code to integrate EJB 3.0 with your web framework, since Seam already has it. </p:paragraph>
<p:paragraph alignment="justify" spacingBefore="5">Note that you don't have to use EJB 3.0 to use Seam, and if you're developing in an environment that doesn't support EJB 3.0, Seam provides alternatives. </p:paragraph>
</p:chapter>
</p:document>
The page doesn't throw an error but only shows a blank page. Anyway help would be greatly appreciated. Hopefully I'm on the right track.
W
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079202#4079202
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079202
18Â years, 8Â months
[JBoss Seam] - Re: Problem with Two DataModel
by keuller
Thanks for all tips, but anyone works.
Below is my modified code:
@Name("servicoBean")
| @Scope(ScopeType.EVENT)
| public class ServicoBean
| {
| @Logger
| private Log log;
|
| @DataModel
| private List<Categoria> categorias;
|
| @DataModelSelection("categorias")
| private Categoria categoria;
|
| @DataModel
| private List<Servico> servicos;
|
| @DataModelSelection("servicos")
| private Servico servico;
| ...
| }
I dont change anyXHTML code of "servicos.xhtml" page. The first @DataModel "categoria" works fine and display all data, but second "servicos" does not works again. I use two XHTML pages, the first page called "servicos.xhtml" shows result of "categorias" DataModel object and second page "listServices.xhtml" shows the result of "servicos" DataModel object, but any data is displayed on "listServices.xhtml".
The action code fired by <t:commandLink /> inside <t:dataTable />:
| ..
| public String selecionaCategoria(Categoria categ)
| {
| log.info("Selecionando a categoria..." + categ.getId());
| this.categoria = categ;
| findServicos();
| return "success";
| }
| ...
|
I'm using JBoss EL to call this action method. Here is code of "listServices.xhtml" page:
| ...
| <h:form id="frmServicos">
| <t:dataList var="servico" value="#{servicos}" layout="simple"
| preserveDataModel="false">
| <h:outputText value="#{servico.titulo}" />
| </t:dataList>
| </h:form>
| ...
|
This <t:dataTable /> is empty but there is data in DataModel collection. I have two @Factory objects for each @DataModel object.
Any suggestion ?
Regards.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079195#4079195
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079195
18Â years, 8Â months
[EJB 3.0] - Re: Is it possible to deploy EJB2 style entity beans in a EJ
by jeklund
So.. I've split the project into two jar files project-ejb.jar and project-ejb-entities.jar that are deployed within an .ear.
The EJB version of project-ejb-entities.jar is 2.1. If the EJB version of project-ejb.jar is 2.1 too, everything works fine as before, but if I set the version of project-ejb.jar to 3.0 things start to go wrong..
using project-ejb-entities#bean-name in <ejb-link> elements I get the following
2007-08-29 15:07:48,261 WARN [org.jboss.ejb3.enc.DeploymentEjbResolver] can't find a deployment for path 'project-ejb-entities.jar' of ejb link 'project-ejb-entities.jar#TableProtectData'
2007-08-29 15:07:48,261 WARN [org.jboss.injection.EJBHandler] IGNORING DEPENDENCY: unable to find <ejb-local-ref> of interface org.ejbca.core.ejb.protect.TableProtectDataLocal and ejbLink of project-ejb-entities.jar#TableProtectData in ejb-jar.xml of TableProtectSession it might not be deployed yet
and without specifying the jar
2007-08-29 15:07:48,261 WARN [org.jboss.injection.EJBHandler] IGNORING DEPENDENCY: unable to find <ejb-local-ref> of interface org.ejbca.core.ejb.protect.TableProtectDataLocal and ejbLink of TableProtectData in ejb-jar.xml of TableProtectSession it might not be deployed yet
Using the same environment as before. Any help is greatly appreciated.
/Johan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079194#4079194
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079194
18Â years, 8Â months
[JBoss Seam] - UnsupportedOperationException when using h:selectManyListbox
by wise_guybg
Hi,
I receive an UnsupportedOperationException when I try to call entityManager.merge(exam)
Here is a part of the stack trace:
anonymous wrote : java.util.AbstractList.clear(AbstractList.java:217)
| org.hibernate.type.CollectionType.replaceElements(CollectionType.java:445)
| org.hibernate.type.CollectionType.replace(CollectionType.java:524)
| org.hibernate.type.TypeFactory.replace(TypeFactory.java:482)
| org.hibernate.event.def.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:340)
| org.hibernate.event.def.DefaultMergeEventListener.entityIsPersistent(DefaultMergeEventListener.java:153)
| org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:126)
|
And a part of the JSF code:
<h:selectManyListbox id="providerList" value="#{exam.providerList}" styleClass="field" required="true">
| <s:selectItems value="#{providers}" var="p" label="#{p.name}"/>
| <s:convertEntity />
| </h:selectManyListbox>
Where "providers" is received from a @Factory method and exam.providerList is used with a getter/setter for the property
List<Provider> providerList
of the Exam entity.
I found that setProviderList() is called with an argument of type Arrays$ArrayList which is immutable and does not override AbstractList.remove(). This is the reason for the exception to occur.
I wanted to ask if some has seen the same problem and knows the solution. Maybe there is something else that I'm not doing right.
I have also found a workaround which I consider very ugly. What I did was to make a modification to setProviderList() so that it recognizes Arrays$ArrayList and create a new ArrayList from it.
Any comments? Thanks in advance...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079190#4079190
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079190
18Â years, 8Â months