我在Windows 7计算机上运行旧版JBoss上的Adobe LiveCycle ES4 Server。在同一网络中的另一台Windows机器上,我设置了一个也在JBoss上运行的客户端,但是更新版本(7.1.1)。使用Adobe提供的示例代码,我试图通过RMI测试我的连接,但是我遇到了错误。这是堆栈跟踪:
09:53:18,369 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-5) HHH000230: Schema export complete
09:53:18,370 INFO [org.jboss.weld.deployer] (MSC service thread 1-8) JBAS016008: Starting weld service for deployment jboss-as-kitchensink-jsp.war
09:53:18,438 INFO [org.jboss.web] (MSC service thread 1-2) JBAS018210: Registering web context: /jboss-as-kitchensink-jsp
09:53:18,528 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018565: Replaced deployment "jboss-as-kitchensink-jsp.war" with deployment "jboss-as-kitchensink-jsp.war"
09:53:26,035 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) ALC-DSC-031-000: com.adobe.idp.dsc.net.DSCNamingException: Remote EJBObject lookup failed for ejb/Invocation provider
09:53:26,036 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initialise(EjbMessageDispatcher.java:101)
09:53:26,037 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.doSend(EjbMessageDispatcher.java:141)
09:53:26,037 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:69)
09:53:26,038 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)
09:53:26,038 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at com.adobe.livecycle.readerextensions.client.ReaderExtensionsServiceClient.invoke(ReaderExtensionsServiceClient.java:58)
09:53:26,039 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at com.adobe.livecycle.readerextensions.client.ReaderExtensionsServiceClient.applyUsageRights(ReaderExtensionsServiceClient.java:105)
09:53:26,040 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.as.quickstarts.kitchensinkjsp.servlet.AdobeServlet.applyUsageRights(AdobeServlet.java:118)
09:53:26,040 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.as.quickstarts.kitchensinkjsp.servlet.AdobeServlet.doPost(AdobeServlet.java:75)
09:53:26,041 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
09:53:26,041 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
09:53:26,042 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
09:53:26,043 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
09:53:26,043 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)
09:53:26,044 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
09:53:26,044 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
09:53:26,045 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
09:53:26,046 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
09:53:26,046 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
09:53:26,047 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
09:53:26,047 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
09:53:26,048 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
09:53:26,048 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
09:53:26,049 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
09:53:26,049 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
09:53:26,050 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
09:53:26,051 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
09:53:26,051 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at java.lang.Thread.run(Unknown Source)
09:53:26,052 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) Caused by: javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory org.jnp.interfaces.NamingContextFactory from classloader ModuleClassLoader for Module "deployment.jboss-as-kitchensink-jsp.war:main" from Service Module Loader
09:53:26,053 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.as.naming.InitialContextFactoryBuilder.createInitialContextFactory(InitialContextFactoryBuilder.java:64)
09:53:26,053 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
09:53:26,054 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
09:53:26,054 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at javax.naming.InitialContext.init(Unknown Source)
09:53:26,055 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at javax.naming.InitialContext.<init>(Unknown Source)
09:53:26,055 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initJndiContext(EjbMessageDispatcher.java:228)
09:53:26,056 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.getJndiContext(EjbMessageDispatcher.java:241)
09:53:26,057 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initialise(EjbMessageDispatcher.java:91)
09:53:26,057 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) ... 26 more
这是我的代码:
protected void applyUsageRights() {
try {
//Set connection properties required to invoke LiveCycle
Properties connectionProps = new Properties();
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "jnp://113.252.20.43:1099");
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,ServiceClientFactoryProperties.DSC_EJB_PROTOCOL);
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "JBoss");
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, MY_USER);
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, MY_PASSWORD);
//Create a ServiceClientFactory object
ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
//Create a ReaderExtensionsServiceClient object
ReaderExtensionsServiceClient reClient = new ReaderExtensionsServiceClient(myFactory);
//Retrieve the PDF document to which to apply usage rights
FileInputStream fileInputStream = new FileInputStream("C:\\sample.pdf");
Document inputPDF = new Document(fileInputStream);
//Create a UsageRight object and specify specific usage rights
UsageRights useRight = new UsageRights();
useRight.setEnabledDynamicFormFields(true);
useRight.setEnabledComments(true);
useRight.setEnabledFormFillIn(true);
useRight.setEnabledDigitalSignatures(true);
//Create a ReaderExtensionsOptions object
ReaderExtensionsOptionSpec reOptions = new ReaderExtensionsOptionSpec();
//Set the usage rights
reOptions.setUsageRights(useRight);
reOptions.setMessage("This is a Rights-Enabled PDF Document");
//Apply usage rights to a PDF document
Document rightsEnabledPDF = reClient.applyUsageRights(
inputPDF,
"RE2",
null,
reOptions);
//Create a new PDF file that represents the rights-enabled PDF document
File resultFile = new File("C:\\Adobe\\LoanUsageRights.pdf");
rightsEnabledPDF.copyToFile(resultFile);
}catch (Exception e) {
e.printStackTrace();
}
}
答案 0 :(得分:0)
是否可以使用SOAP?
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_SOAP_ENDPOINT, "http://113.252.20.43:80");
connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,ServiceClientFactoryProperties.DSC_SOAP_PROTOCOL);
我个人没有成功调用远程LiveCycle服务器上的EJB端点。如果你得到它,我想看看你的解决方案。
希望这有帮助。
答案 1 :(得分:0)
ni问题只是在你的类路径中包含了jboss-client类。在jboss 5 vs jboss 4x中有很多。但IT有效。我在Linux和jboss 5.2上配置LC es4,使用Java api从jboss 5调用jboss 6的远程客户端