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

keystore and static ressources not found #87

Closed
ragulan77 opened this issue Sep 26, 2015 · 6 comments
Closed

keystore and static ressources not found #87

ragulan77 opened this issue Sep 26, 2015 · 6 comments
Labels

Comments

@ragulan77
Copy link

Hi,

I am trying to launch the custom_authorisation example in vertx web exemple. I have the following error:

java.io.FileNotFoundException: /home/ragulan/NetBeansProjects/vertx-examples/web-examples/web-examples/src/main/java/io/vertx/example/web/custom_authorisation/keystore.jceks (No such file or directory)
java.lang.RuntimeException: java.io.FileNotFoundException: /home/ragulan/NetBeansProjects/vertx-examples/web-examples/web-examples/src/main/java/io/vertx/example/web/custom_authorisation/keystore.jceks (No such file or directory)
at io.vertx.ext.auth.jwt.impl.JWTAuthProviderImpl.(JWTAuthProviderImpl.java:71)
at io.vertx.ext.auth.jwt.JWTAuth.create(JWTAuth.java:41)
at io.vertx.example.web.custom_authorisation.Server.start(Server.java:30)
at io.vertx.core.AbstractVerticle.start(AbstractVerticle.java:111)
at io.vertx.core.impl.DeploymentManager.lambda$doDeploy$169(DeploymentManager.java:407)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$15(ContextImpl.java:314)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:357)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.FileNotFoundException: /home/ragulan/NetBeansProjects/vertx-examples/web-examples/web-examples/src/main/java/io/vertx/example/web/custom_authorisation/keystore.jceks (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.(FileInputStream.java:138)
at io.vertx.ext.auth.jwt.impl.JWTAuthProviderImpl.(JWTAuthProviderImpl.java:61)
... 9 more

It works fine when I change the path as follow:

JWTAuth jwt = JWTAuth.create(vertx, new JsonObject()
        .put("keyStore", new JsonObject()
            .put("type", "jceks")
            .put("path", "/home/ragulan/NetBeansProjects/vertx-examples/web-examples/src/main/java/io/vertx/example/web/custom_authorisation/keystore.jceks")
            .put("password", "secret")));

Static ressources are not found too. When I go on http://localhost:8080/ I have the message "Not Found" (index.html not found I think, like the issue #61 ).

Can someone help me please ?

@pmlopes
Copy link
Member

pmlopes commented Sep 27, 2015

Can you describe how you're trying to run? command line, ide? also what is your cwd path when you run, so we can try to reproduce the issue.

@cescoffier
Copy link
Member

It's probably a "current working directory" issue.

@ragulan77
Copy link
Author

I am runing with almost the last version of Netbeans. I switch on the tag 3.0.0 with git, click "run" on Netbeans and select the concerning class. I don't know what to say about the cwd path, actually my netbeans is on my desktop.

edit : I tried on both linux mint and Windows 8.1

@purplefox
Copy link
Contributor

Yes, I believe there is at least one other issue like this. The solution is to set up the IDE to the correct working dir.

@purplefox
Copy link
Contributor

Just a thought. I think we can fix it so the examples run on every IDE out of the box even if the IDEs have different cwd configured.

All we need to do is to evaluate new File(".").getAbsolutePath() to find out what the actual cwd is set to. Then we compare that to the examples directory that the test wants. There will be some overlap in the paths. From that we can compute what to set System.setProperty("vertx.cwd", exampleDir); to in ExampleRunner.java (in vertx-examples).

@purplefox
Copy link
Contributor

Should be fixed with #89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants