0
我在Windows 7机器上的JBoss上运行Adobe LiveCycle ES4服务器。在同一个网络中的另一台Windows机器上,我设置了一个也在JBoss上运行的客户端,但可能是一个更新的版本(7.1.1)。使用Adobe提供的示例代码,我试图通过RMI测试我的连接,但遇到了错误。这里是堆栈跟踪:尝试在JBoss上运行示例LiveCycle代码的RMI错误
14:57:40,226 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) Caused by: java.lang.ClassNotFoundException: org.jboss.proxy.ClientContainer from [Module "deployment.jboss-as-kitchensink-jsp.war:main" from Service Module Loader] (no security manager: RMI class loader disabled)
14:57:40,226 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
14:57:40,227 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
14:57:40,227 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
14:57:40,228 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
14:57:40,228 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
14:57:40,228 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
14:57:40,229 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at java.io.ObjectInputStream.readClassDesc(Unknown Source)
14:57:40,229 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
14:57:40,230 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at java.io.ObjectInputStream.readObject0(Unknown Source)
14:57:40,230 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
14:57:40,231 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at java.io.ObjectInputStream.readSerialData(Unknown Source)
14:57:40,231 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
14:57:40,231 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at java.io.ObjectInputStream.readObject0(Unknown Source)
14:57:40,232 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at java.io.ObjectInputStream.readObject(Unknown Source)
14:57:40,232 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at java.rmi.MarshalledObject.get(Unknown Source)
14:57:40,233 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
14:57:40,233 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:816)
14:57:40,234 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) ... 29 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();
}
}
谁能告诉我什么,我做错了什么?我知道我的客户端计算机可以访问LiveCycle服务器,因为我可以访问我使用REST在Workbench中创建的服务(通过剪切并粘贴URL到Workbench提供的客户端计算机的浏览器)。是否因为我使用了错误的EJB端口? 1099是根据示例代码的默认值,但我不确定如何检查它是否正确,并且不太了解JNDI。它与安全设置有关吗?
谢谢!我在我的类路径中有jbossall-client.jar文件,但显然这只是引用其他jar文件,我没有在我的类路径中。一旦我只复制了整个jar文件夹,这个错误就消失了,但另一个弹出来了:(一次一个步骤.. – wlaem