lgrignon / grails3-quick-start

Grails 3 quick start to avoid installing grails command line + Hibernate Search plugin show case
1 stars 4 forks source link

Errors while doing run-app #1

Open daniilshevelev opened 6 years ago

daniilshevelev commented 6 years ago

Hi I try to run the project in IntelliJ IDEA and get this errors:

"C:\Program Files\Java\jdk1.8.0_60\bin\java" -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:CICompilerCount=3 -Djline.WindowsTerminal.directConsole=false -Dfile.encoding=UTF-8 -classpath C:\Users\dan\AppData\Local\Temp\classpath.jar org.grails.cli.GrailsCli run-app --plain-output Error | Error occurred running Grails CLI: startup failed: script15208106671061740933093.groovy: 4: unable to resolve class org.apache.lucene.analysis.standard.StandardTokenizerFactory @ line 4, column 1. import org.apache.lucene.analysis.standard.StandardTokenizerFactory ^ script15208106671061740933093.groovy: 5: unable to resolve class org.apache.lucene.analysis.core.LowerCaseFilterFactory @ line 5, column 1. import org.apache.lucene.analysis.core.LowerCaseFilterFactory ^ script15208106671061740933093.groovy: 6: unable to resolve class org.apache.lucene.analysis.ngram.NGramFilterFactory @ line 6, column 1. import org.apache.lucene.analysis.ngram.NGramFilterFactory ^ 3 errors (Use --stacktrace to see the full trace)

lgrignon commented 6 years ago

Hi. I dont' know how it is supposed to run in IntelliJ console but what is your output using gradlew bootRun (cf readme)?

daniilshevelev commented 6 years ago

@lgrignon I tried the following in PowerShell:

.\gradlew.bat bootRun -Dgrails.env=dev -Dserver.port=8082 --info

And got this error:

Task '.env=dev' not found in root project 'grails3-quick-start'.

When running the same command in IDEA I got this errors:

Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type CrossBuildFileHashCache using BuildSessionScopeServices.createCrossBuildFileHashCache().
...
BUILD FAILED in 0s
Failed to create parent directory 'C:\Windows\System32\.gradle' when creating directory 'C:\Windows\System32\.gradle\4.0\fileHashes'
12:24:16 PM: Tasks execution finished 'bootRun -Dgrails.env=dev -Dserver.port=8082 --debug'.
lgrignon commented 6 years ago

Hi again. You do not need the PowerShell environment. Please try again using a regular command line tool.

I will take a look sooner or later for running into IntelliJ, but it was not the original purpose of this repo :)

daniilshevelev commented 6 years ago

That error comes from Gradle and not from PowerShell. Getting the same error in Windows cmd.

lgrignon commented 6 years ago

That is very strange. I confirm that it works on my machine from a fresh install. This command line is definitively supposed to work.

lgrignon commented 6 years ago

Could you please try on another machine/shell just to collect more clues

lgrignon commented 6 years ago

Hello. Any update on this.?

pantbinod commented 6 years ago

@dashingly move following code from /conf/application.groovy to runtime.groove then it works fine.

import org.apache.lucene.analysis.core.LowerCaseFilterFactory
import org.apache.lucene.analysis.ngram.NGramFilterFactory
import org.apache.lucene.analysis.standard.StandardTokenizerFactory

grails.plugins.hibernatesearch = {
    rebuildIndexOnStart false
    throwOnEmptyQuery false
//  fullTextFilter name: "reserveContext", impl: ReserveContextFullTextFilterFactory, cache: 'none'

    analyzer( name: 'ngram', tokenizer: StandardTokenizerFactory ) {
        filter LowerCaseFilterFactory
        filter(NGramFilterFactory) {
            param 'minGramSize', 3
            param 'maxGramSize', 3
        }
    }

}
daniilshevelev commented 6 years ago

Thanks @pantbinod , I will give it a try next week.

lgrignon commented 6 years ago

Note : the quick start have been updated this week, please try again with the new version and tell me if it works better.

Thanks @pantbinod if your solution works with the new version