Blog

Oregano – how to run the server

Hello there,

First, check this post if you dunno Oregano.

This one looks kinda easy, but I took some times to get the server running and the basic example provided working, cause of some stuff not written in the manual.

I’m using mysql. I’ve downloaded the JDBC connector from the mysql.com website. Do as described in the manual and put this in your config
[xml]

[/xml]

Continue to follow the manual.
When you are creating the table you need to insert a record in the mode table, otherwise when oregano will want to update the value, you’ll get an error ( as no record is in the table yet ).
If you are using mysql that support innoDB use innoDB and put transaction=”true” in your config file.
If so instead of using the oregano.sql provided in the zip downloaded on their website you can use this file which create all the table in innoDB and insert the missing record

I got an error with the server ID too so I’ve changed it. If you do so, remember to change it everywhere in the config file ( here in the node ) otherwise your basic example will not work…

That’s all for now…

More will come as I will go further in the development with this socket server.

And thx to Eric who helped me to find my way…

  • Jonas

    I have recently installed and tested the oregano example, and it works just fine when i run it on my localhost server.

    but when trying to run it externally and on linux server i can’t seem to get a connection. the server is running and listening on the correct ports.

    any idea? anything special I need to think about?

  • Jonas

    I have recently installed and tested the oregano example, and it works just fine when i run it on my localhost server.

    but when trying to run it externally and on linux server i can’t seem to get a connection. the server is running and listening on the correct ports.

    any idea? anything special I need to think about?

  • zeflasher

    Hmmm like that, no sorry no ideas.
    The firewall maybe? ( I know it’s stupid but sometimes a reminder is good 🙂 )

    Sorry can’t help you like that.
    If you still have a problem drop me a line at zeflasher [at] gmail [dot] com

  • zeflasher

    Hmmm like that, no sorry no ideas.
    The firewall maybe? ( I know it’s stupid but sometimes a reminder is good 🙂 )

    Sorry can’t help you like that.
    If you still have a problem drop me a line at zeflasher [at] gmail [dot] com

  • Innosan

    Hey there zeflasher, i have been working with oregano server for a while now, but just now started trying to implement a custom server extension. I followed the oregano DOC created a blank java class file that implements the extension package. But when i start the server it fails to create any groups. If you have any idea i would appareciate it. I am fairly stuck

  • Innosan

    Hey there zeflasher, i have been working with oregano server for a while now, but just now started trying to implement a custom server extension. I followed the oregano DOC created a blank java class file that implements the extension package. But when i start the server it fails to create any groups. If you have any idea i would appareciate it. I am fairly stuck

  • zeflasher

    Hello Innosan.
    Ok I’ve done an extension for the group and had no problem really. The only thing is that your class should not belong to any package.
    Contact me on my email zeflasher [at] gmail [dot] com and I will send you my java class ( nothing much in it ) and the config using it.
    C ya around

  • zeflasher

    Hello Innosan.
    Ok I’ve done an extension for the group and had no problem really. The only thing is that your class should not belong to any package.
    Contact me on my email zeflasher [at] gmail [dot] com and I will send you my java class ( nothing much in it ) and the config using it.
    C ya around

  • Innosan

    Hello again, I figured out my problem i hadn’t defined all the implemented classes before compiling it, and since it wasn’t an abstract class.. oops >

  • Innosan

    Hello again, I figured out my problem i hadn’t defined all the implemented classes before compiling it, and since it wasn’t an abstract class.. oops >

  • About extending Oregano serverside with java classes, so called extensions :

    In order to make it work, you need :
    – to compile the .class file
    – to put it in the right directory of your server location
    – to be aware that if you used package, you need to put the .class in the same folder structure.
    – To configure properly the config.xml with the package structure also

    HTH

    Feel free to contact me for further questions.
    I’ll put the forum back asap, as some might need it back 🙂

    See you there.

    Eric Priou

  • About extending Oregano serverside with java classes, so called extensions :

    In order to make it work, you need :
    – to compile the .class file
    – to put it in the right directory of your server location
    – to be aware that if you used package, you need to put the .class in the same folder structure.
    – To configure properly the config.xml with the package structure also

    HTH

    Feel free to contact me for further questions.
    I’ll put the forum back asap, as some might need it back 🙂

    See you there.

    Eric Priou

  • zeflasher

    Cheers eric…
    Yeah will be great to have it…
    Anotherwise for the package, I did had trouble ( even when creating the right structure in the extensions folder ) :/
    I’ll try again…

  • zeflasher

    Cheers eric…
    Yeah will be great to have it…
    Anotherwise for the package, I did had trouble ( even when creating the right structure in the extensions folder ) :/
    I’ll try again…

  • Feel free to post there :
    http://www.v-i-a.net/forum/

  • Feel free to post there :
    http://www.v-i-a.net/forum/

  • Peter

    Hi people, i have trying to create a groupextension.
    The server can find it and starts up, but no startup groups get created.
    I see you have had this problem Innosan, how did you fix it? You say ” i hadn’t defined all the implemented classes before compiling it”.
    What does that mean? I think I have implemented all methods that the interface defines. This is what my extenstion class file looks like:

    import org.omus.data.Message;
    import org.omus.data.DataRow;
    import org.omus.core.User;
    import org.omus.core.Group;
    import org.omus.core.PropertyUpdate;
    import org.omus.core.GroupCreationData;

    class myDefaultGroupExt implements org.omus.ext.GroupExtension {

    /**
    * Invoked before the group will be created. The GroupCreationData object contains methods
    * to read the name and the configID of the group that is supposed to be created. If this
    * method returns false, the creation of this group will be aborted. This way you can
    * implement some kind of error checking on the server or load some additional data before
    * the group is created. You can use the setErrorCode method of the GroupCreationData object
    * to send customized error codes to the clients in case you want to prevent the creation of
    * that group. Otherwise a default error code will be sent.
    */
    public boolean prepareGroupCreation (GroupCreationData gcd) {
    return true;
    }

    /**
    * Invoked after the group has been created. Each class that implements this interface should
    * keep a reference to the group object in a field.
    */
    public void finishGroupCreation (Group group) {

    }

    /**
    * Invoked after the group has been removed. You can still modify the properties of this group
    * which will be written to the database after this method finished executing.
    */
    public void groupRemoved () {

    }

    /**
    * Invoked after a user has joined the group. You can use the DataRow object, which is empty
    * initially, to send additional data to the client which will be received in the paramater of
    * the

    onChange

    event handler of the group object in the client. (if you develop an extension to
    * the login group, the additional data will be receceived in the

    onLogin

    or

    onRegister

    events.
    */
    public void userJoined (User user, DataRow extraData) {

    }

    /**
    * Invoked after a user has left the group. You can still change the properties of the user.
    * This method gets invoked before the userJoined method of the new group will be invoked.
    */
    public void userLeft (User user) {

    }

    /**
    * Invoked before a message is sent to the specified user. This event may originate from a
    * client calling

    sendToUser

    or

    sendToAll

    in

    org.omus.messenger

    * or from any server extension
    * calling sendToGroup or sendToAll in the MessagingManager. Return true if you want the message
    * to proceed on its way to the client.
    */
    public boolean messageToUser (Message msg, User recipient) {
    return true;
    }

    /**
    * Invoked before a message is sent to all the clients who are currently member of this group.
    * This event may originate from a client calling

    sendToGroup

    in

    org.omus.messenger

    * or from any
    * server extension calling

    sendToGroup

    in the MessagingManager. Return true if you want the message
    * to proceed on its way to the clients.
    */
    public boolean messageToGroup (Message msg) {
    return true;
    }

    /**
    * Invoked after a message from the specified sender has been received.
    * This event originates from a client calling

    sendToServer

    in

    org.omus.messenger

    .
    */
    public void messageFromClient (Message msg, User sender) {

    }

    /**
    * Invoked before the properties of the specified owner will be synchronized. The sender represents
    * the client that modified the properties. PropertyUpdate is a subclass of PropertySet. This object
    * does not contain all the properties that are associated with the owner, but only the modified ones.
    * You can implement some kind of error checking and only return true if you want the new values to be
    * accepted and synchronized. If you return false to reset all affected properties to their old value,
    * you can use the

    setErrorCode

    method of the PropertyUpdate object to send customized
    * error codes to the clients. Otherwise a default error code will be sent.
    */
    public boolean syncUserProperties (PropertyUpdate newValues, User sender, User owner) {
    return true;
    }

    /**
    * Invoked before the properties of this group will be synchronized.
    * The sender represents the
    * client that modified the properties. PropertyUpdate is a subclass of PropertySet. This object
    * does not contain all the properties that are associated with this group, but only the modified ones.
    * You can implement some kind of error checking and only return true if you want the new values to be
    * accepted and synchronized. If you return false to reset all affected properties to their old value,
    * you can use the

    setErrorCode

    method of the PropertyUpdate object to send customized error
    * codes to the clients. Otherwise a default error code will be sent.
    */
    public boolean syncGroupProperties (PropertyUpdate newValues, User sender) {
    return true;
    }
    }

    I am using the example application and when i remove my extenstion from the config.xml the startup groups get created.

    What could be the problem?
    Very thankful for help.
    /Peter

  • Peter

    Hi people, i have trying to create a groupextension.
    The server can find it and starts up, but no startup groups get created.
    I see you have had this problem Innosan, how did you fix it? You say ” i hadn’t defined all the implemented classes before compiling it”.
    What does that mean? I think I have implemented all methods that the interface defines. This is what my extenstion class file looks like:

    import org.omus.data.Message;
    import org.omus.data.DataRow;
    import org.omus.core.User;
    import org.omus.core.Group;
    import org.omus.core.PropertyUpdate;
    import org.omus.core.GroupCreationData;

    class myDefaultGroupExt implements org.omus.ext.GroupExtension {

    /**
    * Invoked before the group will be created. The GroupCreationData object contains methods
    * to read the name and the configID of the group that is supposed to be created. If this
    * method returns false, the creation of this group will be aborted. This way you can
    * implement some kind of error checking on the server or load some additional data before
    * the group is created. You can use the setErrorCode method of the GroupCreationData object
    * to send customized error codes to the clients in case you want to prevent the creation of
    * that group. Otherwise a default error code will be sent.
    */
    public boolean prepareGroupCreation (GroupCreationData gcd) {
    return true;
    }

    /**
    * Invoked after the group has been created. Each class that implements this interface should
    * keep a reference to the group object in a field.
    */
    public void finishGroupCreation (Group group) {

    }

    /**
    * Invoked after the group has been removed. You can still modify the properties of this group
    * which will be written to the database after this method finished executing.
    */
    public void groupRemoved () {

    }

    /**
    * Invoked after a user has joined the group. You can use the DataRow object, which is empty
    * initially, to send additional data to the client which will be received in the paramater of
    * the

    onChange

    event handler of the group object in the client. (if you develop an extension to
    * the login group, the additional data will be receceived in the

    onLogin

    or

    onRegister

    events.
    */
    public void userJoined (User user, DataRow extraData) {

    }

    /**
    * Invoked after a user has left the group. You can still change the properties of the user.
    * This method gets invoked before the userJoined method of the new group will be invoked.
    */
    public void userLeft (User user) {

    }

    /**
    * Invoked before a message is sent to the specified user. This event may originate from a
    * client calling

    sendToUser

    or

    sendToAll

    in

    org.omus.messenger

    * or from any server extension
    * calling sendToGroup or sendToAll in the MessagingManager. Return true if you want the message
    * to proceed on its way to the client.
    */
    public boolean messageToUser (Message msg, User recipient) {
    return true;
    }

    /**
    * Invoked before a message is sent to all the clients who are currently member of this group.
    * This event may originate from a client calling

    sendToGroup

    in

    org.omus.messenger

    * or from any
    * server extension calling

    sendToGroup

    in the MessagingManager. Return true if you want the message
    * to proceed on its way to the clients.
    */
    public boolean messageToGroup (Message msg) {
    return true;
    }

    /**
    * Invoked after a message from the specified sender has been received.
    * This event originates from a client calling

    sendToServer

    in

    org.omus.messenger

    .
    */
    public void messageFromClient (Message msg, User sender) {

    }

    /**
    * Invoked before the properties of the specified owner will be synchronized. The sender represents
    * the client that modified the properties. PropertyUpdate is a subclass of PropertySet. This object
    * does not contain all the properties that are associated with the owner, but only the modified ones.
    * You can implement some kind of error checking and only return true if you want the new values to be
    * accepted and synchronized. If you return false to reset all affected properties to their old value,
    * you can use the

    setErrorCode

    method of the PropertyUpdate object to send customized
    * error codes to the clients. Otherwise a default error code will be sent.
    */
    public boolean syncUserProperties (PropertyUpdate newValues, User sender, User owner) {
    return true;
    }

    /**
    * Invoked before the properties of this group will be synchronized.
    * The sender represents the
    * client that modified the properties. PropertyUpdate is a subclass of PropertySet. This object
    * does not contain all the properties that are associated with this group, but only the modified ones.
    * You can implement some kind of error checking and only return true if you want the new values to be
    * accepted and synchronized. If you return false to reset all affected properties to their old value,
    * you can use the

    setErrorCode

    method of the PropertyUpdate object to send customized error
    * codes to the clients. Otherwise a default error code will be sent.
    */
    public boolean syncGroupProperties (PropertyUpdate newValues, User sender) {
    return true;
    }
    }

    I am using the example application and when i remove my extenstion from the config.xml the startup groups get created.

    What could be the problem?
    Very thankful for help.
    /Peter

  • Peter

    Hi people, i have trying to create a groupextension.
    The server can find it and starts up, but no startup groups get created.
    I see you have had this problem Innosan, how did you fix it? You say ” i hadn’t defined all the implemented classes before compiling it”.
    What does that mean? I think I have implemented all methods that the interface defines.
    I am using the example application and when i remove my extenstion from the config.xml the startup groups get created.
    What could be the problem?
    Very thankful for help.
    /Peter

  • Peter

    Hi people, i have trying to create a groupextension.
    The server can find it and starts up, but no startup groups get created.
    I see you have had this problem Innosan, how did you fix it? You say ” i hadn’t defined all the implemented classes before compiling it”.
    What does that mean? I think I have implemented all methods that the interface defines.
    I am using the example application and when i remove my extenstion from the config.xml the startup groups get created.
    What could be the problem?
    Very thankful for help.
    /Peter

  • Peter

    erixtekila, i have tried to register to post messages on http://www.v-i-a.net/forum/
    but i get no activation email sent to me so I cant login.
    Yours
    /Peter

  • Peter

    erixtekila, i have tried to register to post messages on http://www.v-i-a.net/forum/
    but i get no activation email sent to me so I cant login.
    Yours
    /Peter

  • Paul

    I noticed an additional reason that the group can fail to be created. In working with the oregano server, I changed the config.xml where the groupConfig.group(‘configID’) attribute was a different configuration, while keeping the groups the same.

    I got the error:
    error / changeGroups error code = cgr-e-027
    error description: GroupFactory: group has already been created with a different configID
    additional info: group name = green – configID = standard

    serverID: server1 – 07.03.2008 – 13:12:21
    error / services error code = srv-e-006
    error description: GroupManager: error creating startup group

    Later I noticed that “You can create an unlimited number of groups with the same configID but different names, but you cannot create two groups with the same name.”

    However, I had to execute a query in MySQL to update the configID of the group.

    update groupprops set configID = ‘NewGroup’ where groupName = ‘green’;

    This solved the issue.

  • Paul

    I noticed an additional reason that the group can fail to be created. In working with the oregano server, I changed the config.xml where the groupConfig.group(‘configID’) attribute was a different configuration, while keeping the groups the same.

    I got the error:
    error / changeGroups error code = cgr-e-027
    error description: GroupFactory: group has already been created with a different configID
    additional info: group name = green – configID = standard

    serverID: server1 – 07.03.2008 – 13:12:21
    error / services error code = srv-e-006
    error description: GroupManager: error creating startup group

    Later I noticed that “You can create an unlimited number of groups with the same configID but different names, but you cannot create two groups with the same name.”

    However, I had to execute a query in MySQL to update the configID of the group.

    update groupprops set configID = ‘NewGroup’ where groupName = ‘green’;

    This solved the issue.