Expand my Community achievements bar.

EJBClient at Oracle Application Server cannot Render a PDF from LiveCycle running at JBoss

Avatar

Former Community Member
I deploy the code at JBoss and it works.

I deploy the same code at Oracle Application Server (localhost:80)

invoking JBoss (localhost:8080) where LiveCycle Server Runs.



Exception thrown:



javax.naming.CommunicationException: Failed to retrieve stub from server 192.168.10.160:1100 [Root e

xception is java.io.StreamCorruptedException: unexpected block data]





(The goal is to deploy the Custom Application at Oracle Application Server with the LiveCycle running at JBoss). Are there any restrictions?)



------------------------------------------------------------------------

My Code is the following:



package clientcontextproject;



import java.io.IOException;

import com.adobe.formServer.client.EJBClient;

import com.adobe.formServer.interfaces.IOutputContext;

import java.util.Hashtable;

import javax.naming.InitialContext;

import javax.servlet.*;

import javax.servlet.http.*;



public class ContextServlet extends HttpServlet {

private static final String CONTENT_TYPE = "text/html; charset=windows-1253";



public void init(ServletConfig config) throws ServletException {

super.init(config);

}



public void doPost(HttpServletRequest request,

HttpServletResponse response) throws ServletException, IOException {response.setContentType(CONTENT_TYPE);



EJBClient formServer = new EJBClient();

Hashtable propsJNDI = new Hashtable();



propsJNDI.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");

propsJNDI.put("java.naming.provider.url","jnp://localhost:8080");

propsJNDI.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");

try {



InitialContext initialContextOb = new InitialContext(propsJNDI);



formServer.setInitialContext(initialContextOb);

String sFormQuery="MyFile.xdp";

String sFormPreference="MSDHTML"; //

String sContentRootURI="C:\\InfoQuest\\JDevApp\\PDFRepository";

String sTargetURL="HandleData3";

String sApplicationWebRoot="http://localhost:80/MyWebRoot";

byte [] cData= new byte[0];



IOutputContext myOutputContext=formServer.renderForm(

sFormQuery,

sFormPreference,

cData,

"CacheEnabled=False",

null,

sApplicationWebRoot,

sTargetURL,

sContentRootURI,

null

);

ServletOutputStream oOutput=response.getOutputStream();

response.setContentType(myOutputContext.getContentType());

int outLength=myOutputContext.getOutputContent().length;

byte[] cContent=new byte[outLength];

cContent=myOutputContext.getOutputContent();

oOutput.write(cContent);

}

catch(Exception e)

{response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,e.getMessage());} } }



------------------------------------------------------------------------

It seems that the problem occured after loading the interface: org.jnp.interfaces.NamingContext (jbossall-client-2001-04-03.jar)

which uses org.jboss.logging.Logger Class (jboss-common.jar).



At the line:

IOutputContext myOutputContext=formServer.renderForm(...)



the Exception mentioned above was thrown.



As build Libraries (from JDeveloper) I used:

J2EE,JSP Runtime libs of JDeveloper

and FormServer-client.jar,Adobe-common.jar,Axis.jar,Jaxrpc-impl.jar



As run time libraries (at WEB-INF/lib):

(From Axis1.4):axis.jar,commons-discovery-0.2.jar,commons-logging-1.0.4.jar,jaxrpc.jar

and jbossall-client-2001-04-03.jar,jboss-common.jar



Aris
1 Reply

Avatar

Former Community Member
Hi,

I too trying do the same sort of thing but instead of oracle appserver i am using Webspehere. if you sorted out the problem then please give me the solution.



The goal is to deploy the Custom Application at Websphere Application Server with the LiveCycle running at JBoss)



thanks in advance.