Thursday, February 23, 2012 4:39

‘Java’ News

Subscribe to RSS feed

Convert e.printStackTrace() to string

Tuesday, October 25, 2011 23:11

When catching Java exceptions, we usually want to print the stack trace.  Sometimes we also want the detailed message to be used in business related logic. e.g. sending the detailed exception message by email. So we need to convert the result of e.printStackTrace() to string: private static String getStackTrace(Exception e) { StringWriter stringWriter= ...

Nginx configuration – nginx.conf

Tuesday, August 10, 2010 19:52

server { listen 80; server_name nginx.org www.nginx.org; root /data/www; location / { ...

Tagged with:

Resin – java.lang.NoClassDefFoundError: javax/xml/ws/WebServiceRef

Tuesday, August 10, 2010 11:33

Error -  java.lang.NoClassDefFoundError: javax/xml/ws/WebServiceRef was thrown when running my web application on myeclipse based on Resin 3.1. It is due to a MyEclipse (I am using My Eclipse 5.5.0 GA) defect. http://www.myeclipseide.com/index.php?name=PNphpBB2&file=viewtopic&t=21403&start=0&postdays=0&postorder=asc&highlight= Workaround:  add them under the jar files under lib folder in the boot configuration of Resin in MyEclipse. Also there is ...

Tagged with:

Resin ArrayIndexOutOfBoundsException Tiles

Tuesday, August 10, 2010 11:29

There was error thrown when accessing Java web application using Tiles in Resin environment. We came across java.lang.ArrayIndexOutOfBoundsException when using Resin 4.0.8.   The root cause is a defect from Resin 4.0.8.  (http://bugs.caucho.com/view.php?id=4104) . The solution is upgrade the Resin to version 4.0.9

Tagged with:

java.lang.NoClassDefFoundError: com/sun/activation/registries/LogSupport

Sunday, August 8, 2010 12:17

I came across this issue when executing one unit test. From the log info, it seems that this class is not found in activation.jar.  Yes, this class is not there. But the root cause is -  the reference of javaee.jar in myeclipse.   After removing the reference to JavaEE 5 package ...

RSA DER Key generated by Java

Monday, August 2, 2010 12:56

We can use the normal java way to generate RSA key. (for security reason, we'd better  generate 2048 bytes RSA key) But the problem is the most popular way to store RSA key is keeping them as DER format. You can get some detailed info below: http://www.cryptosys.net/pki/rsakeyformats.html Also if you want the java code ...

Tagged with:

Eclipse SVN Error

Wednesday, May 5, 2010 20:41

Error message: commit -m "commit message." files RA layer request failed svn: Commit failed (details follow): svn: PROPFIND request failed on '/repo/path/!svn/vcc/default' svn: PROPFIND of '/repo/path/!svn/vcc/default': Could not read status line: connection was closed by server. (http://example.com) How to fix? Looking at my SVN configurations I could only find the JavaHL option, no SVNKit available.

Tagged with:

Install Apache Tomcat 5.5 and IIS 6.0 with JK

Tuesday, March 23, 2010 15:57

System Requirements For this installation I used the following: Windows Server 2003 Enterprise Edition Internet Information Services (IIS) 6.0 Sun Java Runtime JRE 5.0 Update 2 Apache Jakarta Tomcat version 5.5.9 The JK Tomcat Web Server Connectors 1. Install the JDK and Tomcat and set the environment variable. 2. Configure JK Download JK from http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.14/isapi_redirect-1.2.14.exe Setup the file. (It’s better that ...

PowerDesigner Reverse Engineer

Friday, February 5, 2010 13:34

Get the Physical Data Model 1. Menu Operation File, Reverse Engineer , Database, New Phycial Data Model 2. Connection Add a connect to the target database 3. Choose tables to generate the models Generate the Java Code 1. Menu Operation Tools , Generate Object-Oriented Model, Detail, O/R Mapping, Enable Transformations, Extended Model Definitions, O/R Mapping,      Hibernate To be continued.

Tagged with: ,