Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Access Content Space docs from JSP!

Avatar

Former Community Member

Hi,

How do I access PDF docs in contentSpace from JSP page?

Regards,

Srujan

9 Replies

Avatar

Level 10

http://www.adobe.com/devnet/livecycle/articles/access_cs_03.html

The above article explains how to access content space document through Java coding,

Hope that may help you!

Nith

Avatar

Former Community Member

I am using ES2.

Can I implement same stuff in ES2 also.

Sorry! I am new to Adobe LC ES2.

Regards,

Srujan

Avatar

Level 10

Definitelly you could implement that in LCES2.

Nith

Avatar

Former Community Member

I tried using what you sent before...I am getting the follwoing error!

import

java.io.File;

import

java.util.Properties;

import

com.adobe.idp.Document;

import

com.adobe.idp.dsc.clientsdk.ServiceClientFactory;

import

com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;

import

com.adobe.livecycle.contentservices.client.CRCResult;

import

com.adobe.livecycle.contentservices.client.impl.DocumentManagementServiceClientImpl;

public

class ContentServ {

/**

* @param args

*/

public static void main(String[] args) {

Properties connectionProps =

new Properties();

connectionProps.setProperty(ServiceClientFactoryProperties.

DSC_DEFAULT_SOAP_ENDPOINT, "http://localhost:8080");

connectionProps.setProperty(ServiceClientFactoryProperties.

DSC_TRANSPORT_PROTOCOL,ServiceClientFactoryProperties.DSC_SOAP_PROTOCOL);

connectionProps.setProperty(ServiceClientFactoryProperties.

DSC_SERVER_TYPE, "JBoss");

connectionProps.setProperty(ServiceClientFactoryProperties.

DSC_CREDENTIAL_USERNAME, "administrator");

connectionProps.setProperty(ServiceClientFactoryProperties.

DSC_CREDENTIAL_PASSWORD, "password");

try{

ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);

DocumentManagementServiceClientImpl docManager =

new DocumentManagementServiceClientImpl(myFactory);

CRCResult cr = (CRCResult)docManager.retrieveContent(

"srik", "/Company Home/srik/sri.pdf", "");

Document doc = (Document) cr.getDocument();

File fil =

new File("D:\\AdobeContentSpace\first.pdf");

doc.copyToFile(fil);

}

catch(Exception ex){}

}

}

I am getting the error :

ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2

JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:820]

Please help me

Regards,

Srujan

Avatar

Former Community Member

Detail error code is

ALC-CSV-30101-000:

com.adobe.livecycle.contentservices.client.exceptions.CSInvalidParameterException: ALC-CSV-030-101-Invalid or No Store specified while invoking [retrieveContent].

at com.adobe.livecycle.contentservices.dsc.impl.DocumentManagementServiceImpl.retrieveContent(

DocumentManagementServiceImpl.java:444)

at sun.reflect.GeneratedMethodAccessor2455.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(

DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(

Method.java:597)

at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(

DefaultPOJOInvokerImpl.java:118)

at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(

InvocationInterceptor.java:140)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(

RequestInterceptorChainImpl.java:60)

at com.adobe.idp.dsc.interceptor.impl.DocumentPassivationInterceptor.intercept(

DocumentPassivationInterceptor.java:53)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(

RequestInterceptorChainImpl.java:60)

at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(

TransactionInterceptor.java:74)

at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.execute(

EjbTransactionCMTAdapterBean.java:357)

at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doSupports(

EjbTransactionCMTAdapterBean.java:227)

at sun.reflect.GeneratedMethodAccessor777.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(

DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(

Method.java:597)

at org.jboss.invocation.Invocation.performCall(

Invocation.java:359)

at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(

StatelessSessionContainer.java:237)

at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(

CachedConnectionInterceptor.java:158)

at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(

StatelessSessionInstanceInterceptor.java:169)

at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(

CallValidationInterceptor.java:63)

at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(

AbstractTxInterceptor.java:121)

at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(

TxInterceptorCMT.java:378)

at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(

TxInterceptorCMT.java:181)

at org.jboss.ejb.plugins.SecurityInterceptor.invoke(

SecurityInterceptor.java:168)

at org.jboss.ejb.plugins.LogInterceptor.invoke(

LogInterceptor.java:205)

at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(

ProxyFactoryFinderInterceptor.java:138)

at org.jboss.ejb.SessionContainer.internalInvoke(

SessionContainer.java:648)

at org.jboss.ejb.Container.invoke(

Container.java:960)

at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(

BaseLocalProxyFactory.java:430)

at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(

StatelessSessionProxy.java:103)

at $Proxy401.doSupports(Unknown Source)

at com.adobe.idp.dsc.transaction.impl.ejb.EjbTransactionProvider.execute(

EjbTransactionProvider.java:104)

at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor.intercept(

TransactionInterceptor.java:72)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(

RequestInterceptorChainImpl.java:60)

at com.adobe.idp.dsc.interceptor.impl.InvocationStrategyInterceptor.intercept(

InvocationStrategyInterceptor.java:55)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(

RequestInterceptorChainImpl.java:60)

at com.adobe.idp.dsc.interceptor.impl.InvalidStateInterceptor.intercept(

InvalidStateInterceptor.java:37)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(

RequestInterceptorChainImpl.java:60)

at com.adobe.idp.dsc.interceptor.impl.AuthorizationInterceptor.intercept(

AuthorizationInterceptor.java:188)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(

RequestInterceptorChainImpl.java:60)

at com.adobe.idp.dsc.interceptor.impl.JMXInterceptor.intercept(

JMXInterceptor.java:48)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(

RequestInterceptorChainImpl.java:60)

at com.adobe.idp.dsc.engine.impl.ServiceEngineImpl.invoke(

ServiceEngineImpl.java:121)

at com.adobe.idp.dsc.routing.Router.routeRequest(

Router.java:129)

at com.adobe.idp.dsc.provider.impl.base.AbstractMessageReceiver.invoke(

AbstractMessageReceiver.java:329)

at com.adobe.idp.dsc.provider.impl.soap.axis.sdk.SoapSdkEndpoint.invokeCall(

SoapSdkEndpoint.java:139)

at com.adobe.idp.dsc.provider.impl.soap.axis.sdk.SoapSdkEndpoint.invoke(

SoapSdkEndpoint.java:81)

at sun.reflect.GeneratedMethodAccessor791.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(

DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(

Method.java:597)

at org.apache.axis.providers.java.RPCProvider.invokeMethod(

RPCProvider.java:397)

at org.apache.axis.providers.java.RPCProvider.processMessage(

RPCProvider.java:186)

at org.apache.axis.providers.java.JavaProvider.invoke(

JavaProvider.java:323)

at org.apache.axis.strategies.InvocationStrategy.visit(

InvocationStrategy.java:32)

at org.apache.axis.SimpleChain.doVisiting(

SimpleChain.java:118)

at org.apache.axis.SimpleChain.invoke(

SimpleChain.java:83)

at org.apache.axis.handlers.soap.SOAPService.invoke(

SOAPService.java:454)

at org.apache.axis.server.AxisServer.invoke(

AxisServer.java:281)

at org.apache.axis.transport.http.AxisServlet.doPost(

AxisServlet.java:699)

at javax.servlet.http.HttpServlet.service(

HttpServlet.java:710)

at org.apache.axis.transport.http.AxisServletBase.service(

AxisServletBase.java:327)

at javax.servlet.http.HttpServlet.service(

HttpServlet.java:803)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(

ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(

ApplicationFilterChain.java:206)

at com.adobe.idp.dsc.provider.impl.soap.axis.InvocationFilter.doFilter(

InvocationFilter.java:43)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(

ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(

ApplicationFilterChain.java:206)

at com.adobe.idp.um.auth.filter.CSRFFilter.doFilter(

CSRFFilter.java:41)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(

ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(

ApplicationFilterChain.java:206)

at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(

ReplyHeaderFilter.java:96)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(

ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(

ApplicationFilterChain.java:206)

at org.apache.catalina.core.StandardWrapperValve.invoke(

StandardWrapperValve.java:230)

at org.apache.catalina.core.StandardContextValve.invoke(

StandardContextValve.java:175)

at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(

SecurityAssociationValve.java:179)

at org.jboss.web.tomcat.security.JaccContextValve.invoke(

JaccContextValve.java:84)

at org.apache.catalina.core.StandardHostValve.invoke(

StandardHostValve.java:128)

at org.apache.catalina.valves.ErrorReportValve.invoke(

ErrorReportValve.java:104)

at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(

CachedConnectionValve.java:157)

at org.apache.catalina.core.StandardEngineValve.invoke(

StandardEngineValve.java:109)

at org.apache.catalina.connector.CoyoteAdapter.service(

CoyoteAdapter.java:241)

at org.apache.coyote.http11.Http11Processor.process(

Http11Processor.java:844)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(

Http11Protocol.java:580)

at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(

JIoEndpoint.java:447)

at java.lang.Thread.ru

Thread.java:619)

ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2

JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:820]

I am giving correct Name Space and path also. But still getting this error!

Help me asap

Srujan

Avatar

Level 10

com.adobe.livecycle.contentservices.client.exceptions.CSInvalidParamet erException: ALC-CSV-030-101-Invalid or No Store specified while invoking [retrieveContent].From the above line in your error log, it seems that the Store is not mentioned either in Code or in AdminUI configuration.

Are you sure that you have configured the Store named?

Nith

Avatar

Former Community Member

Hi Nitin,

Yes I configured properly in http://localhost:8080/contentspace

Over there I created new space called 'SrujanSpace' under that I uploade one pdf file also. As you said I didn't do conf in admin UI. I don't believe changes  are in admin UI (http://localhost:8080/adminui).If any please help me out on that.

Thanks for replying .... for referrance i am giving the image also here.

public

class ContentServ {

/**

* @param args

*/

public static ServiceClientFactory m_serviceFactory = null;

private static PasswordCredential m_credential;

public static void main(String[] args) {

Properties connectionProps =

new Properties();

connectionProps.setProperty(ServiceClientFactoryProperties.

DSC_DEFAULT_EJB_ENDPOINT, "jnp://3.209.177.40:1099");

connectionProps.setProperty(ServiceClientFactoryProperties.

DSC_TRANSPORT_PROTOCOL,ServiceClientFactoryProperties.DSC_EJB_PROTOCOL);

connectionProps.setProperty(ServiceClientFactoryProperties.

DSC_JBOSS_SERVER_TYPE, "JBoss");

connectionProps.setProperty(ServiceClientFactoryProperties.

DSC_CREDENTIAL_USERNAME, "administrator");

connectionProps.setProperty(ServiceClientFactoryProperties.

DSC_CREDENTIAL_PASSWORD, "password");

connectionProps.setProperty(

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

connectionProps.setProperty(

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

try{

m_serviceFactory = ServiceClientFactory.createInstance(connectionProps);

DocumentManagementServiceClientImpl docManager =

new DocumentManagementServiceClientImpl(m_serviceFactory);

System.

out.println("Hello Service....");

String storeName =

"Kumar";

String nodePath =

"/Company Home/SrujanSpace/Kumar/lces2_technical_wp.pdf";

CRCResult cr = docManager.retrieveContent(storeName,nodePath,

"1.0");

//callServ(storeName,nodePath,"1.0");

//

System.

out.println("Hello Service-2....");

Document doc = (Document) cr.getDocument();

File fil =

new File("D:\\AdobeContentSpace\first.pdf");

doc.copyToFile(fil);

}

catch(Exception ex){}

}

Regards,contentSpace.JPG

Srujan

Message was edited by: Srujanm

Avatar

Former Community Member

Nitin,

Issue has resolved!

Now able to access the content from content space.

/Srujan