Error when install plugin

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Error when install plugin

Jackie
I use the file DocumentationPlugin.groovy  you give us and export as a jar file(plugin.jar),there is also a depentdence jar(slf4j-api-1.6.4.jar) ,then I fix glu-meta-model.json.groovy,add
plugins :[
  [
    fqcn: 'com.best.glu.plugin',
        classPath:['/home/glu/org.linkedin.glu.console-server5.5.1/glu/repository/plugin.jar',
                       '/home/glu/org.linkedin.glu.console-server-5.5.1/glu/repository/slf4j-api-1.6.4.jar']
  ],
]

when generate the distributions,there is an error:
Unknown exception: Exception while processing template [file:/home/org.linkedin.glu.packaging-all-5.5.1/packages/org.linkedin.glu.packaging-setup-5.5.1/config-templates/console-server/glu/repository/exploded-wars/org.linkedin.glu.console-webapp-@consoleMetaModel.version@/WEB-INF/lib/plugins.ctmpl]

how to solve it?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Error when install plugin

frenchyan
Administrator
Some questions to try to narrow down what the problem is:

1) have you tried generating the distribution without the plugins you added (using just the default one?)
2) which command line exactly are you using to generate the distribution?
3) which os are you using? which java version?
4) can you post the content of your glu-meta-model.json.groovy file?
5) can you post the full stack trace of the exception? (use --stacktrace)

Yan

Reply | Threaded
Open this post in threaded view
|

Re: Error when install plugin

Jackie
In reply to this post by Jackie
I abandoned it,because after I read the original code,I guess my thought is unrealistic.
And now I have another problem: I want to save org.linkedin.glu.agent-server.out every day,I already add (appender new org.apache.log4j.DailyRollingFileAppender(name:"dailyAppender",layout:pattern(conversionPattern: '%c{2} %m%n'),fileName:"/home/glu/org.linkedin.glu.agent-server-zkc1-5.5.1/data/logs/daily.log",datePattern:"'.'yyyy-MM-dd"))  into congif.groovy, and before which should I add (dailyAppender:)  controllers or gsp or others?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Error when install plugin

frenchyan
Administrator
I am sorry I am not entirely sure I understand the question. Could you (or attach) your config file? What is the problem exactly?

Yan
Reply | Threaded
Open this post in threaded view
|

Re: Error when install plugin

Jackie
environments {
  production {
    // configuration parameters should be read from the console.config.location file
  }
  development {

    // read config properties coming from the build
    grails.config.locations << "file:./lib/build.properties.groovy"

    // configuration parameters
    console.sslEnabled = true

    console.keystorePassword = 'nacEn92x8-1'
    console.keyPassword = 'nWVxpMg6Tkv'

    console.truststorePassword = 'nacEn92x8-1'

    console.bootstrap.fabrics = [
      [ name: 'glu-dev-1', zkConnectString: '127.0.0.1:2181', zkSessionTimeout: '5s', color: '#005a87' ],
      [ name: 'glu-dev-2', zkConnectString: '127.0.0.1:2181', zkSessionTimeout: '5s', color: '#5a0087' ],
    ]

    console.defaults = console.dev.defaults

    plugins.StreamFileContentPlugin.unrestrictedLocation = '/export/content/glu'
    plugins.StreamFileContentPlugin.maskFileContent = true

    grails.serverURL = "http://${InetAddress.getLocalHost().canonicalHostName}:8080/${appName}"

    // define the plugins as a Map, or a class name or an array of class names
    orchestration.engine.plugins = [
      'org.linkedin.glu.orchestration.engine.plugins.builtin.StreamFileContentPlugin'
    ]

    // storage type supported right now are 'filesystem' and 'memory'
    console.commandsService.storageType = 'filesystem'

    // log4j configuration
    log4j = {

      appenders {
        appender new org.apache.log4j.DailyRollingFileAppender(name:"dailyAppender",layout:pattern(conversionPattern: '%c{2} %m%n'),fileName:"/home/glu/org.linkedin.glu.agent-server-zkc1-5.5.1/data/logs/daily.log",datePattern:"'.'yyyy-MM-dd")
        console name:'stdout', layout:pattern(conversionPattern: '%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] %m%n')
      }

      error  dailyAppender:'org.codehaus.groovy.grails.web.servlet',  //  controllers
             'org.codehaus.groovy.grails.web.pages', //  GSP
             stdout:'org.codehaus.groovy.grails.web.sitemesh', //  layouts
             'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
             'org.codehaus.groovy.grails.web.mapping', // URL mapping
             'org.codehaus.groovy.grails.commons', // core / classloading
             'org.codehaus.groovy.grails.plugins', // plugins
             'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
             'org.springframework',
             'org.hibernate'

      info 'grails',
           'org.linkedin',
           'org.pongasoft'

      //debug 'org.linkedin.zookeeper.tracker', 'org.linkedin.glu.agent.tracker'
      //debug 'org.apache.http'

      //debug 'org.linkedin.glu.console.domain'
      //debug 'org.linkedin.glu.spring.resources.GrailsPluginLoadOrderDebugger'

//        trace 'org.hibernate.SQL', 'org.hibernate.type'
//        trace 'org.codehaus.groovy.grails.orm'
//        trace 'org.codehaus.groovy.grails.orm.hibernate'


      warn   'org.mortbay.log'
    }
  }
  test {

    // read config properties coming from the build
    grails.config.locations << "file:./lib/build.properties.groovy"

    // configuration parameters
    console.sslEnabled = true

    console.keystorePassword = 'nacEn92x8-1'
    console.keyPassword = 'nWVxpMg6Tkv'

    console.truststorePassword = 'nacEn92x8-1'

    console.defaults = console.dev.defaults

    plugins.StreamFileContentPlugin.unrestrictedLocation = '/export/content/glu'

    grails.serverURL = "http://localhost:8080/${appName}"

    // define the plugins as a Map, or a class name or an array of class names
    orchestration.engine.plugins = [
      'org.linkedin.glu.orchestration.engine.plugins.builtin.StreamFileContentPlugin'
    ]

    // storage type supported right now are 'filesystem' and 'memory'
    console.commandsService.storageType = 'filesystem'

    // log4j configuration
    log4j = {

        appenders {
            console name:'stdout', layout:pattern(conversionPattern: '%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] %m%n')
        }

        error  'org.codehaus.groovy.grails.web.servlet',  //  controllers
             'org.codehaus.groovy.grails.web.pages', //  GSP
             'org.codehaus.groovy.grails.web.sitemesh', //  layouts
             'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
             'org.codehaus.groovy.grails.web.mapping', // URL mapping
             'org.codehaus.groovy.grails.commons', // core / classloading
             'org.codehaus.groovy.grails.plugins', // plugins
             'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
             'org.springframework',
             'org.hibernate'

        info 'grails',
             'org.linkedin'

        //debug 'org.linkedin.glu.agent.tracker', 'org.linkedin.glu.zookeeper.client'

        //trace 'org.hibernate.SQL', 'org.hibernate.type'


        warn   'org.mortbay.log'
    }
  }
Reply | Threaded
Open this post in threaded view
|

Re: Error when install plugin

frenchyan
Administrator

​Thanks for posting the model, but like I said I don't understand your question. Can you please explain what the problem is?

Yan
Reply | Threaded
Open this post in threaded view
|

Re: Error when install plugin

Jackie
What I exactly want to do is creating daily rolling log file for(org.linkedin.glu.agent-server.out),because this file is larger and larger with time going by.So where should I modify the code?

And I have another question:
when I select deploy,there is a plan:
              1. Install script for [/mountPoint] on [agentName]
              2. Run [install] phase for [/mountPoint] on [agentName]
              3. Run [configure] phase for [/mountPoint] on [agentName]
              4. Run [start] phase for [/mountPoint] on [agentName]
I filter step 2,4,only left 1,3,like:
              1. Install script for [/mountPoint] on [agentName]
              2. Run [configure] phase for [/mountPoint] on [agentName]
I already change the stateMachine like:
              NONE: [[to: 'installed', action: 'install'],[to: 'running',action: 'configure']],
              installed: [[to: 'stopped', action: 'configure'], [to: 'NONE', action: 'uninstall']],
              stopped: [[to: 'running', action: 'start'], [to: 'installed', action: 'unconfigure']],
              running: [[to: 'stopped', action: 'stop']]
there is still an error:
              java.lang.IllegalStateException: no valid transition found for 'configure' from [currentState:NONE]: valid action(s) [install]
how to solve it?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Error when install plugin

frenchyan
Administrator
In regards to logging, I am not too familiar with how to set up the daily rolling file appender, but looking at the file you attached it only contains the development and test environment and seems to be coming from the source code.

What you need to change is the glu meta model and add your log4j section there so that when you generate your distribution the proper log4j section will be generated: see this part in the documentation: http://pongasoft.github.io/glu/docs/latest/html/console.html#logging

In regards to your state machine, it does not seem to make sense to me that you have the transitions:

installed -> stopped (action=configure)
NONE -> running (action=configure)

Or in other words the same action (which in the end maps to one closure in your groovy script) could be called from 2 entirely different paths while not ending on the same state (stopped vs running). I do not know if that is the reason why glu is confused or not, but your state machine is not very logical.

The other possibility is that your state machine is not being taken into account. How did you tell glu to use a different state machine? Did you follow this: http://pongasoft.github.io/glu/docs/latest/html/glu-script.html#defining-your-own-state-machine ?

Yan


Reply | Threaded
Open this post in threaded view
|

Re: Error when install plugin

Jackie
I have understood what you said ,I was wrong yesterday
Today I try to exchange configure and install(do configure first,then install)
stateMachine = [
        defaultTransitions: [
          NONE: [[to: 'installed', action: 'configure']],
          installed: [[to: 'stopped', action: 'install'], [to: 'NONE', action: 'unconfigure']],
          stopped: [[to: 'running', action: 'start'], [to: 'installed', action: 'uninstall']],
          running: [[to: 'stopped', action: 'stop']]
        ],
       
        defaultEntryState: 'NONE'
 ]

but when I select deploy,the plan only left 1 step : install script
what's the matter with it?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Error when install plugin

frenchyan
Administrator
defaultEntryState should be set to "running" not NONE

Yan
Reply | Threaded
Open this post in threaded view
|

Re: Error when install plugin

Jackie
I add the code to meta-model:(my purpose is to write the log information into daily.log and save everyday)
log4j: """
  {
                    appenders {
  appender new org.apache.log4j.DailyRollingFileAppender(name:"dailyAppender",layout:pattern(conversionPattern: '%d{yyyy-dd-mm hh:mm:ss} %t %c{2} %p %m%n'),fileName:"/home/glu/logs/daily.log",datePattern:"'.'yyyy-MM-dd")
    }
  error  dailyAppender:'org.linkedin.glu.agent.impl.AgentImpl'

      info  dailyAppender:'org.linkedin.glu.agent.impl.AgentImpl'

                        warn  dailyAppender:'org.linkedin.glu.agent.impl.AgentImpl'
  }
     """
the file did created , but there is no info or error information in the log,it's blank.I don't know what the wrong is?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Error when install plugin

frenchyan
Administrator
The log4j section that you define in the console area is for the console. This is what it looks like when you don't override it: https://github.com/pongasoft/glu/blob/master/packaging/org.linkedin.glu.packaging-setup/src/cmdline/resources/config-templates/console-server/conf/glu-console-webapp.groovy.gtmpl#L93

In your case you are adding an appender, which is fine, but the error info and warn ask to display a single agent class (this is the console, not the agent) and this is why it is not working (in a way, it is working... as you define it, it is doing the right thing). But that is not what you want. Take a look at the link and use the same logger names.

Yan