Hi all,

I tried using a trial SSL certificate for securing my test application.

I got following error -
INFO: Starting the Grizzly [HTTP] server
java.io.FileNotFoundException: C:\Documents and Settings\Admin\.keystore (The 
system cannot find the file specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(Unknown Source)
        at java.io.FileInputStream.<init>(Unknown Source)
        at 
com.noelios.restlet.ext.grizzly.HttpsServerHelper.configure(HttpsServerHelper.java:155)
        at 
com.noelios.restlet.ext.grizzly.GrizzlyServerHelper.start(GrizzlyServerHelper.java:102)
        at org.restlet.Server.start(Server.java:383)
        at org.restlet.Component.startServers(Component.java:1233)
        at org.restlet.Component.start(Component.java:1194)
        at restservice.InputDataWebService.main(InputDataWebService.java:37)


Here is my sample code -
import java.io.File;

import org.restlet.Component;
import org.restlet.VirtualHost;
import org.restlet.data.Protocol;

public class InputDataWebService {

        public static void main(String[] args) {
        try {
            // Create a new Component.
            Component component = new Component();
            // Add a new HTTP server listening on port 8182.
            component.getServers().add(Protocol.HTTP, 8182);
            component.getServers().add(Protocol.HTTPS, 8183);

            /* arredocenter.com */
            VirtualHost host = new VirtualHost(component.getContext());
            host.setHostDomain("www.metadata.com|metadata.com|metadata");
            host.attach(new InputDataApplication(component.getContext()));
            component.getHosts().add(host);


            // Update component's context with keystore parameters.
            File keystoreFile = new File("D:\\metadata.crt", "keystore");
            component.getContext().getParameters().add("keystorePath", 
        keystoreFile.toURI().toASCIIString());
            component.getContext().getParameters().add("keystorePassword", 
        "vidya.vadke");
            component.getContext().getParameters().add("keyPassword", 
"vidya.vadke");

           

            // Start the component.
            component.start();
        } catch (Exception e) {
            // Something is wrong.
            e.printStackTrace();
        }
    }

}

Can anyone tell me what am i missing here?

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=990522

Reply via email to