Package org.jpox.exceptions

Examples of org.jpox.exceptions.JPOXException


            {
                resources = clr.getResources(location, pc_class.getClassLoader());
            }
            catch (IOException e)
            {
                throw new JPOXException("Error loading resource", e).setFatal();
            }
            if (!resources.hasMoreElements() && JPOXLogger.METADATA.isDebugEnabled())
            {
                JPOXLogger.METADATA.debug(LOCALISER.msg("044049",
                    metadata_file_extension, pc_class.getName(), location));
View Full Code Here


        {
            return;
        }
        if (primaryFmd.isInitialised() || primaryFmd.isPopulated())
        {
            throw new JPOXException(LOCALISER.msg("MetaData.File.AlreadyPopulatedError",
                primaryFmd.getFilename())).setFatal();
        }
        if (JPOXLogger.METADATA.isDebugEnabled())
        {
            JPOXLogger.METADATA.debug(LOCALISER.msg("044056", primaryFmd.getFilename()));
View Full Code Here

        {
            return;
        }
        if (primaryCmd.isInitialised() || primaryCmd.isPopulated())
        {
            throw new JPOXException(LOCALISER.msg("044068", primaryCmd.name)).setFatal();
        }
        if (JPOXLogger.METADATA.isDebugEnabled())
        {
            JPOXLogger.METADATA.debug(LOCALISER.msg("044096", primaryCmd.getFullClassName()));
        }
View Full Code Here

            return;
        }

        if (primaryFmd.isInitialised() || primaryFmd.isPopulated())
        {
            throw new JPOXException(LOCALISER.msg("044107",
                primaryFmd.name, ormFmd.getAbstractClassMetaData().getFullClassName())).setFatal();
        }

        if (ormFmd.className != null)
        {
View Full Code Here

        {
            return;
        }
        if (primaryCmd.isInitialised() || primaryCmd.isPopulated())
        {
            throw new JPOXException(LOCALISER.msg("044068", primaryCmd.name)).setFatal();
        }

        if (JPOXLogger.METADATA.isDebugEnabled())
        {
            JPOXLogger.METADATA.debug(LOCALISER.msg("044095", primaryCmd.getFullClassName()));
View Full Code Here

            return;
        }

        if (primaryFmd.isInitialised() || primaryFmd.isPopulated())
        {
            throw new JPOXException(LOCALISER.msg("044107",
                primaryFmd.name, annotFmd.getAbstractClassMetaData().getFullClassName())).setFatal();
        }

        if (primaryFmd.className == null && annotFmd.className != null)
        {
View Full Code Here

                    JPOXLogger.CONNECTION.debug(LOCALISER.msg("032018", txConnectionFactoryName));
                }
            }
            catch (Exception e)
            {
                throw new JPOXException("Error creating transactional connection factory", e).setFatal();
            }
        }
        else
        {
            throw new JPOXException("Error creating transactional connection factory. No connection factory plugin defined");
        }

        // Factory for connections - nontransactional
        cfElem = omfContext.getPluginManager().getConfigurationElementForExtension(
            "org.jpox.store_connectionfactory",
            new String[] {"datastore", "transactional"}, new String[] {storeManagerKey, "false"});
        if (cfElem != null)
        {
            nontxConnectionFactoryName = cfElem.getAttribute("name");
            try
            {
                ConnectionFactory cf = (ConnectionFactory)omfContext.getPluginManager().createExecutableExtension(
                    "org.jpox.store_connectionfactory",
                    new String[] {"datastore", "transactional"},
                    new String[] {storeManagerKey, "false"}, "class-name",
                    new Class[] {OMFContext.class, String.class},
                    new Object[] {omfContext, "nontx"});
                if (JPOXLogger.CONNECTION.isDebugEnabled())
                {
                    JPOXLogger.CONNECTION.debug(LOCALISER.msg("032019", nontxConnectionFactoryName));
                }
                omfContext.getConnectionFactoryRegistry().registerConnectionFactory(nontxConnectionFactoryName, cf);
            }
            catch (Exception e)
            {
                throw new JPOXException("Error creating nontransactional connection factory", e).setFatal();
            }
        }
    }
View Full Code Here

                throw new JPOXUserException(LOCALISER.msg("038001", id, cmd.getFullClassName()));
            }
        }
        else
        {
            throw new JPOXException("StoreManager.manageClassForIdentity called for id=" + id +
                " yet should only be called for datastore-identity/SingleFieldIdentity");
        }

        // If the class is not yet managed, manage it
        if (!managesClass(className))
View Full Code Here

                cls = omfContext.getPluginManager().loadClass(elem.getExtension().getPlugin().getSymbolicName(),
                    elem.getAttribute("class-name"));
            }
            if (cls == null)
            {
                throw new JPOXException("Cannot create Poid Generator for strategy " + poidGeneratorName);
            }
           
            // Create the new PoidGenerator since the first time required (registers it with the PoidManager too)
            generator = poidManager.createPoidGenerator(generatorNameKeyInManager, cls, props, this, null);
        }

        // Get the next value from the generator
        Object oid = getStrategyValueForGenerator(generator, om);

        if (mmd != null)
        {
            // replace the value of the id, but before convert the value to the field type if needed
            Object convertedValue = TypeConversionHelper.convertTo(oid, mmd.getType());
            if (convertedValue == null)
            {
                throw new JPOXException(LOCALISER.msg("038003", mmd.getFullFieldName(), oid)).setFatal();
            }
            oid = convertedValue;
        }

        if (JPOXLogger.POID.isDebugEnabled())
View Full Code Here

     * Create the key as an Object.
     * @return the key as an Object;
     */
    protected Object createKeyAsObject()
    {
        throw new JPOXException("SingleFIeldIdentity.createKeyAsObject must not be called.").setFatal();
    }
View Full Code Here

TOP

Related Classes of org.jpox.exceptions.JPOXException

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.