If you see this error in your logs, it just means that your JDK has not been able to locate the trustStore.

Fix this in your user profile (JDK fix)

Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
	at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:183)
	at java.security.cert.PKIXParameters.(PKIXParameters.java:103)
	at java.security.cert.PKIXBuilderParameters.(PKIXBuilderParameters.java:87)
	at sun.security.validator.PKIXValidator.(PKIXValidator.java:55)

You can verify this by typing this into console (command prompt in windows)

C:\>keytool -list
keytool error: java.lang.Exception: Keystore file does not exist: C:\Users\John.Doe\.keystore

A simple fix for this can be to copy your default keystore supplied by java into your profile.

C:\>copy %JAVA_HOME%\jre\lib\security\cacerts %USERPROFILE%\.keystore
1 file(s) copied.

This should put a default keystore into your profile, which you can play around with.

This by no means is the solution you should be using in server environments. There you are various ways to handle this at server level.

See below links for more info.

http://docs.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html#Features

http://www.herongyang.com/PKI/HTTPS-Java-Programs-Communicate-with-HTTPS-Server.html

http://www.oracle.com/technetwork/java/javase/tech/index-jsp-136007.html

Fix this for a java application (e.g. Application Server like JBoss)

Set the trust store location and password on the java executable using JVM arguments.

Arguments:

-Djavax.net.ssl.trustStore=<TRUST_STORE_LOCATION>
-Djavax.net.ssl.trustStorePassword=<TRUST_STORE_PASSWORD> (default is 'changeit')

You can do this for Jboss by adding as similar instruction mentioned below to your /bin/run.bat

After placing my keystore in \server\\conf, I added this line to my run.bat.

set "JAVA_OPTS=%JAVA_OPTS% -Djavax.net.ssl.trustStore=%JBOSS_HOME%\server\<JBOSS_PROFILE>\conf\.keystore -Djavax.net.ssl.trustStorePassword=changeit"
Tagged with:
 

Deploy to Artifactory (remote repository) using Maven

On December 3, 2012, in java, maven, by Kishore Chintoju

Overview

Deploy to artifactory using maven.

Configuration

Add your repository server configuration to maven settings.xml

This needs to be done only once. If the repository is already configured in your user settings.xml, skip this step.

Add below configuration to your settings.xml

Below configuration can be obtained from your artifactory

<server>
  <id>{repo-id}</id>
  <username>{repo-username}</username>
  <password>{password/encrypted password}</password>
</server>

More info here

Add maven-deploy-plugin to your pom

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-deploy-plugin</artifactId>
  <version>2.7</version>
</plugin>

More info http://maven.apache.org/plugins/maven-deploy-plugin/plugin-info.html

Add remote (artifactory) repository to your POM

<distributionManagement>
  <repository>
    <id>{repo-id}</id>
    <name>{repo-id}</name>
    <url>http://{repo-host-name}/artifactory/{repo-url}</url>
  </repository>
</distributionManagement>

More info at

Deploy Using Maven

Running below command would deploy it to the default repository

1.mvn deploy

In case of multiple repositories in pom, specify repository id.

1.mvn deploy -DrepositoryId

More info at http://maven.apache.org/plugins/maven-deploy-plugin/usage.html

Tagged with:
 

We were able to complete this telugu copy of Saibaba 9 Thursday’s Vratam due to the grace of baba during our vrat. This book is a result of a huge effort from my wife.

Please download/read/correct/distribute as you see fit.

Tagged with:
 

Stop two words from combining in telugu font

On May 3, 2012, in fun, web development, by Kishore Chintoju

Sometimes in Telugu font if you put two words next to each other without a space they combine.
e.g. మహేష్ + తొ = మహేష్తొ
But what we want is మహేష్​తొ

In such cases use a zero width space or invisible space in my words to stop them from combining.

  1. Type మహేష్
  2. Type zero width space using “Alt+8023″ for MS word and unicode &#8023; for web
  3. Then type తొ

This trick even works in word.

Tagged with:
 

LinkageError in server logs due to duplicate xml api jars

On April 5, 2012, in java, jboss, maven, by Kishore Chintoju

Ever seen this  linkage error. This is caused by various reasons of duplicate jars containing xml-apis.

I had this issue when I included Apache POI jars (poi-ooxml-schemas) which in turn included stax-api jars (geronimo-stax-api_1.0_spec.jar, stax-api.jar) and xml-api’s (xml-api.jar, xmlbeans.jar).

Excluding them from your dependency would solve the issue.

Exclude Example

<exclusions>
	<exclusion>
		<artifactId>stax-api</artifactId>
		<groupId>stax</groupId>
	</exclusion>
	<exclusion>
		<artifactId>geronimo-stax-api_1.0_spec</artifactId>
		<groupId>org.apache.geronimo.specs</groupId>
	</exclusion>
	<exclusion>
		<artifactId>xml-apis</artifactId>
		<groupId>xml-apis</groupId>
	</exclusion>
	<exclusion>
		<artifactId>dom4j</artifactId>
		<groupId>dom4j</groupId>
	</exclusion>
</exclusions>

LinkageError Stack Trace

java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "com.sun.xml.bind.DatatypeConverterImpl.parseQName(Ljava/lang/String;Ljavax/xml/namespace/NamespaceContext;)Ljavax/xml/namespace/QName;" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, com/sun/xml/bind/DatatypeConverterImpl, and the class loader (instance of ) for interface javax/xml/bind/DatatypeConverterInterface have different Class objects for the type javax/xml/namespace/QName used in the signature
	at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:227)
	at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:84)
	at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:66)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:214)
	at javax.xml.bind.ContextFinder.find(ContextFinder.java:375)
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
	at org.jboss.ws.core.jaxws.CustomizableJAXBContextFactory.createContext(CustomizableJAXBContextFactory.java:90)
	at org.jboss.ws.core.jaxws.JAXBDeserializer.getJAXBContext(JAXBDeserializer.java:96)
	at org.jboss.ws.core.jaxws.JAXBDeserializer.deserialize(JAXBDeserializer.java:66)
	at org.jboss.ws.core.binding.DeserializerSupport.deserialize(DeserializerSupport.java:61)
	at org.jboss.ws.core.soap.XMLContent.unmarshallObjectContents(XMLContent.java:179)
	at org.jboss.ws.core.soap.XMLContent.transitionTo(XMLContent.java:96)
	at org.jboss.ws.core.soap.SOAPContentElement.transitionTo(SOAPContentElement.java:140)
	at org.jboss.ws.core.soap.SOAPBodyElementDoc.transitionTo(SOAPBodyElementDoc.java:85)
	at org.jboss.ws.core.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:172)
	at org.jboss.ws.core.EndpointInvocation.transformPayloadValue(EndpointInvocation.java:273)
	at org.jboss.ws.core.EndpointInvocation.getRequestParamValue(EndpointInvocation.java:115)
	at org.jboss.ws.core.EndpointInvocation.getRequestPayload(EndpointInvocation.java:135)
	at org.jboss.ws.core.server.DelegatingInvocation.getArgs(DelegatingInvocation.java:80)
	at org.jboss.wsf.container.jboss50.invocation.InvocationHandlerEJB3.invoke(InvocationHandlerEJB3.java:93)
	at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:221)
	at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:468)
	at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:293)
	at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:203)
	at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:129)
	at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:85)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
	at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
	at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:662)
Tagged with:
 

I have decided to write some of the devotional text we learn in Telugu font so it is available for wider audience and can be read on any screens (Mobile/Table/PC) screens on any resolution on can be printed nicely as well. Coming from a background of Telugu medium, it does feel nice to be able to write in Telugu again. Let’s keep Telugu alive and well.


Sri Rama Rama Rameti Mantra on occasion of  Sri Rama Navami.

శ్రీ రామ రామ రామేతి
రమే రామే మనోరమే
సహస్రనామ తత్ తుల్యం
రామ నామ వరాననే

See this video for details on how it is to be pronounced.

Tagged with:
 

Sleepout in sydney’s centennial park

On September 21, 2011, in Uncategorized, by Kishore Chintoju

Let’s sleepout in Centennial Park, Sydney in support of homeless.

Visit hrxsleepout.com.au for more info and to register for the event.

And you don’t have to attend to support the cause, donate here http://hrxsleepout.gofundraise.com.au/page/team-peace

Tagged with:
 

Beware of this EMail/SMS scam as responses to any ads on classifieds/forums. I just got this scam email in response to an ad on the Gumtree.

Continue reading »

Tagged with:
 

Microsoft just suggested that the best editor for a Java file is Microsoft Visual Studio .. :)

It even implied that it’s actually a J# file.. take that for skewed view of the world.

http://shell.windows.com/fileassoc/0409/xml/redir.asp?EXT=java


Microsoft suggesting visual studio as an editor for a Java file

 

Evaluate an EL expression

On February 8, 2011, in java, by Kishore Chintoju

Once you start using EL heavily within your UI, eventually you will want to use it/evaluate it back in your EJB’s and Seam/Spring components

There are three steps to evaluating an EL expression.

//get current EL context
javax.el.ELContext elContext = javax.faces.context.FacesContext.getCurrentInstance().getELContext();

//get the expression factory (for seam). You can probably do ExpressionFactory.newInstance() if not using seam .
javax.el.ExpressionFactory expressionFactory = org.jboss.seam.core.Expressions.instance().getExpressionFactory();

//Create value expression as the EL I'm evaluating is a value e.g. #{bean.property} . Create MethodExpression if the EL is a method e.g. #{bean.method()}
javax.el.ValueExpression valueExpression = expressionFactory.createValueExpression(elContext, elExpressionYouAreEvaluating, WhateverYouAreExpecting.class);

// get value and dont' forget to cast.
whateverYouAreExpecting = (WhateverYouAreExpecting) valueExpression.getValue(elContext);

Yup.. that’s how convulted this is . It should more be like below

//NOTE: imaginary code
Object value = ExpressionFactory.getValue("#{bean.property}");

That’s what these guys are asking as well..

Tagged with: