Hi SupportTeam,
We are facing problem while invoking an EJB service running in Websphere 6.1 through our client (with the program "ConvertWordDocument.java").
we are using the following jar files in our client.
1) adobe-generatepdf-client.jar
2) adobe-livecycle-client.jar
3) adobe-usermanager-client.jar
4) adobe-utilities.jar
5) naming.jar
6) namingclient.jar
7) j2ee.jar
8) ws_runtime.jar
9) ibmorb.jar
10) ibmorbapi.jar
Could you please help us and let us know what are the jar files needed to invoke that EJB service through our client which is using Sun JDK 1.5.
Below is the code we are using.
import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;
import javax.naming.Context;
import com.adobe.idp.Document;
import com.adobe.idp.dsc.InvocationContext;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;
import com.adobe.livecycle.generatepdf.client.CreatePDFResult;
import com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient;
import com.ibm.ws.install.configmanager.utils.HashtableUtils;
public class ConvertWordDocument {
public static void main(String[] args)
{
try{
//Set connection properties required to invoke LiveCycle ES
Properties connectionProps = new Properties();
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "iiop://esealvm343.al.sw.ericsson.se:2089");
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,Service ClientFactoryProperties.DSC_EJB_PROTOCOL);
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "WebSphere");
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
//Create a ServiceClientFactory instance
ServiceClientFactory factory = ServiceClientFactory.createInstance(connectionProps);
//Create a GeneratePdfServiceClient object
GeneratePdfServiceClient pdfGenClient = new GeneratePdfServiceClient(factory);
//Get a Microsoft Word file document to convert to a PDF document
String inputFileName = "C:\\sun.doc";
FileInputStream fileInputStream = new FileInputStream(inputFileName);
Document inDoc = new Document(fileInputStream);
//Set createPDF parameter values
String adobePDFSettings = "Smallest_File_Size";
String securitySettings = "No Security";
String fileTypeSettings = "Filetype Settings";
//Convert the Word document to a PDF document
CreatePDFResult result = pdfGenClient.createPDF2(inDoc,inputFileName,fileTypeSettings,adobePDFSettings,securitySet tings,null,null);
//Get the newly created document
Document createdDocument = result.getCreatedDocument();
//Save the converted PDF document as a PDF file
createdDocument.copyToFile(new File("C:\\testdoc\\sunejb.pdf"));
}
catch (Exception e) {
e.printStackTrace();
System.out.println("Error OCCURRED: " + e.getMessage());
}
}
}
The Complete error we are facing is given below:
ALC-DSC-031-000:
com.adobe.idp.dsc.net.DSCNamingException
: Remote EJBObject lookup failed for ejb/Invocation provider at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initialise(
EjbMessageDispatcher.java:97
) at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.doSend(
EjbMessageDispatcher.java:130
) at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(
AbstractMessageDispatcher.java:57
) at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(
ServiceClient.java:208
) at com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient.createPDF2(
GeneratePdfServiceClient.java:519
) at ConvertWordDocument.main(
ConvertWordDocument.java:86
) Caused by:
javax.naming.NamingException: Failed to initialize the ORB [Root exception is java.lang.ClassCastException
: com.sun.corba.se.impl.orb.ORBImpl] at com.ibm.ws.naming.util.Helpers.getOrb(
Helpers.java:294
) at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(
WsnInitCtxFactory.java:373
) at com.ibm.ws.naming.util.WsnInitCtx.getContext(
WsnInitCtx.java:112
) at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(
WsnInitCtx.java:422
) at com.ibm.ws.naming.util.WsnInitCtx.lookup(
WsnInitCtx.java:143
) at javax.naming.InitialContext.lookup(Unknown Source) at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initialise(
EjbMessageDispatcher.java:88
) ... 5 more Caused by:
java.lang.ClassCastException
: com.sun.corba.se.impl.orb.ORBImpl at com.ibm.ws.orb.GlobalORBFactory.init(
GlobalORBFactory.java:82
) at com.ibm.ejs.oa.EJSORBImpl.initializeORB(
EJSORBImpl.java:174
) at com.ibm.ejs.oa.EJSClientORBImpl.<init>(
EJSClientORBImpl.java:97
) at com.ibm.ejs.oa.EJSClientORBImpl.<init>(
EJSClientORBImpl.java:73
) at com.ibm.ejs.oa.EJSORB.init(
EJSORB.java:386
) at com.ibm.ws.naming.util.Helpers.getOrb(
Helpers.java:285
) ... 11 more
Error OCCURRED: Remote EJBObject lookup failed for ejb/Invocation provider