Unable to resolve class on Heroku for Spring Boot app - heroku

I created a Spring Boot Groovy app to be deployed on Heroku. I was able to successfully do that, but in running it I came across an error in a Spring Jar (spring-social-facebook-web). I downloaded the code from github, added some logging to a class and rebuilt the module.
Then I commented out the reference to the Jar from the dependencies section and added a reference to my version of the Jar file:
compile fileTree(dir: 'libs', include: '*.jar')
The built app has the new Jar file included in it and it builds fine locally. But when I upload it to Heroku, I get compilation errors that the classes contained in the customized Jar aren't being found - each import is marked as unable to resolve class ... .
Any idea what is going wrong? I've posted a question to Heroku support but haven't heard anything yet.
Thanks in advance.

First time using Heroku and got into the same basic pattern. Unfortunately I didn't store the debug jar I was creating in the git repository. Funny how things start to work when all the pieces are present.

Related

kotlin maven compiler unresolved reference to local dependency

Googled all the Internet, I don’t know how to fix it.
The bottom line: there are 3 spring boot applications (microservices) written in Kotlin with this folder structure
parent-folder:
-api
-service1
-service2
parent-folder is just a folder for convenience in which microservices are added.
api is a spring boot application, but in it only utility classes are common for all other microservices
in the folder with api I do mvn install, the jar is installed and gets into the .m2/ folder
this is the installed service I add to the service1 dependency and when I try to do
mvn install, in the folder with service1 I get the error Error: (4,21) kotlin: Unresolved reference: api
for clarity, here is a screen of the pom Api service
dependency in service1
compile plugin of service1
when I try to make mvn install in service1 I get an error which indicates to
maven kotlin compiler just does not see the package, but everything is working in the intellij idea if i run it as application, I don’t know what i should to do; why the kotlin maven compiler does not want to get the dependency from the local maven
inside jar api there are such classes
in my case the solution was in logic of jar generation
api service was a spring project, when i try to do mvn clean install it creates jar with structure:
api.jar
-META-INF
-BOOT-INF
but when another service use it maven cant find required packages because it was looking in in package name but not in META or BOOT folders
IMPORTANT NOTE!
when you create folders inside project like src/main/kotlin maven-kotlin-compiler will create generated classes in jar inside META folder, but if you create src/main/java it will create jar that will contain generated classes inside folder that have same name that your package name

In the Quarkus Amazon Lambda HTTP guide the Lambda runtime cannot find QuarkusStreamHandler on the classpath

As this issue hasn't been raised already I'm obviously missing something simple. I am following the Quarkus - Amazon Lambda with Resteasy, Undertow, or Vert.x Web guide using the 1.0.0.Final release (I've also tried the CR and 0.28.1 releases).
I have this packaged as an Uber jar.
I have run the mvn quarkus-bootstrap:build-tree and this shows the io.quarkus:quarkus-amazon-lambda-http-deployment:jar:1.0.0.Final with it's dependant jars and checking the generated runner jar shows that the io.quarkus.amazon.lambda.runtime.QuarkusStreamHandler.class file is present.
However, whenever I run this either in the AWS SAM environment or in AWS proper I get the dreaded java.lang.ClassNotFoundException: io.quarkus.amazon.lambda.runtime.QuarkusStreamHandler
I'm at a loss where to turn. I'm compiling using Maven 3.6.2 and Graal 19.2.1 (though not the native compilation).
If anyone stumbles across this, I found that adding "quarkus.package.uber-jar=true" to application.properties folder is required when working with maven.
https://quarkus.io/guides/maven-tooling

Error while executing Simple Spring Boot Application in Spring Tool Suite

I have recently installed Spring Tool Suite 4.0.1 on Ubuntu 18.04 and tried to run hello world spring application but it gives the following compile-time error. I have searched on google a lot but cannot find the relevant info.
Error:
"Description Resource Path Location Type
Archive for required library: '/home/anshul/.m2/repository/org/springframework/spring-test/5.1.2.RELEASE/spring-test-5.1.2.RELEASE.jar' in project 'demo' cannot be read or is not a valid ZIP file"
It looks like the JAR file in your local Maven repository is corrupted. The easiest way to solve this is to completely wipe out the local Maven repo (delete everything under .m2/repository and kick off an Update Maven Project... in STS. That will trigger Maven to download the dependencies again.

Gradle project dependency not working

Can some one please help me in below:
I am using RTC and checkout Gradle project, but at the end when I am checking the properties and looking for source folder for my build, I am getting nothing.
Also I am not send the repository specific Gradle jars. What i am doing wrong?
I tried including external jars but no luck as their are too many jars.
Error: project is not at all building.
right click on your project then configure and convert it to gradle project.
Refresh and you will see all dependencies.

Grails run-app causes error generating web.xml file and bootstrap.groovy not included in war file

I am working on an maven application. When I run it from IntelliJ, it successfully launches my application. But bootstrap.groovy file is not being read. I have created a new username to be added to DB in bootstrap and it should allow me to login to the application using that username for the first time. This is not getting invoked during the start of the program. What settings should I do to include bootstrap.groovy.
The same happens when I create a war file and deploy it in the test server. Bootstrap.grrovy is not read. To create the war file, I use mvn package in command line.
My other question with the same application is that when I do grails run-app, I get the following error: Error generating web.xml file.
What is that I am missing? Please let me know.
Well, I fixed the issue. The web.xml was created when I changed the grails dependent jar. I was using 2.3.4 in my application and my jar was incompatible as I had 2.4.3 version of the jar. Now my program is up and running! Hope this helps someone who is facing the same problem.

Resources