Grails GraphQL plugin - controller not running when deployed to Heroku - heroku

I have a simple Grails-React app using the React profile that works fine locally but has an issue with the GraphQL plugin not being loaded when deploying to Heroku, it uses:
Grails 3.3.10
JDK 8
Gradle 4.4 (locally) remote on Heroku? I don't know.
Grails React profile
GraphQL plugin 1.0.3.BUILD-SNAPSHOT
The code is here: https://github.com/wellsst/grails3-react-diceware
Running locally with server:bootRun and heroku local -f ProcfileLocal the log entry appears:
INFO --- [ main] g.plugins.DefaultGrailsPluginManager : Grails plug-in [gormGraphql] with version [1.0.3.BUILD-SNAPSHOT] loaded successfully
But remotely on Heroku no errors are shown nor is any logging for GraphQL.
Hitting the "application" controller I see nothing GraphQL and only 1 controller:
{"message":"Welcome to Grails!","environment":"production","appversion":"1","grailsversion":"3.3.10","appprofile":"react","groovyversion":"2.4.17","jvmversion":"1.8.0_222-heroku","reloadingagentenabled":false,"artefacts":{"controllers":1,"domains":1,"services":0},"controllers":[{"name":"grails3.react.diceware.ApplicationController","logicalPropertyName":"application"}],"plugins":[{"name":"i18n","version":"3.3.10"},{"name":"dataBinding","version":"3.3.10"},{"name":"restResponder","version":"3.3.10"},{"name":"jsonView","version":"1.2.9"},{"name":"eventBus","version":"3.3.2"},{"name":"core","version":"3.3.10"},{"name":"dataSource","version":"3.3.10"},{"name":"codecs","version":"3.3.10"},{"name":"controllers","version":"3.3.10"},{"name":"urlMappings","version":"3.3.10"},{"name":"mimeTypes","version":"3.3.10"},{"name":"domainClass","version":"3.3.10"},{"name":"converters","version":"3.3.10"},{"name":"controllersAsync","version":"3.3.2"},{"name":"hibernate","version":"6.1.12"},{"name":"services","version":"3.3.10"},{"name":"interceptors","version":"3.3.10"},{"name":"cache","version":"4.0.1"}]}
I am suspecting it is the version of gradle on Heroku or something about how the GraphQL plugin is configured. Ideas?

My fudge around for this was to deploy to Cloud Foundry, no issues. I suspect it around the different versions of gradle (locally vs remote)

Related

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

Heroku deployment of Gradle application: pom.xml missing

I have an existing Maven based application on Heroku that I want to replace with a JHipster generated, Gradle based one. The steps I took were:
Develop the new Gradle based application using JHipster
run jhipster heroku
git merge heroku --strategy ours
git push heroku
Most of the deployment succeeds (Node.js app detected, webpack logging), but then I get an error:
Could not find a pom.xml file! Please check that it exists and is committed to Git.
It is correct that there is no pom.xml, because now it is a Gradle application. But apparently, Heroku still expects a Maven based one. Where is this knowledge stored and how can I reset it?
Already found out. You have to run this command, to remove the Maven build pack:
heroku buildpacks:clear
Additionally, in my case I also had to set:
heroku buildpacks:set heroku/nodejs
Or Heroku didn't know whether to run as Gradle or NodeJS. The latter is needed for JHipster based applications.

Jhipster Webpack failure for Jhipster Maven Microservice Gateway application in Dev environment

I have generated a Sample Microservice application and a Microservice gateway application using Jhipster. Both applications are built using maven and are using Jhipster registry for identification and routing. I am successfully able to build the Micro service application and able to reach it in the assigned localhost port.
I have build issues while building ./mvnw for gateway application. But it builds properly for gradle application and the API's are up. I have issues only for maven in org.springframework.boot:spring-boot-maven-plugin:2.0.5.
Its running on Windows 10 machine, latest version of Jhipster.
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.5.RELEASE:run (default-cli) on project api-contact-gateway: Could not exec java: Cannot run program "C:\Program Files\Java\jdk1.8.0_181\jre\bin\java.exe": CreateProcess error=206, The filename or extension is too long
I have debugged further and could see that the Classpath passed as a part of JVM arguments is too long. But my system variables are properly set.
I coudn't find any specific solution. I just lowered my Jhipster version to 4.14

Deployment in Jboss fuse using Maven

I have created a Fuse integration project in developer studio 9.0.2 and I'm using jboss-fuse-karaf-6.3.0 as the runtime container.
I want to deploy this project using Maven, but not able to figure out -
How and where to give server URL, user name and password for the deployment ?
Does project gets deployed to fabric or karaf ?
Will appreciate if anybody can help with some pointers.
Thanks in advance.
Is that server running locally or remote?
Locally you can simply define the server in the servers view and then use Add context menu to deploy your project.
it gets deployed to Karaf
When building projects with Maven I use osgi:install and dev:watch commands (available in both JBoss Fuse and vanilla Karaf). The following setup works well for a development machine.
First build with Maven using install goal, so the artifact gets installed in local repository.
Then issue osgi:install (see Manual Deployment in JBoss Fuse docs) command in your container to install your bundle. Job done!
> osgi:install mvn:it.your.package/your-artifact/1.0.0
Once the bundle is installed you will see a message like
Bundle ID: 352
This is the ID of the bundle installed. Issue the following command:
> dev:watch 352
Watched URLs/IDs:
352
Now every time you rebuild with Maven, the bundle gets redeployed automatically.
Watch out some settings to be changed if dev:watch does not reload bundles on JBoss Fuse 6.3.0
edit: use -SNAPSHOT in your version with this setup. Regular versionsmay not redeploy correctly because the container sees the version is the same and may use previously loaded classes, thus causing classloading issues.

Spring Maven rest web service - What is the URL when deploying on real web server?

I followed this tutorial https://spring.io/guides/gs/rest-service/ by creating maven project in intellij, addind pom.xml etc. Then I run on localhost exactly as written in the tutorial and all works:
http://localhost:8080/greeting
When greeting came from the annotation of method in the controller #RequestMapping("/greeting").
Then I made JAR artifact & deployed it to Tomact on 'real server' (Elastic beanstalk environment running EC2 instance on AWS).
I got from AWS the base URL of my webserver running Tomact. What is now the suffix to my service? This is NOT working:
http://someEnvironmentName.elasticbeanstalk.com/greeting
EDIT: How I made the artifact JAR
In intellij I can compile & run maven project and then test it in localhost. So what I did:
Right click on the project name->Open Module Settings->Artifacts->Add->Jar
Build->Build Artifacts->Selecting the Jar from above
Maybe I need to build WAR? And how to deal with the POM.xml? Now my pom is exactly as in the linked tutorial.
Thanks,
If you use spring-boot, you donĀ“t need a tomcat because spring include an embedded tomcat. Only you run the application with Maven. So, the advantage of spring-boot is not dependent on an application server and using other containers such as Docker.
Do you put the port in the call to your webserver?
On the other hand, check your server logs to see if there are any problem.
Solution (Thanks to #JBNizet suggestion):
Follow this link http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-create-a-deployable-war-file
Modify the Application.java file
Modify the pom.xml (By adding one more dependency)
Then if you are using Intellij IDE under Build->Build Artifacts will be automatically option for WAR file.
Just deploy to AWS elasticbeanstalk instance running EC2 in the usual way. The URL is:
http://someEnvironmentName.elasticbeanstalk.com/greeting

Resources