OutOfMemoryError: unable to create new native thread
Weblogic报错OutOfMemoryError: unable to create new native thread时要修改的配置
使用iReport和Jasperreport开发报表
iReport是报表设计器,它负责设计报表模板,并生成*.jrxml,可以编译生成*.jasper模板文件;Jasperreport是报表产生库,它通过传入模板生成pdf或html格式的报表。
1,下载iReport和Jasperreport,要生成pdf必须要下载itext-2.0.1.jar和中文支持包iTextAsian.jar。我下载的版本是iReport-2.0.0.zip和jasperreports-1.3.4.jar。
配置Tomcat和Eclipse集成调试来代替hot deploy热部署
JVM有一个 Java 平台调试架构( Java Platform Debugger Architecture , JPDA )支持Java程序调试,也就是说DEBUG调试与IDE开发工具无关,可以在eclipse, Intelli-J IDEA,netbeans进行DEBUG调试,JPDA也和应用服务器无关,可以在Weblogic,Jboss,Tomcat里进行DEBUG调试。
DEBUG支持实时代码修正,JPDA 实现了在运行中的应用程序中用经过修改的代码进行替换的能力,允许在调试器会话过程中更改源代码,要使用该功能,只需在编辑器中更改代码并恢复调试。所以,只要在eclipse等IDE里改了源代码并编译,马上就可以应用到运行中环境。在一定程度上,完全可以用eclipse等IDE的debug调试功能来代替应用服务器的hot deploy热部署。当然在某种情况下,hot deploy热部署还是需要的。
Spring transaction事务的roll back回滚机制
之前的Domain Service Owner Transaction Design Pattern已经提到了Spring的事务机制和Spring事务设计, Spring的transaction事务管理应该是Spring应用广泛的最大原因,但是我们中国的Java开发者好像并不知道Spring的事务到底是怎么回事。所以,我转载一段Spring官方参考文档说明Spring的事务回滚机制。
Spring框架的事务基础架构代码将默认地 只 在抛出运行时和unchecked exceptions时才标识事务回滚。 也就是说,当抛出一个 RuntimeException 或其子类例的实例时。(Errors 也一样 - 默认地 - 标识事务回滚。)从事务方法中抛出的Checked exceptions将 不 被标识进行事务回滚。
配置Spring+hibernate使用ehcache作为second-level cache
大量数据流动是web应用性能问题常见的原因,而缓存被广泛的用于优化数据库应用。cache被设计为通过保存从数据库里load的数据来减少应用和数据库之间的数据流动。数据库访问只有当检索的数据不在cache里可用时才必要。hibernate可以用两种不同的对象缓存:first-level cache 和 second-level cache。first-level cache和Session对象关联,而second-level cache是和Session Factory对象关联。
缺省地,hibernate已经使用基于每个事务的first-level cache。Hibernate用first-level cache主要是减少在一个事务内的sql查询数量。例如,如果一个对象在同一个事务内被修改多次,hibernate将只生成一个包括所有修改的UPDATE SQL语句。为了减少数据流动,second-level cache在Session Factory级的不同事务之间保持load的对象,这些对象对整个应用可用,不只是对当前用户正在运行的查询。这样,每次查询将返回已经load在缓存里的对象,避免一个或更多潜在的数据库事务。
How To Get Started Using JNA - 如何用Java调用本地dll或so库
Java Native Access (JNA) is A small set of Java language utilities and conventions for dynamically accessing native libraries (for example, .dll's on Windows or .so's on Solaris) on any supported platform without writing anything but Java code—no JNI or native code is required, and access is dynamic at runtime without code generation.
用Spring和EHCache缓存中间Service的方法结果集
Caching the result of methods using Spring and EHCache
之前知道,在J2ee应用里可以用oscache缓存jsp页面,也可以用ehcache等作为hibernate等ORM缓存方案,为j2ee应用提高性能,减少数据库负荷压力。 而这篇文档Caching the result of methods using Spring and EHCache ,描述了用ehcache和spring ioc来缓存中间Service方法的结果集。这是很妙的想法。
Java垃圾收集调优-Java Garbage Collection Tuning
Introduction
Correctly tuning Java garbage collection is important for high traffic web applications. This document provides some general guidelines as well as links to additional resources.
顶级java/j2ee开发者应具有什么素质?
Javalobby has promoted "What traits do top notch Java/J2EE developers have?" to their main page. While it's geared to drive traffic towards an education/marketing site (offering books on J2EE Q&As), the question is worth asking: what makes J2EE developers "good" J2EE developers?
The traits offered on Javalobby:
- Passion to learn and build quality Java/J2EE Systems. without passion one can not achieve anything.
- Ability to think not only from the technical perspective but also from the business perspective.
- Ability to analyse "What if" scenarios like what if I want to support new products in the future? What if I want to support web clients? etc.
- Ability to look at the big picture (like design concepts, transactional issues, concurrency issues, performance, memory etc) and drill down to details when required to do so.
- Right attitude. Avoid "I know it all" attitude. I have come across some talented Java/J2EE practitioners who hardly listen and believe that they know it all would not like to be corrected.
- Good interpersonal and communication skills.
- Eagerness to learn and keep up with the emerging technologies and frameworks like Spring, Ajax, JSF, Hibernate etc.
未成年人上网可借鉴日本做法
一、提醒孩子上网要有社会责任心,注意自己发送的内容不要有失礼的语言;
二、严格控制孩子的网上信件。有的家长甚至掌握孩子电子信箱的密码;
三、要求孩子不要擅自上网,不要看儿童不宜的内容;
四、学生用学校电脑上网时,老师要在场。在家里,家长最好和孩子一起上网。家长要与孩子商量,在孩子同意的基础上规定上网时间,以免孩子沉迷于网络。
NekoHTML FAQ
- Why are the DOM element names always uppercase?
- Why do I get a hierarchy request error using DOM?
- How do I add filters before the tag balancer?
- How do I parse HTML document fragments?
- How can I get the location of document information?
- Do I have to use all of Xerces2?
- What version of NekoHTML am I using?
一个使用NekoHTML解析html的例子
NekoHTML 可以解析、修整和净化html文档,可以自动关闭标记,修补一些常见的错误,也可以用NekoHTML从html文档里抽取文本。
NekoHTML is a simple HTML scanner and tag balancer that enables application programmers to parse HTML documents and access the information using standard XML interfaces. The parser can scan HTML files and "fix up" many common mistakes that human (and computer) authors make in writing HTML documents. NekoHTML adds missing parent elements; automatically closes elements with optional end tags; and can handle mismatched inline element tags.
NekoHTML is written using the Xerces Native Interface (XNI) that is the foundation of the Xerces2 implementation. This enables you to use the NekoHTML parser with existing XNI tools without modification or rewriting code.
