Maven – java.lang.OutOfMemoryError

Problem:
[INFO] Trace
java.lang.OutOfMemoryError: Java heap space
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:99)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:393)
at java.lang.StringBuffer.append(StringBuffer.java:225)
at hidden.org.codehaus.plexus.util.StringUtils.replace(StringUtils.java:816)
at hidden.org.codehaus.plexus.util.StringUtils.replace(StringUtils.java:782)

Solution:
set MAVEN_OPTS=”-Xmx1024m”

maven findbugs Exception – Caused by: java.io.FileNotFoundException: /target/findbugsXml.xml

Problem Statement:

Embedded error: /target/findbugsXml.xml (No such file or directory)
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: A java source file could not be added

.....
Caused by: java.io.FileNotFoundException: /target/findbugsXml.xml (No such file or directory)

This bug is not producible in Windows OS

Solution:

Link: https://hudson.dev.java.net/issues/show_bug.cgi?id=2714 

After using following settings, the error is gone. The problem is version number. 
If we dont give version it will take 1.2.1 and failed in Linux. 
If you put 1.2 it works fine in Linux.

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
	<findbugsXmlOutput>true</findbugsXmlOutput>
	<findbugsXmlWithMessages>
		true
	</findbugsXmlWithMessages>
	<xmlOutput>true</xmlOutput>
</configuration>
</plugin>

Java-Oracle The Network Adapter could not establish the connection Exception

Problem Statement: Java / Oracle Exception

logExceptions, Io exception: The Network Adapter could not establish the connection

Test cases are working fine in dev environment. Same tests are failed in unix environment and caused the above exception.

Solution: In config file database host name is abcd. From Unix environment, it failed to resolve this name to ip address.

Replaced host name with ip address. Now it is working in windows and unix too.