Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

com4j with websphere not working

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ,
I have an little knowledge on jni calls. i am not clear how to proceed with this issue.
The issue is we have an java code which calls the com4j code. (it works in tomcat and websphere in windows xp .but it is not working in the server (windows 2003).
the code is



package com.intelliview.pdflib.core;

import org.apache.log4j.Logger;

import com.intelliview.com4j.ivdb.ClassFactory;
import com.intelliview.com4j.ivdb.IIViewX;
import com.intelliview.commonlibs.api.IPdfViewer;
import com.intelliview.dal.dao.ResourcesBundleHandler;

public class ReportExporter implements IPdfViewer {
static Logger logger = Logger.getLogger("ReportExporter");
private static IIViewX ivdb = null;
private static boolean exportSupport = false;

private static final ReportExporter pdfExporter = new ReportExporter();

private ReportExporter() {
try {
boolean testPDFSupport = true;
try {
String pdfSupport = ResourcesBundleHandler.getResourceBundle().getString("PDF_SUPPORT");
testPDFSupport = Boolean.parseBoolean(pdfSupport);
}catch(Exception ex1) {}
if(testPDFSupport && System.getProperty("os.name").toUpperCase().startsWith("WIN") ) {
ivdb = ClassFactory.createIViewX();
System.out.println("IVDB is "+ivdb);
exportSupport = true;
}

}catch (Exception e) {
System.out.println("Error while loading IntelliVIEW Analyzer ocx for com4j");
logger.error("Error while loading IntelliVIEW Analyzer ocx for com4j",e);
}
}

public static boolean isReportExportable() {
return exportSupport;
}

public static ReportExporter getPdfExporter() {
return pdfExporter;
}

public void exportReport(int type, String ivwrFilePath, String outputFilePath) {
System.out.println("ivwr file path "+ivwrFilePath);
System.out.println("outputFilePath "+outputFilePath);
System.out.println("Type is "+type);
if(exportSupport) {
ivdb.exportReport(type,ivwrFilePath,outputFilePath);
System.out.println("Export done");
}else {
System.out.println("Unable to export report using Analyzer ocx");
}
}

public static void main(String[] args) {
ReportExporter rp = ReportExporter.getPdfExporter();
rp.exportReport(1,"C:\\Program Files\\IntelliVIEW Reporter 4.1.1 (Java)\\generated_files\\companyid_1\\temp_1244466448703.ivwr","e:\\pdf1.pdf");
/* rp.exportReport(2,"E:\\Program Files\\IntelliVIEW Reporter 4.1.1 (Java)\\generated_files\\companyid_1\\temp_1244206070619.ivwr","e:\\pdf2.xls");
rp.exportReport(3,"E:\\Program Files\\IntelliVIEW Reporter 4.1.1 (Java)\\generated_files\\companyid_1\\temp_1244206070619.ivwr","e:\\pdf3.xls");
rp.exportReport(4,"E:\\Program Files\\IntelliVIEW Reporter 4.1.1 (Java)\\generated_files\\companyid_1\\temp_1244206070619.ivwr","e:\\pdf4.xls");
rp.exportReport(5,"E:\\Program Files\\IntelliVIEW Reporter 4.1.1 (Java)\\generated_files\\companyid_1\\temp_1244206070619.ivwr","e:\\pdf5.xls");
rp.exportReport(6,"E:\\Program Files\\IntelliVIEW Reporter 4.1.1 (Java)\\generated_files\\companyid_1\\temp_1244206070619.ivwr","e:\\pdf6.xls");
*/
}
}






package com.intelliview.com4j.ivdb ;

import com4j.*;

/**
* Defines methods to create COM objects
*/
public abstract class ClassFactory {
private ClassFactory() {} // instanciation is not allowed


/**
* IViewX Control
*/
public static com.intelliview.com4j.ivdb.IIViewX createIViewX() {
return COM4J.createInstance( com.intelliview.com4j.ivdb.IIViewX.class, "{D6645B31-AC56-4E9B-85CB-12939C7367B9}" );
}
}



the problem is while calling the exportReport()- method in the websphere server in the server machine(windows 2003) it gets hanged. no error message is been displayed. but it works fine in other machine.

please could any one has any suggessions how to proceed..
is any thing to be configured to make the method call work in websphere..

thanks
Regards,
Naveen

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic