error with webservice

163 views
Skip to first unread message

Service clients - Weesoo.com

unread,
Oct 18, 2011, 8:55:19 PM10/18/11
to jodcon...@googlegroups.com
Hello

i've made a fresh install of jod with tomcat on ubuntu 11.04 and i have the following error when trying convert a ppt to swf:

com.artofsolving.jodconverter.openoffice.connection.OpenOfficeException: could not obtain service: com.sun.star.ucb.FileContentProvider
	com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection.getService(AbstractOpenOfficeConnection.java:119)
	com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection.getFileContentProvider(AbstractOpenOfficeConnection.java:129)
	com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.convertInternal(OpenOfficeDocumentConverter.java:116)
	com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:104)
	com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.convertInternal(OpenOfficeDocumentConverter.java:88)
	com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:82)
	com.artofsolving.jodconverter.web.DocumentConverterServlet.doPost(DocumentConverterServlet.java:71)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

cause mère

com.artofsolving.jodconverter.openoffice.connection.OpenOfficeException: connection failed: socket,host=localhost,port=8100,tcpNoDelay=1
	com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection.connect(AbstractOpenOfficeConnection.java:81)
	com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection.getService(AbstractOpenOfficeConnection.java:115)
	com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection.getFileContentProvider(AbstractOpenOfficeConnection.java:129)
	com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.convertInternal(OpenOfficeDocumentConverter.java:116)
	com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:104)
	com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.convertInternal(OpenOfficeDocumentConverter.java:88)
	com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:82)
	com.artofsolving.jodconverter.web.DocumentConverterServlet.doPost(DocumentConverterServlet.java:71)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

cause mère

com.sun.star.lang.IllegalArgumentException
	com.sun.star.comp.bridgefactory.BridgeFactory.createBridge(BridgeFactory.java:158)
	com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection.connect(AbstractOpenOfficeConnection.java:68)
	com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection.getService(AbstractOpenOfficeConnection.java:115)
	com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection.getFileContentProvider(AbstractOpenOfficeConnection.java:129)
	com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.convertInternal(OpenOfficeDocumentConverter.java:116)
	com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:104)
	com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.convertInternal(OpenOfficeDocumentConverter.java:88)
	com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:82)
	com.artofsolving.jodconverter.web.DocumentConverterServlet.doPost(DocumentConverterServlet.java:71)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

can you help

thank you
Gabriel

Richard Gathogo

unread,
Oct 19, 2011, 3:04:28 PM10/19/11
to jodcon...@googlegroups.com
Hi Weesoo,
Which version of jodconverter are you using?
Regards Richard Gathogo.
Love covers a multitude of sins.



--
You received this message because you are subscribed to the Google Groups "JODConverter" group.
To post to this group, send email to jodcon...@googlegroups.com.
To unsubscribe from this group, send email to jodconverter...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jodconverter?hl=en.

Service clients - Weesoo.com

unread,
Oct 19, 2011, 4:04:35 PM10/19/11
to jodcon...@googlegroups.com
Hello and thanks for your reply

i'm using 2.something (install with apt-get on ubuntu). But actually i resolved this issue (it seems it was a permission matter, as soffice was up and listening

so the webservice is working ok, but:

i cannot get it to work from php with pear (tryed Request.php and Request2.php)

also i was previously using pyodconverter, but apparently python bridge is broken on ubuntu 11.04. can you confirm ? or is there something to do the trick ?

thank you for your reply

Gabriel

2011/10/19 Richard Gathogo <muragu...@gmail.com>



--
Cordialement
Gabriel
09 79 94 71 13

Service clients - Weesoo.com

unread,
Oct 19, 2011, 4:29:32 PM10/19/11
to jodcon...@googlegroups.com
i found my version, it is 2.2.2-6

thanks

2011/10/19 Service clients - Weesoo.com <con...@weesoo.com>

Mohamed Amine Berrabah

unread,
Jan 14, 2012, 8:25:25 PM1/14/12
to jodcon...@googlegroups.com
HI, i have implement this servlet to upload a ppt and to convert it to pdf  :

package servlet;

import java.io.File;
import java.io.IOException;
import java.net.ConnectException;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.fileupload.DiskFileUpload;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUpload;
import org.apache.commons.fileupload.FileUploadException;
import org.springframework.scripting.support.RefreshableScriptTargetSource;

import session.BeanSessionFichierRemote;

import com.artofsolving.jodconverter.DocumentConverter;
import com.artofsolving.jodconverter.openoffice.connection.OpenOfficeConnection;
import com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection;
import com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter;

import entity.Fichier;
import entity.User;

/**
 * Servlet implementation class ajout
 */
public class ajout extends HttpServlet {
private static final long serialVersionUID = 1L;

/**
* @see HttpServlet#HttpServlet()
*/
public ajout() {
super();

}

/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
*      response)
*/
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {

doPost(request, response);
}

/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
*      response)
*/
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {

String nom = null, login = null ,chemin=null;

// upload image
boolean isMultipart = FileUpload.isMultipartContent(request);
if (!isMultipart) {
request.setAttribute("msg", "Request was not multipart!");
request.getRequestDispatcher("msg.jsp").forward(request, response);
return;
}

DiskFileUpload upload = new DiskFileUpload();
List items = null;
try {
items = upload.parseRequest(request);
} catch (FileUploadException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Iterator itr = items.iterator();

while (itr.hasNext()) {
FileItem item = (FileItem) itr.next();
if (item.isFormField()) {
String fieldName = item.getFieldName();
if (fieldName.equals("nom"))
nom = item.getString();

if (fieldName.equals("login"))
login = item.getString();

}

else {

File fullFile = new File(item.getName());
String ch=System.getenv("user.home"+"/projet_pad/MyProj/Library/");
File savedFile = new File("C:\\Users\\Administrateur\\projet_pad\\webs\\WebContent\\PptFile", fullFile.getName());
chemin = fullFile.getName();
try {
item.write(savedFile);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
/*****************************************************************************************************************/
/*****************************************************************************************************************/
//**********************Ajout dans la base de donnée*************************************************************//
Hashtable<String, String> h = new Hashtable<String, String>();
h.put("java.naming.factory.initial",
"org.objectweb.carol.jndi.spi.MultiOrbInitialContextFactory");
h.put("java.naming.provider.url", "rmi://localhost:1099");
h.put("java.naming.factory.url.pkgs", "org.objectweb.jonas.naming");
Context ctx;
try {
ctx = new InitialContext(h);
String JNDI_NAME = "session.BeanSessionFichier" + "_"
+ BeanSessionFichierRemote.class.getName() + "@Remote";
BeanSessionFichierRemote ref = (BeanSessionFichierRemote) ctx
.lookup(JNDI_NAME);
System.out.println(login+chemin+nom);
User u=new User();
u.setLogin(login);
Fichier f=new Fichier();
f.setChemin(chemin);
f.setNom(nom);
f.setUser(u);
ref.AddFichier(f);
response.sendRedirect("/webs/GetFichierUser?login="+login+"");

} catch (NamingException e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
//******************************************************************************************************//

System.out.println("le nom de slide est :" + chemin);
// String newm = nom.substring(nom.lastIndexOf("."));

String newname = chemin.substring(0, chemin.length() - 4);

// String nom = "cours";

System.out.println("le nouveau nom apré l'exctarction est :" + newname);

// partie convetion au pdf
   File inputFile = new File("C:\\Users\\Administrateur\\projet_pad\\webs\\WebContent\\PptFile\\"+newname+".ppt");
   System.out.println("Jointure de ppt en cours ...");
   
   File outputFile = new File("C:\\Users\\Administrateur\\projet_pad\\webs\\WebContent\\PdfFile\\"+newname+".pdf");
   System.out.println("Creation de pdf en cours ...");

   // connect to an OpenOffice.org instance running on port 8100
   OpenOfficeConnection connection = new SocketOpenOfficeConnection(8100);
   System.out.println("Connexion avec OOo (localhost:8100) en cours ...");
   
   try {
       connection.connect();
       System.out.println("Connexion éffectuée ... ");
   } catch (ConnectException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
   }

   // convert
   DocumentConverter converter = new OpenOfficeDocumentConverter(connection);
   converter.convert(inputFile, outputFile);
   System.out.println("Convertion en cours ...");

   // close the connection
   connection.disconnect();
   System.out.println("Deconnexion en cours ...");



}

}


I got this errors 

com.artofsolving.jodconverter.openoffice.connection.OpenOfficeException: connection failed: socket,host=localhost,port=8100,tcpNoDelay=1
	com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection.connect(AbstractOpenOfficeConnection.java:81)
	servlet.ajout.doPost(ajout.java:170)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


I user jobconverter 2.2.2 
and OOo 3.1
and i have run the soffice on localhost:8100
I dont understand why it doesn't work !!? 
Please help
Reply all
Reply to author
Forward
0 new messages