[JBoss Seam] - Ajax4JSF mediaOutput tag and Seam
by alexg79
I'm trying to display thumbnails of images I have on the database using a4j:mediaoutput, like this:
<a4j:mediaOutput element="img" mimeType="image/jpeg" createContent="#{download.sendThumbnail}" value="#{screenshot.id}" />
The "download" component looks like this:
| @Name("download")
| @Stateless
| public class DownloadBean implements Download {
|
| @PersistenceContext
| private EntityManager em;
|
| @Override
| public void sendImage(OutputStream os, Object screenshotId) throws IOException {
| Screenshot ss = em.find(Screenshot.class, screenshotId);
| if (ss != null)
| os.write(ss.getImageData());
| }
|
| @Override
| public void sendThumbnail(OutputStream os, Object screenshotId) throws IOException {
| Screenshot ss = em.find(Screenshot.class, screenshotId);
| if (ss != null)
| os.write(ss.getThumbnailData());
| }
|
| }
When loading the page, however, I get the following exception in the server console:
| 00:49:02,174 ERROR [[default]] Servlet.service() for servlet default threw exception
| javax.faces.el.EvaluationException: /entry.xhtml @170,79 createContent="#{download.sendThumbnail}": Target Unreachable, identifier 'download' resolved to null
| at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
| at org.ajax4jsf.framework.resource.UserResource.send(UserResource.java:110)
| at org.ajax4jsf.framework.resource.ResourceLifecycle.send(ResourceLifecycle.java:86)
| at org.ajax4jsf.framework.resource.InternetResourceService.sendResource(InternetResourceService.java:256)
| at org.ajax4jsf.framework.resource.InternetResourceService.serviceResource(InternetResourceService.java:240)
| at org.ajax4jsf.framework.resource.InternetResourceService.serviceResource(InternetResourceService.java:141)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:261)
| 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.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
| 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.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:619)
|
So how can it possibly be null? The "download" component is loaded ok, since it shows up in the Seam component list during deploy.
What am I doing wrong? Could this be a configuration problem?
Using JBoss 4.2.1GA, Seam CVS and Ajax4JSF v1.1.1.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076051#4076051
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076051
18Â years, 9Â months
[JBoss Seam] - Re: selectDate & convertDateTime
by damianharvey
If you are rendering the selectDate via an ajax call (eg. using ajax4jsf) then you will need to do a few javascript hacks.
If this is the case for you then add this bit of Javascript to your page (it's taken from the selectDate javascript that is called when a page is loaded normally
| <script type="text/javascript">
| //<![CDATA[
| //This script block is needed to set Seam Date picker defaults as they don't otherwise get set by AJAX call - only needed on pages where date picker is rendered via AJAX
| var CAL_DAYS_SHORT = 'Su,Mo,Tu,We,Th,Fr,Sa';
| var CAL_DAYS_MEDIUM = 'Sun,Mon,Tue,Wed,Thu,Fri,Sat';
| var CAL_DAYS_LONG = 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday';
| var CAL_MONTHS_MEDIUM = 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec';
| var CAL_MONTHS_LONG = 'January,February,March,April,May,June,July,August,September,October,November,December';
| var CAL_FIRST_DAY_OF_WEEK = 0;
| var CAL_DATE_FORMAT = 'dd/MM/yyyy';
| //]]>
| </script>
|
Cheers,
Damian.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076043#4076043
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076043
18Â years, 9Â months
[JBoss Seam] - Re: Mail examples broken in CVS?
by pete.muirï¼ jboss.org
"lowecg2004" wrote : After reading the Seam reference for 2.0.0.b1 I think I've found some niggles (which you're probably well aware of, but I'll raise them anyway ;)
Probably not ;)
Firstly, your problem deploying the mail example. I can't reproduce this using current CVS and a clean install of JBoss AS 4.2.1.GA. Is this your setup?
anonymous wrote : I believe the deployment instructions for mail-ra.rar need revising since the file mail-ra.rar is no longer part of JBoss 4.2.x - this is implied when the doc states "replacing the default rar with the one distributed with Seam". To resolve, I copied the Seam mail-ra.rar to default/deploy. Is this still correct? Or should I be removing/replacing any other mail files?
Please raise a JIRA issue as I'm going to need to talk to the JBoss AS guys about how they package mail-ra now.
anonymous wrote : The doc refers the reader to http://wiki.jboss.org/wiki/Wiki.jsp?page=InboundJavaMail for more information on mail-ra.rar. The wiki currently does not have any information on this file.
Do you mean the page doesn't work or isn't very clear about what to do?
anonymous wrote : To a vanilla seam-gen project, the Eclipse build path needs updating to add lib/mail.jar and lib/mail-ra.jar (note: JAR and not RAR) - it would be useful to get this from the docs rather than having to work it out.
Please raise a JIRA issue re seam-gen not adding in those files to the eclipse .classpath.
anonymous wrote : The docs states that "Most seam annotations will work inside a MDB but you musn't access the persistence context." - Why is this? Isn't that quite a severe limitation? Can anything be done to get around this?
IIRC this is a limitation of EJB3. You need to inject an SFSB/SLSB into the MDB (or Seam component) and do your persistence work in them.
anonymous wrote : Some very useful information comes to light in this thread:
|
| http://www.jboss.com/index.html?module=bb&op=viewtopic&t=115420
|
| Particularly later on when the OP is talking about ports. I would like to see that in the docs.
Specific information on mail-ra should be on the wiki not in the Seam manual (as its not part of the Seam project at the moment, but part of the JBoss AS project). So please add/edit that wiki page linked above as you see fit :)
anonymous wrote : Finally, the takeaway example needs tweaking before it will build from CVS: the build.xml contains an import to ../../build.xml which should be ../build.xml? Also the references to jboss-el.jar and jbpm-jpdl.jar in application.xml should be relative to lib/. After these changes the example builds but I just get a completely blank page when I run it. It would be great if this sample used the Meldware server.
This example is definitely work in progress which I intend to get back to soon :p
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076042#4076042
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076042
18Â years, 9Â months
[JBoss Tools (users)] - Classpath entry will not be exported or published.
by fabricio.lemos
Just after I create an ear Seam Project, there is a warning saying:
Classpath entry org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeInitializer/JBoss 4.2 runtime will not be exported or published. Runtime ClassNotFoundExceptions may result.
When I try to deploy the project to Jboss 4.2.1, I get
18:20:59,346 INFO [TomcatDeployer] deploy, ctxPath=/Teste8, warUrl=.../deploy/Teste8.war/
18:20:59,783 ERROR [[/Teste8]] Error configuring application listener of class org.jboss.seam.servlet.SeamListener
java.lang.ClassNotFoundException: org.jboss.seam.servlet.SeamListener
I am using Jboss Tools 200708161644-nightly and the strange thing is that previously I was able to create and deploy Seam applications with the same configurations and version.
Is there anything that I have to do by myself?
thanks in advance,
FabrÃcio Lemos
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076041#4076041
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076041
18Â years, 9Â months