Package org.apache.ojb.broker.metadata

Examples of org.apache.ojb.broker.metadata.MetadataException


                return result;
            }
            catch (Throwable e)
            {
                logProblem(anObject, null, e.getClass().getName());
                throw new MetadataException("Error invoking method:" + m.getName() + " in object:" + anObject.getClass().getName(), e);
            }
        }
        else
        {
            logProblem(anObject, null, "get: getReadMethod returned null");
            throw new MetadataException(
                    "Can't get ReadMethod for property:" + getPropertyDescriptor().getName() + " in object:" + anObject.getClass().getName());
        }
    }
View Full Code Here


            {
                /*
         * Daren Drummond:   Throw here so we are consistent
         *           with PersistentFieldDefaultImpl.
         */
                throw new MetadataException("Can't find property " + aPropertyName + " in " + aClass.getName());
            }
            return descriptor;
        }
        catch (IntrospectionException ex)
        {
            /*
       * Daren Drummond:   Throw here so we are consistent
       *           with PersistentFieldDefaultImpl.
       */
            throw new MetadataException("Can't find property " + aPropertyName + " in " + aClass.getName(), ex);
        }

    }
View Full Code Here

                ClassDescriptor baseCld = cld.getRepository().getDescriptorFor(cld.getBaseClass());
                value = ClassHelper.buildNewObjectInstance(baseCld);
            }
            catch (Exception e)
            {
                throw new MetadataException("Can't create new base class object for '" + cld.getBaseClass()+"'", e);
            }
            putToFieldCache(obj, value);
        }

        copyObjectToObject(obj, value);
View Full Code Here

                    " of type " + type.getName() + " is null. Can't write into null.", ignored);
        }
        catch (IllegalAccessException e)
        {
            getLog().error("while set field: " + buildMessageString(obj, value, fld));
            throw new MetadataException("IllegalAccess error setting field:" +
                    (fld != null ? fld.getName() : null) + " in object:" + obj.getClass().getName(), e);
        }
        catch (Exception e)
        {
            getLog().error("while set field: " + buildMessageString(obj, value, fld), e);
            throw new MetadataException("Error setting field:" + (fld != null ? fld.getName() : null) +
                    " in object:" + obj.getClass().getName(), e);
        }
    }
View Full Code Here

            Object result = fld.get(ProxyHelper.getRealObject(obj));
            return result;
        }
        catch (IllegalAccessException e)
        {
            throw new MetadataException(
                    "IllegalAccess error getting field:" +
                    (fld != null ? fld.getName() : null) + " in object:"
                    + obj != null ? obj.getClass().getName() : null, e);
        }
        catch (Throwable e)
        {
            throw new MetadataException("Error getting field:" +
                    (fld != null ? fld.getName() : null) + " in object:" +
                    (obj != null ? obj.getClass().getName() : null) , e);
        }
    }
View Full Code Here

    private void checkNested(String fieldName)
    {
        if(fieldName.indexOf(PATH_TOKEN) > -1)
        {
            throw new MetadataException("This implementation does not support nested fields");
        }
    }
View Full Code Here

                    fld.setAccessible(true);
                }
            }
            catch (NoSuchFieldException e)
            {
                throw new MetadataException("Can't find member '"
                        + fieldName + "' in class " + (fld != null ? fld.getDeclaringClass() : rootObjectType), e);
            }
            result.add(fld);
        }
        return result;
View Full Code Here

            }
            return f;
        }
        catch (NoSuchFieldException e)
        {
            throw new MetadataException("Can't find member '" + fieldname + "' in " + c.getName(), e);
        }
    }
View Full Code Here

    {
        if (isNestedField == UNKNOWN_FIELD) // not initialized
        {
            if (fieldName == null)
            {
                throw new MetadataException(
                        "Unexpected behaviour: fieldName is null, can not calculate field rootObjectType");
            }
            if (fieldName.indexOf(PATH_TOKEN) >= 0)
            {
                isNestedField = NESTED_FIELD;
View Full Code Here

                    {
                        attrib = createNestedFieldValue(pField);
                    }
                    catch (InstantiationException e)
                    {
                        throw new MetadataException("Error instantiate field: "
                                + name + " in object:" + realClass.getName(), e);
                    }
                    catch (IllegalAccessException e)
                    {
                        throw new MetadataException("Error getting field:"
                                + name + " in object:" + realClass.getName(), e);
                    }

                    /*
                    TODO: here we need cast to AbstractPersistentField to execute the doSet-method.
View Full Code Here

TOP

Related Classes of org.apache.ojb.broker.metadata.MetadataException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.