Xfire unable to comm. to server under proxy

Log shows xfire.transport.http.HttpChannel Server returned error code = 417 It sounds like xfire added a “Expect 100 continue” in the header once an outgoing proxy is used. (E.g. by java property, -Dhttp.proxyHost=10.1.1.1 -Dhttp.proxyPort=8080) If a reverse proxy server is used, the reverse proxy server may not response to Expect header. Two solutions: For apache as… Read More »

Testing SMTP server

Depends on the SMTP protocol Way to test: 1. For SMTP, Using telnet to send SMTP command and payload to the server 2. For SMTP/tls or SMTPS, require to use openssl s_client ref: https://qmail.jms1.net/test-auth.shtml

EditText has different style for hint

ref.: http://stackoverflow.com/questions/3406534/password-hint-font-in-android/18073897#18073897 Solution android:fontFamily=”sans-serif” From Dialogs Guide Tip: By default, when you set an EditText element to use the “textPassword” input type, the font family is set to monospace, so you should change its font family to “sans-serif” so that both text fields use a matching font style.  

VS2012 useful plugin

Enhanced Scrollbar Middle-Click Scrolling Organize Imports for Visual Basic Custom Document Well Tools Options Support Auto Brace Completion HTML Copy Fix Mixed Tabs Ctrl + Click Go To Definition Align Assignments Move Line Up/Down Commands Column Guides Colorized Parameter Help http://visualstudiogallery.msdn.microsoft.com/3a96a4dc-ba9c-4589-92c5-640e07332afd

Java report system

Opensource Candidate: Jasper Report (http://community.jaspersoft.com/project/jasperreports-library/resources) Dynamic Report (http://www.dynamicreports.org/) Dynamic Jasper (http://dynamicjasper.com/) Comparison Part 1 http://lagivan.blogspot.hk/2011/10/choosing-java-reporting-tool.html Comparison Part 2 http://lagivan.blogspot.hk/2011/11/choosing-java-reporting-tool-part-2.html

Tomcat JMX in linux

Common error /etc/hosts not yet set hostname -i does not match external ip missing -Djava.rmi.server.hostname=50.112.22.47″ Or Use set the JMX listener directly on tomcat ref 1: http://stackoverflow.com/questions/834581/remote-jmx-connection ref 2: http://blog.markshead.com/1129/connecting-visual-vm-to-tomcat-7/

Customize order by in JPQL

Ref : http://stackoverflow.com/questions/9262413/hibernate-dynamic-order For example, if there is a customize ordering in enum or a specific field. We can use “Case when ? else ? end” syntax in order by. (Supported in JPA) SELECT o FROM Cat o ORDER BY CASE o.name WHEN ‘Tom’ THEN 0 ELSE 1 END

JavaMailSenderImpl sample

– By pass cert installation – Require logon – Dump debug message   <bean id=”javaMail” class=”org.springframework.mail.javamail.JavaMailSenderImpl”> <property name=”host” value=”${mail.host}”/> <property name=”port” value=”${mail.port}”/> <property name=”username” value=”${mail.username}”/> <property name=”password” value=”${mail.password}”/> <property name=”javaMailProperties”> <props> <prop key=”mail.smtp.auth”>true</prop> <prop key=”mail.smtp.starttls.enable”>true</prop> <prop key=”mail.smtp.ssl.trust”>*</prop> <prop key=”mail.debug”>true</prop> </props> </property> </bean>