Unable to create com.adobe.aemfd.docmanager.Document Object

Avatar

Avatar
Validate 1
Level 1
Wells_Sri
Level 1

Likes

0 likes

Total Posts

17 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
Wells_Sri
Level 1

Likes

0 likes

Total Posts

17 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
Wells_Sri
Level 1

06-07-2021

Hi, I am trying to create to convert base64 encoded pdf document to com.adobe.aemfd.docmanager.Document object by using below line of code. But it throwing error. Any suggestion please.

 

Document document = new Document(Base64.decodeBase64(base64));

 

Errors:

 

Exception in thread "main" java.lang.NoClassDefFoundError: com/adobe/aemfd/docmanager/source/DocumentSourceHandler
at com.aemproject.core.workflows.ConvertBase64ToDocument.main(ConvertBase64ToDocument.java:76)
Caused by: java.lang.ClassNotFoundException: com.adobe.aemfd.docmanager.source.DocumentSourceHandler
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 1 more

 

I don't know how to resolve this problem.

 

-Sri

Accepted Solutions (0)

Answers (3)

Answers (3)

Avatar

Avatar
Affirm 100
Employee
Kosta_Prokopiu1
Employee

Likes

165 likes

Total Posts

371 posts

Correct reply

107 solutions
Top badges earned
Affirm 100
Validate 1
Establish
Give Back 5
Give Back 3
View profile

Avatar
Affirm 100
Employee
Kosta_Prokopiu1
Employee

Likes

165 likes

Total Posts

371 posts

Correct reply

107 solutions
Top badges earned
Affirm 100
Validate 1
Establish
Give Back 5
Give Back 3
View profile
Kosta_Prokopiu1
Employee

06-07-2021

I see you posted also in another thread.

 

I tested this with AEM Forms 6.5.7 using 

<dependency>
<groupId>com.adobe.aemfd</groupId>
<artifactId>aemfd-client-sdk</artifactId>
<version>6.3.0</version>
</dependency>

and it did work.

 

What version of AEM Forms are you using?

Avatar

Avatar
Affirm 100
Employee
Kosta_Prokopiu1
Employee

Likes

165 likes

Total Posts

371 posts

Correct reply

107 solutions
Top badges earned
Affirm 100
Validate 1
Establish
Give Back 5
Give Back 3
View profile

Avatar
Affirm 100
Employee
Kosta_Prokopiu1
Employee

Likes

165 likes

Total Posts

371 posts

Correct reply

107 solutions
Top badges earned
Affirm 100
Validate 1
Establish
Give Back 5
Give Back 3
View profile
Kosta_Prokopiu1
Employee

06-07-2021

@GirishBedekar he is decoding it in the call.

 

But I wonder which Base64 class that is. The Oracle JDK class is defined here https://docs.oracle.com/javase/8/docs/api/java/util/Base64.html

Are you sure that a byte array is passed? Sure that the base64 variable decodes to a proper PDF?

Did you try to have the decoding separate like

byte [] thePdfDocument = Base64.decodeBase64(base64);

Document document = new Document(thePdfDocument);

 

-Kosta

 

Avatar

Avatar
Ignite 1
Level 7
GirishBedekar
Level 7

Likes

172 likes

Total Posts

241 posts

Correct reply

38 solutions
Top badges earned
Ignite 1
Give Back 5
Give Back 3
Give Back 10
Give Back
View profile

Avatar
Ignite 1
Level 7
GirishBedekar
Level 7

Likes

172 likes

Total Posts

241 posts

Correct reply

38 solutions
Top badges earned
Ignite 1
Give Back 5
Give Back 3
Give Back 10
Give Back
View profile
GirishBedekar
Level 7

06-07-2021

There is no constructor to create document from base64 in AEM forms OSGi

https://helpx.adobe.com/experience-manager/6-5/forms/javadocs/index.html?com/adobe/aemfd/docmanager/...