1

I have this file structure;

enter image description here

Then on my beans xml config I have;

enter image description here

But when I start the server up I get a FileNotFoundException /store/thestore.jks

What am I missing? Thanks in advance.

Laazo
  • 467
  • 8
  • 22
  • The leading `/` in `/store/thestore.jks`? Try with `store/thestore.jks`. I can't think of anything else; it looks fine IMO. – x80486 Apr 03 '17 at 14:42
  • 1
    @ɐuıɥɔɐɯ still getting; `java.io.FileNotFoundException: store\thestore.jks (The system cannot find the path specified)` – Laazo Apr 03 '17 at 14:45
  • Please include the stack trace. – 11thdimension Apr 03 '17 at 14:47
  • 1
    Can you copy `thestore.jks` into `resources` (outside `/store`) and modify the entry to `classpath:thestore.jks`? Also try with `file:thestore.jks`. Additionally, like @11thdimension said, update the question with your stack trace... – x80486 Apr 03 '17 at 14:49

1 Answers1

2

According to source code here com.noelios.restlet.util.DefaultSslContextFactory.createSslContext()

190            FileInputStream keyStoreInputStream = null;
191            try {
192                keyStoreInputStream = ((this.keyStorePath != null) && (!"NONE"
193                        .equals(this.keyStorePath))) ? new FileInputStream(
194                        this.keyStorePath) : null;
195                keyStore.load(keyStoreInputStream, this.keyStorePassword);

It's using FileInputStream, which means it will try to read file from the file system and not from the JAR itself.

You have to put jks file outside JAR and provide absolute path to it.

For example

<prop key="keyStorePath">C:/store/thestore.jks</prop>
11thdimension
  • 10,333
  • 4
  • 33
  • 71