Apr 162016
 
FAQ

Many times we face issues like the database will be down due to some reason and even after the database issue has been fixed the application data source wont be able to reconnect to DB properly or it will run on some stale DB connections and cause transaction failure and unexpected behaviors. To avoid this we need to configure the JNDI pool to autoreconnect to a valid connection to database after recovering from shutdown/failure so that application can run smoothly.

In this article we will discuss the JNDI/DataSource autoreconnect configuration steps for different application servers.

Apache Tomcat J2EE ServerTomcat jdbc connection pool reconnect:

i. Login to Tomcat server.
ii. Navigate to ‘\conf’ and edit context.xml file
iii. Add parameters ‘validationQuery=”select 1 from dual”’ and ‘testOnBorrow=”true”’ under the Resource tag.

<Resource auth="Container"
driverClassName="oracle.jdbc.OracleDriver"
initialSize="5"
maxActive="120"
maxIdle="5"
maxWait="5000"
name="jdbc/oracle/myds"
password="secret"
poolPreparedStatements="true"
type="javax.sql.DataSource"
url="jdbc:oracle:thin:@DBHOSTNAME:1521/ServiceName"
username="testuser"
validationQuery="select 1 from tab"
testOnBorrow="true"/>

iv. Restart tomcat to reflect the changes.
Continue reading »

© Incase of any copyright infringements please check copyrights page for faster resolutions.
Apr 112016
 
 Posted by on April 11, 2016 at 8:20 pm Big Data, Database, MongoDB No Responses »
MongoDB

When Using MongoDB in local computer or laptop for development we usually see mongoDB eating up all RAM and makes the machine very slow to operate, so in this article we will discuss on how to restrict MongoDB memory usage in a non standard way. Usually it is suggested not to restrict mongoDB memory as MongoDB defers to the operating system when loading data into memory from disk. It simply memory maps all its data files and relies on the operating system to cache data. The OS typically evicts the least-recently-used data from RAM when it runs low on memory. So in a production environment it is not recommended to restrict MongoDB memory usage as this might impact the performance and functionalities.
Continue reading »

© Incase of any copyright infringements please check copyrights page for faster resolutions.
Mar 222016
 
Oracle Weblogic Server

While deploying application with JPA 2.0 implementation in weblogic 10.x we used to get java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo error for the application deployment and usually you will be seeing this error in older versions of weblogic like here we faced below issue with WLS 10.3.6.

<Mar 8, 2016 1:27:12 AM IST> <Warning> <HTTP> <vmapp01g12app1> <MYServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1457380632336>

<BEA-101162> <User defined listener org.springframework.web.context.ContextLoaderListener failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'EntityManager' defined in URL [zip:C:/WL_HOME_1036/user_projects/domains/MYDOMAIN/servers/MYServer/tmp/_WL_user/MyApp01/epnft3/war/WEB-INF/lib/create_mbean.jar!/spring-config/appbean/applicationContext-appbean-config.xml]:

Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/SharedCacheMode;.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'EntityManager' defined in URL [zip:C:/WL_HOME_1036/user_projects/domains/MYDOMAIN/servers/MYServer/tmp/_WL_user/MyApp01/epnft3/war/WEB-INF/lib/create_mbean.jar!/spring-config/appbean/applicationContext-appbean-config.xml]:

Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/SharedCacheMode;

Continue reading »

© Incase of any copyright infringements please check copyrights page for faster resolutions.
Mar 152016
 
 Posted by on March 15, 2016 at 3:11 am FAQ, Threads and Synchronization No Responses »
FAQ

Most of you already be knowing about Quartz scheduler but just for information Quartz scheduler is a job scheduling library that can be integrated into a wide variety of enterprise class Java applications. If you want to know more about how to implement the Quatrz scheduler in your application then you can check Quartz implementation link. Here in this article we are focusing on Quartz scheduler shutdown process, as this is where most of developers miss out details.

Issues faced due to improper implementation of Quartz Scheduler Shutdown is servers will not go down in graceful or sometime force shutdown’s also and will casue servers to go to incompatible state and Application process will get hung till we manually kill the process from back end and restart again.
Continue reading »

© Incase of any copyright infringements please check copyrights page for faster resolutions.
Feb 222016
 
 Posted by on February 22, 2016 at 11:03 pm Microsoft IIS Web Server, Web Servers Tagged with: ,  No Responses »
Microsoft IIS

REMOTE_USER is the name of the user as it is derived from the authorization header sent by the client, before the user name is mapped to a Windows account. We had a requirement to manipulate the remote user header variable in IIS into some other format so that our application can read the same and authenticate in a multi-domain environments.

At present IIS does not have the capability to set REMOTE_USER header format in NTLM environments as the IIS Rewriting Module runs before authentication which in turn give a NULL value for remote user. to elaborate the process below are the steps it follows before setting the REMOTE_USER header.
Continue reading »

© Incase of any copyright infringements please check copyrights page for faster resolutions.