powered by Jive Software

Webstart - Jive - Tomcat

Hi.

The Idea:

I want to integrate a IM into a java webstart app.

The problem:

The Webstart “Sandbox” only allows to access

it’'s own host (tomcat) on port xyz.

Is there any chance to integrate the IM into the tomcat.

or to redirect somehow throw the tomcat ???

Thx alot. Fab.

Try this:

tomcat\webapps\imserver\WEB-INF\lib\messenger.jar

tomcat\webapps\imserver\WEB-INF\lib\startup.jar

  • from jive_messenger\lib (jive_messenger - binary distr of Jive Messenger)

tomcat\imserver\WEB-INF\jive_messenger

  • full (or “lite”) jive_messenger (“lite” may contain only folders from full jive_messenger)

tomcat\webapps\imserver\WEB-INF\lib\myproviders.jar

  • if you implement any providers…

tomcat\webapps\imserver\WEB-INF\lib\ServerStarter.jar

  • must contain compiled ServerStarter.java

ServerStarter.java:


package imserver; import org.jivesoftware.messenger.starter.ServerStarter; import javax.servlet.http.HttpServlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import java.io.File; public class StarterServlet extends HttpServlet {     public void init(ServletConfig config) throws ServletException {
        super.init(config);
        String path = getServletContext().getRealPath("/");
        if (path == null) {
            // you may log "Error: Server not found, can not resolve server location!"
            return;
        }
        path += "WEB-INF" + File.separator + "jive_messenger";
        System.setProperty("messengerHome", path);
        ServerStarter.main(null);
    }
}

tomcat\webapps\imserver\WEB-INF\web.xml

web.xml :


<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4">
    <servlet>
        <servlet-name>starter</servlet-name>
        <servlet-class>imserver.StarterServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
</web-app>

Rey

Hi Rey,

I am also working on this project on similar lines. I want to deploy JM server as a web application on Tomcat 5.0.27

As per your guidelines, I made the following directory structure given below:

c:\tomcat5.0

imserver

WEB-INF

jive_messenger

bin

classes

conf

javadoc

jspc —> contains the compiled *.JSP files

lib

logs

plugins

resources

tempbuid

webapp

whack

webapps

imserver

WEB-INF

web.xml

classes

lib

messenger.jar

startup.jar

ServerStarter.jar --> Created this file using JAR utility

ServerStarter.java

ServerStarter.class

Kindly note the following:

  1. Folder ‘‘jive_messenger’’ contains the contents of ‘‘target’’ folder (after building the source code using ANT application)

  2. ServerStarter.java -> Your code throws errors while compiling, Error: class not found - org.jivesoftware.messenger.starter.ServerStarter. so I took this file from JM source code folder ( src/java/org/jivesoftware/messenger/starter )

  3. ServerStarter.class --> I took this file from ‘‘target’’ folder ( classes/org/jivesoftware/messenger/starter )

  4. The folder ‘‘classes’’ is empty

  5. Usually *.jsp and *.html files are to be kept in the web application folder in our case which is ‘‘imserver’’, but none of these files are stored here.

When I start the tomcat server, it deploys ‘‘imserver’’ as a web application, but I wonder how to access the index.jsp/index.html page so as to login to admin module???

When I tried the url ( http://localhost:8080/imserver/index.jsp ), the browser threw ‘‘Page Not Found’’ error as it doesn’'t find any index.jsp in the (imserver) web application folder.

I would like to know, where to place *.jsp files from JM server source code (src/web) folder and the URL to access these pages.

Please guide me, incase of, if i have left out something or I have mis-understood your guidelines.

Thank you for your assistance…

Regards,

Sandeep Raul

The above directory structure has aligned towards LEFT side becoming difficult to undertstand the folder hierarchy.

Please read it as given below:

c:\tomcat5.0

======>imserver

==========>WEB-INF

==============>jive_messenger

==================>bin

==================>classes

==================>conf

==================>javadoc

==================>jspc —> contains the compiled *.JSP files

==================>lib

==================>logs

==================>plugins

==================>resources

==================>tempbuid

==================>webapp

==================>whack

======>webapps

==========>imserver

==============>WEB-INF

==================>web.xml

==================>classes

==================>lib

======================>messenger.jar

======================>startup.jar

======================>ServerStarter.jar --> Created this file using JAR utility

======================>ServerStarter.java

======================>ServerStarter.class

Thanks

Sandeep Raul

Hi Sandeep!

I’'m sorry,

it is wrong path (“tomcat\imserver\WEB-INF\jive_messenger”) in

tomcat\imserver\WEB-INF\jive_messenger

  • full (or “lite”) jive_messenger (“lite” may contain only folders from full jive_messenger)

Right path is:

“tomcat[b]webapps[/b]imserver\WEB-INF\jive_messenger”

For acces to login page use url “http://localhost:9090/login.jsp


Rey

Sandip, you should end up with the following directory strucrure (for “lite” (minimal working) version Jive Messegger):

tomcat

======>webapps

==========>imserver

==============>WEB-INF

==================>web.xml

==================>lib

======================>messenger.jar

======================>startup.jar

======================>ServerStarter.jar

==================>jive_messenger

======================>conf

======================>plugins

======================>resources


Rey