Index: beanutils/src/java/org/apache/commons/beanutils/BeanUtils.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/BeanUtils.java,v
retrieving revision 1.22
diff -u -r1.22 BeanUtils.java
--- beanutils/src/java/org/apache/commons/beanutils/BeanUtils.java	17 May 2002 07:25:50 -0000	1.22
+++ beanutils/src/java/org/apache/commons/beanutils/BeanUtils.java	19 May 2002 09:53:34 -0000
@@ -619,12 +619,21 @@
                 return; // Skip this property setter
             }
             if (descriptor instanceof MappedPropertyDescriptor) {
+                if (((MappedPropertyDescriptor) descriptor).getMappedWriteMethod() == null) {
+                    return; // Read-only, skip this property setter
+                }
                 type = ((MappedPropertyDescriptor) descriptor).
                     getMappedPropertyType();
             } else if (descriptor instanceof IndexedPropertyDescriptor) {
+                if (((IndexedPropertyDescriptor) descriptor).getIndexedWriteMethod() == null) {
+                    return; // Read-only, skip this property setter
+                }
                 type = ((IndexedPropertyDescriptor) descriptor).
                     getIndexedPropertyType();
             } else {
+                if (descriptor.getWriteMethod() == null) {
+                    return; // Read-only, skip this property setter
+                }
                 type = descriptor.getPropertyType();
             }
         }
@@ -652,7 +661,7 @@
                 newValue = value;
             }
         } else {                             // Value into scalar
-            if (value instanceof String) {
+            if (value instanceof String || (value == null && type.isPrimitive())) {
                 newValue = ConvertUtils.convert((String) value, type);
             } else if (value instanceof String[]) {
                 newValue = ConvertUtils.convert(((String[]) value)[0],
