[JNDI/Naming/Network] - JBoss EJB 3 TrailBlazer doesn't seem to work for me
by happytour
Greetings,
I'm starting using EJB 3 with JBoss 4.0.5GA and I deployed the EJB 3 TrailBlazer (EJBTrail.ear). I launced the browser and I went in the Message Driven Beans section. Here I pressed the "Try the message driven calculation" button, I accepted the default values in the Investment calculator windows and I pressed on the Calculate button. I got HTTP 500 saying "javax.naming.NameNotFoundException mdb not bound". This is true since I didn't deploy any queue named mdb. However, the same page is saying:
If the queue does not exist, the JBoss container automatically creates it at deploy time. There is no XML configuration file needed!
So I don't understand wether I have or not to explicitly deploy the queue.
Okay, I deployed the queue with the following service:
<?xml version="1.0" encoding="UTF-8"?>
<depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager
After doing this, I got the following message in the console:
[mdb] Bound to JNDI name: queue/mdb
Now when I repeat the test and I click on the Calculate button, as described previously, I get the message:
Please wait a while, I am checking wether the message has arrived.
But the result is not displayed, meaning that the message didn't arrive. No error message is displayed in the server's console.
Could someone please explain how to get running this nice tutorial ?
Kind regards,
Nicolas
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054482#4054482
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054482
18Â years, 11Â months
[JBossCache] - Re: How could I create a new Region programmatically?
by Sancheski
I think I found the solution, perhaps it is gonna be usefull for someone.
The code below could be used as an example:
| //getting the cache's eviction RegionManager
| RegionManager regionMgr = cache.getEvictionRegionManager();
|
| //Creating your own EvictionConfiguration
| FIFOConfiguration config = new FIFOConfiguration();
| ((FIFOConfiguration) config).setMaxNodes(10);
|
| //New instance of an EvictionPolicy
| FIFOEviction eviction = new FIFOPolicy();
| //Configure eviction policy in the cache instance
| eviction.configure(cache);
| //finally, create the region
| regionMgr.createRegion("/foo/com", eviction, config);
|
|
What I was missing was the eviction configuration in the cache instance (eviction.configure(cache);) so I got a NullPointerException when the Timer threads did periodic node clean up by running the eviction policy.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054479#4054479
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054479
18Â years, 11Â months
[Tomcat, HTTPD, Servlets & JSP] - 3 Extra cr-lf downloading files
by scirob
Hey all, my problem is i am downloading some files via http using Jboss 4.0 and i get 3 extra cr-lf at the end of the files i download (zip, pdf, txt... all the files have 6 extra bytes at the end).
My code is in a jsp:
<%@ page import="java.io.File,
java.io.InputStream,
java.io.FileInputStream,
java.io.OutputStream"%>
<%@ page session="false" %>
<%
String contentType = (String)application.getAttribute("fileupload_type");
String fileName = (String)application.getAttribute("fileupload_name");
String allowCache = "true";
String openDirectly = "false";
if(allowCache == null || allowCache.equalsIgnoreCase("false"))
{
response.setHeader("pragma", "no-cache");
response.setHeader("Cache-control", "no-cache, no-store, must-revalidate");
response.setHeader("Expires", "01 Apr 1995 01:10:10 GMT");
}
if(contentType!=null)
{
response.setContentType(contentType);
}
if(fileName != null)
{
fileName = fileName.substring(fileName.lastIndexOf('\\')+1);
fileName = fileName.substring(fileName.lastIndexOf('/')+1);
StringBuffer contentDisposition = new StringBuffer();
if(openDirectly==null || openDirectly.equalsIgnoreCase("false"))
{
contentDisposition.append("attachment;");
}
contentDisposition.append("filename=\"");
contentDisposition.append(fileName);
contentDisposition.append("\"");
response.setHeader ("Content-Disposition", contentDisposition.toString());
}
byte[] bytes = (byte[])application.getAttribute("fileupload_bytes");
if (bytes != null)
{
response.setContentLength(bytes.length);
response.getOutputStream().write(bytes);
response.getOutputStream().flush();
response.getOutputStream().close();
response.flushBuffer();
%>
Thanks for your help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054473#4054473
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054473
18Â years, 11Â months