Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grails 3.0.1 CLI won't start #608

Closed
nandris opened this issue Apr 5, 2015 · 14 comments
Closed

Grails 3.0.1 CLI won't start #608

nandris opened this issue Apr 5, 2015 · 14 comments

Comments

@nandris
Copy link

nandris commented Apr 5, 2015

grails 3.0.1 create-app and gradle run succeed

grails -version
| Grails Version: 3.0.1
| Groovy Version: 2.4.3
| JVM Version: 1.7.0_67

... but the grails cli won't start:

$grails
BUILD SUCCESSFUL
Total time: 3.226 secs
| Error Error occurred running Grails CLI: Bad <init> method call from inside of a branch
Exception Details:
Location:
org/grails/cli/interactive/completers/RegexCompletor.<init>(Ljava/lang/String;)V @73: invokespecial
Reason:
Error exists in the bytecode
Bytecode:
0000000: b800 184d 04bd 0004 5903 2c12 1932 121b
0000010: 2bb9 0021 0300 5359 10ff 1202 b800 272a
0000020: 5fab 0000 0000 0043 0000 0002 aad3 b1ff
0000030: 0000 001b 59b3 a684 0000 002e 5f5a 5903
0000040: 32b8 002d c000 2f5f 57b7 0031 a700 225f
0000050: 5a59 0332 121b b800 35c0 001b 5f57 b700
0000060: 38a7 000d bb00 3a59 123c b700 3dbf 57b1
0000070:
Stackmap Table:
full_frame(@60,{UninitializedThis,Object[#47],Object[#66]},{Object[#68],UninitializedThis})
full_frame(@79,{UninitializedThis,Object[#47],Object[#66]},{Object[#68],UninitializedThis})
full_frame(@100,{UninitializedThis,Object[#47],Object[#66]},{Object[#68],UninitializedThis})
full_frame(@110,{Object[#2],Object[#47],Object[#66]},{Object[#68]})
(Use --stacktrace to see the full trace)

I installed grails 3.0.1 with gvm in the usual way and am using Linux mint.

Completely stumped by this and --stacktrace doesn't yield any more info.

@jeffscottbrown
Copy link
Member

Is anyone else able to reproduce this?

@nandris
Copy link
Author

nandris commented Apr 5, 2015

update

I get similar bytecode when I try to manually install grails from the git repo.

(afaik this is not due to gvm)

git clone https://github.com/grails/grails-core.git
cd grails-core
$./gradlew install
Download https://repo.grails.org/grails/core/commons-io/commons-io/2.2/commons-io-2.2-javadoc.jar
Download https://repo.grails.org/grails/core/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1.pom
Download https://repo.grails.org/grails/core/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1-sources.jar
Download https://repo.grails.org/grails/core/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1.jar
:populateDependencies
:grails-async:generatePomFileForMavenPublication
:grails-async:compileJava UP-TO-DATE
:grails-async:compileGroovy
Note: /home/mic/Github/grails-core/grails-async/src/main/groovy/org/grails/async/transform/internal/DelegateAsyncTransformation.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:grails-async:processResources UP-TO-DATE
:grails-async:classes
:grails-async:jar
:grails-async:groovydoc
[ant:groovydoc] Resource org/codehaus/groovy/tools/groovy.ico not found so skipped
:grails-async:javadocJar
:grails-async:sourcesJar
:grails-async:signArchives SKIPPED
:grails-async:installToHomeDist
:grails-async:publishMavenPublicationToMavenLocal
:grails-bom:generatePomFileForMavenPublication
:grails-bom:publishMavenPublicationToMavenLocal
:grails-bootstrap:generatePomFileForMavenPublication
:grails-bootstrap:groovydoc
[ant:groovydoc] Resource org/codehaus/groovy/tools/groovy.ico not found so skipped
:grails-bootstrap:javadocJar
:grails-bootstrap:sourcesJar
:grails-bootstrap:signArchives SKIPPED
:grails-bootstrap:installToHomeDist
:grails-bootstrap:publishMavenPublicationToMavenLocal
:grails-compat:generatePomFileForMavenPublication
:grails-spring:compileJava UP-TO-DATE
:grails-spring:compileGroovy
:grails-spring:processResources UP-TO-DATE
:grails-spring:classes
:grails-spring:jar
:grails-core:compileJava UP-TO-DATE
:grails-core:compileGroovy
/home/mic/Github/grails-core/grails-core/src/main/groovy/org/grails/plugins/DefaultGrailsPlugin.java:409: warning: non-varargs call of varargs method with inexact argument type for last parameter;
LOG.debug("Cannot load plug-in resource watch list from [" + GrailsArrayUtils.toString(watchedResourcePatternReferences) +
^
cast to Object for a varargs call
cast to Object[] for a non-varargs call and to suppress this warning
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
:grails-core:processResources
:grails-core:classes
:grails-core:jar
:grails-databinding:compileJava UP-TO-DATE
:grails-databinding:compileGroovy
:grails-databinding:processResources UP-TO-DATE
:grails-databinding:classes
:grails-databinding:jar
:grails-encoder:compileJava UP-TO-DATE
:grails-encoder:compileGroovy
Note: /home/mic/Github/grails-core/grails-encoder/src/main/groovy/org/grails/encoder/impl/BasicJSONEncoder.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /home/mic/Github/grails-core/grails-encoder/src/main/groovy/org/grails/encoder/impl/BasicCodecLookup.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:grails-encoder:processResources UP-TO-DATE
:grails-encoder:classes
:grails-encoder:jar
:grails-taglib:compileJava UP-TO-DATE
:grails-taglib:compileGroovy
Note: /home/mic/Github/grails-core/grails-taglib/src/main/groovy/org/grails/taglib/AbstractTemplateVariableBinding.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:grails-taglib:processResources
:grails-taglib:classes
:grails-taglib:jar
:grails-gsp:compileJava UP-TO-DATE
:grails-gsp:compileGroovy
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:grails-gsp:processResources UP-TO-DATE
:grails-gsp:classes
:grails-gsp:jar
:grails-validation:compileJava UP-TO-DATE
:grails-validation:compileGroovy
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /home/mic/Github/grails-core/grails-validation/src/main/groovy/org/grails/validation/RangeConstraint.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:grails-validation:processResources
:grails-validation:classes
:grails-validation:jar
:grails-plugin-domain-class:compileJava UP-TO-DATE
:grails-plugin-domain-class:compileGroovy
:grails-plugin-domain-class:processResources
:grails-plugin-domain-class:classes
:grails-plugin-domain-class:jar
:grails-web-common:compileJava UP-TO-DATE
:grails-web-common:compileGroovy
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:grails-web-common:processResources
:grails-web-common:classes
:grails-web-common:jar
:grails-web-databinding:compileJava UP-TO-DATE
:grails-web-databinding:compileGroovy
Note: /home/mic/Github/grails-core/grails-web-databinding/src/main/groovy/grails/web/databinding/DataBindingUtils.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /home/mic/Github/grails-core/grails-web-databinding/src/main/groovy/org/grails/web/databinding/DataBindingLazyMetaPropertyMap.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:grails-web-databinding:compileGroovy FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':grails-web-databinding:compileGroovy'.
> Bad <init> method call from inside of a branch
Exception Details:
Location:
grails/web/mime/MimeType.<init>(Ljava/lang/String;)V @119: invokespecial
Reason:
Error exists in the bytecode
Bytecode:
0000000: 05bd 0004 5903 2b12 4fb8 009c 5359 0403
0000010: bd00 04b8 003d c000 8e12 8eb8 009c 5359
0000020: 10ff 1202 b800 a02a 5fab 0000 0000 00a3
0000030: 0000 0004 a159 6e5c 0000 002b aad3 b1ff
0000040: 0000 0054 b7d2 0ba6 0000 0067 e925 fa09
0000050: 0000 0086 5f5a 5903 32b8 006d c000 4f5f
0000060: 5904 32b8 006d c000 4f5f 5905 3212 8eb8
0000070: 005d c000 8e5f 57b7 002e a700 5c5f 5a59
0000080: 0332 b800 6dc0 004f 5f57 b700 a2a7 0049
0000090: 5f5a 5903 32b8 006d c000 4f5f 5904 3212
00000a0: 8eb8 005d c000 8e5f 57b7 00a4 a700 2a5f
00000b0: 5a59 0332 b800 6dc0 004f 5f59 0432 b800
00000c0: 6dc0 004f 5f57 b700 a7a7 000d bb00 a959
00000d0: 12ab b700 acbf 57b1
Stackmap Table:
full_frame(@84,{UninitializedThis,Object[#79]},{Object[#89],UninitializedThis})
full_frame(@125,{UninitializedThis,Object[#79]},{Object[#89],UninitializedThis})
full_frame(@144,{UninitializedThis,Object[#79]},{Object[#89],UninitializedThis})
full_frame(@175,{UninitializedThis,Object[#79]},{Object[#89],UninitializedThis})
full_frame(@204,{UninitializedThis,Object[#79]},{Object[#89],UninitializedThis})
full_frame(@214,{Object[#2],Object[#79]},{Object[#89]})

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 11 mins 56.783 secs

@jeffscottbrown
Copy link
Member

What JDK are you using and does the problem still happen if you use -noverify?

Thanks for the feedback.

@nandris
Copy link
Author

nandris commented Apr 5, 2015

I am using JVM Version: 1.7.0_67 manually downloaded and installed, after removing openjdk

sudo apt-get remove openjdk*
sudo mkdir -p /opt/java
cd ~/Downloads
sudo mv jdk1.7.0_67 /opt/java
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/jdk1.7.0_67/bin/java" 1
sudo update-alternatives --set java /opt/java/jdk1.7.0_67/bin/java
sudo update-alternatives --install "/usr/bin/javac" "javac" "/opt/java/jdk1.7.0_67/bin/javac" 1
sudo update-alternatives --set javac /opt/java/jdk1.7.0_67/bin/javac
sudo ln -s /etc/alternatives/javac /usr/bin/javac

As currently working:
mic@mic-X202EP ~ $ java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
mic@mic-X202EP ~ $ javac -version
javac 1.7.0_67

@jeffscottbrown
Copy link
Member

Does the problem go away if you use 1.7.0_45?

@nandris
Copy link
Author

nandris commented Apr 5, 2015

Use of -noverify

mic@mic-X202EP ~/Grails/anotherapp $ grails -noverify

BUILD SUCCESSFUL

Total time: 20.829 secs
| Error Error occurred running Grails CLI: Bad <init> method call from inside of a branch
Exception Details:
Location:
org/grails/cli/interactive/completers/RegexCompletor.<init>(Ljava/lang/String;)V @73: invokespecial
Reason:
Error exists in the bytecode
Bytecode:
0000000: b800 184d 04bd 0004 5903 2c12 1932 121b
0000010: 2bb9 0021 0300 5359 10ff 1202 b800 272a
0000020: 5fab 0000 0000 0043 0000 0002 aad3 b1ff
0000030: 0000 001b 59b3 a684 0000 002e 5f5a 5903
0000040: 32b8 002d c000 2f5f 57b7 0031 a700 225f
0000050: 5a59 0332 121b b800 35c0 001b 5f57 b700
0000060: 38a7 000d bb00 3a59 123c b700 3dbf 57b1
0000070:
Stackmap Table:
full_frame(@60,{UninitializedThis,Object[#47],Object[#66]},{Object[#68],UninitializedThis})
full_frame(@79,{UninitializedThis,Object[#47],Object[#66]},{Object[#68],UninitializedThis})
full_frame(@100,{UninitializedThis,Object[#47],Object[#66]},{Object[#68],UninitializedThis})
full_frame(@110,{Object[#2],Object[#47],Object[#66]},{Object[#68]})
(Use --stacktrace to see the full trace)

@nandris
Copy link
Author

nandris commented Apr 6, 2015

SOLVED

This problem goes away when I use jdk1.7.0_45 instead of jdk1.7.0_67

Thanks for the feedback

@nandris nandris closed this as completed Apr 6, 2015
@anderskristian
Copy link

I think the problem has nothing with JDK to do.
I get the same problem each time I upgrade Grails
The cure is to start a new shell.
I even observe out of memory problems, these problems vanish after rebooting my MAC .. Please dont quite me for that ... but the problems did go away :-)

@robertoschwald
Copy link

Problem also occurs sometimes on OSX 10.11.x using Java 8.0_65. So maybe reopen the issue?

@Vishal-Sahu
Copy link

Set a env variable called GRAILS_OPTS with the value "-XX:-UseSplitVerifier -Xverify:none"

@fabiop
Copy link

fabiop commented Oct 5, 2016

On OS X 10.11 (15A284)
| Grails Version: 3.1.11
| Groovy Version: 2.4.7
| JVM Version: 1.8.0_101

export GRAILS_OPTS="-XX:-UseSplitVerifier -Xverify:none"
bash-3.2$ grails wrapper
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option UseSplitVerifier; support was removed in 8.0
| Error Error occurred running Grails CLI: null (Use --stacktrace to see the full trace)
bash-3.2$ grails wrapper --stacktrace --verbose
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option UseSplitVerifier; support was removed in 8.0
| Error Error occurred running Grails CLI: null
java.lang.NullPointerException
at org.grails.cli.GrailsCli.initializeProfile(GrailsCli.groovy:511)
at org.grails.cli.GrailsCli.initializeApplication(GrailsCli.groovy:310)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:273)
at org.grails.cli.GrailsCli.main(GrailsCli.groovy:163)
| Error Error occurred running Grails CLI: null
bash-3.2$

@akhalik
Copy link

akhalik commented Oct 28, 2016

I have setup grails 3.2.1. on windows JAVA_HOME and GRAILS_HOME is also set. verified by running grails -version and worked as expected.

But when issue command to create app, it always throw following error

"Error occurred running Grails CLI: unable to find valid certification path to requested target (Use --stacktrace to see the full trace)".

I tried it by disconnecting the internet and come to know its trying to connect to https://repo.grails.org

It seems that some certificates must be in JAVA_HOME/jre/lib/security/cacerts. with this thought I downloaded the SSL certificates from https://repo.grails.org by accessing the URL in browser.

same certificates imported in the JAVA_HOME/jre/lib/security/cacerts but still no change.

I could not find even a single related post over the internet.

when creating Grails app in Netbeans 8, I get the same error.

I don't know if I need any other valid certificate or there is any other problem.

Many thanks in advance for any help on this.

@emmanuelrosa
Copy link

I get the same error with Grails 3.2.4 on MacOS and Java 8 (update 20)

  • OS: MacOS Sierra 10.12.2
  • JVM:
    java version "1.8.0_20"
    Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
    Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

| Error Error occurred running Grails CLI: Bad method call from inside of a branch
Exception Details:
Location:
org/grails/cli/interactive/completers/AllClassCompleter.()V @123: invokespecial
Reason:
Error exists in the bytecode
Bytecode:
0x0000000: b800 144c 04bd 0016 5903 2b12 1732 2b12
0x0000010: 1832 2b12 1932 121b 2b12 1c32 121e b900
0x0000020: 2402 0012 26b9 002a 0400 b900 2d02 00bb
0x0000030: 002f 5912 0212 02b7 0032 b900 3503 0012
0x0000040: 37b8 003d c000 3712 37b8 0041 5359 10ff
0x0000050: 1204 b800 452a 5fab 0000 003f 0000 0002
0x0000060: 1374 8337 0000 0019 4ad1 f42c 0000 002a
0x0000070: 5f5a 0312 37b8 004b c000 37b7 004e a700
0x0000080: 225f 5a59 0332 121b b800 51c0 001b 5f57
0x0000090: b700 54a7 000d bb00 5659 1258 b700 5bbf
0x00000a0: 572a b600 5f4d 2c2a 5fb5 0061 2c57 b1
Stackmap Table:
full_frame(@112,{UninitializedThis,Object[#101]},{Object[#103],UninitializedThis})
full_frame(@129,{UninitializedThis,Object[#101]},{Object[#103],UninitializedThis})
full_frame(@150,{UninitializedThis,Object[#101]},{Object[#103],UninitializedThis})
full_frame(@160,{Object[#2],Object[#101]},{Object[#103]})
(Use --stacktrace to see the full trace)

However, it works fine with Java 7 (update 40) and Java 8 (update 121)

java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)

java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

@zyppe
Copy link

zyppe commented Jun 4, 2017

I am a new one in Grails and Groovy.
When I try to use Netbeans IDE to create a Grails APP, it says :

Warning |
Unrecognized flag: non-interactive.
Error |
Specify an application name or use --inplace to create an application in the current directory

so I try to create app in the cmd, it tells me the same error,
| Error Command [create-app] error: null (Use --stacktrace to see the full trace)
Grails Version:
| Grails Version: 3.3.0.M2
| Groovy Version: 2.4.11
| JVM Version: 1.8.0_131

java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
Windows 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants