OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

OOo 3.0.1: Bootstrap.bootstrap() throws a NoConnectException

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
lenaz
General User
General User


Joined: 06 May 2009
Posts: 5

PostPosted: Wed May 06, 2009 11:08 pm    Post subject: OOo 3.0.1: Bootstrap.bootstrap() throws a NoConnectException Reply with quote

Hi there!

I know, the bootstrap-method-problems are discussed very often, but I have not found a solution for my problem.

following situation:
we have a web-application, implemented as JSPs on a JETTY-Server (Win XP)(Linux should be supported too)
install-path of OOo 3: C:/fsales/OpenOffice.org3/ (without blank!)

a part of the jetty - configfile:
Code:

wrapper.java.classpath.12=C:/fsales/OpenOffice.org3/URE/java/jurt.jar
wrapper.java.classpath.13=C:/fsales/OpenOffice.org3/Basis/program/classes/unoil.jar
wrapper.java.classpath.14=C:/fsales/OpenOffice.org3/URE/java/ridl.jar
wrapper.java.classpath.15=C:/fsales/OpenOffice.org3/URE/java/juh.jar
wrapper.java.classpath.16=C:/fsales/OpenOffice.org3/URE/java/bootstrapconnector.jar
wrapper.java.classpath.17=C:/fsales/OpenOffice.org3/program  //prevents the "no executable found!"-exception


now, the OOo - API is used in JSP-Files ... it worked perfectly with OOo 2, but with OOo 3, there comes this NoConnectException:
Code:

INFO   | jvm 1    | 2009/05/06 17:19:07 | com.sun.star.comp.helper.BootstrapException: com.sun.star.connection.NoConnectException
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at com.sun.star.comp.helper.Bootstrap.bootstrap(Bootstrap.java:297)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.apache.jsp.oo_005fintegration_005fvon_005fkunde_005ffill_005fcreate_jsp._jspService(org.apache.jsp.oo_005fintegration_005fvon_005fkunde_005ffill_005fcreate_jsp:270)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.servlet.Dispatcher.include(Dispatcher.java:192)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.apache.jsp.oo_005fintegration_005fvon_005fkunde_005ffill_jsp._jspService(org.apache.jsp.oo_005fintegration_005fvon_005fkunde_005ffill_jsp:182)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:170)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.Server.handle(Server.java:285)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:751)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
INFO   | jvm 1    | 2009/05/06 17:19:07 |    at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)


thrown by the following statement:
Code:

mxRemoteContext = com.sun.star.comp.helper.Bootstrap.bootstrap();


following JSP-File fills an OOo Draft with data from a database and converts it to PDF
as said: it worked with OOo 2
here the lines of code (concerning OOo) of this JSP
Code:

<%@page import="com.sun.star.awt.Point"%>
<%@page import="com.sun.star.awt.Size"%>
<%@page import="com.sun.star.awt.FontWeight"%>
<%@page import="com.sun.star.beans.PropertyState"%>
<%@page import="com.sun.star.beans.PropertyValue"%>
<%@page import="com.sun.star.beans.XPropertySet"%>
<%@page import="com.sun.star.beans.XPropertyState"%>
<%@page import="com.sun.star.bridge.XUnoUrlResolver"%>
<%@page import="com.sun.star.comp.servicemanager.ServiceManager"%>
<%@page import="com.sun.star.connection.*"%>
<%@page import="com.sun.star.frame.*"%>
<%@page import="com.sun.star.container.*"%>
<%@page import="com.sun.star.drawing.*"%>
<%@page import="com.sun.star.lang.*"%>
<%@page import="com.sun.star.style.*"%>
<%@page import="com.sun.star.table.XCell"%>
<%@page import="com.sun.star.text.*"%>
<%@page import="com.sun.star.uno.*"%>
<%@page import="com.sun.star.util.XRefreshable"%>
<%@page import="com.sun.star.view.XPrintable"%>

<%
System.out.println("Start opening Office-Connection");
try {
    XComponentContext mxRemoteContext = null;
    XMultiComponentFactory mxRemoteServiceManager = null;
    System.out.println("Create Hashtable with DataBaseComponents");
       Hashtable recipient = new Hashtable();
       /* filling hashtable .... */

System.out.println("Hashtable created");
        // load template with User fields and bookmark
        
        java.io.File sourceFile = new java.io.File(application.getRealPath("/") +"/oo_vorlagen/kunde/" + request.getParameter("file"));
        StringBuffer sTemplateFileUrl = new StringBuffer("file:///");
        sTemplateFileUrl.append(sourceFile.getCanonicalPath().replace('\\', '/'));

       
      if (mxRemoteContext == null && mxRemoteServiceManager == null) {
            // get the remote office context. If necessary a new office
            // process is started
         System.out.println("try to connect to a running office");
            //String oooExeFolder = "C:\\fsales\\OpenOffice/program";
            //mxRemoteContext = BootstrapSocketConnector.bootstrap(oooExeFolder);
            mxRemoteContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
           
            System.out.println("Connected to a running office ...");
            mxRemoteServiceManager = mxRemoteContext.getServiceManager();
           
            String available = (mxRemoteServiceManager != null ? "available" : "not available");
            System.out.println("remote ServiceManager is " + available);
        }
       mxRemoteServiceManager = mxRemoteServiceManager;           
        // retrieve the Desktop object, we need its XComponentLoader
        Object desktop = mxRemoteServiceManager.createInstanceWithContext(
            "com.sun.star.frame.Desktop", mxRemoteContext);
        XComponentLoader xComponentLoader = (XComponentLoader)
            UnoRuntime.queryInterface(XComponentLoader.class, desktop);
       
        // define load properties according to com.sun.star.document.MediaDescriptor
        // the boolean property AsTemplate tells the office to create a new document
        // from the given file
        PropertyValue[] loadProps = new PropertyValue[2];
        loadProps[0] = new PropertyValue();
        loadProps[0].Name = "AsTemplate";
        loadProps[1] = new PropertyValue();
        loadProps[0].Value = new Boolean(true);
        loadProps[1].Name = "Hidden";
        loadProps[1].Value = new Boolean(false);
        // load
System.out.println("Load file: " + sTemplateFileUrl.toString());      
        XComponent xTemplateComponent =  xComponentLoader.loadComponentFromURL(sTemplateFileUrl.toString(), "_blank",  0, loadProps);       
         System.out.println("Office Document opened:" + sTemplateFileUrl.toString());           
        // get XTextFieldsSupplier, XBookmarksSupplier interfaces
        XTextFieldsSupplier xTextFieldsSupplier = (XTextFieldsSupplier)
            UnoRuntime.queryInterface(XTextFieldsSupplier.class,
                                      xTemplateComponent);
        XBookmarksSupplier xBookmarksSupplier = (XBookmarksSupplier)
            UnoRuntime.queryInterface(XBookmarksSupplier.class, xTemplateComponent);
       
        // access the TextFields and the TextFieldMasters collections
        XNameAccess xNamedFieldMasters = xTextFieldsSupplier.getTextFieldMasters();
        XEnumerationAccess xEnumeratedFields = xTextFieldsSupplier.getTextFields();
       
        // iterate over hashtable and insert values into field masters
        java.util.Enumeration keys = recipient.keys();
        while(keys.hasMoreElements()) {
            // get column name
            String key = (String)keys.nextElement();
           
            // access corresponding field master      Try to put the DB-Values
         try {
            Object fieldMaster = xNamedFieldMasters.getByName(
               "com.sun.star.text.FieldMaster.User." + key);
            
            // query the XPropertySet interface, we need to set the Content property
            XPropertySet xPropertySet = (XPropertySet)UnoRuntime.queryInterface(
               XPropertySet.class, fieldMaster);
            
            // insert the column value into field master
            xPropertySet.setPropertyValue("Content", recipient.get(key));
         } catch (java.lang.Exception e) {
                           // System.out.println("DB-Column: " + key + " not in Office-Form");
                        }
        }
        // afterwards we must refresh the textfields collection
        XRefreshable xRefreshable = (XRefreshable)UnoRuntime.queryInterface(
            XRefreshable.class, xEnumeratedFields);
        xRefreshable.refresh();

java.io.File targetFile = new java.io.File(application.getRealPath("/") +"/kontakt_anhaenge/" + koknr + ".pdf");
        StringBuffer sStoreFileUrl = new StringBuffer("file:///");
        sStoreFileUrl.append(targetFile.getCanonicalPath().replace('\\', '/')); 
        XComponent xDoc=xTemplateComponent;
      String storeUrl = sStoreFileUrl.toString();
      
        XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, xDoc);

  XFrame xFrame = xModel.getCurrentController().getFrame();
  xFrame.activate();

        XStorable xStorable = (XStorable)UnoRuntime.queryInterface(
            XStorable.class, xDoc);
     //   PropertyValue[] storeProps = new PropertyValue[1];
       PropertyValue[] props = new PropertyValue[2];

        props[0] = new PropertyValue();
  props[0].Name = "FilterName";
  props[0].Value = "writer_pdf_Export";
  props[1] = new PropertyValue();
  props[1].Name = "CompressionMode";
  props[1].Value = "1";


        System.out.println("... store \"" + koknr + ".pdf\" .");
        xStorable.storeToURL(storeUrl, props);//storeProps);   
      
        xTemplateComponent.dispose();   



okay...i hope i didn't forget anything to say ... else just tell me...

does anyone have an idea?

greetings from austria
lenaz
Back to top
View user's profile Send private message
lenaz
General User
General User


Joined: 06 May 2009
Posts: 5

PostPosted: Thu May 07, 2009 5:33 am    Post subject: Reply with quote

Okay.. i got a step further!

i replaced following code
Code:


            // get the remote office context. If necessary a new office
            // process is started
         System.out.println("try to connect to a running office");
            //String oooExeFolder = "C:\\fsales\\OpenOffice/program";
            //mxRemoteContext = BootstrapSocketConnector.bootstrap(oooExeFolder);
            mxRemoteContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
           
            System.out.println("Connected to a running office ...");
            mxRemoteServiceManager = mxRemoteContext.getServiceManager();
           
            String available = (mxRemoteServiceManager != null ? "available" : "not available");
            System.out.println("remote ServiceManager is " + available);
       
                 
        // retrieve the Desktop object, we need its XComponentLoader
        Object desktop = mxRemoteServiceManager.createInstanceWithContext(
            "com.sun.star.frame.Desktop", mxRemoteContext);


with the this one:
Code:

System.out.println("xcomponentcontext");
  XComponentContext xcomponentcontext = Bootstrap.createInitialComponentContext(null);
 
  // create a connector, so that it can contact the office
  System.out.println("urlResolver");
  XUnoUrlResolver urlResolver = UnoUrlResolver.create(xcomponentcontext);

  System.out.println("initialObject");
  Object initialObject = urlResolver.resolve("uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager");


  System.out.println("xOfficeFactory");
  XMultiComponentFactory xOfficeFactory = (XMultiComponentFactory) UnoRuntime.queryInterface(
      XMultiComponentFactory.class, initialObject);

  // retrieve the component context as property (it is not yet exported from the office)
  // Query for the XPropertySet interface.
  XPropertySet xProperySet = (XPropertySet) UnoRuntime.queryInterface(
      XPropertySet.class, xOfficeFactory);

  // Get the default context from the office server.
  Object oDefaultContext = xProperySet.getPropertyValue("DefaultContext");

  // Query for the interface XComponentContext.
  XComponentContext xOfficeComponentContext = (XComponentContext) UnoRuntime.queryInterface(
      XComponentContext.class, oDefaultContext);

  // now create the desktop service
  // NOTE: use the office component context here!
  Object desktop = xOfficeFactory.createInstanceWithContext(
       "com.sun.star.frame.Desktop", xOfficeComponentContext);


now i have to start OpenOffice.org on the server this way:
Code:

%OO_HOME%/program/soffice.exe -accept=socket,host=localhost,port=8100;urp


and everything is going well.

but now I don't want that OOo runs all the time, so i start the program in my JSP as soon as needed:
Code:

Runtime.getRuntime().exec(System.getenv("OO_HOME").replace("\\", "/") + "/program/soffice \"-accept=socket,host=0,port=8100;urp\" \"-invisible\"");


but when i do it this way, i get this connection:
Code:

INFO   | jvm 1    | 2009/05/07 15:30:56 | com.sun.star.connection.NoConnectException: java.net.ConnectException: Connection refused: connect
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at com.sun.star.lib.connections.socket.socketConnector.connect(socketConnector.java:166)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at com.sun.star.comp.connections.Connector.connect(Connector.java:141)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at com.sun.star.comp.urlresolver.UrlResolver$_UrlResolver.resolve(UrlResolver.java:128)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.apache.jsp.oo_005fintegration_005fvon_005fkunde_005ffill_005fcreate_jsp._jspService(org.apache.jsp.oo_005fintegration_005fvon_005fkunde_005ffill_005fcreate_jsp:304)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.servlet.Dispatcher.include(Dispatcher.java:192)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.apache.jsp.oo_005fintegration_005fvon_005fkunde_005ffill_jsp._jspService(org.apache.jsp.oo_005fintegration_005fvon_005fkunde_005ffill_jsp:182)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:170)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.Server.handle(Server.java:285)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:751)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
INFO   | jvm 1    | 2009/05/07 15:30:56 |    at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)


caused by this statement:
Code:

Object initialObject = urlResolver.resolve("uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager");


in the server's task manager i can see the process... so it's there ...
can someone help me?
Back to top
View user's profile Send private message
sasa-zmei
General User
General User


Joined: 01 May 2009
Posts: 5

PostPosted: Thu May 07, 2009 8:29 am    Post subject: Reply with quote

Hello lenaz!

I want ask your about one thing:
Do you use
com.sun.star.lib.loader
package?

Really I have worked with OO3.1 not long ago, with help NetBeans IDE.

Without this package you should set up the connection "manually".
Back to top
View user's profile Send private message
lenaz
General User
General User


Joined: 06 May 2009
Posts: 5

PostPosted: Thu May 07, 2009 10:29 am    Post subject: Reply with quote

hi sasa-zmei

i used com.sun.star.lib.loader in a Desktop-Application for testing porposes only ...
in this webapplikation, i don't use it.

the JSP is working fine now... i had a permission issue with the jetty-service on the server-machine

topic-problem solved ... for further questions..just ask Smile
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Sun May 10, 2009 8:56 am    Post subject: Reply with quote

First, I don't have an idea what's causing the problems from your first post in this thread.

lenaz wrote:
but now I don't want that OOo runs all the time, so i start the program in my JSP as soon as needed:
Code:

Runtime.getRuntime().exec(System.getenv("OO_HOME").replace("\\", "/") + "/program/soffice \"-accept=socket,host=0,port=8100;urp\" \"-invisible\"");

My guess: You have to add some Thread.sleep() after calling Runtime.getRuntime().exec(). Runtime.getRuntime().exec() terminates before OOo is up and running an available for connections. Depending on the hardware you're using you might have to wait some seconds up to 10 or 15 or even more. Start a try with 30 seconds and decrease the Thread.sleep() if this helps at all.

lenaz wrote:
Code:
            //String oooExeFolder = "C:\\fsales\\OpenOffice/program";
            //mxRemoteContext = BootstrapSocketConnector.bootstrap(oooExeFolder);

Just out of pure curiosity: Why aren't you using the BootstrapSocketConnector any more?
Back to top
View user's profile Send private message
lenaz
General User
General User


Joined: 06 May 2009
Posts: 5

PostPosted: Mon May 11, 2009 12:04 am    Post subject: Reply with quote

the process was up and running, but not in a correct way ... it was a permission issue of the jetty-service itself ... so the office-process wasn't listening for connection-requests

i don't use the BootstrapSocketConnector because it didn't solve my problem ... and the problem seemed to be the permission-issue ...
a second reasen might be, that i need an additional .jar, we have to deliver to our customer... so the method i use now is much more comfortable
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group