Posts

Installing OpenCv 3.0 and Javacv on Raspberry Pi

Preface --------- I had a free raspberry pi's version B lying around and a spare PS3 eye and a few hours in hand { which later extended to days and week :) }. Decided to use Javacv for a quick IP-Cam setup and a simple face recognition(Dint get time to work till now).  Thanks a lot for Samuel Audet for helping out with a lot of issues. https://groups.google.com/forum/#!topic/javacv/Ql1v5THKIcQ Going through the above link you can read all my interactions with Samuel. This is gonna be a pretty lengthy post. Read through if you need to compile a later version if not simply skip to interesting parts and links. Events --------- Step 1 Look for existing tutorial and I did found one,very well explained with steps  http://salaboy.com/2013/06/14/using-javacv-in-the-raspberry-pi-linux-arm/ Went through the steps, installed the opencv version 2.4.  Opencv installation success (!yaay!)  . Developer in me decided I will take a latest version of javac...

Autowiring a static variable using Spring

Yes, This sounds wrong and should never try to do it in a proper design (According to me). With the above disclaimer, Might run into such a case where we need to do this kind of thing, you are at the right blog. There are 2 ways to do it i guess, i have the simple working way jotted here. Lets get started Consider the class @Component public class Foo { private static ObjectA objectA; // Static variable to be used in static method in class @Autowired ObjectA autowiredObjectA; // Orginal bean that is autowired @postConstruct public void init() {   Foo.objectA=this.autowiredObjectA; // So this method is responsible for handing out the bean after                                                                     the class is constructed and autowired by the spring         ...

\r command not found. Cygwin script

You might have faced this error when creating a cygwin script, Even a simple script can replicate this issue #!/bin/sh date who ls ps ax ./deploy.sh ./deploy.sh: line 2: $'date\r': command not found ./deploy.sh: line 3: $'who\r': command not found https://cygwin.com/ml/cygwin-announce/2010-08/msg00015.html This page has the problem in detail.So the solution is #!/bin/sh # ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples (set -o igncr) 2>/dev/null && set -o igncr; # this comment is needed date who ls ps ax This line does the trick. Happy Cygwin scripting :)

Debugging the SSL Issues in Linux

First of all the JVM Needs to start in the Debug mode as many servers report the errors vaguely. It is better to start in Debug mode Add the JVM parameter -Djavax.net.debug=all After that before Even trying to run the transaction try to connect the server with the certificate using openssl openssl s_client -showcerts -connect 10.24.256.69:443 If the certificate is present it shows the last statement as Verify return code: 0 (ok) Check the link below for a more detailed tutorial. http://www.cyberciti.biz/faq/test-ssl-certificates-diagnosis-ssl-certificate/ If for some reason is receiving an error OpenSSL: socket: Connection refused connect:errno=111 It means that the PORT might be wrong in the connection. So we need to find the right port on which https is running. This can be done using nmap So what u do is nmap -sS 10.24.256.69 sample output for above command  Host is up (0.0051s latency). Not shown: 999 closed ports PORT    STATE ...

Maven Eclipse heap Space Issue

Add this under JRe tab in Run configuration in eclipse -Xms1024m -Xmx3000m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled

counts of IllegalAnnotationExceptions @javax.xml.bind.annotation.XmlElement annotation is found on two places; one would be suffice.

So this happen when you annotate the filed this way @XmlElement(name = "Country") private String country; Throws an Error as below @javax.xml.bind.annotation.XmlElement annotation is found on two places; one would be suffice. this problem is related to the following location: at @javax.xml.bind.annotation.XmlElement(nillable=false, name=Country, defaultValue= The easy fix is to move the annotation to the setter method @XmlElement(name = "Country") public void setCountry(String country) { this.country = country; } This Works Fine.

Couldn't store job: Unable to serialize JobDataMap for insertion into database because the value of property 'jobLauncher' is not serializable

This occurs during the quartz - spring-batch integration when we are trying to pass in the JobLauncher object into the quartz class that extens the quartz bean. this can be overcome like below <bean id="fetchTransaction_quartz" class="org.springframework.scheduling.quartz.JobDetailFactoryBean"> <property name="jobClass" value="com.incomm.chase.settlement.quartz.FetchTransaction"> </property>   <property name="jobDataAsMap">       <map>       entry key="timeout" value="5"/>       <entry key="jobName" value="chaseSettlement"></entry>       <!--the entries added here will cause a serialization exception -->           <!--  <entry key="jobLocator" value-ref="jobRegistry"/>            <entry key="jobLauncher" value-ref="jobLauncher"/> -->      </map>  </pro...