Viewing pdf after uploading it to AWS S3 bucket

Confluence User - 22 Jul, 2018

Greetings - testing out the AWS  S3 file upload plugin discussed on this site and it works great.

File Upload Form Element Integrated with Amazon S3

I can see and open the file on AWS. however when I try to view it in Joget It doesnt display properly. below is what I see.... did anyone have success with the plug in and did you have to do further development?

 

aws;s3;fileupload

6


23 Jul, 2018
confluenceUser
confluenceUser

Hi, from the screenshot, it seems that the PDF file viewed is shown as text instead of PDF. You might need to add some code in the plugin to set the appropriate MIME type in the response headers or something.

23 Jul, 2018
confluenceUser
confluenceUser

Thanks - make sense. I tried with text and it does work. 

 

 

24 Jul, 2018
confluenceUser
confluenceUser

so I tried to recompile the source with maven and I get this error when uploading the plugin and trying to use it:

Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.services.s3.AmazonS3Client

is there a trick to packaging the application with maven? I have the sdk in the maven dependicies

 

25 Jul, 2018
confluenceUser
confluenceUser

Hoping for some guidance. I was able to create a jar successfully with maven package. but I cant upload the plugin to joget. it seems to upload but doesnt show up on the list. has anyone packaged a plug in with windows? below is the package results and maven project if anyone can help, much appreciate it. 

 

maven project. used eclipse -  package.zip

 

 

 

D:\aimsware\aims>mvn package
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.joget:aims:bundle:5.0.0
[WARNING] 'build.plugins.plugin.version' for org.apache.felix:maven-bundle-plugin is missing. @ line 40, column 21
[WARNING] 'dependencies.dependency.scope' for com.amazonaws:aws-java-sdk-bom:pom must be one of [provided, compile, runtime, test, system] but is 'import'. @ line 102, column 11
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ---------------------------< org.joget:aims >---------------------------
[INFO] Building aims 5.0.0
[INFO] -------------------------------[ bundle ]-------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ aims ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\aimsware\aims\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ aims ---
[INFO] Compiling 3 source files to D:\aimsware\aims\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ aims ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\aimsware\aims\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) @ aims ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.4.3:test (default-test) @ aims --- [INFO] No tests to run.
[INFO]
[INFO] --- maven-bundle-plugin:3.5.1:bundle (default-bundle) @ aims ---
[WARNING] Bundle org.joget:aims:bundle:5.0.0 : Split package, multiple jars provide the same package:org/joget/workflow/model/service
Use Import/Export Package directive -split-package:=(merge-first|merge-last|error|first) to get rid of this warning
Package found in [Jar:wflow-wfengine, Jar:wflow-directory]
Class path [Jar:., Jar:commons-logging, Jar:wflow-core, Jar:wflow-wfengine, Jar:xercesImpl, Jar:xml-apis, Jar:shark-maven, Jar:sharkadminapi, Jar:sharkappmappersistence-dods, Jar:sharkappmappersistence-dodslayer, Jar:sharkassignment-historyrelated, Jar:sharkassignment-standard, Jar:sharkassignment-xpdlstraightparticipantmapping, Jar:sharkcaching-lru, Jar:sharkcaching-simple, Jar:sharkclientapi, Jar:sharkcommonapi, Jar:sharkcorbaclientapi, Jar:sharkeventaudit-dods, Jar:sharkeventaudit-dodslayer, Jar:sharkeventaudit-notifying, Jar:sharkeventaudit-smtp, Jar:sharkinternalapi, Jar:sharkinteroperability-wfxml, Jar:sharkkernel-standard, Jar:sharklogging-eaf, Jar:sharklogging-standard, Jar:sharkpartmappersistence-dods, Jar:sharkpartmappersistence-dodslayer, Jar:sharkrepositorypersistence-dods, Jar:sharkrepositorypersistence-dodslayer, Jar:sharkrepositorypersistence-filesystem, Jar:sharksecurity-standard, Jar:sharktoolagent-standard, Jar:sharkusergroup-dods, Jar:sharkusergroup-dodslayer, Jar:sharkutilities-dods, Jar:sharkutilities-dodslayer, Jar:sharkutilities-geronimo, Jar:sharkutilities-map, Jar:sharkutilities-misc, Jar:sharkutilities-wmentity, Jar:sharkutilities-xpil, Jar:sharkwebservice-asapapi, Jar:sharkwebservice-wfxmlapi, Jar:xapool, Jar:eaflog4j, Jar:stdconnection, Jar:stdcaches, Jar:stdtransaction, Jar:tro-jta, Jar:tro-localcontext, Jar:twexpdl, Jar:util, Jar:dsconnection, Jar:connector-api, Jar:jotm, Jar:jotm_jrmp_stubs, Jar:carol, Jar:howl-logger, Jar:sharkscripting-standard, Jar:sharkclientutilities-misc, Jar:sharkinstancepersistence-dods, Jar:sharkinstancepersistence-dodslayer, Jar:dbmanager, Jar:eaf-api, Jar:eafconfreader, Jar:bsh, Jar:wflow-commons, Jar:log4j, Jar:spring-core, Jar:spring-orm, Jar:spring-beans, Jar:spring-jdbc, Jar:spring-tx, Jar:spring-context-support, Jar:spring-context, Jar:spring-aop, Jar:aopalliance, Jar:spring-aspects, Jar:aspectjweaver, Jar:spring-webmvc, Jar:spring-expression, Jar:spring-web, Jar:spring-modules-validation, Jar:commons-validator, Jar:oro, Jar:commons-digester, Jar:antlr, Jar:js, Jar:spring-security-acl, Jar:spring-security-core, Jar:spring-security-web, Jar:spring-security-config, Jar:hibernate-core, Jar:jboss-logging, Jar:jboss-logging-annotations, Jar:jboss-transaction-api_1.2_spec, Jar:dom4j, Jar:hibernate-commons-annotations, Jar:hibernate-jpa-2.1-api, Jar:javassist, Jar:jandex, Jar:hibernate-entitymanager, Jar:jta, Jar:slf4j-api, Jar:slf4j-log4j12, Jar:jcl-over-slf4j, Jar:commons-dbcp, Jar:commons-pool, Jar:transactions-jta, Jar:transactions, Jar:transactions-api, Jar:atomikos-util, Jar:mockito-all, Jar:wflow-jdbc, Jar:mysql-connector-java, Jar:ojdbc6, Jar:sqljdbc, Jar:json-simple, Jar:ehcache-core, Jar:jsoup, Jar:csrfguard, Jar:wflow-directory, Jar:wflow-plugin-base, Jar:org.apache.felix.main, Jar:org.apache.felix.framework, Jar:xom, Jar:xmlParserAPIs, Jar:xalan, Jar:jaxen, Jar:jdom, Jar:freemarker, Jar:opencsv, Jar:simple-xml, Jar:stax-api, Jar:stax, Jar:xpp3, Jar:httpclient, Jar:httpcore, Jar:commons-codec, Jar:httpmime, Jar:json, Jar:json-lib, Jar:commons-beanutils, Jar:commons-collections, Jar:commons-lang, Jar:ezmorph, Jar:displaytag, Jar:commons-email, Jar:javax.mail, Jar:activation, Jar:itext, Jar:itext-asian, Jar:bcmail-jdk15, Jar:bcprov-jdk15, Jar:bctsp-jdk15, Jar:core-renderer, Jar:dwr, Jar:jstl, Jar:jsp-api, Jar:servlet-api, Jar:aws-java-sdk-s3, Jar:aws-java-sdk-kms, Jar:aws-java-sdk-core, Jar:jackson-databind, Jar:jackson-annotations, Jar:jackson-core, Jar:joda-time]
[WARNING] Bundle org.joget:aims:bundle:5.0.0 : Export org.joget, has 1, private references [com.amazonaws.services.s3],
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.911 s
[INFO] Finished at: 2018-07-24T21:31:48-04:00
[INFO] ------------------------------------------------------------------------

 

 

 

27 Jul, 2018
confluenceUser
confluenceUser

when u upload to joget, is there any error in the log file?

29 Jul, 2018
confluenceUser
confluenceUser

Hi - when packaging with maven I get this warning:

[WARNING] Bundle org.joget:aws_s3_upload_field:bundle:5.0.0 : Export org.joget, has 1, private references [com.amazonaws.services.s3],
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.580 s
[INFO] Finished at: 2018-07-28T13:19:43-07:00
[INFO] Final Memory: 25M/573M
[INFO] ------------------------------------------------------------------------

when using it the log has this error:

Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.http.AmazonHttpClient

below is the pom fle...

pom.xml

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print