Hello everybody
I'm trying to do a basic form with Livecycle Forms but I have some errors and doubts. I have done a servlet when I try to generate that pdf form but, when it runs renderForm() method, it shows this error
13:01:58,525 INFO [STDOUT] Error al realizar el 'Render': javax.naming.NameNotFoundException: com not bound
13:01:58,525 ERROR [STDERR] com.adobe.formServer.interfaces.RenderFormException: javax.naming.NameNotFoundException: com not bound
13:01:58,525 ERROR [STDERR] at com.adobe.formServer.client.EJBClient.renderForm(EJBClient.java:357)
13:01:58,525 ERROR [STDERR] at net.flexlive.randori.pdfConstructor.generatePdf(pdfConstructor.java:102)
13:01:58,525 ERROR [STDERR] at net.flexlive.randori.pdfConstructor.doGet(pdfConstructor.java:36)
13:01:58,525 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
13:01:58,525 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
13:01:58,525 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
13:01:58,525 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
13:01:58,525 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
13:01:58,525 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
13:01:58,525 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
13:01:58,525 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
13:01:58,525 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
13:01:58,525 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
13:01:58,525 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
13:01:58,525 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
13:01:58,525 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
13:01:58,525 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
13:01:58,525 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
13:01:58,525 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
13:01:58,525 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
13:01:58,525 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
13:01:58,525 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
13:01:58,525 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
13:01:58,525 ERROR [STDERR] Caused by: javax.naming.NameNotFoundException: com not bound
13:01:58,525 ERROR [STDERR] ... 23 more
I was looking for a solution but I haven't idea about what can be the problem of this. I¨'m using JBOSS 4.2.3 and Eclipse 3.3.2 and my servlet code is this:
String sNom = "solicitud_final.xdp";
String sRoot = "http://localhost:8080/AdobeForms/web";
//Construyo el path de la aplicacion, para que el form server sepa volver
String appPath = request.getServletPath();
//appPath = appPath.substring(0, appPath.lastIndexOf("/"));
String sURL = request.getScheme() + "/" +
request.getServerName() + ":" +
request.getServerPort() +
request.getContextPath() +
appPath;
//Configuro las opciones
String m_sOptions = "RenderAtClient=true&CacheEnabled=false";
//Cojo el XML para la preCarga del formulario
byte[] mData = null;
//String sRutaXML = mRootForms + "/" + mXMLData;
//mData = readFile(sRutaXML);
//Instancio el FormServer mediante la API
EJBClient ejbClient = new EJBClient();
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, org.jnp.interfaces.NamingContextFactory");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
env.put(Context.PROVIDER_URL, "172.26.121.76:1099");
InitialContext context = null;
try {
context = new InitialContext(env);
} catch (Exception e) {
System.out.println("Error al iniciar el contexto: " + e.getMessage());
return;
}
ejbClient.setInitialContext(context);
IFormServer ifs = (IFormServer)ejbClient;
//LLamo al metodo que conastruye el formulario
IOutputContext mIOC = ifs.renderForm(
sNom,
"PDFForm",
null,//mData,
m_sOptions,
request.getHeader("User-Agent"),
sURL,
null,
sRoot,
null);
//Construyo la salida y la muestro por pantalla
ServletOutputStream oOutput = response.getOutputStream();
response.setContentType(mIOC.getContentType());
byte[] cContent = mIOC.getOutputContent();
oOutput.write(cContent);
oOutput.flush();
oOutput.close();
However, it looks like an important interface is not bound becaused it can't find the name of the interface. But Java and the LC servers aren't my bag.
Good luck,
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script