BasicDataSource causing java.util.ConcurrentModificationException in WebSphere

Problem With Spring, declares data source as “org.apache.commons.dbcp.BasicDataSource“. When deployed to WebSphere, everything work perfectly. File : spring-datasource.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd "> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location"> <value>classpath:config/database/database.properties</value> </property> </bean> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="${jdbc.driverClassName}" /> <property name="url" value="${jdbc.url}" /> <property name="username" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> </bean> …

Read more

How to increase WebSphere JVM memory

Problem When a J2EE web application is deployed into the WebSphere Application Server 7 (WAS), the WAS started to load very slow and keep hanging for whatever actions selected, end with a “java.lang.OutOfMemoryError” error message in the WebSphere’s log file. Solution The default WebSphere’s Java Virtual Machine memory is not enough; you should adjust more …

Read more

WebSphere 7 & javax/persistence/OneToMany.orphanRemoval() error

Problem In Hibernate development, contains a model class with JPA @OneToMany annotation : @OneToMany( cascade=CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user") public Set<Debit> getDebits() { return this.debits; } When web application is deployed on WebSphere 7, it hit following error message : Caused by: java.lang.NoSuchMethodError: javax/persistence/OneToMany.orphanRemoval()Z at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1912) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:707) … 118 more P.S hibernate-jpa-2.0-api-1.0.0.Final.jar …

Read more