Examples of CreationException


Examples of javax.enterprise.inject.CreationException

        {
            Throwable throwable = getRootException(re);
           
            if(!(throwable instanceof RuntimeException))
            {
                throw new CreationException(throwable);
            }
            throw (RuntimeException) throwable;
        }

        return instance;
View Full Code Here

Examples of javax.enterprise.inject.CreationException

            NamingEnumeration<NameClassPair> persUnits = context.list("java:openejb/PersistenceUnit");
           
            if (persUnits == null)
            {
                throw new CreationException("No PersistenceUnit found in java:openejb/PersistenceUnit!");
            }

            String shortestMatch = null;
           
            while (persUnits.hasMore())
            {
                NameClassPair puNc = persUnits.next();
               
                if (puNc.getName().startsWith(unitName))
                {
                    if (shortestMatch == null || shortestMatch.length() > puNc.getName().length())
                    {
                        shortestMatch = puNc.getName();
                    }
                }
               
            }
           
            if (shortestMatch == null)
            {
                throw new CreationException("PersistenceUnit '" + unitName + "' not found");
            }
           
            factory = (EntityManagerFactory) context.lookup("java:openejb/PersistenceUnit/" + shortestMatch);
           
           
        }
        catch (NamingException e)
        {
            throw new CreationException("PersistenceUnit '" + unitName + "' not found", e );
        }
        return clazz.cast(factory);
    }
View Full Code Here

Examples of javax.enterprise.inject.CreationException

        {
            Throwable throwable = ClassUtil.getRootException(re);
           
            if(!(throwable instanceof RuntimeException))
            {
                throw new CreationException(throwable);
            }
            throw (RuntimeException) throwable;
        }

        return instance;
View Full Code Here

Examples of javax.enterprise.inject.CreationException

            NamingEnumeration<NameClassPair> persUnits = context.list("java:openejb/PersistenceUnit");
           
            if (persUnits == null)
            {
                throw new CreationException("No PersistenceUnit found in java:openejb/PersistenceUnit!");
            }

            String shortestMatch = null;
           
            while (persUnits.hasMore())
            {
                NameClassPair puNc = persUnits.next();
               
                if (puNc.getName().startsWith(unitName))
                {
                    if (shortestMatch == null || shortestMatch.length() > puNc.getName().length())
                    {
                        shortestMatch = puNc.getName();
                    }
                }
               
            }
           
            if (shortestMatch == null)
            {
                throw new CreationException("PersistenceUnit '" + unitName + "' not found");
            }
           
            factory = (EntityManagerFactory) context.lookup("java:openejb/PersistenceUnit/" + shortestMatch);
           
           
        } catch (NamingException e) {
            throw new CreationException("PersistenceUnit '" + unitName + "' not found", e );
        }
        return clazz.cast(factory);
    }
View Full Code Here

Examples of javax.enterprise.inject.CreationException

        {
            Throwable throwable = ClassUtil.getRootException(re);
           
            if(!(throwable instanceof RuntimeException))
            {
                throw new CreationException(throwable);
            }
            throw (RuntimeException) throwable;
        }

        return instance;
View Full Code Here

Examples of javax.enterprise.inject.CreationException

        {
            Throwable throwable = getRootException(re);
           
            if(!(throwable instanceof RuntimeException))
            {
                throw new CreationException(throwable);
            }
            throw (RuntimeException) throwable;
        }

    }
View Full Code Here

Examples of javax.enterprise.inject.CreationException

        {
            Throwable throwable = getRootException(re);
           
            if(!(throwable instanceof RuntimeException))
            {
                throw new CreationException(throwable);
            }
            throw (RuntimeException) throwable;
        }

        return instance;
View Full Code Here

Examples of javax.enterprise.inject.CreationException

            NamingEnumeration<NameClassPair> persUnits = context.list("java:openejb/PersistenceUnit");
           
            if (persUnits == null)
            {
                throw new CreationException( "No PersistenceUnit found in java:openejb/PersistenceUnit!" );
            }

            String shortestMatch = null;
           
            while (persUnits.hasMore())
            {
                NameClassPair puNc = persUnits.next();
               
                if (puNc.getName().startsWith(unitName))
                {
                    if (shortestMatch == null || shortestMatch.length() > puNc.getName().length())
                    {
                        shortestMatch = puNc.getName();
                    }
                }
               
            }
           
            if (shortestMatch == null)
            {
                throw new CreationException("PersistenceUnit '" + unitName + "' not found");
            }
           
            factory = (EntityManagerFactory) context.lookup("java:openejb/PersistenceUnit/" + shortestMatch);
           
           
        } catch (NamingException e) {
            throw new CreationException("PersistenceUnit '" + unitName + "' not found", e );
        }
        return factory;
    }
View Full Code Here

Examples of javax.enterprise.inject.CreationException

        {
            Throwable throwable = getRootException(re);
           
            if(!(throwable instanceof RuntimeException))
            {
                throw new CreationException(throwable);
            }
            throw (RuntimeException) throwable;
        }

        return instance;
View Full Code Here

Examples of javax.inject.CreationException

            instance = createInstance(creationalContext);

        }
        catch (RuntimeException re)
        {
            throw new CreationException(re);
        }
        catch (Exception e)
        {
            throw new WebBeansException(e);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.