【问题标题】:LiveCycle / JBoss JNDI error : Failed instantiate InitialContextFactory org.jnp.interfaces.NamingContextFactoryLiveCycle / JBoss JNDI 错误:无法实例化 InitialContextFactory org.jnp.interfaces.NamingContextFactory
【发布时间】:2013-12-07 13:00:53
【问题描述】:

我在 Windows 7 机器上的旧版 JBoss 上运行 Adob​​e LiveCycle ES4 服务器。在同一网络中的另一台 Windows 机器上,我设置了一个也在 JBoss 上运行的客户端,但版本较新(7.1.1)。使用 Adob​​e 提供的示例代码,我正在尝试通过 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(); 
  }         
}

【问题讨论】:

  • 请发布堆栈跟踪的其余部分。
  • 我已经编辑了我的帖子以包含堆栈跟踪的其余部分。

标签: java jboss jndi rmi livecycle


【解决方案1】:

它可以使用 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 端点。如果你解决了,想看看你的解决方案。

希望这会有所帮助。

【讨论】:

    【解决方案2】:

    有一个问题只是将 jboss-client 类包含到您的类路径中。在 jboss 5 vs jboss 4x 中有很多。但它可以工作。我在 Linux 和 jboss 5.2 上的配置 LC es4,使用 Java api 使用 jboss 5 的客户端类从 jboss 6 远程调用

    【讨论】:

      猜你喜欢
      • 2012-10-04
      • 1970-01-01
      • 1970-01-01
      • 2017-10-21
      • 2011-11-11
      • 1970-01-01
      • 1970-01-01
      • 2015-08-12
      • 1970-01-01
      相关资源
      最近更新 更多