We are unable to build the groupdocs-viewer-java-web-sample-2.12.0 project, getting below error
D:\doccept\previewtools\groupdocs-viewer-java-web-sample-2.12.0>ant war
Buildfile: D:\doccept\previewtools\groupdocs-viewer-java-web-sample-2.12.0\build
.xml
clean:
[echo] Cleaning the build
[delete] Deleting directory D:\doccept\previewtools\groupdocs-viewer-java-web
-sample-2.12.0\build
[echo] Cleaning the dist
[echo] Cleaning the out
init:
[echo] Creating the build directory
[mkdir] Created dir: D:\doccept\previewtools\groupdocs-viewer-java-web-sampl
e-2.12.0\build\WEB-INF\classes
[mkdir] Created dir: D:\doccept\previewtools\groupdocs-viewer-java-web-sampl
e-2.12.0\build\WEB-INF\lib
compile:
[echo] Compile the source files
[javac] D:\doccept\previewtools\groupdocs-viewer-java-web-sample-2.12.0\buil
d.xml:22: warning: ‘includeantruntime’ was not set, defaulting to build.sysclass
path=last; set to false for repeatable builds
[javac] Compiling 22 source files to D:\doccept\previewtools\groupdocs-viewe
r-java-web-sample-2.12.0\build\WEB-INF\classes
[javac] D:\doccept\previewtools\groupdocs-viewer-java-web-sample-2.12.0\src
com\groupdocs\viewer\samples\javaweb\handler\CustomImageCacheHandler.java:5: err
or: package org.apache.commons.io does not exist
[javac] import org.apache.commons.io.IOUtils;
[javac] ^
[javac] D:\doccept\previewtools\groupdocs-viewer-java-web-sample-2.12.0\src
com\groupdocs\viewer\samples\javaweb\servlet\ViewerServlet.java:3: error: packag
e com.fasterxml.jackson.databind does not exist
[javac] import com.fasterxml.jackson.databind.ObjectMapper;
[javac] ^
[javac] D:\doccept\previewtools\groupdocs-viewer-java-web-sample-2.12.0\src
com\groupdocs\viewer\samples\javaweb\servlet\ViewerServlet.java:18: error: packa
ge org.apache.commons.io does not exist
[javac] import org.apache.commons.io.IOUtils;
[javac] ^
[javac] D:\doccept\previewtools\groupdocs-viewer-java-web-sample-2.12.0\src
com\groupdocs\viewer\samples\javaweb\handler\CustomImageCacheHandler.java:88: er
ror: cannot find symbol
[javac] return IOUtils.toString(inputStream);
[javac] ^
[javac] symbol: variable IOUtils
[javac] location: class CustomImageCacheHandler
[javac] D:\doccept\previewtools\groupdocs-viewer-java-web-sample-2.12.0\src
com\groupdocs\viewer\samples\javaweb\servlet\ViewerServlet.java:47: error: canno
t find symbol
[javac] new ObjectMapper().writeValue(streamUtils, object);
[javac] ^
[javac] symbol: class ObjectMapper
[javac] location: class ViewerServlet
[javac] D:\doccept\previewtools\groupdocs-viewer-java-web-sample-2.12.0\src
com\groupdocs\viewer\samples\javaweb\servlet\ViewerServlet.java:48: error: cannot find symbol
[javac] json = IOUtils.toString(streamUtils.getInputStream()
);
[javac] ^
[javac] symbol: variable IOUtils
[javac] location: class ViewerServlet
[javac] D:\doccept\previewtools\groupdocs-viewer-java-web-sample-2.12.0\src
com\groupdocs\viewer\samples\javaweb\servlet\ViewerServlet.java:61: error: canno
t find symbol
[javac] IOUtils.copy((InputStream) inputStream, response.getOutputStream());
[javac] ^
[javac] symbol: variable IOUtils
[javac] location: class ViewerServlet
[javac] 7 errors
BUILD FAILED
D:\doccept\previewtools\groupdocs-viewer-java-web-sample-2.12.0\build.xml:22: Co
mpile failed; see the compiler error output for details.
Total time: 0 seconds.
We need to integrate this application with my java web-project could you please help up how to integrate.
From your stack trace we can assume that you haven't these libraries (org.apache.commons.io and com.fasterxml.jackson.databind) in your local TomCat . Please try to download and put these .jar files to the "lib" folder in our sample or in to TomCat "lib" folder.
You can download org.apache.commons.io library from here and com.fasterxml.jackson.databind from here .
If you will have more questions please feel free to contact us.
I put both jar files in tomcat/lib directory now we are getting below error
D:\doccept\previewtools\groupdocs-viewer-java-web-sample-2.12.0>ant war Buildfile: D:\doccept\previewtools\groupdocs-viewer-java-web-sample-2.12.0\build .xml
clean: [echo] Cleaning the build [delete] Deleting directory D:\doccept\previewtools\groupdocs-viewer-java-web -sample-2.12.0\build [echo] Cleaning the dist [echo] Cleaning the out
init: [echo] Creating the build directory [mkdir] Created dir: D:\doccept\previewtools\groupdocs-viewer-java-web-sampl e-2.12.0\build\WEB-INF\classes [mkdir] Created dir: D:\doccept\previewtools\groupdocs-viewer-java-web-sampl e-2.12.0\build\WEB-INF\lib
compile: [echo] Compile the source files [javac] D:\doccept\previewtools\groupdocs-viewer-java-web-sample-2.12.0\buil d.xml:22: warning: ‘includeantruntime’ was not set, defaulting to build.sysclass path=last; set to false for repeatable builds [javac] Compiling 22 source files to D:\doccept\previewtools\groupdocs-viewe r-java-web-sample-2.12.0\build\WEB-INF\classes [javac] D:\doccept\previewtools\groupdocs-viewer-java-web-sample-2.12.0\src<br>com\groupdocs\viewer\samples\javaweb\servlet\ViewerServlet.java:47: error: canno t access ObjectCodec [javac] new ObjectMapper().writeValue(streamUtils, object); [javac] ^ [javac] class file for com.fasterxml.jackson.core.ObjectCodec not found [javac] 1 error
BUILD FAILED D:\doccept\previewtools\groupdocs-viewer-java-web-sample-2.12.0\build.xml:22: Co mpile failed; see the compiler error output for details.
Could you please also check in your local TomCat folder if you have this library com.fasterxml.jackson.core. Seems that you should add it to the TomCat "lib" folder also .
In your stack trace you can see this line:
class file for com.fasterxml.jackson.core.ObjectCodec not found.
This indicates that you haven't such class in your environment and you should add this library (com.fasterxml.jackson.core) to it.
Build success and generated the war file, deployed the war file in tomcat webapps folder and starts the server, we are getting below 500 error, Could you please help us.
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
We are sorry to hear that you still have the issue with our web sample, but we can't reproduce the issue on our side and our sample is working well for us . Could you please describe, step by step, how you use our sample and which version of TomCat you are using for deploy the ROOT.war file.
Please come back to us with these details and we will be glad to help you.