Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Not able to point to keystore file in embedded jetty

Hi All,

I am using embedded jetty 7.2.2. and wanted to configure SSL in it . For this i have created fragment bundle named jettyconfig which consist of FragmentActivator class and jetty.xml & keystore1 located under folder etc. The fragment bundle is called from jetty.boot bundle .

Attach is the complete jettyconfig fragment bundle for your reference . In jetty.xml file if i set the keystore path as highlighted  below i get the following exception 

jetty.xml entry for SSL 

 <Call name="addConnector">
   <Arg>
     <New class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
<Set name="Port">8443</Set>
<Set name="maxIdleTime">30000</Set>
        <Set name="Acceptors">2</Set>
        <Set name="AcceptQueueSize">100</Set>
<Set name="Keystore"><Property name="jetty.home" default="." />/etc/keystore1</Set>
<Set name="Password">OBF:1igd1igf1igh1idp1idr1idt</Set>
<Set name="KeyPassword">OBF:1igd1igf1igh1idp1idr1idt</Set>
   <Set name="truststore"><Property name="jetty.home" default="." />/etc/keystore1</Set>
        <Set name="trustPassword">OBF:1igd1igf1igh1idp1idr1idt</Set>
     </New>
   </Arg>
     </Call> 

Exception trace below comes on console when jetty is coming up :

2011-02-25 13:33:43.671:INFO::Started SelectChannelConnector@0.0.0.0:50099
2011-02-25 13:33:43.672:WARN::FAILED SslSelectChannelConnector@0.0.0.0:8443: java.io.FileNotFoundException: C:\Mitul\Software\eclipse-jpaas-helios-SR1-win32\etc\keystore1 (The system cannot find the path specified)
2011-02-25 13:33:43.673:WARN::FAILED org.eclipse.jetty.server.Server@182a70: java.io.FileNotFoundException: C:\Mitul\Software\eclipse-jpaas-helios-SR1-win32\etc\keystore1 (The system cannot find the path specified)
java.io.FileNotFoundException: C:\Mitul\Software\eclipse-jpaas-helios-SR1-win32\etc\keystore1 (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at org.eclipse.jetty.util.resource.FileResource.getInputStream(FileResource.java:274)
at org.eclipse.jetty.server.ssl.SslSelectChannelConnector.getKeyStore(SslSelectChannelConnector.java:683)
at org.eclipse.jetty.server.ssl.SslSelectChannelConnector.getKeyManagers(SslSelectChannelConnector.java:650)
at org.eclipse.jetty.server.ssl.SslSelectChannelConnector.createSSLContext(SslSelectChannelConnector.java:637)
at org.eclipse.jetty.server.ssl.SslSelectChannelConnector.doStart(SslSelectChannelConnector.java:595)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.Server.doStart(Server.java:254)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper.start(ServerInstanceWrapper.java:175)
at org.eclipse.jetty.osgi.boot.internal.serverfactory.JettyServerServiceTracker.serviceChanged(JettyServerServiceTracker.java:108)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:933)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:149)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:756)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:711)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)

If the path is changed to  /newWP1/jettyconfig/etc/ketystore1 then it is able to locate the given file .  Here newWP1 is my eclipse workspace name & jettyconfig is the bundle which is attached .
I wanted to know how can i point to required file without the use of /newWP1/jettyconfig in key store path ???


Best Regards,
mitul

Attachment: jettyconfig.zip
Description: Zip archive


Back to the top