Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

Need help deploying a gradle/spring app to heroku.

I am following along the "Deploying to heroku" video in Chris Ramacciotti's "Deploying a spring application" course. When I run the command "heroku local web", the server appears to start working but then gets killed. The following error is outputted:

4:53:50 AM web.1 | > ConverterNotFoundException: No converter found capable of converting from type java.lang.String to type java.lang.Integer] 4:53:50 AM web.1 | at org.springframework.boot.bind.PropertiesConfigurationFactory.validate(PropertiesConfigurationFactory.java:296) 4:53:50 AM web.1 | at org.springframework.boot.bind.PropertiesConfigurationFactory.doBindPropertiesToTarget(PropertiesConfigurationFactory.java:255) 4:53:50 AM web.1 | at org.springframework.boot.bind.PropertiesConfigurationFactory.bindPropertiesToTarget(PropertiesConfigurationFactory.java:227) 4:53:50 AM web.1 | at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.ja va:297) 4:53:50 AM web.1 | ... 51 common frames omitted [DONE] Killing all processes with signal null 4:53:51 AM web.1 Exited with exit code 1

1 Answer

Craig Dennis
STAFF
Craig Dennis
Treehouse Teacher

Sounds like something in your config is passing a String value when it expecting a int value. Is the code someplace you can share?

https://github.com/ivartheboneless/numberspellWebApp

^That's all my code. The executable jar file is in the builds/libs folder. When I run "gradlew.bat stage", it builds successfully but when I run "heroku local web", I get this error.

I hope my code makes sense

Hey Craig Dennis, were you able to check out my code?

ConverterNotFoundException: No converter found capable of converting from type java.lang.String to type java.lang.Integer]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:687)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:967)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:956)
at org.numberspell.AppConfig.main(AppConfig.java:14)

It appears that the error is referring to the following part of my code:

package org.numberspell;

import org.numberspell.data.Dictionary;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;

@EnableAutoConfiguration
@ComponentScan
public class AppConfig {
    public static void main(String[] args) {
        //loading words into the dictionary
        Dictionary.load();
        SpringApplication.run(AppConfig.class, args);
    }
}

It's referring to the line where is says " SpringApplication.run(AppConfig.class, args); "

Craig Dennis
Craig Dennis
Treehouse Teacher

What happens when you call Dictionary.load() outside of Spring?