Hi,
I got this Exception when I was trying to convert the BarCode into XML. Here is my client Program.
import java.io.File;
import java.io.*;
import java.io.FileInputStream;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import javax.xml.transform.*;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import com.adobe.livecycle.barcodedforms.CharSet;
import com.adobe.livecycle.barcodedforms.Delimiter ;
import com.adobe.livecycle.barcodedforms.XMLFormat ;
import com.adobe.idp.Document;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;
import com.adobe.livecycle.barcodedforms.client.*;
public class Testmain {
public static void main(String[] args) {
try
{
//Set LiveCycle ES service connection properties
Properties ConnectionProps = new Properties();
ConnectionProps.setProperty("DSC_DEFAULT_EJB_ENDPOINT", "t3://rndvipdev02:80");
ConnectionProps.setProperty("DSC_TRANSPORT_PROTOCOL","EJB");
ConnectionProps.setProperty("DSC_SERVER_TYPE", "Weblogic");
ConnectionProps.setProperty("DSC_CREDENTIAL_USERNAME", "administrator");
ConnectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", "password");
//Create a ServiceClientFactory object
ServiceClientFactory myFactory = ServiceClientFactory.createInstance(ConnectionProps);
BarcodedFormsServiceClient barClient = new BarcodedFormsServiceClient(myFactory);
//Specify a PDF document to convert to a XDP file
FileInputStream fileInputStream = new FileInputStream("D:\\abc\\barcode.pdf");
Document inDoc = new Document (fileInputStream);
java.lang.Boolean myFalse = new java.lang.Boolean(false);
java.lang.Boolean myTrue = new java.lang.Boolean(true);
//Decode barcoded form data
org.w3c.dom.Document decodeXML = barClient.decode(
inDoc,
myTrue,
myFalse,
myFalse,
myFalse,
myFalse,
myFalse,
myFalse,
myFalse,
CharSet.UTF_8);
//Convert the decoded data to XDP data
List extractedData = barClient.extractToXML(
decodeXML,
Delimiter.Tab,
Delimiter.Tab,
XMLFormat.XDP);
//Create an Iterator object and iterate through
//the List object
Iterator iter = extractedData.iterator();
int i = 0 ;
while (iter.hasNext()) {
//Get the org.w3c.dom.Document object in each element
org.w3c.dom.Document myDom = (org.w3c.dom.Document)iter.next();
//Convert the org.w3c.dom.Document object to a
//com.adobe.idp.Document object
com.adobe.idp.Document myDocument = convertDOM(decodeXML);
//Save the XML data to extractedData.xml
File myFile = new File("D:\\abc\\extractedData"+i+".xml");
myDocument.copyToFile(myFile);
i++;
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
//This user-defined method converts an org.w3c.dom.Document to a
//com.adobe.idp.Document object
public static com.adobe.idp.Document convertDOM(org.w3c.dom.Document doc)
{
byte[] mybytes = null ;
com.adobe.idp.Document myDocument = null;
try
{
//Create a Java Transformer object
TransformerFactory transFact = TransformerFactory.newInstance();
Transformer transForm = transFact.newTransformer();
//Create a Java ByteArrayOutputStream object
ByteArrayOutputStream myOutStream = new ByteArrayOutputStream();
//Create a Java Source object
Source myInput = new DOMSource(doc);
//Create a Java Result object
Result myOutput = new StreamResult(myOutStream);
//Populate the Java ByteArrayOutputStream object
transForm.transform(myInput,myOutput);
//Get the size of the ByteArrayOutputStream buffer
int myByteSize = myOutStream.size();
//Allocate myByteSize to the byte array
mybytes = new byte[myByteSize];
//Copy the content to the byte array
mybytes = myOutStream.toByteArray();
com.adobe.idp.Document myDoc = new com.adobe.idp.Document(mybytes);
myDocument = myDoc ;
}
catch(Exception ee)
{
ee.printStackTrace();
}
return myDocument;
}
}
Here is the Exception StackTrace
ALC-DSC-005-000: com.adobe.idp.dsc.DSCNotSerializableException: Not Serializable
Caused by: ALC-DSC-003-000: com.adobe.idp.dsc.DSCInvocationException: Invocation error.
at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.java:210)
at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor.java:134)
at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:44)
at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(TransactionInterceptor.java:74)
at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.execute(EjbTransactionCMTAdapterBean.java:336)
at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doSupports(EjbTransactionCMTAdapterBean.java:212)
at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapter_z73hg_ELOImpl.doSupports(EjbTransactionCMTAdapter_z73hg_ELOImpl.java:145)
at com.adobe.idp.dsc.transaction.impl.ejb.EjbTransactionProvider.execute(EjbTransactionProvider.java:104)
at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor.intercept(TransactionInterceptor.java:72)
at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:44)
at com.adobe.idp.dsc.interceptor.impl.InvalidStateInterceptor.intercept(InvalidStateInterceptor.java:37)
at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:44)
at com.adobe.idp.dsc.interceptor.impl.AuthorizationInterceptor.intercept(AuthorizationInterceptor.java:93)
at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:44)
at com.adobe.idp.dsc.engine.impl.ServiceEngineImpl.invoke(ServiceEngineImpl.java:113)
at com.adobe.idp.dsc.routing.Router.routeRequest(Router.java:102)
at com.adobe.idp.dsc.provider.impl.base.AbstractMessageReceiver.invoke(AbstractMessageReceiver.java:298)
at com.adobe.idp.dsc.provider.impl.ejb.receiver.EjbReceiverBean.invoke(EjbReceiverBean.java:151)
at com.adobe.idp.dsc.provider.impl.ejb.receiver.Invocation_fpvhue_EOImpl.invoke(Invocation_fpvhue_EOImpl.java:61)
at com.adobe.idp.dsc.provider.impl.ejb.receiver.Invocation_fpvhue_EOImpl_WLSkel.invoke(ILweblogic.rmi.spi.InboundRequest;Lweblogic.rmi.spi.OutboundResponse;Ljava.lang.Object;)Lweblogic.rmi.spi.OutboundResponse;(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:479)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSubject;Ljava.security.PrivilegedExceptionAction;)Ljava.lang.Object;(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:475)
at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:59)
at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:1016)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
Caused by: com.adobe.barcodedforms.decoder.DecodingException null: com.adobe.barcodedforms.decoder.processors.DataProcessorException: com.adobe.barcodedforms.decoder.processors.DataProcessorException
at com.adobe.livecycle.barcodedforms.BarcodedFormsService.decode(BarcodedFormsService.java:297)
at j