-
1. EMB - done?
andrzejros Sep 27, 2004 10:26 PM (in response to andrzejros)Hey all,
Started looking into JSR-86/Enterprise Media Beans. Is this project still active, and if it is not, where is/was the source located in CVS to take a look?
Thanks,
-D -
2. Re: JBoss EMB docs/examples
andrzejros Sep 28, 2004 9:29 PM (in response to andrzejros)ok, i've found IBM reference implementation and got some questions:
media is added using:MediaEntityLocal imgSamp = mediaEntityHome.create(); imgSamp.setName("image"+System.currentTimeMillis()); imgSamp.setContent(getServletContext().getResourceAsStream("/samples/image1.jpg")); imgSamp.setDescription("kocio"); imgSamp.setMimeType("image/jpeg");
in database record is filled in, image content exists but when:MediaEntityLocal media = mediaEntityHome.findByPrimaryKey(imgId); resp.setContentType(media.getMimeType()); resp.setContentLength((int) media.getSize()); byte[] buffer = new byte[0x10000]; long position = 0; int bytesRead = 0; while ((bytesRead = media.readContent(position, buffer)) != -1) { log("bytes read: " + bytesRead); resp.getOutputStream().write(buffer, 0, bytesRead); position += bytesRead; }
copied from emb spec, serwer throws this:
javax.ejb.EJBException: RuntimeException; CausedByException is:
null
org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:357)
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:514)
org.jboss.ejb.Container.invoke(Container.java:854)
org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:413)
org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:44)
$Proxy102.readContent(Unknown Source)
net.homeunix.andrzejr.web.MediaLoadServlet.doGet(MediaLoadServlet.java:85)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
no content? my database is postgresql 7.4.3 (i've changed DefaultDS to other)
root cause:
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at org.jboss.media.entity.MediaEntity.readContent(MediaEntity.java:542)
at org.jboss.media.entity.MediaEntity.readContent(MediaEntity.java:526)
at sun.reflect.GeneratedMethodAccessor111.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
any ideas? -
3. Re: JBoss EMB docs/examples
andrzejros Sep 28, 2004 9:39 PM (in response to andrzejros)changing db back to hypersonic also causes problem
-
4. Re: JBoss EMB docs/examples
dhartford Sep 29, 2004 10:30 AM (in response to andrzejros)Hi andrzejros,
I'm glad you are tackling your problem with EMB! Unfortunately, I have only been working on some other parts (sporadically and rarely) with EMB and do not have anything in production yet.
Your code does look correct. Only thing might be related to the 'arrayindexoutofbounds' problem could be either the bytearray (if the image is small, maybe set the bytearray size smaller), or there really is a problem in the EMB implementation.
Haven't seen anyone respond back to you, so at least letting you know one person is watching, so don't get discouraged! :-)
-D -
5. Re: JBoss EMB docs/examples
rcbeuker Oct 25, 2004 11:48 AM (in response to andrzejros)I want to use/extend the Media Module to stream Mpeg-4 video to Java clients. Do you know which steps I have to take? How do I get a project (source, paths, libraries etc.)? Are you working on this project at this moment?
Greetings,
Roland Beuker