Package org.apache.ojb.broker.metadata

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


        catch (NoClassDefFoundError ex)
        {
            String message = "Could not use dyna beans (not in classpath), and no field or property matches " + rootObjectType.getName() + "." + fieldName;

            getLog().error(message);
            throw new MetadataException(message);
        }
    }
View Full Code Here


            {
                // no handler could be found -> error
                String message = "No field, property, or DynaProperty can be found to match " + rootObjectType.getName() + "." + fieldName;

                getLog().error(message);
                throw new MetadataException(message);
            }
        }
        return result;
    }
View Full Code Here

                    {
                        attribute = ClassHelper.newInstance(pd.getPropertyType());
                    }
                    catch (Exception e)
                    {
                        throw new MetadataException("Can't instantiate nested object of type '"
                                + pd.getPropertyType() + "' for field '"
                                + pd.getName() + "'", e);
                    }
                }
                setValueFor(pd, target, attribute);
View Full Code Here

                return m.invoke(ProxyHelper.getRealObject(target), null);
            }
            catch (Throwable e)
            {
                logProblem(pd, target, null, "Can't read value from given object");
                throw new MetadataException("Error invoking method:" + m.getName() + " in object " + target.getClass().getName(), e);
            }
        }
        else
        {
            throw new MetadataException("Can't get ReadMethod for property:" + pd.getName() + " in object " + target.getClass().getName());
        }
    }
View Full Code Here

                }
            }
            catch (Throwable e)
            {
                logProblem(pd, target, value, "Can't set value on given object.");
                throw new MetadataException("Error invoking method:" + m.getName() + " in object:" + target.getClass().getName(), e);
            }
        }
        else
        {
            throw new MetadataException("Can't get WriteMethod for property:" + pd.getName() + " in object:" + target.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

                {
                    attribute = getValueFrom(field, current);
                }
                catch (Exception e)
                {
                    throw new MetadataException("Can't read field '" + field.getName() + "' of type " + field.getType().getName(), e);
                }
                if (attribute != null || value != null)
                {
                    // if the intermediary nested object is null, we have to create
                    // a new instance to set the value
                    if (attribute == null)
                    {
                        try
                        {
                            attribute = ClassHelper.newInstance(field.getType());
                        }
                        catch (Exception e)
                        {
                            throw new MetadataException("Can't create nested object of type '"
                                    + field.getType() + "' for field '"
                                    + field.getName() + "'", e);
                        }
                    }
                    try
                    {
                        //field.set(current, attribute);
                        setValueFor(field, current, attribute);
                    }
                    //catch (IllegalAccessException e)
                    catch (Exception e)
                    {
                        throw new MetadataException("Can't set nested object of type '"
                                    + field.getType() + "' for field '"
                                    + field.getName() + "'", e);
                    }
                }
                else
View Full Code Here

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

                    + "' seems to be null. Can't write into null.", ignored);
        }
        catch (Exception e)
        {
            getLog().error("while set field: " + buildMessageString(target, value, field));
            throw new MetadataException("IllegalAccess error setting field:" +
                    (field != null ? field.getName() : null) + " in object:" + target.getClass().getName(), e);
        }
    }
View Full Code Here

                }
            }
            catch (Throwable e)
            {
                logProblem(anObject, aValue, e.getClass().getName());
                throw new MetadataException("Error invoking method:" + m.getName() + " in object:" + anObject.getClass().getName(), e);
            }
        }
        else
        {
            logProblem(anObject, aValue, "set: getWriteMethod returned null");
            throw new MetadataException(
                    "Can't get WriteMethod for property:" + getPropertyDescriptor().getName() + " in object:" + anObject.getClass().getName());
        }
    }
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.