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 5 - java.lang.NumberFormatException: For input string: "0-SNAPSHOT" #1463

Closed
2 of 4 tasks
puneetbehl opened this issue Jun 2, 2021 · 0 comments · Fixed by #1464
Closed
2 of 4 tasks

Grails 5 - java.lang.NumberFormatException: For input string: "0-SNAPSHOT" #1463

puneetbehl opened this issue Jun 2, 2021 · 0 comments · Fixed by #1464
Assignees

Comments

@puneetbehl
Copy link
Contributor

puneetbehl commented Jun 2, 2021

As we are planning to use snapshot version as 5.0.0-SNAPSHOT instead of 5.0.0.BUILD-SNAPSHOT, So Grails 5 application throws java.lang.NumberFormatException: For input string: "0-SNAPSHOT" when we update grailsVersion to 5.0.0-SNAPSHOT.

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. Create a new Grails 5 web application.
  2. Update property grailsVersion to 5.0.0-SNAPSHOT
  3. Run the application

Expected Behaviour

The application should be running on localhost:8080

Actual Behaviour

The application throws following exception:

java.lang.NumberFormatException: For input string: "0-SNAPSHOT"
        at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.base/java.lang.Integer.parseInt(Integer.java:652)
        at java.base/java.lang.Integer.valueOf(Integer.java:983)
        at org.codehaus.groovy.runtime.StringGroovyMethods.toInteger(StringGroovyMethods.java:3120)
        at org.grails.datastore.mapping.core.grailsversion.GrailsVersion.<init>(GrailsVersion.groovy:58)
        at org.grails.datastore.mapping.core.grailsversion.GrailsVersion.getCurrent(GrailsVersion.groovy:142)
        at org.grails.datastore.mapping.core.grailsversion.GrailsVersion.isAtLeastMajorMinor(GrailsVersion.groovy:72)
        at org.grails.orm.hibernate.support.HibernateDatastoreConnectionSourcesRegistrar.postProcessBeanDefinitionRegistry(HibernateDatastoreConnectionSourcesRegistrar.groovy:40)
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311)
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:142)
        at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:438)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:337)
        at grails.boot.GrailsApp.run(GrailsApp.groovy:99)
        at grails.boot.GrailsApp.run(GrailsApp.groovy:485)
        at grails.boot.GrailsApp.run(GrailsApp.groovy:472)
        at com.example.Application.main(Application.groovy:11)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)

Environment Information

  • Operating System: macOS
  • GORM Version: 7.1.0.BUILD-SNAPSHOT (7.1.0.M5)
  • Grails Version (if using Grails): TODO
  • JDK Version: 1.8
@puneetbehl puneetbehl self-assigned this Jun 2, 2021
puneetbehl added a commit that referenced this issue Jun 6, 2021
Extended GrailsVersion and Snapshot classes to property handle string "5.0.0-SNAPSHOT" alongwith "5.0.0.BUILD-SNAPSHOT".
Fixes #1463
puneetbehl added a commit that referenced this issue May 2, 2022
Extended GrailsVersion and Snapshot classes to property handle string "5.0.0-SNAPSHOT" alongwith "5.0.0.BUILD-SNAPSHOT".
Fixes #1463
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant