Wednesday 16 April 2014

PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required

"org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac.  A full JDK (not just JRE) is required"

If you receive this error please know that your web Server requires JDK instead of JRE version. 
 I faced this in jetty application.
 Below is the solution for Jetty:

Solution:

  1. Go to "start.d"  folder.
  1. Open "jsp.ini" file.
  1. Uncomment the below yellow highlighted  line.

# JSP Configuration
# To use an non-jdk compiler for JSP compilation uncomment next line
 -Dorg.apache.jasper.compiler.disablejsr199=true


Some how if it comes on Other servers , better you check the java path  ref in that server configuration.
Or
Uninstall all java version and install jdk .


Friday 4 April 2014

Fatal signal 11 (SIGSEGV)


Fatal signal 11 (SIGSEGV)

I faced the same  issue with Bluetooth Socket /Channel close.
After this android app is closing .

Solution Worked for me:
We are trying to close  channel couple of times until it closes properly.

How to find the Duplicate Records in SQL



TO find out the duplicate records in SQL ,

How to find duplicate records:


select field1,field2,field3, count(*)
  from table_name
  group by field1,field2,field3
  having count(*) > 1



How to Delete duplicate Records:






JSON to XML and XML to JSON in JAVA




Best So far for JSON and XML conversions:

As we all know that  now a days we are some how touches the JSON for webapps or standalone applications.

I have requirement where people are asking for JSON to Object and Object to JSON. For this we have lot more easy ways to convert . But for the JSON to XML and vice-versa, we don’t have much options with attribute and XML standards  support.

I found some solutions which need 5-6 jar dependencies and some attribute problems. And XML standard problems. I also fed up with weird tags like  "<e" . Tried and invested couple of hours for better solution and came up with this below one.

This is very simple and easy to understand , for quick reference please check the ref URL .

Finally I am very much satisfied with simple solution like "Staxon".


Very soon I will provide the working example Which I used .

StAXON - JSON via StAX
StAXON lets you read and write JSON using the Java Streaming API for XML (javax.xml.stream). StAXON acts as a door opener for JSON to powerful XML related technologies like
  • XSL transformations (XSLT)
  • XML binding API (JAXB)
  • XML Schema Definition (XSD)
  • XPath, XQuery, ...
Features
  • Support for JAXB and JAX-RS
  • Trigger JSON arrays via XML processing instruction
  • Full XML namespace support
  • Support the JSON Processing API (JSR-353), Jackson and Gson as JSON streaming backends
  • Memory efficient, even for very large documents
Documentation
Check the Getting Started guide first. More documentation is available from the StAXON Wiki.
Downloads
The Downloads page provides Maven instructions and individual download links.