how to run apache's vysper xmpp server

5.1k Views Asked by At

I'm having issue running vysper.

  1. Download/Extract Files frome here (Apache Vysper 0.7 Release)
  2. Modified the spring-config.xml to have additional users/passwords

Just updated this section:

 <bean id="addUsers" class="org.apache.vysper.spring.AddUserHelper">
        <constructor-arg index="0">
            <map>
                <entry key="admin@test" value="Password" />
                <entry key="darewreck@test" value="Password" />
                <!--<entry key="[email protected]" value="CHOOSE A SECURE PASSWORD" />-->
                <!--<entry key="[email protected]" value="CHOOSE A SECURE PASSWORD" />-->
            </map>
        </constructor-arg>
        <property name="storageProviderRegistry" ref="storageRegistry" />
    </bean>

I'm assumign that "test" is the registered domain for the server when it runs?
Or is there a place you specify the domain of the server?

  1. executed /bin/run.bat

16:16:22,415 | INFO | org.springframework.context.support.ClassPathXmlApplicationContext | Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@625e068: startup date [Mon Sep 16 16:16:22 PDT 2013]; root of context hierarchy 16:16:22,457 | INFO | org.springframework.beans.factory.xml.XmlBeanDefinitionReader | Loading XML bean definitions from class path resource [spring-config.xml] 16:16:22,514 | INFO | org.springframework.beans.factory.support.DefaultListableBeanFactory | Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@19f9e 414: defining beans [inmemoryStorageRegistry,jcrStorageRegistry,addUsers,tcpEndpoint,server]; root of factory hierarchy 16:16:22,762 | INFO | org.apache.vysper.xmpp.server.DefaultServerRuntimeContext | replacing the storage provider registry with org.apache.vysper.storage.inmemory.MemoryStorageProviderRegistry 16:16:22,821 | INFO | org.apache.vysper.xmpp.server.DefaultServerRuntimeContext | adding module... servicediscovery (1.0beta) 16:16:22,825 | INFO | org.apache.vysper.xmpp.server.DefaultServerRuntimeContext | adding module... roster (1.0beta) 16:16:22,877 | INFO | org.apache.vysper.xmpp.server.DefaultServerRuntimeContext | adding module... XEP-0092 Software Version (1.0) 16:16:22,881 | INFO | org.apache.vysper.xmpp.server.DefaultServerRuntimeContext | adding module... XEP-0202 Entity Time (1.0) 16:16:22,883 | INFO | org.apache.vysper.xmpp.server.DefaultServerRuntimeContext | adding module... XEP-0054 Vcard-temp (1.0) 16:16:22,883 | ERROR | org.apache.vysper.xmpp.modules.extension.xep0054_vcardtemp.VcardTempModule | no VcardTempPersistenceManager found 16:16:22,883 | INFO | org.apache.vysper.xmpp.server.DefaultServerRuntimeContext | adding module... XEP-0199 XMPP Ping (2.0) 16:16:22,883 | INFO | org.apache.vysper.xmpp.server.DefaultServerRuntimeContext | adding module... XEP-0049 Private Data (1.2) 16:16:22,884 | ERROR | org.apache.vysper.xmpp.modules.extension.xep0049_privatedata.PrivateDataModule | no PrivateDataPersistenceManager found 16:16:22,884 | INFO | org.apache.vysper.xmpp.server.DefaultServerRuntimeContext | adding module... XEP-0050 Ad-hoc Commands (1.2) 16:16:22,885 | INFO | org.apache.vysper.xmpp.server.DefaultServerRuntimeContext | adding module... XEP-0133 Service Administration (1.1) 16:16:22,885 | INFO | org.apache.vysper.xmpp.server.DefaultServerRuntimeContext | adding module... XEP-0045 Multi-user chat (1.24) 16:16:22,891 | WARN | org.apache.vysper.xmpp.modules.extension.xep0045_muc.MUCModule | No room storage provider found, using the default (in memory) 16:16:22,891 | WARN | org.apache.vysper.xmpp.modules.extension.xep0045_muc.MUCModule | No occupant storage provider found, using the default (in memory)

  1. Opened an XMPP client (Swift) (Any XMPP client should work)

User: darewreck@test Password: Password

However, Swift Client receives an encryption error. I'm not really sure what I'm doing wrong.

The server prints out:

16:18:49,571 | DEBUG | org.apache.vysper.xmpp.protocol.SessionStateHolder | session state changed to = INITIATED
16:18:56,582 | DEBUG | org.apache.vysper.xml.decoder.XMPPContentHandler | Decoder writing stanza: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" to="test" version="1.0"></stream:stream
>
16:18:56,584 | INFO  | stanza.client | stream
16:18:56,585 | DEBUG | org.apache.vysper.xmpp.protocol.SessionStateHolder | session state changed to = STARTED
16:18:56,588 | INFO  | stanza.server | stream.starttls[required]
16:18:56,590 | DEBUG | org.apache.vysper.xml.decoder.XMPPContentHandler | Decoder writing stanza: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"></starttls>
16:18:56,591 | INFO  | stanza.client | starttls
16:18:56,592 | DEBUG | org.apache.vysper.xmpp.protocol.SessionStateHolder | session state changed to = ENCRYPTION_STARTED
16:18:56,604 | DEBUG | org.apache.vysper.xmpp.protocol.SessionStateHolder | session state changed to = CLOSED

Is there something i'm not configuring correctly with the authentication/password provided in the spring-config.xml file?

1

There are 1 best solutions below

1
On

<bean id="inmemoryStorageRegistry" class="org.apache.vysper.storage.inmemory.MemoryStorageProviderRegistry" />

<bean id="jcrStorageRegistry" class="org.apache.vysper.storage.jcr.JcrStorageProviderRegistry" />

<!-- choose one of the storage registries -->
<alias name="inmemoryStorageRegistry" alias="storageRegistry" />

<!-- default users; remove if you have persistently stored users
     NOTE: if passwords are empty, random passwords are generated and printed on the console
           So, your default install of Vysper is secure from the very beginning
-->
<bean id="addUsers" class="org.apache.vysper.spring.AddUserHelper">
    <constructor-arg index="0">
        <map>
            <entry key="[email protected]" value="CHOOSE A SECURE PASSWORD" />
            <entry key="user1@localhost" value="user1" />
            <entry key="user2@localhost" value="user2" />
            <!--<entry key="[email protected]" value="CHOOSE A SECURE PASSWORD" />-->
        </map>
    </constructor-arg>
    <property name="storageProviderRegistry" ref="storageRegistry" />
</bean>

<bean id="tcpEndpoint" class="org.apache.vysper.mina.TCPEndpoint">
</bean>

<!-- for making the server available over HTTP transport, configure the BOSH endpoint
     BOSH requires extension xep0124-xep0206-bosh to be on the classpath.
-->

<bean id="boshEndpoint" class="org.apache.vysper.xmpp.extension.xep0124.BoshEndpoint">
    <property name="accessControlAllowOrigin">
        <list><value>*</value></list>
    </property>
    <property name="port" value="8080" />
    <property name="contextPath" value="/bosh" />
</bean>


<bean id="server" class="org.apache.vysper.spring.SpringCompatibleXMPPServer"
      init-method="init" destroy-method="destroy">
    <!-- TODO change domain name to your domain -->
    <constructor-arg value="localhost"/>
    <property name="endpoints">
        <list>
            <ref bean="tcpEndpoint"/>
            <ref bean="boshEndpoint"/>
        </list>
    </property>
    <property name="storageProviderRegistry" ref="storageRegistry" />
    <property name="certificateFile" value="classpath:bogus_mina_tls.cert" />
    <property name="certificatePassword" value="boguspw" />
    <property name="modules" >
        <list>
            <bean class="org.apache.vysper.xmpp.modules.extension.xep0092_software_version.SoftwareVersionModule"/>
            <bean class="org.apache.vysper.xmpp.modules.extension.xep0202_entity_time.EntityTimeModule" />
            <bean class="org.apache.vysper.xmpp.modules.extension.xep0054_vcardtemp.VcardTempModule" />
            <bean class="org.apache.vysper.xmpp.modules.extension.xep0119_xmppping.XmppPingModule" />
            <bean class="org.apache.vysper.xmpp.modules.extension.xep0049_privatedata.PrivateDataModule" />
            <bean class="org.apache.vysper.xmpp.modules.extension.xep0050_adhoc_commands.AdhocCommandsModule" />
            <bean class="org.apache.vysper.xmpp.modules.extension.xep0133_service_administration.ServiceAdministrationModule" >
                <property name="addAdmins">
                    <list><value>[email protected]</value></list>
                </property>
            </bean>
            <!-- below some more modules which are available as separately-built jars. 
                 make sure they are on the classpath when enabling them or remove the beans below, 
                 depending on the features your server should expose -->
            <!--<bean class="org.apache.vysper.xmpp.modules.extension.xep0060_pubsub.PublishSubscribeModule" />-->
            <bean class="org.apache.vysper.xmpp.modules.extension.xep0045_muc.MUCModule" />
        </list>
    </property>
</bean>