Search Results

Search found 1962 results on 79 pages for 'moose factory'.

Page 1/79 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Moose and error messages, the sun and the moon [closed]

    - by xxxxxxx
    So again using Moose I write a role like this: package My::Role; use Moose::Role; use Some::Class::Consuming::My::Role; With the note that Some::Class::Consuming::My::Role consumes the role My::Role; And what do I get ? I get an error message like this: A role generator is required to generate roles at /usr/local/share/perl/5.10.0/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm line 79 MooseX::Role::Parameterized::Meta::Role::Parameterizable::generate_role('MooseX::Role::Parameterized::Meta::Role::Parameterizable=HASH...', 'consumer', 'Moose::Meta::Class=HASH(0x894e540)', 'parameters', 'HASH(0x86fc1e0)') called at /usr/local/share/perl/5.10.0/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm line 116 MooseX::Role::Parameterized::Meta::Role::Parameterizable::apply('MooseX::Role::Parameterized::Meta::Role::Parameterizable=HASH...', 'Moose::Meta::Class=HASH(0x894e540)', 'element_type', 'Tuple') called at /usr/local/lib/perl/5.10.0/Moose/Util.pm line 132 Moose::Util::_apply_all_roles('Moose::Meta::Class=HASH(0x894e540)', undef, 'Stuff', 'HASH(0x894e1d0)') called at /usr/local/lib/perl/5.10.0/Moose/Util.pm line 86 Moose::Util::apply_all_roles('Moose::Meta::Class=HASH(0x894e540)', 'Stuff', 'HASH(0x894e1d0)') called at /usr/local/lib/perl/5.10.0/Moose.pm line 57 Moose::with('Moose::Meta::Class=HASH(0x894e540)', 'Group', 'HASH(0x894e1d0)') called at /usr/local/lib/perl/5.10.0/Moose/Exporter.pm line 293 Moose::with('Group', 'HASH(0x894e1d0)') called at Some_path_on_disk line 6 require Some_other_path_on_disk called at Some_path_on_disk line 9 Group::BEGIN() called at Yet_another_path_on_disk line 0 eval {...} called at Yet_another_path_on_disk line 0 Compilation failed in require at some_path_on_disk line 9. BEGIN failed--compilation aborted at some_path_on_disk line 9. What am I to make of this ? As Dijkstra would concisely describe, this looks like "just a meaningless concatenation of words"(which is exactly what it is). Would a more appropriate error message be "You cannot use a class consuming the role that you are currently defining " ? What does the error message try to convey ? Can the author make the error message meaningful ? Will he ever make it so ? maybe this can be planned for version 3.14159265358979323846 ? In actuality I get one and a half pages of error which is completely unreadable and devoid of any logic or sense of respect for the user that is using Moose (in terms of intuitive error messages) just like the one above. What's to be done in this case ? I mean I get on my screen these error messages that are sometimes completely unrelated to the problem that I'm having (which I can assess after solving the problems that probably caused them, I say probably becuase I have no idea where these error messages came from because they look like they fell from the sky as they have no relation to the actual situation). Is this: the inexplicable dramatic destiny of the Perl programmer using Moose ? someone being extremely lazy and sloppy at writing error messages ? maybe on heavy drugs ? me not understanding basic english ? Gentlemen, when writing software, please please please, take care of the poor programmer that will use it and respect him by writing relevant error messages. (Except for error messages Moose is a pretty good piece of software)

    Read the article

  • Circular reference with entity manager factory

    - by CodesLikeA_Mokey
    Every time I try and start my app, I get this error on startup: SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'identityAccessAppConfig': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.package.identityaccess.identity.UserRepository com.package.identityaccess.IdentityAccessAppConfig.userRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Cannot create inner bean '(inner bean)' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1': Cannot resolve reference to bean 'identityAccessEntityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'identityAccessEntityManagerFactory': Requested bean is currently in creation: Is there an unresolvable circular reference? at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198) at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:741) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5291) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'identityAccessAppConfig': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.package.identityaccess.identity.UserRepository com.package.identityaccess.IdentityAccessAppConfig.userRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Cannot create inner bean '(inner bean)' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1': Cannot resolve reference to bean 'identityAccessEntityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'identityAccessEntityManagerFactory': Requested bean is currently in creation: Is there an unresolvable circular reference? at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1116) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:353) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1025) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:921) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:438) at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:277) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:139) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.<init>(PersistenceExceptionTranslationInterceptor.java:79) at org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor.<init>(PersistenceExceptionTranslationAdvisor.java:71) at org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:85) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1502) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1470) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521) ... 20 more Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.package.identityaccess.identity.UserRepository com.package.identityaccess.IdentityAccessAppConfig.userRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Cannot create inner bean '(inner bean)' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1': Cannot resolve reference to bean 'identityAccessEntityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'identityAccessEntityManagerFactory': Requested bean is currently in creation: Is there an unresolvable circular reference? at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:514) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285) ... 45 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Cannot create inner bean '(inner bean)' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1': Cannot resolve reference to bean 'identityAccessEntityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'identityAccessEntityManagerFactory': Requested bean is currently in creation: Is there an unresolvable circular reference? at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:282) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:126) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1387) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1128) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:912) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:855) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:770) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:486) ... 47 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1': Cannot resolve reference to bean 'identityAccessEntityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'identityAccessEntityManagerFactory': Requested bean is currently in creation: Is there an unresolvable circular reference? at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107) at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:615) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:441) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1025) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:921) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:271) ... 60 more Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'identityAccessEntityManagerFactory': Requested bean is currently in creation: Is there an unresolvable circular reference? at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.beforeSingletonCreation(DefaultSingletonBeanRegistry.java:327) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:217) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323) I am new to configuring spring through java and have been spinning circles for days. I have my application which includes 2 separate modules. The identity-access module will handle user and access information and will have a datasource to an older database. The other module module2 will eventually have its own database. Here are the config files: application: @Configuration @EnableWebMvc @ComponentScan(basePackages = "com.package.myapp.web") @ImportResource({"classpath:com/package/appbase/appbase-context.xml"}) @Import(com.package.identityaccess.IdentityAccessAppConfig.class) public class IMSAppConfig extends WebMvcConfigurerAdapter { @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**").addResourceLocations("ims/resources/"); } } identity-access: @Configuration @ComponentScan(basePackages = "com.package.identityaccess") @EnableJpaRepositories(entityManagerFactoryRef = "identityAccessEntityManagerFactory", value = "com.package.identityaccess") @EnableTransactionManagement public class IdentityAccessAppConfig { @Autowired UserRepository userRepository; @Bean public DataSource identityAccessDataSource() throws IOException, SQLException { return new SelfConfiguringBasicDataSource(System.getProperty("db_properties_path") + "/dev.oracle.properties", ""); } @Bean public Map<String, Object> identityAccessJpaProperties() { Map<String, Object> props = new HashMap<>(); props.put("eclipselink.weaving", "false"); props.put("eclipselink.target-database", OraclePlatform.class.getName()); return props; } @Bean public JpaVendorAdapter identityAccessJpaVendorAdapter() { EclipseLinkJpaVendorAdapter eclipseLinkJpaVendorAdapter = new EclipseLinkJpaVendorAdapter(); eclipseLinkJpaVendorAdapter.setDatabasePlatform(OraclePlatform.class.getName()); eclipseLinkJpaVendorAdapter.setGenerateDdl(false); eclipseLinkJpaVendorAdapter.setShowSql(true); return eclipseLinkJpaVendorAdapter; } @Bean public PlatformTransactionManager identityAccessTransactionManager() throws IOException, SQLException { JpaTransactionManager txManager = new JpaTransactionManager(); txManager.setEntityManagerFactory(identityAccessEntityManagerFactory().getObject()); return txManager; } @Bean public LocalContainerEntityManagerFactoryBean identityAccessEntityManagerFactory() throws IOException, SQLException { LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean(); lef.setDataSource(identityAccessDataSource()); lef.setJpaPropertyMap(identityAccessJpaProperties()); lef.setJpaVendorAdapter(identityAccessJpaVendorAdapter()); lef.setPackagesToScan("com.package.identityaccess"); return lef; } @Bean public AuthenticationService authenticationService() { return new AuthenticationServiceImpl(userRepository); } } module2: @Configuration @ComponentScan(basePackages = "com.package.myapp.core") @EnableJpaRepositories("com.package.myapp.core.domain") @EnableTransactionManagement public class ModuleTwoAppConfig { @Bean public DataSource dataSource() { EmbeddedDatabaseBuilder embeddedDatabaseBuilder = new EmbeddedDatabaseBuilder(); embeddedDatabaseBuilder.setType(EmbeddedDatabaseType.HSQL); embeddedDatabaseBuilder.addScript("setup.sql"); return embeddedDatabaseBuilder.build(); } @Bean public Map<String, Object> jpaProperties() { Map<String, Object> props = new HashMap<>(); props.put("eclipselink.weaving", "false"); props.put("eclipselink.ddl-generation", "create-tables"); props.put("eclipselink.target-database", HSQLPlatform.class.getName()); return props; } @Bean public JpaVendorAdapter jpaVendorAdapter() { EclipseLinkJpaVendorAdapter eclipseLinkJpaVendorAdapter = new EclipseLinkJpaVendorAdapter(); eclipseLinkJpaVendorAdapter.setDatabasePlatform(HSQLPlatform.class.getName()); eclipseLinkJpaVendorAdapter.setGenerateDdl(true); eclipseLinkJpaVendorAdapter.setShowSql(true); return eclipseLinkJpaVendorAdapter; } @Bean public PlatformTransactionManager transactionManager() { JpaTransactionManager txManager = new JpaTransactionManager(); txManager.setEntityManagerFactory(entityManagerFactory().getObject()); return txManager; } @Bean public LocalContainerEntityManagerFactoryBean entityManagerFactory() { LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean(); lef.setDataSource(dataSource()); lef.setJpaPropertyMap(jpaProperties()); lef.setJpaVendorAdapter(jpaVendorAdapter()); lef.setPackagesToScan("com.package.myapp.core.domain"); return lef; } } UserRepository (uses spring-data): public interface UserRepository extends JpaRepository<User, Long> { @Query("select u from User u where u.user_id = ?1") User findByUserId(String userId); } Can you see any problems with what I've done?

    Read the article

  • Factory, Abstract Factory and Factory Method

    - by skydoor
    Hi, I am really confused about these three terms. My understanding is that: in the Factory pattern, there is no concrete factory. The factory builds the new objects according to the parameters. in Abstract Factory pattern, there are multiple concrete factories. The client has to create different concrete factories explicitly. Is that right? What are the other differences? Furthermore, what is the Factory Method pattern? Is it same as the Factory pattern?

    Read the article

  • Difference between Factory Method and Abstract Factory design patterns using C#.Net

    - by nijhawan.saurabh
    First of all I'll just put both these patterns in context and describe their intent as in the GOF book: Factory Method: Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.   Abstract Factory: Provide an interface for creating families of related or dependent objects without specifying their concrete classes.   Points to note:   Abstract factory pattern adds a layer of abstraction to the factory method pattern. The type of factory is not known to the client at compile time, this information is passed to the client at runtime (How it is passed is again dependent on the system, you may store this information in configuration files and the client can read it on execution). While implementing Abstract factory pattern, the factory classes can have multiple factory methods. In Abstract factory, a factory is capable of creating more than one type of product (Simpilar products are grouped together in a factory)   Sample implementation of factory method pattern   Let's see the class diagram first:                   ProductFactory.cs // ----------------------------------------------------------------------- // <copyright file="ProductFactory.cs" company=""> // TODO: Update copyright text. // </copyright> // -----------------------------------------------------------------------   namespace FactoryMethod {     using System;     using System.Collections.Generic;     using System.Linq;     using System.Text;       /// <summary>     /// TODO: Update summary.     /// </summary>     public abstract class ProductFactory     {         /// <summary>         /// </summary>         /// <returns>         /// </returns>         public abstract Product CreateProductInstance();     } }     ProductAFactory.cs // ----------------------------------------------------------------------- // <copyright file="ProductAFactory.cs" company=""> // TODO: Update copyright text. // </copyright> // -----------------------------------------------------------------------   namespace FactoryMethod {     using System;     using System.Collections.Generic;     using System.Linq;     using System.Text;       /// <summary>     /// TODO: Update summary.     /// </summary>     public class ProductAFactory:ProductFactory     {         public override Product CreateProductInstance()         {             return new ProductA();         }     } }         // ----------------------------------------------------------------------- // <copyright file="ProductBFactory.cs" company=""> // TODO: Update copyright text. // </copyright> // -----------------------------------------------------------------------   namespace FactoryMethod {     using System;     using System.Collections.Generic;     using System.Linq;     using System.Text;       /// <summary>     /// TODO: Update summary.     /// </summary>     public class ProductBFactory:ProductFactory     {         public override Product CreateProductInstance()         {             return new ProductB();           }     } }     // ----------------------------------------------------------------------- // <copyright file="Product.cs" company=""> // TODO: Update copyright text. // </copyright> // -----------------------------------------------------------------------   namespace FactoryMethod {     using System;     using System.Collections.Generic;     using System.Linq;     using System.Text;       /// <summary>     /// TODO: Update summary.     /// </summary>     public abstract class Product     {         public abstract string Name { get; set; }     } }     // ----------------------------------------------------------------------- // <copyright file="ProductA.cs" company=""> // TODO: Update copyright text. // </copyright> // -----------------------------------------------------------------------   namespace FactoryMethod {     using System;     using System.Collections.Generic;     using System.Linq;     using System.Text;       /// <summary>     /// TODO: Update summary.     /// </summary>     public class ProductA:Product     {         public ProductA()         {               Name = "ProductA";         }           public override string Name { get; set; }     } }       // ----------------------------------------------------------------------- // <copyright file="ProductB.cs" company=""> // TODO: Update copyright text. // </copyright> // -----------------------------------------------------------------------   namespace FactoryMethod {     using System;     using System.Collections.Generic;     using System.Linq;     using System.Text;       /// <summary>     /// TODO: Update summary.     /// </summary>     public class ProductB:Product     {          public ProductB()         {               Name = "ProductA";         }         public override string Name { get; set; }     } }     Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text;   namespace FactoryMethod {     class Program     {         static void Main(string[] args)         {             ProductFactory pf = new ProductAFactory();               Product product = pf.CreateProductInstance();             Console.WriteLine(product.Name);         }     } }       Normal 0 false false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

    Read the article

  • Confused about this factory, as it doesn't look like an Abstract Factory nor Factory Method

    - by Pin
    I'm looking into Guice and I've been reading its documentation recently. Reading the motivation section I don't understand the factories part, why they name it that way. To me that factory is just a wrapper for the implementing class they want it to return after calling getInstance(). public class CreditCardProcessorFactory { private static CreditCardProcessor instance; public static void setInstance(CreditCardProcessor creditCardProcessor) { instance = creditCardProcessor; } public static CreditCardProcessor getInstance() { if (instance == null) { throw new IllegalStateException("CreditCardProcessorFactory not initialized. " + "Did you forget to call CreditCardProcessor.setInstance() ?"); } return instance; } } Why do they call it factory as well if it is neither an abstract factory nor a factory method? Or am I missing something? Thanks.

    Read the article

  • factory girl - know when an attribute is overridden in factory

    - by carlos
    Is there any way to determine if attributes are overridden in a factory and adjust the behavior of the factory based on those overrides? The evaluator passed into the callbacks contains a __override_names__ method. Unfortunately, by the time it is passed to the callback, every attribute configured by the factory is included in the array returned. Moreover, the Evaluator is marked as api private.

    Read the article

  • Is there anything wrong with my Factory class?

    - by Alex
    class PieceFactory { @SuppressWarnings("rawtypes") public Piece createPiece(String pieceType) throws Throwable{ Class pieceClass = Class.forName(pieceType); Piece piece = (Piece) pieceClass.newInstance(); return piece; } } I'm not all used to handling exceptions yet therefore I'm just throwing them, but everywhere I use a method that uses this factory it tells me I have to throw exceptions like throwable. For example, in one of my classes I have a method that instantiates a lot of objects using the method that uses the factory. I can use the method in that class by just throwing the exception, however it won't work if I try to pass a reference to that class to another class and then use the method from there. Then it forces me to try catch the exception. I probably don't need a factory but it seemed interesting and I'd like to try to use patterns. The reason I created the factory was that I have 6 subclasses of Piece and I wan't to use a method to instantiate them by passing the type of subclass I want as an argument to the method.

    Read the article

  • Factory Pattern: Determining concrete factory class instantiation?

    - by Chris
    I'm trying to learn patterns and I'm stuck on determining how or where a Factory Pattern determines what class to instanciate. If I have a Application that calls the factory and sends it, say, an xml config file to determine what type of action to take, where does that logic for interpreting the config file happen? THE FACTORY using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace myNamespace { public abstract class SourceFactory { abstract public UploadSource getUploadSource(); } public class TextSourceFactory : SourceFactory { public override UploadSource getUploadSource() { return new TextUploadSource(); } } public class XmlSourceFacotry : SourceFactory { public override UploadSource getUploadSource() { return new XmlUploadSource(); } } public class SqlSourceFactory : SourceFactory { public override UploadSource getUploadSource() { return new SqlUploadSource(); } } } THE CLASSES using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace myNamespace { public abstract class UploadSource { abstract public void Execute(); } public class TextUploadSource : UploadSource { public override void Execute() { Console.WriteLine("You executed a text upload source"); } } public class XmlUploadSource : UploadSource { public override void Execute() { Console.WriteLine("You executed an XML upload source"); } } public class SqlUploadSource : UploadSource { public override void Execute() { Console.WriteLine("You executed a SQL upload source"); } } }

    Read the article

  • How to have Moose return a child class instance instead of its own class, for polymorphism

    - by alex8657
    I want to create a generic class, whose builder would not return an instance of this generic class, but an instance of a dedicated children class. As Moose does automatic object building, i do not get to understand if this something possible, and how to create a Moose class with Moose syntax and having this behaviour Eg: The user asks: $file = Repository-new(uri='sftp://blabla') .... and is returned an Repository::_Sftp instance User would use $file as if it is a Repository instance, without the need to know the real subclass (polymorphism)

    Read the article

  • Moose::Error::Croak error reporting not from perspective of caller.

    - by crashpoint_zero
    I just recently started out on Moose and its a great OO framework not only to use but also to learn new OO concepts. One of the things I wanted to do was to do error reporting from perspective of caller during object creation. I saw that Moose has the module Moose::Error::Croak which tells Moose to override the default error reporting by croak call. I used it but it did not seem to help Moose code - Foo.pm package Foo; use metaclass ( metaclass => 'Moose::Meta::Class', error_class => 'Moose::Error::Croak', ); use Moose; has 'attr1' => ( is => 'rw', isa => 'Str', required => '1', ); no Moose; 1; Moose code - fooser.pl #!/usr/bin/perl use strict; use warnings; use Foo; my $foobj = Foo->new(); This fails with error: Attribute (attr1) is required at /usr/local/lib/perl/5.8.8/Class/MOP/Class.pm line 364 which is terse than the actual stack trace if Moose::Error::Croak is not used. But it does not report it from perspective of caller. If this were a Perl 5 OO code and I had Foo.pm as: package Foo; use strict; use warnings; use Carp; sub new { my ($class, %args) = @_; my $self = {}; if (! exists $args{'attr1'}) { croak "ERR: did not provide attr1"; } $self->{'attr1'} = $args{attr1}; bless $self, $class; return $self; } 1; And if fooser.pl was executed I would have got the error: "ERR: did not provide attr1 at fooser.pl line 6" which is from the perspective of the caller as it points to line no. 6 of fooser.pl rather than MOP.pm's line no. 364. How can I do this in Moose? Or am I misunderstanding something here?

    Read the article

  • Perl Moose::Util::TypeConstraints bug ? what is this error about the name has invalid chars ?

    - by alex8657
    That has been hours i am tracking a Moose::Util::TypeConstraints exceptions, i don't understand where it gets to check a type and tells me that the name is incorrect. I tracked the error to a reduced example to try to locate the problem, and it just shows me that i do not get it. Did i get to a Moose::Util::TypeConstraints bug ? aoffice:new alex$ perl -c ../codesnippets/typeconstrainterror.pl ../codesnippets/typeconstrainterror.pl syntax OK aoffice:new alex$ perl -d ../codesnippets/typeconstrainterror.pl (...) DB<1> r Something::File::LocalFile=HASH(0x100d1bfa8) contains invalid characters for a type name. Names can contain alphanumeric character, ":", and "." at /opt/local/lib/perl5/vendor_perl/5.10.1/darwin-multi-2level/Moose/Util/TypeConstraints.pm line 508 Moose::Util::TypeConstraints::_create_type_constraint('Something::File::LocalFile=HASH(0x100d1bfa8)', undef, undef, undef, undef) called at /opt/local/lib/perl5/vendor_perl/5.10.1/darwin-multi-2level/Moose/Util/TypeConstraints.pm line 285 Moose::Util::TypeConstraints::type('Something::File::LocalFile=HASH(0x100d1bfa8)') called at ../codesnippets/typeconstrainterror.pl line 7 Something::File::is_slink('Something::File::LocalFile=HASH(0x100d1bfa8)') called at ../codesnippets/typeconstrainterror.pl line 33 Debugged program terminated. Use q to quit or R to restart, use o inhibit_exit to avoid stopping after program termination, h q, h R or h o to get additional info. Below, the code that crashes: package Something::File; use Moose; has 'type' =>(is=>'ro', isa=>'Str', writer=>'_set_type' ); sub is_slink { my $self = shift; return ( $self->type eq 'slink' ); } no Moose; __PACKAGE__->meta->make_immutable; 1; package Something::File::LocalFile; use Moose; use Moose::Util::TypeConstraints; extends 'Something::File'; subtype 'PositiveInt' => as 'Int' => where { $_ >0 } => message { 'Only positive greater than zero integers accepted' }; no Moose; __PACKAGE__->meta->make_immutable; 1; my $a = Something::File::LocalFile->new; # $a->_set_type('slink'); print $a->is_slink ." end\n";

    Read the article

  • replacing a method of a Moose object at runtime

    - by xxxxxxx
    Hi, is it possible to replace a method of a Moose object at runtime ? By looking at the source code of Class::MOP::Method(which Moose::Meta::Method inherits from) I concluded that by doing $method->{body} = sub{ my stuff } I would be able to replace at runtime a method of an object. I can get the method using $object->meta->find_method_by_name(<method_name>); However.. this didn't quite work out. Is it conceivable to modify methods at runtime ? and what is the way to do it with Moose ? Thanks

    Read the article

  • How can I use Moose with Test::Class?

    - by rassie
    I'm currently refactoring a test suite built up by a colleague and would like to use Test::Class[::Most] while doing so. As I started I figured out I could really use a couple of Moose roles to decouple code a little bit. However, it seems it's not quite possible -- I'm getting error messages like this one: Prototype mismatch: sub My::Test::Class::Base::blessed: none vs ($) at /usr/lib/perl5/vendor_perl/5.8.8/Sub/Exporter.pm line 896 So the question is: can I use Moose together with Test::Class and if so, how? PS: The code goes like this: package My::Test::Class::Base; use Moose; use Test::Class::Most; with 'My::Cool::Role'; has attr => ( ... );

    Read the article

  • How can I use Moose with Test::Class?

    - by rassie
    I'm currently refactoring a test suite built up by a colleague and would like to use Test::Class[::Most] while doing so. As I started I figured out I could really use a couple of Moose roles to decouple code a little bit. However, it seems it's not quite possible -- I'm getting error messages like this one: Prototype mismatch: sub My::Test::Class::Base::blessed: none vs ($) at /usr/lib/perl5/vendor_perl/5.8.8/Sub/Exporter.pm line 896 So the question is: can I use Moose together with Test::Class and if so, how? PS: The code goes like this: package My::Test::Class::Base; use Moose; use Test::Class::Most; with 'My::Cool::Role'; has attr => ( ... );

    Read the article

  • Factory Method Implementation

    - by cedar715
    I was going through the 'Factory method' pages in SO and had come across this link. And this comment. The example looked as a variant and thought to implement in its original way: to defer instantiation to subclasses... Here is my attempt. Does the following code implements the Factory pattern of the example specified in the link? Please validate and suggest if this has to undergo any re-factoring. public class ScheduleTypeFactoryImpl implements ScheduleTypeFactory { @Override public IScheduleItem createLinearScheduleItem() { return new LinearScheduleItem(); } @Override public IScheduleItem createVODScheduleItem() { return new VODScheduleItem(); } } public class UseScheduleTypeFactory { public enum ScheduleTypeEnum { CableOnDemandScheduleTypeID, BroadbandScheduleTypeID, LinearCableScheduleTypeID, MobileLinearScheduleTypeID } public static IScheduleItem getScheduleItem(ScheduleTypeEnum scheduleType) { IScheduleItem scheduleItem = null; ScheduleTypeFactory scheduleTypeFactory = new ScheduleTypeFactoryImpl(); switch (scheduleType) { case CableOnDemandScheduleTypeID: scheduleItem = scheduleTypeFactory.createVODScheduleItem(); break; case BroadbandScheduleTypeID: scheduleItem = scheduleTypeFactory.createVODScheduleItem(); break; case LinearCableScheduleTypeID: scheduleItem = scheduleTypeFactory.createLinearScheduleItem(); break; case MobileLinearScheduleTypeID: scheduleItem = scheduleTypeFactory.createLinearScheduleItem(); break; default: break; } return scheduleItem; } }

    Read the article

  • Better solution then simple factory method when concrete implementations have different attributes

    - by danip
    abstract class Animal { function eat() {..} function sleep() {..} function isSmart() } class Dog extends Animal { public $blnCanBark; function isSmart() { return $this->blnCanBark; } } class Cat extends Animal { public $blnCanJumpHigh; function isSmart() { return $this->blnCanJumpHigh; } } .. and so on up to 10-20 animals. Now I created a factory using simple factory method and try to create instances like this: class AnimalFactory { public static function create($strName) { switch($strName) { case 'Dog': return new Dog(); case 'Cat': return new Cat(); default: break; } } } The problem is I can't set the specific attributes like blnCanBark, blnCanJumpHigh in an efficient way. I can send all of them as extra params to create but this will not scale to more then a few classes. Also I can't break the inheritance because a lot of the basic functionality is the same. Is there a better pattern to solve this?

    Read the article

  • Is factory method proper design for my problem?

    - by metdos
    Hello Everyone, here is my problem and I'm considering to use factory method in C++, what are your opinions ? There are a Base Class and a lot of Subclasses. I need to transfer objects on network via TCP. I will create objects in first side, and using this object I will create a byte array TCP message, and send it to other side. On the other side I will decompose TCP message, I will create object and I will add this object to a polymorphic queue.

    Read the article

  • EMERGENCY - Major Problems After Perl Module Installed via WHM

    - by Russell C.
    I attempted to install the perl module Net::Twitter::Role::API::Lists using WHM and after doing so my whole site came down. It seems that something that was updated with the install isn't functioning correctly and since our website it written in Perl none of our site scripts will run. In almost 8 years of working with Perl I've never had any issues arise after installing a perl module so I have no idea how to even start troubleshooting. The error I see when trying to compile any of our Perl scripts is below. I'd appreciate any advice on what might be wrong and steps on how I can go about resolve it. Thanks in advance for your help! Attribute (+type_constraint) of class MooseX::AttributeHelpers::Counter has no associated methods (did you mean to provide an "is" argument?) at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Attribute.pm line 551 Moose::Meta::Attribute::_check_associated_methods('Moose::Meta::Attribute=HASH(0x9ae35b4)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Class.pm line 303 Moose::Meta::Class::add_attribute('Moose::Meta::Class=HASH(0xa4d7718)', 'Moose::Meta::Attribute=HASH(0x9ae35b4)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role/Application/ToClass.pm line 142 Moose::Meta::Role::Application::ToClass::apply_attributes('Moose::Meta::Role::Application::ToClass=HASH(0xa4dfb38)', 'Moose::Meta::Role=HASH(0xa3dbdec)', 'Moose::Meta::Class=HASH(0xa4d7718)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role/Application.pm line 72 Moose::Meta::Role::Application::apply('Moose::Meta::Role::Application::ToClass=HASH(0xa4dfb38)', 'Moose::Meta::Role=HASH(0xa3dbdec)', 'Moose::Meta::Class=HASH(0xa4d7718)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role/Application/ToClass.pm line 31 Moose::Meta::Role::Application::ToClass::apply('Moose::Meta::Role::Application::ToClass=HASH(0xa4dfb38)', 'Moose::Meta::Role=HASH(0xa3dbdec)', 'Moose::Meta::Class=HASH(0xa4d7718)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role.pm line 419 Moose::Meta::Role::apply('Moose::Meta::Role=HASH(0xa3dbdec)', 'Moose::Meta::Class=HASH(0xa4d7718)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Util.pm line 132 Moose::Util::_apply_all_roles('Moose::Meta::Class=HASH(0xa4d7718)', 'undef', 'MooseX::AttributeHelpers::Trait::Counter') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Util.pm line 86 Moose::Util::apply_all_roles('Moose::Meta::Class=HASH(0xa4d7718)', 'MooseX::AttributeHelpers::Trait::Counter') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose.pm line 57 Moose::with('Moose::Meta::Class=HASH(0xa4d7718)', 'MooseX::AttributeHelpers::Trait::Counter') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Exporter.pm line 293 Moose::with('MooseX::AttributeHelpers::Trait::Counter') called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 10 require MooseX/AttributeHelpers/Counter.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers.pm line 23 MooseX::AttributeHelpers::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 require MooseX/AttributeHelpers.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/ClassAttribute/Role/Meta/Class.pm line 6 MooseX::ClassAttribute::Role::Meta::Class::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 require MooseX/ClassAttribute/Role/Meta/Class.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/ClassAttribute.pm line 11 MooseX::ClassAttribute::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 require MooseX/ClassAttribute.pm called at /usr/lib/perl5/site_perl/5.8.8/Olson/Abbreviations.pm line 6 Olson::Abbreviations::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 require Olson/Abbreviations.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/Types/DateTime/ButMaintained.pm line 10 MooseX::Types::DateTime::ButMaintained::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 require MooseX/Types/DateTime/ButMaintained.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/Types/DateTimeX.pm line 9 MooseX::Types::DateTimeX::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 require MooseX/Types/DateTimeX.pm called at /usr/lib/perl5/site_perl/5.8.8/Net/Amazon/S3/Client/Bucket.pm line 5 Net::Amazon::S3::Client::Bucket::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 require Net/Amazon/S3/Client/Bucket.pm called at /usr/lib/perl5/site_perl/5.8.8/Net/Amazon/S3.pm line 111 Net::Amazon::S3::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 require Net/Amazon/S3.pm called at /home/atrails/www/cgi-bin/main.pm line 1633 main::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 require main.pm called at /home/atrails/cron/meetup.pl line 20 main::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 Attribute (+default) of class MooseX::AttributeHelpers::Counter has no associated methods (did you mean to provide an "is" argument?) at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Attribute.pm line 551 Moose::Meta::Attribute::_check_associated_methods('Moose::Meta::Attribute=HASH(0xa4df4b4)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Class.pm line 303 Moose::Meta::Class::add_attribute('Moose::Meta::Class=HASH(0xa4d7718)', 'Moose::Meta::Attribute=HASH(0xa4df4b4)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role/Application/ToClass.pm line 142 Moose::Meta::Role::Application::ToClass::apply_attributes('Moose::Meta::Role::Application::ToClass=HASH(0xa4dfb38)', 'Moose::Meta::Role=HASH(0xa3dbdec)', 'Moose::Meta::Class=HASH(0xa4d7718)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role/Application.pm line 72 Moose::Meta::Role::Application::apply('Moose::Meta::Role::Application::ToClass=HASH(0xa4dfb38)', 'Moose::Meta::Role=HASH(0xa3dbdec)', 'Moose::Meta::Class=HASH(0xa4d7718)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role/Application/ToClass.pm line 31 Moose::Meta::Role::Application::ToClass::apply('Moose::Meta::Role::Application::ToClass=HASH(0xa4dfb38)', 'Moose::Meta::Role=HASH(0xa3dbdec)', 'Moose::Meta::Class=HASH(0xa4d7718)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role.pm line 419 Moose::Meta::Role::apply('Moose::Meta::Role=HASH(0xa3dbdec)', 'Moose::Meta::Class=HASH(0xa4d7718)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Util.pm line 132 Moose::Util::_apply_all_roles('Moose::Meta::Class=HASH(0xa4d7718)', 'undef', 'MooseX::AttributeHelpers::Trait::Counter') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Util.pm line 86 Moose::Util::apply_all_roles('Moose::Meta::Class=HASH(0xa4d7718)', 'MooseX::AttributeHelpers::Trait::Counter') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose.pm line 57 Moose::with('Moose::Meta::Class=HASH(0xa4d7718)', 'MooseX::AttributeHelpers::Trait::Counter') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Exporter.pm line 293 Moose::with('MooseX::AttributeHelpers::Trait::Counter') called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 10 require MooseX/AttributeHelpers/Counter.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers.pm line 23 MooseX::AttributeHelpers::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 require MooseX/AttributeHelpers.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/ClassAttribute/Role/Meta/Class.pm line 6 MooseX::ClassAttribute::Role::Meta::Class::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 require MooseX/ClassAttribute/Role/Meta/Class.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/ClassAttribute.pm line 11 MooseX::ClassAttribute::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 require MooseX/ClassAttribute.pm called at /usr/lib/perl5/site_perl/5.8.8/Olson/Abbreviations.pm line 6 Olson::Abbreviations::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 require Olson/Abbreviations.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/Types/DateTime/ButMaintained.pm line 10 MooseX::Types::DateTime::ButMaintained::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 require MooseX/Types/DateTime/ButMaintained.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/Types/DateTimeX.pm line 9 MooseX::Types::DateTimeX::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 require MooseX/Types/DateTimeX.pm called at /usr/lib/perl5/site_perl/5.8.8/Net/Amazon/S3/Client/Bucket.pm line 5 Net::Amazon::S3::Client::Bucket::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 require Net/Amazon/S3/Client/Bucket.pm called at /usr/lib/perl5/site_perl/5.8.8/Net/Amazon/S3.pm line 111 Net::Amazon::S3::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 require Net/Amazon/S3.pm called at /home/atrails/www/cgi-bin/main.pm line 1633 main::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 require main.pm called at /home/atrails/cron/meetup.pl line 20 main::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Counter.pm line 0 Attribute (+type_constraint) of class MooseX::AttributeHelpers::Number has no associated methods (did you mean to provide an "is" argument?) at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Attribute.pm line 551 Moose::Meta::Attribute::_check_associated_methods('Moose::Meta::Attribute=HASH(0xa4ea48c)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Class.pm line 303 Moose::Meta::Class::add_attribute('Moose::Meta::Class=HASH(0xa4f778c)', 'Moose::Meta::Attribute=HASH(0xa4ea48c)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role/Application/ToClass.pm line 142 Moose::Meta::Role::Application::ToClass::apply_attributes('Moose::Meta::Role::Application::ToClass=HASH(0xa4f8014)', 'Moose::Meta::Role=HASH(0xa38b764)', 'Moose::Meta::Class=HASH(0xa4f778c)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role/Application.pm line 72 Moose::Meta::Role::Application::apply('Moose::Meta::Role::Application::ToClass=HASH(0xa4f8014)', 'Moose::Meta::Role=HASH(0xa38b764)', 'Moose::Meta::Class=HASH(0xa4f778c)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role/Application/ToClass.pm line 31 Moose::Meta::Role::Application::ToClass::apply('Moose::Meta::Role::Application::ToClass=HASH(0xa4f8014)', 'Moose::Meta::Role=HASH(0xa38b764)', 'Moose::Meta::Class=HASH(0xa4f778c)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role.pm line 419 Moose::Meta::Role::apply('Moose::Meta::Role=HASH(0xa38b764)', 'Moose::Meta::Class=HASH(0xa4f778c)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Util.pm line 132 Moose::Util::_apply_all_roles('Moose::Meta::Class=HASH(0xa4f778c)', 'undef', 'MooseX::AttributeHelpers::Trait::Number') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Util.pm line 86 Moose::Util::apply_all_roles('Moose::Meta::Class=HASH(0xa4f778c)', 'MooseX::AttributeHelpers::Trait::Number') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose.pm line 57 Moose::with('Moose::Meta::Class=HASH(0xa4f778c)', 'MooseX::AttributeHelpers::Trait::Number') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Exporter.pm line 293 Moose::with('MooseX::AttributeHelpers::Trait::Number') called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 9 require MooseX/AttributeHelpers/Number.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers.pm line 24 MooseX::AttributeHelpers::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 require MooseX/AttributeHelpers.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/ClassAttribute/Role/Meta/Class.pm line 6 MooseX::ClassAttribute::Role::Meta::Class::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 require MooseX/ClassAttribute/Role/Meta/Class.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/ClassAttribute.pm line 11 MooseX::ClassAttribute::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 require MooseX/ClassAttribute.pm called at /usr/lib/perl5/site_perl/5.8.8/Olson/Abbreviations.pm line 6 Olson::Abbreviations::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 require Olson/Abbreviations.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/Types/DateTime/ButMaintained.pm line 10 MooseX::Types::DateTime::ButMaintained::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 require MooseX/Types/DateTime/ButMaintained.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/Types/DateTimeX.pm line 9 MooseX::Types::DateTimeX::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 require MooseX/Types/DateTimeX.pm called at /usr/lib/perl5/site_perl/5.8.8/Net/Amazon/S3/Client/Bucket.pm line 5 Net::Amazon::S3::Client::Bucket::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 require Net/Amazon/S3/Client/Bucket.pm called at /usr/lib/perl5/site_perl/5.8.8/Net/Amazon/S3.pm line 111 Net::Amazon::S3::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 require Net/Amazon/S3.pm called at /home/atrails/www/cgi-bin/main.pm line 1633 main::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 require main.pm called at /home/atrails/cron/meetup.pl line 20 main::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 Attribute (+default) of class MooseX::AttributeHelpers::Number has no associated methods (did you mean to provide an "is" argument?) at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Attribute.pm line 551 Moose::Meta::Attribute::_check_associated_methods('Moose::Meta::Attribute=HASH(0xa4f7804)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Class.pm line 303 Moose::Meta::Class::add_attribute('Moose::Meta::Class=HASH(0xa4f778c)', 'Moose::Meta::Attribute=HASH(0xa4f7804)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role/Application/ToClass.pm line 142 Moose::Meta::Role::Application::ToClass::apply_attributes('Moose::Meta::Role::Application::ToClass=HASH(0xa4f8014)', 'Moose::Meta::Role=HASH(0xa38b764)', 'Moose::Meta::Class=HASH(0xa4f778c)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role/Application.pm line 72 Moose::Meta::Role::Application::apply('Moose::Meta::Role::Application::ToClass=HASH(0xa4f8014)', 'Moose::Meta::Role=HASH(0xa38b764)', 'Moose::Meta::Class=HASH(0xa4f778c)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role/Application/ToClass.pm line 31 Moose::Meta::Role::Application::ToClass::apply('Moose::Meta::Role::Application::ToClass=HASH(0xa4f8014)', 'Moose::Meta::Role=HASH(0xa38b764)', 'Moose::Meta::Class=HASH(0xa4f778c)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role.pm line 419 Moose::Meta::Role::apply('Moose::Meta::Role=HASH(0xa38b764)', 'Moose::Meta::Class=HASH(0xa4f778c)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Util.pm line 132 Moose::Util::_apply_all_roles('Moose::Meta::Class=HASH(0xa4f778c)', 'undef', 'MooseX::AttributeHelpers::Trait::Number') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Util.pm line 86 Moose::Util::apply_all_roles('Moose::Meta::Class=HASH(0xa4f778c)', 'MooseX::AttributeHelpers::Trait::Number') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose.pm line 57 Moose::with('Moose::Meta::Class=HASH(0xa4f778c)', 'MooseX::AttributeHelpers::Trait::Number') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Exporter.pm line 293 Moose::with('MooseX::AttributeHelpers::Trait::Number') called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 9 require MooseX/AttributeHelpers/Number.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers.pm line 24 MooseX::AttributeHelpers::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 require MooseX/AttributeHelpers.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/ClassAttribute/Role/Meta/Class.pm line 6 MooseX::ClassAttribute::Role::Meta::Class::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 require MooseX/ClassAttribute/Role/Meta/Class.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/ClassAttribute.pm line 11 MooseX::ClassAttribute::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 require MooseX/ClassAttribute.pm called at /usr/lib/perl5/site_perl/5.8.8/Olson/Abbreviations.pm line 6 Olson::Abbreviations::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 require Olson/Abbreviations.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/Types/DateTime/ButMaintained.pm line 10 MooseX::Types::DateTime::ButMaintained::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 require MooseX/Types/DateTime/ButMaintained.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/Types/DateTimeX.pm line 9 MooseX::Types::DateTimeX::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 require MooseX/Types/DateTimeX.pm called at /usr/lib/perl5/site_perl/5.8.8/Net/Amazon/S3/Client/Bucket.pm line 5 Net::Amazon::S3::Client::Bucket::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 require Net/Amazon/S3/Client/Bucket.pm called at /usr/lib/perl5/site_perl/5.8.8/Net/Amazon/S3.pm line 111 Net::Amazon::S3::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 require Net/Amazon/S3.pm called at /home/atrails/www/cgi-bin/main.pm line 1633 main::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 require main.pm called at /home/atrails/cron/meetup.pl line 20 main::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/Number.pm line 0 Attribute (+type_constraint) of class MooseX::AttributeHelpers::String has no associated methods (did you mean to provide an "is" argument?) at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Attribute.pm line 551 Moose::Meta::Attribute::_check_associated_methods('Moose::Meta::Attribute=HASH(0xa4fdae0)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Class.pm line 303 Moose::Meta::Class::add_attribute('Moose::Meta::Class=HASH(0xa4fd5c4)', 'Moose::Meta::Attribute=HASH(0xa4fdae0)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role/Application/ToClass.pm line 142 Moose::Meta::Role::Application::ToClass::apply_attributes('Moose::Meta::Role::Application::ToClass=HASH(0xa5002d8)', 'Moose::Meta::Role=HASH(0xa42a690)', 'Moose::Meta::Class=HASH(0xa4fd5c4)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role/Application.pm line 72 Moose::Meta::Role::Application::apply('Moose::Meta::Role::Application::ToClass=HASH(0xa5002d8)', 'Moose::Meta::Role=HASH(0xa42a690)', 'Moose::Meta::Class=HASH(0xa4fd5c4)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role/Application/ToClass.pm line 31 Moose::Meta::Role::Application::ToClass::apply('Moose::Meta::Role::Application::ToClass=HASH(0xa5002d8)', 'Moose::Meta::Role=HASH(0xa42a690)', 'Moose::Meta::Class=HASH(0xa4fd5c4)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Role.pm line 419 Moose::Meta::Role::apply('Moose::Meta::Role=HASH(0xa42a690)', 'Moose::Meta::Class=HASH(0xa4fd5c4)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Util.pm line 132 Moose::Util::_apply_all_roles('Moose::Meta::Class=HASH(0xa4fd5c4)', 'undef', 'MooseX::AttributeHelpers::Trait::String') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Util.pm line 86 Moose::Util::apply_all_roles('Moose::Meta::Class=HASH(0xa4fd5c4)', 'MooseX::AttributeHelpers::Trait::String') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose.pm line 57 Moose::with('Moose::Meta::Class=HASH(0xa4fd5c4)', 'MooseX::AttributeHelpers::Trait::String') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Exporter.pm line 293 Moose::with('MooseX::AttributeHelpers::Trait::String') called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/String.pm line 10 require MooseX/AttributeHelpers/String.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers.pm line 25 MooseX::AttributeHelpers::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/String.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/String.pm line 0 require MooseX/AttributeHelpers.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/ClassAttribute/Role/Meta/Class.pm line 6 MooseX::ClassAttribute::Role::Meta::Class::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/String.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/String.pm line 0 require MooseX/ClassAttribute/Role/Meta/Class.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/ClassAttribute.pm line 11 MooseX::ClassAttribute::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/String.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/String.pm line 0 require MooseX/ClassAttribute.pm called at /usr/lib/perl5/site_perl/5.8.8/Olson/Abbreviations.pm line 6 Olson::Abbreviations::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/String.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/String.pm line 0 require Olson/Abbreviations.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/Types/DateTime/ButMaintained.pm line 10 MooseX::Types::DateTime::ButMaintained::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/String.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/String.pm line 0 require MooseX/Types/DateTime/ButMaintained.pm called at /usr/lib/perl5/site_perl/5.8.8/MooseX/Types/DateTimeX.pm line 9 MooseX::Types::DateTimeX::BEGIN() called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/String.pm line 0 eval {...} called at /usr/lib/perl5/site_perl/5.8.8/MooseX/AttributeHelpers/String.pm line 0 require MooseX/Types/DateTimeX.pm called at /usr/lib/perl5/site_perl/5.8.8/Net/Amazon/S3/Client/Bucket.pm line 5 Net::Amazon::S3::Client::Bucket::BEGIN() called at /usr/lib/perl5/site_per

    Read the article

  • Alternatives to storing Moose object using Apache::Session with CODE references

    - by Hartmut Behrens
    I have a Moose class that i would like to store using Apache::Session::File. However, Apache::Session::File by default will not store it and instead i get the error message: (in cleanup) Can't store CODE items at blib\lib\Storable.pm (autosplit into blib\lib\auto\Storable\_freeze.al)... This problem can be circumvented by setting $Storable::Deparse = 1; $Storable::Eval = 1; in order to allow CODE references to be serialized. The offending method in the Moose class is listed below, which retrieves a column from a mysql database: sub _build_cell_generic { my ($self,$col) = @_; my $sth = $self->call_dbh('prepare','select '.$col.' from '.$self->TABLE.' where CI = ? and LAC = ? and IMPORTDATE = ?'); $sth->execute($self->CI,$self->LAC,$self->IMPORTDATE); my $val = $sth->fetchrow_array; $sth->finish; return defined $val ? $val : undef; } So presumably the dbh object (isa DBIx::Connector) contains CODE references. Is there a better alternative in order to allow serialization of this Moose class than setting $Storable::Deparse and $Storable::Eval ?

    Read the article

  • Scala factory pattern returns unusable abstract type

    - by GGGforce
    Please let me know how to make the following bit of code work as intended. The problem is that the Scala compiler doesn't understand that my factory is returning a concrete class, so my object can't be used later. Can TypeTags or type parameters help? Or do I need to refactor the code some other way? I'm (obviously) new to Scala. trait Animal trait DomesticatedAnimal extends Animal trait Pet extends DomesticatedAnimal {var name: String = _} class Wolf extends Animal class Cow extends DomesticatedAnimal class Dog extends Pet object Animal { def apply(aType: String) = { aType match { case "wolf" => new Wolf case "cow" => new Cow case "dog" => new Dog } } } def name(a: Pet, name: String) { a.name = name println(a +"'s name is: " + a.name) } val d = Animal("dog") name(d, "fred") The last line of code fails because the compiler thinks d is an Animal, not a Dog.

    Read the article

  • Rebuilding lazily-built attribute when an underlying attribute changes in Moose

    - by friedo
    I've got a Moose class with a lazy_build attribute. The value of that attribute is a function of another (non-lazy) attribute. Suppose somebody instantiates the class with a value of 42 for the required attribute. Then they request the lazy attribute, which is calculated as a function of 42. Then, they have the nerve to change the first attribute! The lazy one has already been built, so the builder will not get called again, and the lazy attribute is now out-of-date. I have a solution now where I maintain a "dirty" flag on the required attribute, and an accessor on the lazy one checks the dirty flag and rebuilds it if needed. However, this seems like a lot of work. Is there a way to handle this within Moose, e.g. using traits?

    Read the article

  • Singleton Roles in Moose

    - by mjn12
    I am attempting to write a singleton role using Perl and Moose. I understand a MooseX::Singleton module is available but there is always resistance when requiring another CPAN module for our project. After trying this and having a little trouble I would like to understand WHY my method is not working. The singleton role I have written is as follows: package Singleton; use Moose::Role; my $_singleInstance; around 'new' => sub { my $orig = shift; my $class = shift; if (not defined $_singleInstance ){ $_singleInstance = $class->$orig(@_); } return $_singleInstance; }; sub getInstance { return __PACKAGE__->new(); } 1; This appears to work find when only one class uses the singleton role. However when two classes (ClassA and ClassB for example) both consume the Singleton role it appears as they are both referring to a shared $_singleInstance variable. If I call ClassA-getInstance it returns a reference to a ClassA object. If I call ClassB-getInstance sometime later in the same script it returns a reference to an object of type ClassA (even though I clearly called the getInstance method for ClassB). If I dont use a role and actually copy and paste the code from the Singleton role into ClassA and ClassB it appears to work fine. Whats going on here?

    Read the article

  • Perl OO frameworks and program design - Moose and Conway's inside-out objects (Class::Std)

    - by Emmel
    This is more of a use-case type of question... but also generic enough to be more broadly applicable: In short, I'm working on a module that's more or less a command-line wrapper; OO naturally. Without going into too many details (unless someone wants them), there isn't a crazy amount of complexity to the system, but it did feel natural to have three or four objects in this framework. Finally, it's an open source thing I'll put out there, rather than a module with a few developers in the same firm working on it. First I implemented the OO using Class::Std, because Perl Best Practices (Conway, 2005) made a good argument for why to use inside-out objects. Full control over what attributes get accessed and so on, proper encapsulation, etc. Also his design is surprisingly simple and clever. I liked it, but then noticed that no one really uses this; in fact it seems Conway himself doesn't really recommend this anymore? So I moved to everyone's favorite, Moose. It's easy to use, although way way overkill feature-wise for what I want to do. The big, major downside is: it's got a slew of module dependencies that force users of my module to download them all. A minor downside is it's got way more functionality than I really need. What are recommendations? Inconvenience fellow developers by forcing them to use a possibly-obsolete module, or force every user of the module to download Moose and all its dependencies? Is there a third option for a proper Perl OO framework that's popular but neither of these two?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >