[Installation, Configuration & Deployment] - JBoss blows mime type
by kuvera
After my servlet is run, JBoss returns an inconsistent and usually bad http response mime type to the browser. Mostly it becomes "application/octet-stream" instead of "application/pdf" which I explicitly set. But not always... This is the output part:
| ServletOutputStream out = res.getOutputStream();
| res.setContentType("application/pdf");
| res.setContentLength((int)outfile.length());
| bis = new BufferedInputStream(new FileInputStream(outfile));
| bos = new BufferedOutputStream(out);
| byte[] buff = new byte[2048];
| int bytesRead;
| while(-1 != (bytesRead = bis.read(buff, 0, buff.length)))
| {
| bos.write(buff, 0, bytesRead);
| }
| bos.flush();
| bos.close();
|
It used to work all the time in standalone Tomcat 5.5. The server-wide web.xml contains the pdf mime type. I don't understand this issue.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4030155#4030155
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4030155
19Â years, 1Â month
[JBoss Messaging] - Failure on queue example running
by gregnewjboss
I've installed JbossAppserver version 4.2.0.CR1 and I've installed jboss-messaging-1.0.1.SP4.
I wanted to test example to see if it was ok.
So I tried QUEUE example but I have an exception :
[root@xxx queue]# ant
Buildfile: build.xml
identify:
[echo] ###########################################################################
[echo] # Running the QUEUE example #
[echo] ###########################################################################
[echo] The queue: testQueue
[echo] The client jar: ../../jboss-messaging-client.jar
sanity-check:
init:
compile:
run:
[java] javax.naming.NoInitialContextException: Can't find property: java.naming.factory.initial
[java] at javax.naming.spi.NamingManager.getInitialContext(java.util.Hashtable) (/lib/ssa/libgcj.so.4.0.0)
[java] at javax.naming.InitialContext.getDefaultInitCtx() (/lib/ssa/libgcj.so.4.0.0)
[java] at javax.naming.InitialContext.getURLOrDefaultInitCtx(java.lang.String) (/lib/ssa/libgcj.so.4.0.0)
[java] at javax.naming.InitialContext.lookup(java.lang.String) (/lib/ssa/libgcj.so.4.0.0)
[java] at org.jboss.example.jms.common.Util.doesDestinationExist(java.lang.String) (Unknown Source)
[java] at org.jboss.example.jms.common.ExampleSupport.setup() (Unknown Source)
[java] at org.jboss.example.jms.common.ExampleSupport.run() (Unknown Source)
[java] at org.jboss.example.jms.queue.QueueExample.main(java.lang.String[]) (Unknown Source)
[java] #####################
[java] ### FAILURE! ###
[java] #####################
BUILD FAILED
file:/opt/jboss/jboss-messaging-1.0.1.SP4/examples/queue/build.xml:79: Java returned: 1
Total time: 1 second
Have you got an idea for solving this problem?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4030148#4030148
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4030148
19Â years, 1Â month