[jboss-user] [JBossCache] - Re: java.io.NotSerializableException: java.lang.Object -Clus
1. Based on some further research, I did not find any "java.lang.Object" declaration in the (Beans/VO, Action forms, Decorators) of the application classes. 2. The Mappings are clean and theres no DB -> field mapping of type Object. 3. Although, In "com.ibatis.db.sqlmap.cache.memory" package, MemoryCacheController has a inner class declaration "StrongReference", which has java.lang.Object declaration. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960495#3960495 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960495 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBossCache] - Re: java.io.NotSerializableException: java.lang.Object -Clus
Well, I think this has got to do with the way Ibatis is implemented. Here's an example. private List runQueryForList(SqlStatement localSql, Connection conn, Object parameterObject, int skipResults, int maxResults, RowHandler rowHandler) throws SQLException { List list; if(log.isDebugEnabled()) { log.debug("executeQueryForList: " + name); conn = ConnectionLogProxy.newInstance(conn); } ErrorField errorField = new ErrorField(); if(rowHandler == null) list = new ArrayList(); else list = null; ResultSet rs = null; PreparedStatement ps = null; String errorMessage = "Check the SQL statement."; try { sqlMap.incrementExecutionThrottle(conn); ps = createStatement(conn, localSql, parameterObject); if(sqlMap.isDriverHintsEnabled() && maxResults != -1 && skipResults != -1) { ps.setFetchSize(maxResults + skipResults); ps.setMaxRows(maxResults + skipResults); } errorMessage = "Check the Parameter Map (or inline parameters)."; applyParameterMap(localSql, ps, parameterObject, errorField); errorField.errorField = null; errorMessage = "Check the SQL statement."; rs = ps.executeQuery(); for(int i = 0; i < skipResults; i++) if(!rs.next()) break; errorMessage = "Check the Result Map."; int n = 0; if(rowHandler == null) { for(; (maxResults == -1 || n < maxResults) && rs.next(); n++) { Object object = applyResultMap(conn, rs, null, errorField); list.add(object); } errorField.errorField = null; } else { for(; (maxResults == -1 || n < maxResults) && rs.next(); n++) { Object object = applyResultMap(conn, rs, null, errorField); rowHandler.handleRow(object); } errorField.errorField = null; } } catch(Throwable t) { Throwable tt = unwrapProxyException(t); String msg = ""; if(errorField.errorField != null) msg = "Error executing '" + name + "' in '" + resourceName + "'. " + errorMessage + " Check the '" + errorField + "' property. Cause: " + t; else msg = "Error executing '" + name + "' in '" + resourceName + "'. " + errorMessage + " Cause: " + t; if(log.isErrorEnabled()) log.error(msg, t.fillInStackTrace()); if(t instanceof SQLException) throw (SQLException)t; else throw new SQLException(msg); } finally { closeResultSet(rs); closeStatement(ps); sqlMap.decrementExecutionThrottle(conn); } notifyListeners(); return list; } BELOW IS THE applyResultMap METHOD private Object applyResultMap(Connection conn, ResultSet rs, Object resultObject, ErrorField errorField) throws SQLException {Object object = resultObject; String typeName = null; if(getResultMapName() != null) { ResultMap map = getSqlMap().getResultMap(getResultMapName()); typeName = map.getClassName(); if(object == null) object = instantiate(map.getClassName()); ResultMapping mapping; for(Iterator names = map.getMappedPropertyNames(); names.hasNext(); setBeanProperty(mapping, object, conn, rs, errorField)) { String propertyName = (String)names.next(); mapping = map.getResultMapping(propertyName); } } else if(resultClass != null) { typeName = resultClass; if(object == null) object = instantiate(resultClass); if(object instanceof BaseValue) { ResultMapping mapping = new ResultMapping(); mapping.setPropertyName("value"); mapping.setColumnName("VALUE"); mapping.setColumnIndex(new Integer(1)); setBeanProperty(mapping, object, conn, rs, errorField); } else if(object instanceof Map) { ResultSetMetaData rsmd = rs.getMetaData(); int i = 0; for(int n = rsmd.getColumnCount(); i < n; i++) { String columnName = rsmd.getColumnLabel(i + 1); ((Map)object).put(columnName, rs.getObject(i + 1)); } } else { autoMapResultSet(conn, rs, object, errorField
[jboss-user] [JBossCache] - Re: java.io.NotSerializableException: java.lang.Object -Clus
We investigated the application code and Ibatis sources. 1. All the application classes (Beans, Actionforms, Decorators) are serializable. (This takes care of all the objects in chain) 2. We suspected that Ibatis could be problem area and made all the classes serializable (For sanity sake) Yet the java.io.NotSerializableException: java.lang.Object is seen. Its becomming impossible to understand what could be the reason for this. Help Appreciated. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960438#3960438 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960438 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBossCache] - java.io.NotSerializableException: java.lang.Object -Cluster
Hello, We are using JbossCache in a clustered environment. (JBoss, Ibatis, Oracle). We are unable to figure out the reason for an exception when the JBossCacheService tries to do replication on the other node. [java.io.NotSerializableException: java.lang.Object] We have ensured that all the objects stored in Collections implement the Serializable interface. Following is the detailed stack trace. -- 09:57:47,393 INFO [STDOUT] java.io.NotSerializableException: java.lang.Object 09:57:47,393 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054) 09:57:47,393 INFO [STDOUT] at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332) 09:57:47,393 INFO [STDOUT] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304) 09:57:47,393 INFO [STDOUT] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278) 09:57:47,409 INFO [STDOUT] at java.util.ArrayList.writeObject(ArrayList.java:529) 09:57:47,409 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 09:57:47,409 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 09:57:47,409 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 09:57:47,409 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324) 09:57:47,409 INFO [STDOUT] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1296) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278) 09:57:47,409 INFO [STDOUT] at java.util.HashMap.writeObject(HashMap.java:978) 09:57:47,409 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 09:57:47,409 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 09:57:47,409 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 09:57:47,409 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324) 09:57:47,409 INFO [STDOUT] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1296) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052) 09:57:47,409 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278) 09:57:47,409 INFO [STDOUT] at org.jboss.web.tomcat.tc5.session.SessionBasedClusteredSession.writeExternal(SessionBasedClusteredSession.java:288) 09:57:47,409 INFO [STDOUT] at org.jboss.web.tomcat.tc5.session.JBossCacheService.externalizeSession(JBossCacheService.java:771) 09:57:47,409 INFO [STDOUT] at org.jboss.web.tomcat.tc5.session.JBossCacheService.