Category Archives: Java

java.io.NotSerializableException

I was getting this error today during writing a program java.io.NotSerializableException: com.xxxx.xxx.xxx.thunderhead.Project    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)    at java.util.ArrayList.writeObject(ArrayList.java:570)  

Posted in Java, Troubleshoot | Leave a comment

java.security.InvalidKeyException: Illegal key size or default parameters

I was working on webservice call where my code was breaking in RAD during decrypting the password of keystore. I encountered below error: Caused by: java.security.InvalidKeyException: Illegal key size or default parameters    at javax.crypto.Cipher.a(DashoA13*..) ~[na:1.6]    at javax.crypto.Cipher.a(DashoA13*..) ~[na:1.6]  … Continue reading

Posted in Axis2, Java, Rampart | Tagged , , , | 1 Comment

Caused by: java.security.UnrecoverableKeyException: Cannot recover key

During deployment of my code on server I faced below issue signature issue: org.apache.axis2.AxisFault: Error in signature with X509Token    at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:70)    at org.apache.axis2.engine.Phase.invoke(Phase.java:318)    at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:254)    at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:419)    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165) Caused by: org.apache.rampart.RampartException: Error in signature with X509Token   … Continue reading

Posted in Axis2, Java, Rampart | Tagged , , , | Leave a comment

java.lang.IllegalStateException: Cannot map handler [controller] to URL path : There is already handler

I am using Spring 3.0 for my new application…I am not very familiar with annotation but learning them they are cool.  Today I faced “Cannot Map Handler [XXX] to URL Path” error, while running my page. Later debug I found … Continue reading

Posted in Java, Spring | Tagged , | 1 Comment

How To get ServletContext inside Filter

I was coding last night and I have to get some information from Manifest file in filters. In order to read the Manifest I need the ServletContext. Using below code you can get the ServletContext inside Filter. public class SomeFilter … Continue reading

Posted in HowTo, Java | 1 Comment

XStream: Cannot parse date

I was sending date “06-14-2011” in XML request, during it’s processing i got this parse error Cannot parse date 06-14-2011 com.thoughtworks.xstream.converters.basic.DateConverter.fromString(DateConverter.java:97) this is because Xstream by default don’t handle MM-dd-yyyy format. So we need to add one in order to … Continue reading

Posted in Java, Troubleshoot, xstream | Tagged , | 1 Comment

Mainframe CICS DB2 : java.lang.NoClassDefFoundError: com/ibm/crypto/provider/IBMJCE

I was trying to access Mainframe () DB2 using standalone application with “com.ibm.db2.jcc.DB2Driver” driver where I encountered the below error java.lang.NoClassDefFoundError: com/ibm/crypto/provider/IBMJCE Problem was that ibmjceprovider.jar was missing from my classpath and java.security file I added the jar file and … Continue reading

Posted in Articles, DB2, Java, Troubleshoot | Leave a comment

Java Return Value to Unix Shell Script

Today I faced a situation where I need to verify something though Java class in database . My problem was I have to do this inside unix shell script. I created the below solution to achieve that, I am posting … Continue reading

Posted in HowTo, Java, unix | Leave a comment

DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704

SQLCODE -204 is "object does not exist". I was getting this error while executing a query, this was happening because I was using the SCHEMA name of Q7 database and executing the query inside Q0 db. means not able to … Continue reading

Posted in DB2, Java, Troubleshoot | Leave a comment

When we need HttpSessionBindingListener?

The HttpSessionBindingListener interface is implemented when an object needs to be notified if it's being bound to a session or unbound from a session. Objects implement this interface so that they can be notified when they are being bound or … Continue reading

Posted in HowTo, Java | Leave a comment