OFBIZ运行时Cannot start() org.ofbiz.service.rmi.RmiServiceContainer异常解决方法。

OFBIZ版本 9.04
执行startofbiz.bat 运行出现如下异常
2010-12-02 00:13:10,688 (main) [  GenericDispatcher.java:61 :INFO ] Creating new dispatcher [RMIDispatcher] (main)
org.ofbiz.base.start.StartupException: Cannot start() org.ofbiz.service.rmi.RmiServiceContainer (Unable to start the RMI disp
atcher (Listen failed on port: 0; nested exception is:
        java.io.IOException: SSL certificate alias cannot be null; MUST be set for SSLServerSocketFactory!))
        at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:103)
        at org.ofbiz.base.start.Start.startStartLoaders(Start.java:272)
        at org.ofbiz.base.start.Start.startServer(Start.java:322)
        at org.ofbiz.base.start.Start.start(Start.java:326)
        at org.ofbiz.base.start.Start.main(Start.java:411)
org.ofbiz.base.container.ContainerException: Unable to start the RMI dispatcher (Listen failed on port: 0; nested exception i
s:
        java.io.IOException: SSL certificate alias cannot be null; MUST be set for SSLServerSocketFactory!)
        at org.ofbiz.service.rmi.RmiServiceContainer.start(RmiServiceContainer.java:133)
        at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:101)
        at org.ofbiz.base.start.Start.startStartLoaders(Start.java:272)
        at org.ofbiz.base.start.Start.startServer(Start.java:322)
        at org.ofbiz.base.start.Start.start(Start.java:326)
        at org.ofbiz.base.start.Start.main(Start.java:411)
Caused by: java.rmi.server.ExportException: Listen failed on port: 0; nested exception is:
        java.io.IOException: SSL certificate alias cannot be null; MUST be set for SSLServerSocketFactory!
        at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:312)
        at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:218)
        at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:393)
        at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:129)
        at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:190)
        at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:293)
        at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:256)
        at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:155)
        at org.ofbiz.service.rmi.RemoteDispatcherImpl.<init>(RemoteDispatcherImpl.java:44)
        at org.ofbiz.service.rmi.RmiServiceContainer.start(RmiServiceContainer.java:131)
        ... 5 more
Caused by: java.io.IOException: SSL certificate alias cannot be null; MUST be set for SSLServerSocketFactory!
        at org.ofbiz.service.rmi.socket.ssl.SSLServerSocketFactory.createServerSocket(SSLServerSocketFactory.java:89)
        at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:649)
        at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:299)
        ... 14 more
org.ofbiz.base.container.ContainerException: Unable to start the RMI dispatcher (Listen failed on port: 0; nested exception i
s:
        java.io.IOException: SSL certificate alias cannot be null; MUST be set for SSLServerSocketFactory!)
        at org.ofbiz.service.rmi.RmiServiceContainer.start(RmiServiceContainer.java:133)
        at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:101)
        at org.ofbiz.base.start.Start.startStartLoaders(Start.java:272)
        at org.ofbiz.base.start.Start.startServer(Start.java:322)
        at org.ofbiz.base.start.Start.start(Start.java:326)
        at org.ofbiz.base.start.Start.main(Start.java:411)
Caused by: java.rmi.server.ExportException: Listen failed on port: 0; nested exception is:
        java.io.IOException: SSL certificate alias cannot be null; MUST be set for SSLServerSocketFactory!
        at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:312)
        at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:218)
        at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:393)
        at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:129)
        at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:190)
        at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:293)
        at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:256)
        at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:155)
        at org.ofbiz.service.rmi.RemoteDispatcherImpl.<init>(RemoteDispatcherImpl.java:44)
        at org.ofbiz.service.rmi.RmiServiceContainer.start(RmiServiceContainer.java:131)
        ... 5 more
Caused by: java.io.IOException: SSL certificate alias cannot be null; MUST be set for SSLServerSocketFactory!
        at org.ofbiz.service.rmi.socket.ssl.SSLServerSocketFactory.createServerSocket(SSLServerSocketFactory.java:89)
        at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:649)
        at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:299)
        ... 14 more
2010-12-02 00:13:10,731 (OFBiz_Shutdown_Hook) [    ContainerLoader.java:114:INFO ] Shutting down containers
java.lang.NullPointerException
        at org.ofbiz.service.rmi.RmiServiceContainer.stop(RmiServiceContainer.java:170)
        at org.ofbiz.base.container.ContainerLoader.unload(ContainerLoader.java:122)
        at org.ofbiz.base.start.Start.shutdownServer(Start.java:311)
        at org.ofbiz.base.start.Start.access$000(Start.java:45)
        at org.ofbiz.base.start.Start$2.run(Start.java:288)

找到/framework/base/config/ofbiz-containers.xml 文件
替换掉原来的这段配置
<!-- RMI Service Dispatcher -->
    <container name="rmi-dispatcher" class="org.ofbiz.service.rmi.RmiServiceContainer">
        <property name="bound-name" value="RMIDispatcher"/>
        <property name="bound-host" value="127.0.0.1"/>
        <property name="bound-port" value="1099"/>
        <property name="delegator-name" value="default"/>
        <property name="client-factory" value="org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory"/>
        <property name="server-factory" value="org.ofbiz.service.rmi.socket.ssl.SSLServerSocketFactory"/>
        <property name="ssl-client-auth" value="false"/>
    </container>
--------------------------------------------------------------------
<container name="rmi-dispatcher" class="org.ofbiz.service.rmi.RmiServiceContainer">
        <property name="bound-name" value="RMIDispatcher"/>
        <property name="bound-host" value="127.0.0.1"/>
        <property name="bound-port" value="1099"/>
        <property name="delegator-name" value="default"/>
        <property name="client-factory" value="org.ofbiz.service.rmi.socket.ssl.SSLClientSocketFactory"/>
        <property name="server-factory" value="org.ofbiz.service.rmi.socket.ssl.SSLServerSocketFactory"/>
        <property name="ssl-keystore" value="framework/base/config/ofbizrmi.jks"/>
        <property name="ssl-keystore-type" value="JKS"/>
        <property name="ssl-keystore-pass" value="changeit"/>
        <property name="ssl-keystore-alias" value="rmissl"/>
        <property name="ssl-client-auth" value="false"/>
    </container>

就可以正常启动了。

你可能感兴趣的:(java,socket,Access,sun)