You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mike Guo <ho...@163.com> on 2015/09/23 20:15:01 UTC

what's the Bootstrap when I use "stream" result type for a picture output

Hi. all.

I got a very strange issues.

I tried to generate dynamic check code by struts2.  so, I used buffered image and javax.imageio for a byteinputstream in my Action.

look like the function work fine. but strange thing is:  every time when I access that dynamic check code action. system will be start a java application “Bootstrap”

please check the picture. also, when quit this Bootstrap java application, and my tomcat is stop running too.



would you please share with me what’s this? and why it running by automatic?





thanks so much


Mike.G


Re: what's the Bootstrap when I use "stream" result type for a picture output

Posted by Mike Guo <ho...@163.com>.
and I think the finally answer is here:

http://www.oracle.com/technetwork/articles/javase/headless-136834.html <http://www.oracle.com/technetwork/articles/javase/headless-136834.html>



just for record.

Mike.G


> 在 2015年9月24日,12:05,Mike Guo <ho...@163.com> 写道:
> 
> ok, finally, I got the solution for this one.  although I don’t know why.
> 
> I just add one java param in here:
> java -Djava.awt.headless=true then it will be gone.
> 
> 
> 
> thanks 
> 
> 
> Mike.G
> 
> 
>> 在 2015年9月24日,12:02,Mike Guo <ho...@163.com> 写道:
>> 
>> ok, I just found it is not related with tomcat or struts.
>> 
>> I just use this code:
>> 
>> 
>> import java.util.Arrays;
>> 
>> import javax.imageio.ImageIO;
>> 
>> public class ListImageFormatters {
>> 
>>   public static void main(String[] args) {
>>       String[] readerFormatNames = ImageIO.getReaderFormatNames();
>>       //[BMP, bmp, jpg, JPG, wbmp, jpeg, png, PNG, JPEG, WBMP, GIF, gif]
>>       System.out.println(Arrays.toString(readerFormatNames));
>> 
>>       //[jpg, BMP, bmp, JPG, jpeg, wbmp, png, JPEG, PNG, WBMP, GIF, gif]
>>       String[] writerFormatNames = ImageIO.getWriterFormatNames();
>>       System.out.println(Arrays.toString(writerFormatNames));
>>   }
>> 
>> }
>> 
>> and it will start the Bootstrap too.
>> 
>> 
>> so, look like it is belong to JDK part. 
>> 
>> but I don’t understand it still. is there anyone can share some tips to me?
>> 
>> 
>> thanks so much
>> 
>> 
>> Mike.G
>> 
>> 
>> 
>> 
>>> 在 2015年9月24日,11:32,Mike Guo <ho...@163.com> 写道:
>>> 
>>> Anyone? Please.  
>>> 
>>> 
>>> 发自我的 iPhone
>>> 
>>>> 在 2015年9月24日,02:15,Mike Guo <ho...@163.com> 写道:
>>>> 
>>>> Hi. all.
>>>> 
>>>> I got a very strange issues.
>>>> 
>>>> I tried to generate dynamic check code by struts2.  so, I used buffered image and javax.imageio for a byteinputstream in my Action.
>>>> 
>>>> look like the function work fine. but strange thing is:  every time when I access that dynamic check code action. system will be start a java application “Bootstrap”
>>>> 
>>>> please check the picture. also, when quit this Bootstrap java application, and my tomcat is stop running too.
>>>> 
>>>> 
>>>> 
>>>> would you please share with me what’s this? and why it running by automatic?
>>>> 
>>>> <屏幕快照 2015-09-24 02.13.46.png>
>>>> 
>>>> 
>>>> 
>>>> thanks so much
>>>> 
>>>> 
>>>> Mike.G
>>>> 
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>> 
>> 
> 


Re: what's the Bootstrap when I use "stream" result type for a picture output

Posted by Mike Guo <ho...@163.com>.
ok, finally, I got the solution for this one.  although I don’t know why.

I just add one java param in here:
java -Djava.awt.headless=true then it will be gone.



thanks 


Mike.G


> 在 2015年9月24日,12:02,Mike Guo <ho...@163.com> 写道:
> 
> ok, I just found it is not related with tomcat or struts.
> 
> I just use this code:
> 
> 
> import java.util.Arrays;
> 
> import javax.imageio.ImageIO;
> 
> public class ListImageFormatters {
> 
>    public static void main(String[] args) {
>        String[] readerFormatNames = ImageIO.getReaderFormatNames();
>        //[BMP, bmp, jpg, JPG, wbmp, jpeg, png, PNG, JPEG, WBMP, GIF, gif]
>        System.out.println(Arrays.toString(readerFormatNames));
> 
>        //[jpg, BMP, bmp, JPG, jpeg, wbmp, png, JPEG, PNG, WBMP, GIF, gif]
>        String[] writerFormatNames = ImageIO.getWriterFormatNames();
>        System.out.println(Arrays.toString(writerFormatNames));
>    }
> 
> }
> 
> and it will start the Bootstrap too.
> 
> 
> so, look like it is belong to JDK part. 
> 
> but I don’t understand it still. is there anyone can share some tips to me?
> 
> 
> thanks so much
> 
> 
> Mike.G
> 
> 
> 
> 
>> 在 2015年9月24日,11:32,Mike Guo <ho...@163.com> 写道:
>> 
>> Anyone? Please.  
>> 
>> 
>> 发自我的 iPhone
>> 
>>> 在 2015年9月24日,02:15,Mike Guo <ho...@163.com> 写道:
>>> 
>>> Hi. all.
>>> 
>>> I got a very strange issues.
>>> 
>>> I tried to generate dynamic check code by struts2.  so, I used buffered image and javax.imageio for a byteinputstream in my Action.
>>> 
>>> look like the function work fine. but strange thing is:  every time when I access that dynamic check code action. system will be start a java application “Bootstrap”
>>> 
>>> please check the picture. also, when quit this Bootstrap java application, and my tomcat is stop running too.
>>> 
>>> 
>>> 
>>> would you please share with me what’s this? and why it running by automatic?
>>> 
>>> <屏幕快照 2015-09-24 02.13.46.png>
>>> 
>>> 
>>> 
>>> thanks so much
>>> 
>>> 
>>> Mike.G
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
> 


Re: what's the Bootstrap when I use "stream" result type for a picture output

Posted by Mike Guo <ho...@163.com>.
ok, I just found it is not related with tomcat or struts.

I just use this code:


import java.util.Arrays;
  
import javax.imageio.ImageIO;
  
public class ListImageFormatters {
  
    public static void main(String[] args) {
        String[] readerFormatNames = ImageIO.getReaderFormatNames();
        //[BMP, bmp, jpg, JPG, wbmp, jpeg, png, PNG, JPEG, WBMP, GIF, gif]
        System.out.println(Arrays.toString(readerFormatNames));
  
        //[jpg, BMP, bmp, JPG, jpeg, wbmp, png, JPEG, PNG, WBMP, GIF, gif]
        String[] writerFormatNames = ImageIO.getWriterFormatNames();
        System.out.println(Arrays.toString(writerFormatNames));
    }
  
}

and it will start the Bootstrap too.


so, look like it is belong to JDK part. 

but I don’t understand it still. is there anyone can share some tips to me?


thanks so much


Mike.G




> 在 2015年9月24日,11:32,Mike Guo <ho...@163.com> 写道:
> 
> Anyone? Please.  
> 
> 
> 发自我的 iPhone
> 
>> 在 2015年9月24日,02:15,Mike Guo <ho...@163.com> 写道:
>> 
>> Hi. all.
>> 
>> I got a very strange issues.
>> 
>> I tried to generate dynamic check code by struts2.  so, I used buffered image and javax.imageio for a byteinputstream in my Action.
>> 
>> look like the function work fine. but strange thing is:  every time when I access that dynamic check code action. system will be start a java application “Bootstrap”
>> 
>> please check the picture. also, when quit this Bootstrap java application, and my tomcat is stop running too.
>> 
>> 
>> 
>> would you please share with me what’s this? and why it running by automatic?
>> 
>> <屏幕快照 2015-09-24 02.13.46.png>
>> 
>> 
>> 
>> thanks so much
>> 
>> 
>> Mike.G
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


Re: what's the Bootstrap when I use "stream" result type for a picture output

Posted by Mike Guo <ho...@163.com>.
Anyone? Please.  


发自我的 iPhone

> 在 2015年9月24日,02:15,Mike Guo <ho...@163.com> 写道:
> 
> Hi. all.
> 
> I got a very strange issues.
> 
> I tried to generate dynamic check code by struts2.  so, I used buffered image and javax.imageio for a byteinputstream in my Action.
> 
> look like the function work fine. but strange thing is:  every time when I access that dynamic check code action. system will be start a java application “Bootstrap”
> 
> please check the picture. also, when quit this Bootstrap java application, and my tomcat is stop running too.
> 
> 
> 
> would you please share with me what’s this? and why it running by automatic?
> 
> <屏幕快照 2015-09-24 02.13.46.png>
> 
> 
> 
> thanks so much
> 
> 
> Mike.G
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: what's the Bootstrap when I use "stream" result type for a picture output

Posted by Mike Guo <ho...@163.com>.
hi, thanks for your response. 

I got this solved . here’s the article  I searched, it can explain why and how about this thing.

http://www.oracle.com/technetwork/articles/javase/headless-136834.html <http://www.oracle.com/technetwork/articles/javase/headless-136834.html>


thanks again


Mike.G


> 在 2015年9月24日,15:37,Christoph Nenning <Ch...@lex-com.net> 写道:
> 
>> Hi. all.
>> 
>> I got a very strange issues.
>> 
>> I tried to generate dynamic check code by struts2.  so, I used 
>> buffered image and javax.imageio for a byteinputstream in my Action.
>> 
>> look like the function work fine. but strange thing is:  every time 
>> when I access that dynamic check code action. system will be start a
>> java application “Bootstrap”
>> 
>> please check the picture. also, when quit this Bootstrap java 
>> application, and my tomcat is stop running too.
>> 
>> would you please share with me what’s this? and why it running by 
> automatic?
>> 
>> [Image removed] 
>> 
>> thanks so much
>> 
>> Mike.G
> 
> 
> well, this question was cross-posted on tomcat-user list and there were 
> some responses on that list.
> 
> 
> This Email was scanned by Sophos Anti Virus


Re: what's the Bootstrap when I use "stream" result type for a picture output

Posted by Christoph Nenning <Ch...@lex-com.net>.
> Hi. all.
> 
> I got a very strange issues.
> 
> I tried to generate dynamic check code by struts2.  so, I used 
> buffered image and javax.imageio for a byteinputstream in my Action.
> 
> look like the function work fine. but strange thing is:  every time 
> when I access that dynamic check code action. system will be start a
> java application “Bootstrap”
> 
> please check the picture. also, when quit this Bootstrap java 
> application, and my tomcat is stop running too.
> 
> would you please share with me what’s this? and why it running by 
automatic?
> 
> [Image removed] 
> 
> thanks so much
> 
> Mike.G


well, this question was cross-posted on tomcat-user list and there were 
some responses on that list.


This Email was scanned by Sophos Anti Virus