-
Notifications
You must be signed in to change notification settings - Fork 8
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
Created Jar is failing to execute via java -jar #25
Comments
Yes I am also having this exact issue as well! I've not been able to run this project as a jar. I've debugged into the inner workings of the resource loader and it appears that during autodeployment of BPMN files the resource loader recognises the bpmn file as a jar rather than a file. (note the "jar" at the beginning of the URL in @gamodg's stack trace above). When the app is ran using spring boots runner (ie @berndruecker any ideas please? |
same issue here |
I think perhaps the issue is the use of "Now we can read its contents by calling getFile. Although, it should be noted that this approach expects the resource to be present in the filesystem and not within a jar file." |
As a workaround followed the article to use layers for ensuring that files are not packaged in a jar https://spring.io/blog/2020/01/27/creating-docker-images-with-spring-boot-2-3-0-m1 Below is the working Dockerfile FROM adoptopenjdk/openjdk11-openj9:jdk-11.0.14_9_openj9-0.30.0-alpine-slim as builder FROM adoptopenjdk/openjdk11-openj9:jre-11.0.14_9_openj9-0.30.0-alpine |
I wonder why you want to This library is meant to be used within your own application as library/SDK (like e.g. https://github.com/camunda-community-hub/camunda-platform-7-rest-client-java#spring-boot-starter). Then you need to start your own app - and not this library - or do I get this wrong? |
Thanks @berndruecker for your response! Perhaps I am misunderstanding your message, but we are not packaging and trying to run this artefact individually. We are pulling this library into our own application by setting the dependency in our pom file as per the instructions in the readme of this repo, and then attempting to package and run our application as a JAR file. The error (see stack trace in issue description) can be reproduced by taking the example project from the readme which makes use of this repository as a dependency, adding the spring repackage plugin to the pom (as per description of issue) to enable packaging into a jar, then running: |
Sorry - my bad - understood now. I added the proper repackaging rule for Spring Boot in the example: https://github.com/berndruecker/camunda-7-remote-spring-boot-example/blob/main/pom.xml#L26 Note that you should update to 7.17.2 (https://github.com/berndruecker/camunda-7-remote-spring-boot-example/blob/main/pom.xml#L16) because that fixes some resource deployment problems in this setup. |
Hi @berndruecker , thanks for making the change. Unfortunately I think it's introduced a Null Pointer which fails the startup. When I run latest version of the
|
@vijamesDD Thanks for reporting! Does it help if I say this line can't be null ;-) Jokes aside - This is a bit puzzling to me. I can easily fix it (d3ddc3d) - but I still don't understand it - so I don't know how to build a test case for it. How do you run the Unfortunately, the OpenAPI client needs a File (instead of an InputStream) - so there might be differences on this level. Can you test against the latest main branch (so a 7.13.0-SNAPSHOT)? |
Released 7.13.3 with this fix - can you double check if that works for you? |
Hi @berndruecker , thanks for getting this change in! I've tested version 7.12.3 as that appears to be the version thats most recently deployed (incidentally did you mean for it to be 7.12.3 ? the version before that was 7.17.2 I believe)
I noticed though that the bpmn files in the resource folder do not appear to be auto deployed to the engine service on startup, does that occur for you as well? |
The version was a typo from my end - sorry for that. Let me have a look into the deployment tomorrow - I thought it is picking it up properly - but I will double check and probably also add some logging to better diagnose problems |
I can't reproduce your problem - when I run Then I can also see the deployment happing with the just built-in logging:
This is a bit different to when running the application via IDE - which is in-line with expectations:
Could you retry with the now correctly built 7.17.3? |
Hi @berndruecker , sure thing! I've tested with 7.17.3 in the example application. I am also seeing those log lines, but I don't think the auto-deployment is working as intended 😢 I'm finding that the remote engine is not recognising the files as processes and is therefore not creating process definitions for them. Could this be because the Screnshots below of the camunda cockpit for my locally running engine which appears to not have the expected processes defined... |
Thanks for the additional context. Got it - and you are right. It is because of the file ending - my bad (probably not a good idea to do these things as a side hobby whenever there is a little time slot). Nevertheless fixed now in 7.17.4 and tried successfully end-to-end on my end. |
Used the project at https://github.com/berndruecker/camunda-7-remote-spring-boot-example
java -jar <APP>.jar
got the errorno main manifest attribute, in camunda-platform-remote-spring-boot-example-0.0.1-SNAPSHOT.jar
Updated pom.xml to have
but now I am getting below error. Please help !!
The text was updated successfully, but these errors were encountered: