The exception clearly says 'it couldn't find the class' - org.jboss.proxy.ClientContainer
.You are definitely missing the required jboss-client.jar file. Please add it to the classpath. This link has the solution. Hope this helps.
RMI error trying to run sample LiveCycle code on JBoss
Frage
I have Adobe LiveCycle ES4 Server running on JBoss on a Windows 7 machine. On another Windows machine within the same network, I set up a client also running on JBoss, but probably a newer version (7.1.1). Using sample code provided by Adobe, I am trying to test my connection over RMI, but am running into errors. Here is the stack trace:
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
Here is my code:
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();
}
}
Can anyone tell me what I'm doing wrong? I know my client computer can access the LiveCycle server because I'm able to access a service I created in Workbench using REST (by just cutting and pasting the URL Workbench provides into my client computer's browser). Is it because I'm using the wrong EJB Port? 1099 is the default according to the sample code but I'm not sure how to check if it's right and don't know much about JNDI. Does it have something to do with security settings?
Lösung