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

Example can't be run from the project itself #1223

Closed
llowinge opened this issue May 14, 2020 · 8 comments
Closed

Example can't be run from the project itself #1223

llowinge opened this issue May 14, 2020 · 8 comments
Milestone

Comments

@llowinge
Copy link
Contributor

Following https://camel.apache.org/camel-quarkus/latest/first-steps.html

I've modified the pom of the rest-json module as follows:

[14/05/20 13:27:00] ~/R/q/c/e/rest-json ❯❯❯ git diff                                                                                                                                  tags/1.0.0-M7^0 ✭ ✱
diff --git a/examples/rest-json/pom.xml b/examples/rest-json/pom.xml
index 9f7fc4a2..df604fc3 100644
--- a/examples/rest-json/pom.xml
+++ b/examples/rest-json/pom.xml
@@ -20,9 +20,9 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xs
     <parent>
         <groupId>org.apache.camel.quarkus</groupId>
-        <artifactId>camel-quarkus-build-parent</artifactId>
+        <artifactId>camel-quarkus-bom</artifactId>
         <version>1.0.0-M7</version>
-        <relativePath>../../poms/build-parent/pom.xml</relativePath>
+<!--        <relativePath>../../poms/build-parent/pom.xml</relativePath>-->
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

Then i've run dev mode which leads to exception

[14/05/20 13:27:10] ~/R/q/c/e/rest-json ❯❯❯ pwd                                                                                                                                       tags/1.0.0-M7^0 ✭ ✱
/Users/llowinge/Redhat/quarkus/camel-quarkus/examples/rest-json
[14/05/20 13:27:15] ~/R/q/c/e/rest-json ❯❯❯ mvn clean compile quarkus:dev                                                                                                             tags/1.0.0-M7^0 ✭ ✱
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.apache.camel.quarkus:camel-quarkus-examples-rest-json:jar:1.0.0-M7
[WARNING] 'parent.relativePath' of POM org.apache.camel.quarkus:camel-quarkus-examples-rest-json:1.0.0-M7 (/Users/llowinge/Redhat/quarkus/camel-quarkus/examples/rest-json/pom.xml) points at org.apache.camel.quarkus:camel-quarkus-examples instead of org.apache.camel.quarkus:camel-quarkus-bom, please verify your project structure @ line 21, column 13
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] -----< org.apache.camel.quarkus:camel-quarkus-examples-rest-json >------
[INFO] Building Camel Quarkus :: Examples :: Rest Json 1.0.0-M7
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ camel-quarkus-examples-rest-json ---
[INFO] Deleting /Users/llowinge/Redhat/quarkus/camel-quarkus/examples/rest-json/target
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (camel-quarkus-enforcer-rules) @ camel-quarkus-examples-rest-json ---
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.5:process (process-resource-bundles) @ camel-quarkus-examples-rest-json ---
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ camel-quarkus-examples-rest-json ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ camel-quarkus-examples-rest-json ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /Users/llowinge/Redhat/quarkus/camel-quarkus/examples/rest-json/target/classes
[INFO] 
[INFO] --- quarkus-maven-plugin:1.4.1.Final:dev (default-cli) @ camel-quarkus-examples-rest-json ---
Listening for transport dt_socket at address: 5005
java.lang.NullPointerException
        at sun.nio.fs.UnixPath.normalizeAndCheck(UnixPath.java:77)
        at sun.nio.fs.UnixPath.<init>(UnixPath.java:71)
        at sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:281)
        at java.nio.file.Paths.get(Paths.java:84)
        at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.checkForFileChange(RuntimeUpdatesProcessor.java:315)
        at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.doScan(RuntimeUpdatesProcessor.java:126)
        at org.apache.camel.quarkus.core.devmode.CamelHotReplacementSetup$1.run(CamelHotReplacementSetup.java:36)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)

NOTE: If i copy the module out of camel-quarkus tree, then it works.

@lburgazzoli
Copy link
Contributor

I'm unable to replicate the issue

@llowinge
Copy link
Contributor Author

Note i was on tag tags/1.0.0-M7^0

@lburgazzoli
Copy link
Contributor

don't fails for me even on M7

@llowinge
Copy link
Contributor Author

The problem is, that in my case, this line:

Path classesDir = Paths.get(module.getClassesPath()); in module camel-quarkus-support-common has classesPath = null.

@lburgazzoli
Copy link
Contributor

Mind reporting to quarkus ?

@llowinge
Copy link
Contributor Author

I will report it to the similar issue #828

@ppalaga
Copy link
Contributor

ppalaga commented Jun 9, 2020

I cannot reproduce with Camel Quarkus tag 1.0.0-CR2. Could you please retry, @llowinge ?

@ppalaga
Copy link
Contributor

ppalaga commented Jun 10, 2020

@llowinge as noted in #828 this is reproducible when you run an example without replacing camel-quarkus-build-parent with camel-quarkus-bom. So you either need to do that or use -DnoDeps. See also https://camel.apache.org/camel-quarkus/latest/user-guide/first-steps.html Closing as not a bug.

@ppalaga ppalaga closed this as completed Jun 10, 2020
@ppalaga ppalaga added this to the 1.0.0-CR3 milestone Jul 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants