Monday, September 26, 2016

Setup Directory Path for Android Job in Jenkins using Gradle Wrapper

Problem

In one of the Android project the gradlew file was not in the root directory path of the project


Solution

In the Gradle Wrapper set the following attributes:

Root Build Script: ${workspace}/<dir_name>/
From Root Build Script Dir: Check this value




Wednesday, February 22, 2012

Message: An invalid XML character (Unicode: 0xb) was found in the CDATA section.

Once again the XML parsing failed due to a control character (^K)

A simple way to fix in unix was to use the following command and remove such characters from the file

perl -p -i -e 's/[\x00-\x08\x0b-\x0c\x0e-\x1f\x7f]//g' <xmlfile.xml>

Tuesday, January 03, 2012

Message: The entity "nbsp" was referenced, but not declared.

While parsing an XML using Stax I encountered this error.

Even though the data was inside CDATA tags it was still giving this error which was puzzling. On further analysis I found out that Control Characters (^M) was causing this problem.

To fix it in Unix/Linux, just remove control characters and I found this nifty command to do it:
tr -d "\r" < inputfile > outputfile

Sunday, August 07, 2011

vesamenu.c32: Not a COM32R image

This was the error message which came on booting Mint 11 Live CD on a new machine.  The bootable CD was created using Ubuntu 'Startup Disk Creator'. After googling I found the solution was to type live at the prompt

boot: live

Source: http://www.linuxquestions.org/questions/linux-mint-84/trying-to-boot-linux-mint-9-from-usb-flash-drive-vesamenu-c32-not-a-com32r-image-829397/

Thursday, July 14, 2011

javax.naming.NameNotFoundException: No object bound to name java:comp/env/jdbc/xxxx

While adding a new JDBC JNDI lookup in the application, I encountered the following exception on Glassfish 2.1.1.
Caused by: javax.naming.NameNotFoundException: No object bound to name java:comp/env/jdbc/xxxx
at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:856)
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:173)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:407)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201)
at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 104 more


Solution:
For Glassfish 2.1.1 add the following in the web.xml file



        jdbc/xxx
        javax.sql.DataSource
        Container
        Shareable

Thursday, March 10, 2011

JQuery UI Autocomplete with Stripes

While trying to integrate JQuery UI Autocomplete problem, the autocomplete was working with static JavaScript method but not working with values sent from the server.

Now the new JQueryUI expects JSON instead of the deprecated version which expected Strings separated by new line character. Even when I was sending JSON data, the values were not displayed at all.

The problem was that I was using ' to quote the strings instead of "

Friday, February 04, 2011

attempted to return null from a method with a primitive return type (void).


Problem:
I was encoutering this excpetion while inserting a row in the database using myBatis 3. 

Solution:
I had forgotton to change my mapper file xml tag from <select> to <insert>.

org.apache.ibatis.binding.BindingException: Mapper method 'xxx' (interface in.xx.xxxx..xxxDAO) attempted to return null from a method with a primitive return type (void).
 org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:40)
 $Proxy34.XXXX(Unknown Source)
 xxx.xxx.XXXXServiceImpl.save(XXXServiceImpl.java:94)
 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 java.lang.reflect.Method.invoke(Method.java:597)
 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
 org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
 org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopP