java.awt.color,java.awt.Color错误

I have this simple Jsp page:

Color background = Color.white;

%>

Which fails with following error:

java.lang.NoClassDefFoundError

at _text__jsp._jspService(/text.jsp:3)

at com.caucho.jsp.JavaPage.service(JavaPage.java:75)

at com.caucho.jsp.Page.subservice(Page.java:506)

at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)

at com.caucho.server.http.Invocation.service(Invocation.java:315)

at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)

at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:346)

at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)

at com.caucho.server.TcpConnection.run(TcpConnection.java:139)

at java.lang.Thread.run(Thread.java:534)

I'm running it on Resin 2.1.13.

Any idea what's causing this?

解决方案

Not sure about the issue. I can run your code successfully in my Tomcat. May be this problem is particular to Resin. Or, as said by Dave, may be a headless issue.

Your best bet is to convert the image in some POJO and then spit that to the browser, or may be save it somewhere on the disk and then link it in your JSP. If problem persists, try running in headless mode, as Dave pointed out.

Moreover, its important to understand that JSP is a view technology for the web, and must not do that kind of graphics manipulation.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值