Git Product home page Git Product logo

grails-cookie's People

Contributors

ctoestreich avatar dalew75 avatar donbeave avatar matrei avatar stokito avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

grails-cookie's Issues

cannot getCookie, return null

i am usin grail 3.1.1

i am trying to use cookie in grails 3. i tried this plugin but i don't know why its not work at all..

cookieService.setCookie('username', customer?.email)

and i use this code for call it from gsp

<g:cookie name="username"/>

i also tried this way..

def cokusername = cookieService.setCookie('username', customer?.email) println "cookieService.getCookie('username') = "+cookieService.getCookie('username') redirect(controller: "toko",cokusername: cokusername)

and this is in my tokoController.groovy index :

def index={ def toko = CifLogo.executeQuery("from CifLogo order by rand()",[max: 10]) def awdf = cookieService.getCookie('username') println "awdf = "+awdf println "cokusername = "+params.cokusername [tokoList:toko,cokusername:awdf] }

i have no idea to retrieve my cookie. :(

Image of Yaktocat

i also try this way too..

def index(){ def toko = CifLogo.executeQuery("from CifLogo order by rand()",[max: 10]) def awdf = cookieService.getCookie('username') println "awdf = "+awdf println "cokusername = "+params.cokusername [tokoList:toko,cokusername:awdf] }

after

Error when starting app

ERROR grails.boot.GrailsApp - Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsApplicationPostProcessor' defined in demoApp.Application: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [grails.boot.config.GrailsApplicationPostProcessor]: Factory method 'grailsApplicationPostProcessor' threw exception; nested exception is grails.plugins.exceptions.PluginException: Failed to initialize class [grails.plugin.cookie.test.TestService] from plugin [grailsCookie] : grails.plugin.cookie.test.TestService
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:120) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:677) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:519) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:347) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:295) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at grails.boot.GrailsApp.run(GrailsApp.groovy:51) [grails-core-3.1.0.M3.jar:3.1.0.M3]
    at grails.boot.GrailsApp.run(GrailsApp.groovy:335) [grails-core-3.1.0.M3.jar:3.1.0.M3]
    at grails.boot.GrailsApp.run(GrailsApp.groovy:324) [grails-core-3.1.0.M3.jar:3.1.0.M3]
    at grails.boot.GrailsApp$run.call(Unknown Source) [grails-core-3.1.0.M3.jar:3.1.0.M3]
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) [groovy-2.4.5.jar:2.4.5]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) [groovy-2.4.5.jar:2.4.5]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133) [groovy-2.4.5.jar:2.4.5]
    at demoApp.Application.main(Application.groovy:8) [main/:na]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [grails.boot.config.GrailsApplicationPostProcessor]: Factory method 'grailsApplicationPostProcessor' threw exception; nested exception is grails.plugins.exceptions.PluginException: Failed to initialize class [grails.plugin.cookie.test.TestService] from plugin [grailsCookie] : grails.plugin.cookie.test.TestService
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    ... 23 common frames omitted
Caused by: grails.plugins.exceptions.PluginException: Failed to initialize class [grails.plugin.cookie.test.TestService] from plugin [grailsCookie] : grails.plugin.cookie.test.TestService
    at org.grails.plugins.BinaryGrailsPlugin.initializeProvidedArtefacts(BinaryGrailsPlugin.java:133) ~[grails-core-3.1.0.M3.jar:3.1.0.M3]
    at org.grails.plugins.BinaryGrailsPlugin.<init>(BinaryGrailsPlugin.java:66) ~[grails-core-3.1.0.M3.jar:3.1.0.M3]
    at grails.plugins.DefaultGrailsPluginManager.createBinaryGrailsPlugin(DefaultGrailsPluginManager.java:390) ~[grails-core-3.1.0.M3.jar:3.1.0.M3]
    at grails.plugins.DefaultGrailsPluginManager.findCorePlugins(DefaultGrailsPluginManager.java:377) ~[grails-core-3.1.0.M3.jar:3.1.0.M3]
    at grails.plugins.DefaultGrailsPluginManager.attemptLoadPlugins(DefaultGrailsPluginManager.java:329) ~[grails-core-3.1.0.M3.jar:3.1.0.M3]
    at grails.plugins.DefaultGrailsPluginManager.loadPlugins(DefaultGrailsPluginManager.java:239) ~[grails-core-3.1.0.M3.jar:3.1.0.M3]
    at grails.boot.config.GrailsApplicationPostProcessor.initializeGrailsApplication(GrailsApplicationPostProcessor.groovy:88) ~[grails-core-3.1.0.M3.jar:3.1.0.M3]
    at grails.boot.config.GrailsApplicationPostProcessor.setApplicationContext(GrailsApplicationPostProcessor.groovy:211) ~[grails-core-3.1.0.M3.jar:3.1.0.M3]
    at grails.boot.config.GrailsApplicationPostProcessor.<init>(GrailsApplicationPostProcessor.groovy:77) ~[grails-core-3.1.0.M3.jar:3.1.0.M3]
    at grails.boot.config.GrailsAutoConfiguration.grailsApplicationPostProcessor(GrailsAutoConfiguration.groovy:64) ~[grails-core-3.1.0.M3.jar:3.1.0.M3]
    at demoApp.Application.grailsApplicationPostProcessor(Application.groovy) [main/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_75]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_75]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_75]
    at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_75]
    at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426) ~[springloaded-1.2.5.RELEASE.jar:1.2.5.RELEASE]
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    ... 24 common frames omitted
Caused by: java.lang.ClassNotFoundException: grails.plugin.cookie.test.TestService
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[na:1.7.0_75]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_75]
    at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_75]
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_75]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[na:1.7.0_75]
    at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:677) ~[groovy-2.4.5.jar:2.4.5]
    at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:787) ~[groovy-2.4.5.jar:2.4.5]
    at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:775) ~[groovy-2.4.5.jar:2.4.5]
    at org.grails.plugins.BinaryGrailsPlugin.initializeProvidedArtefacts(BinaryGrailsPlugin.java:131) ~[grails-core-3.1.0.M3.jar:3.1.0.M3]
    ... 40 common frames omitted

I've added following line in my build.gradle

dependencies {
    ...
   compile 'org.grails.plugins:grails-cookie:2.0.1'
}

Environment:

| Grails Version: 3.1.0.M3
| Groovy Version: 2.4.5
| JVM Version: 1.7.0_75

Am I missing something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.