Thursday, December 13, 2012
Negative seek offset error / Checksum validation fails
Negative seek offset error / Checksum validation fails
If you face any of these issue , while using nexus with tomcat. Do not doubt the nexus, whose all versions are stable and works fine.
This is the issue with Tomcat. I faced this issue when i use tomcat apache-tomcat-7.0.28 with nexus.
I changed the nexus version from 1.9.2 to 2.3 and tried. Faced similar issue. and changed the tomcat to apache-tomcat-7.0.23 in which it works fine.
apache-tomcat-7.0.28 might have implemented new security mechanism. I didn't care about tomcat versions . I go with tomcat-7.0.23. If you know the reason , update it. It might help others.
--
Thank you.
Regards,
Kaleeswaran.S
If you face any of these issue , while using nexus with tomcat. Do not doubt the nexus, whose all versions are stable and works fine.
This is the issue with Tomcat. I faced this issue when i use tomcat apache-tomcat-7.0.28 with nexus.
I changed the nexus version from 1.9.2 to 2.3 and tried. Faced similar issue. and changed the tomcat to apache-tomcat-7.0.23 in which it works fine.
apache-tomcat-7.0.28 might have implemented new security mechanism. I didn't care about tomcat versions . I go with tomcat-7.0.23. If you know the reason , update it. It might help others.
--
Thank you.
Regards,
Kaleeswaran.S
Thursday, November 29, 2012
Plist File Parsing Using Java
Plist File Parsing Using Java
Below example illustrates , how to iterate over a plist file Nodes using apache's XMLPropertyListConfiguration
public void infoPlistConversion(String plistPath) throws Exception {
XMLPropertyListConfiguration conf = new XMLPropertyListConfiguration(plistPath);
System.out.println("root node children size => "+ conf.getRootNode().getChildrenCount());
System.out.println("conf root => " + conf.getRootNode().getChild(0).getName());
System.out.println("conf.getRoot().getChild(0).getValue() => " + conf.getRootNode().getChild(0).getValue());
List children = conf.getRoot().getChildren();
printChildrenValue(children);
}
private void printChildrenValue(List children) {
if (children instanceof List) {
List<PListNode> configs = (List<PListNode>) children;
for (PListNode pListNode : configs) {
// sub nodes
if (pListNode.getValue() == null && pListNode.getChildrenCount() > 1) {
List pListNodeChildren = pListNode.getChildren();
System.out.println("-------------------------------------------------");
System.out.println("plist Name root => "+ pListNode.getName());
printChildrenValue(pListNodeChildren);
// just print values
} else {
// if it is ConfigParam and elements are not null
System.out.println("plist Name => "+ pListNode.getName());
System.out.println("plist Value => "+ pListNode.getValue());
}
}
}
}
--
Thank you.
Regards,
Kaleeswaran.S
Below example illustrates , how to iterate over a plist file Nodes using apache's XMLPropertyListConfiguration
public void infoPlistConversion(String plistPath) throws Exception {
XMLPropertyListConfiguration conf = new XMLPropertyListConfiguration(plistPath);
System.out.println("root node children size => "+ conf.getRootNode().getChildrenCount());
System.out.println("conf root => " + conf.getRootNode().getChild(0).getName());
System.out.println("conf.getRoot().getChild(0).getValue() => " + conf.getRootNode().getChild(0).getValue());
List children = conf.getRoot().getChildren();
printChildrenValue(children);
}
private void printChildrenValue(List children) {
if (children instanceof List) {
List<PListNode> configs = (List<PListNode>) children;
for (PListNode pListNode : configs) {
// sub nodes
if (pListNode.getValue() == null && pListNode.getChildrenCount() > 1) {
List pListNodeChildren = pListNode.getChildren();
System.out.println("-------------------------------------------------");
System.out.println("plist Name root => "+ pListNode.getName());
printChildrenValue(pListNodeChildren);
// just print values
} else {
// if it is ConfigParam and elements are not null
System.out.println("plist Name => "+ pListNode.getName());
System.out.println("plist Value => "+ pListNode.getValue());
}
}
}
}
--
Thank you.
Regards,
Kaleeswaran.S
Monday, October 29, 2012
Tomcat Maven Plugin Remote Debugging using Eclipse
I am developing a maven based web application. i am running the application with tomcat maven plugin like
mvn tomcat:run
I want to debug the application from eclipse.
Thank you.
Regards,
Kaleeswaran.S
mvn tomcat:run
I want to debug the application from eclipse.
Step 1:
export MAVEN_OPTS="-Xmx512M -XX:MaxPermSize=512m" which allocates 512 MB of memory.
Step 2:
export MAVEN_OPTS="-agentlib:jdwp=transport=dt_socket,address=2480,server=y,suspend=n"
Step 3:
run the application like mvn tomcat:run
step 4:
connect to port 2480 in eclipse remote debugging.
Enjoy. Happy Debugging.
-- Thank you.
Regards,
Kaleeswaran.S
Thursday, August 16, 2012
Jdom CRUD Operations
Hi,
Jdom CRUD Operations
Here is sample code to do some operations like
//Adding elements
public void addElementAtXpath() {
try {
XPath xpath = XPath.newInstance("publishers");
xpath.addNamespace(root_.getNamespace());
Element publisherNode = (Element) xpath.selectSingleNode(root_);
org.jdom.Element element = new Element("kalees");
element.addContent(createElement(CI_FILE_RELEASE_OVERRIDE_AUTH_NODE, TRUE));
publisherNode.addContent(element);
} catch (Exception e) {
e.printStackTrace();
}
}
// Changing attributes
public void changeAttributeValue() {
try {
XPath xpath = XPath.newInstance("scm");
xpath.addNamespace(root_.getNamespace());
Element scmNode = (Element) xpath.selectSingleNode(root_);
scmNode.setAttribute("class", "Kalees");
} catch (Exception e) {
e.printStackTrace();
}
}
//Deleting Elements
public void deleteElementAtXpath() {
//deleting a node...
// deleting content of a node
//triggerNode.removeContent();
try {
String childName = "hudson.plugins.emailext.ExtendedEmailPublisher";
XPath xpath = XPath.newInstance("publishers");
xpath.addNamespace(root_.getNamespace());
Element triggerNode = (Element) xpath.selectSingleNode(root_); // if it is null then element is not present
triggerNode.removeChild(childName);
} catch (Exception e) {
e.printStackTrace();
}
}
public static Element createElement(String nodeName, String NodeValue) {
org.jdom.Element element = new Element(nodeName);
if (NodeValue != null) {
element.addContent(NodeValue);
}
return element;
}
--
Thank you.
Regards,
Kaleeswaran.S
Jdom CRUD Operations
Here is sample code to do some operations like
//Adding elements
public void addElementAtXpath() {
try {
XPath xpath = XPath.newInstance("publishers");
xpath.addNamespace(root_.getNamespace());
Element publisherNode = (Element) xpath.selectSingleNode(root_);
org.jdom.Element element = new Element("kalees");
element.addContent(createElement(CI_FILE_RELEASE_OVERRIDE_AUTH_NODE, TRUE));
publisherNode.addContent(element);
} catch (Exception e) {
e.printStackTrace();
}
}
// Changing attributes
public void changeAttributeValue() {
try {
XPath xpath = XPath.newInstance("scm");
xpath.addNamespace(root_.getNamespace());
Element scmNode = (Element) xpath.selectSingleNode(root_);
scmNode.setAttribute("class", "Kalees");
} catch (Exception e) {
e.printStackTrace();
}
}
//Deleting Elements
public void deleteElementAtXpath() {
//deleting a node...
// deleting content of a node
//triggerNode.removeContent();
try {
String childName = "hudson.plugins.emailext.ExtendedEmailPublisher";
XPath xpath = XPath.newInstance("publishers");
xpath.addNamespace(root_.getNamespace());
Element triggerNode = (Element) xpath.selectSingleNode(root_); // if it is null then element is not present
triggerNode.removeChild(childName);
} catch (Exception e) {
e.printStackTrace();
}
}
public static Element createElement(String nodeName, String NodeValue) {
org.jdom.Element element = new Element(nodeName);
if (NodeValue != null) {
element.addContent(NodeValue);
}
return element;
}
--
Thank you.
Regards,
Kaleeswaran.S
Wednesday, August 8, 2012
Eclisep Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf
Eclisep Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf
If you face this issue in eclipse while running a standalone java application. Eclipse will allocate only 384 MB of Java heap memory. based on the type of JRE you are using and eclipse plugin and application size, this issue occurs. we have to increase heap memory size. To increase the available heap memory, right click your java progrram click "run as -> run configurations" . click argument tab and type -Xms1024M -Xmx1024M in VM arguments field. This increases VM size while running from eclipse.

--
Thank you.
Regards,
Kaleeswaran.S
If you face this issue in eclipse while running a standalone java application. Eclipse will allocate only 384 MB of Java heap memory. based on the type of JRE you are using and eclipse plugin and application size, this issue occurs. we have to increase heap memory size. To increase the available heap memory, right click your java progrram click "run as -> run configurations" . click argument tab and type -Xms1024M -Xmx1024M in VM arguments field. This increases VM size while running from eclipse.

--
Thank you.
Regards,
Kaleeswaran.S
Subscribe to:
Posts (Atom)