Expand my Community achievements bar.

LiveCycle with WebLogic

Avatar

Former Community Member
Hi,



I am new to LiveCycle and I want to use the API to integrate it in Weblogic and control it from our own code. First question is, since I only need the API, what setup do I need to perform? Is simply copying all the jar files, such as formserver-client.jar to my web-inf/lib directory enough? (I would think so).



Second, I tried the example code to render a PDF. It is a simple servlet to call EJBClient class to render it. However, I got this error msg from WebLogic:



Exception error is: javax.naming.NameNotFoundException: While trying to lookup 'ejb.com.adobe/formServer/FormServer' didn't find subcontext 'com'. Resolved 'ejb'; remaining name 'com/adobe/formServer/FormServer'



I am not sure what this is. The servlet code is this:



public void doPost(HttpServletRequest req, HttpServletResponse resp)

throws ServletException, IOException {

// Create a EJBClient object

EJBClient formServer = new EJBClient();

// Declare and populate local variables to pass to renderForm

String sFormQuery = "SLNrenderPDF.xdp"; // Defines the form design to render

String sFormPreference = "PDFForm"; // Defines the preference option

String sContentRootURI = "http://172.18.35.198:7001/ois/forms";

String sTargetURL = "http://172.18.35.198:7001/ois/HandleFormSubmit";

String sApplicationWebRoot = "http://172.18.35.198:7001/ois/";

byte[] cData = new byte[0]; // cData

// Create a Hashtable object

Hashtable propsJNDI = new Hashtable();

//// Populate the Hashtable object with JNDI environment values

propsJNDI.put("java.naming.factory.initial","weblogic.jndi.WLInitialContextFactory");

propsJNDI.put("java.naming.provider.url","t3://172.18.35.198:7001");

try {

// Create an InitialContext object

InitialContext initialContextOb = new InitialContext(propsJNDI);

// Call the EJBClient objects setInitialContext object

formServer.setInitialContext(initialContextOb);

// Call renderForm

IOutputContext myOutputContext = formServer.renderForm(sFormQuery, // sFormQuery

sFormPreference, // sFormPreference

cData, // cData,

"CacheEnabled=False", // sOptions

null, // sUserAgent,

sApplicationWebRoot, // sApplicationWebRoot

sTargetURL, // sTargetURL

sContentRootURI, // sContentRootURI

null // sBaseURL

);

// Create a ServletOutputStream object

ServletOutputStream oOutput = resp.getOutputStream();

// Set the HTTPResponse objects content type

resp.setContentType(myOutputContext.getContentType());

// Get the length of the output stream

int outLength = myOutputContext.getOutputContent().length;

// Create a byte array and allocate outLength bytes

byte[] cContent = new byte[outLength];

// Populate the byte array by invoking getOutputContext

cContent = myOutputContext.getOutputContent();

// Write a byte stream back to the web browser. Pass the byte array

oOutput.write(cContent);

}

// Catch a thrown exception

catch (Exception ioEx) {

System.out.println("Exception error is: " + ioEx.getMessage());

}

}



public void doGet(HttpServletRequest req, HttpServletResponse resp)

throws ServletException, IOException {

doPost(req, resp);

}



Any help would be greatly appreciated. Thanks,
6 Replies

Avatar

Level 9
Hi

Copying the Jars is not enough - the Adobe services run as J2EE services. That is why you're getting an exception when trying to locate the service. You need to do a proper full install, create an ear file, and deploy that.

Full instructions in the docs.

Howard

http://www.avoka.com

Avatar

Former Community Member
Thanks for the reply. I actually found an sample for LiveCycle (http://www.adobe.com/devnet/livecycle/samples.html) and build an ear file and deployed it to WebLogic. I got the same error msg. When I checked the ant scripts, it is only copying 2 jars files (formserver-client.jar and adobe-common.jar) from Abobe installed directory. Since I downloaded only the sandbox (http://www.adobe.com/devnet/livecycle/toolbox/index.html) instead of production version, my suspesion is that formserver-client.jar file is different from the production version and it is missing some jndi deployments. This jar file is only of size 99K.



Any further help is greatly appreciated.

Avatar

Former Community Member
OK. I installed FormServerEJB.jar file and deployed an ear file, on WebLogic 9.2. Does the current jar work with WebLogic 9.2? At run time, I got this error msg:



*** Incorrect JAR for this AppServer ***

com.adobe.formServer.interfaces.RenderFormException: com.adobe.formServer.interf

aces.FormServerException: javax.naming.NameNotFoundException

at com.adobe.formServer.FormServer.renderForm(FormServer.java:213)

at com.adobe.formServer.ejb.FormServerBean.renderForm(FormServerBean.jav

a:83)

at com.adobe.formServer.ejb.FormServer_ow4yam_EOImpl.renderForm(FormServ

er_ow4yam_EOImpl.java:137)

at com.adobe.formServer.client.EJBClient.doRenderForm(EJBClient.java:522

)

at com.adobe.formServer.client.EJBClient.renderForm(EJBClient.java:326)

at gov.osha.web.servlet.servlet1.doPost(servlet1.java:74)

at gov.osha.web.servlet.servlet1.doGet(servlet1.java:43)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run

(StubSecurityHelper.java:225)

at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri

tyHelper.java:127)

at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav

a:283)

at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav

a:175)

at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio

n.run(WebAppServletContext.java:3214)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate

dSubject.java:321)

at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:

121)

at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS

ervletContext.java:1983)

at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC

ontext.java:1890)

at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j

ava:1344)

at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)

at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

Caused by: com.adobe.formServer.interfaces.FormServerException: javax.naming.Nam

eNotFoundException

at com.adobe.formServer.PA.XMLFormAgentWrapper.doPAExecute(XMLFormAgentW

rapper.java:259)

at com.adobe.formServer.PA.XMLFormAgentWrapper.execute(XMLFormAgentWrapp

er.java:173)

at com.adobe.formServer.Controller.doXFARender(Controller.java:543)

at com.adobe.formServer.Controller.doRender(Controller.java:391)

at com.adobe.formServer.Controller.render(Controller.java:120)

at com.adobe.formServer.FormServer.renderForm(FormServer.java:184)

... 20 more

Caused by: javax.naming.NameNotFoundException

at com.adobe.util.Utilities.serviceLookup(Utilities.java:514)

at com.adobe.formServer.PA.XMLFormAgentWrapper.getFormAgentFactory(XMLFo

rmAgentWrapper.java:575)

at com.adobe.formServer.PA.XMLFormAgentWrapper.doPAExecute(XMLFormAgentW

rapper.java:244)

... 25 more

Avatar

Former Community Member
Problem is, I am only evaluating and only had a downloaded version of sandbox, which differs signaficantly from the production version (Why do they do that?). The file structure, jar files, etc are all different, so I can not follow the instruction in the doc. Seems that the FormServer bean is doing another JNDI lookup and failed.



I've enclosed all the jar files found in JBOSS's deployed ear file to my ear file and deployed to WebLogic. Still the same error. Any ideas? Anyone who actually has the LiveCycle form sandbox running on WebLogic 9.2?



Thanks

Avatar

Level 9
The Sandbox only works with JBoss. It's all fully self-contained.

It's a shortcut to the full install, that's why it's different.

If you want to run LiveCycle on WebLogic, you will have to do the full install. There are no shortcuts.



Howard

http://www.avoka.com