Free Support Forum - groupdocs.com

Unable to build the groupdocs-viewer-java-web-sample-2.12.0


#1

Hi Team,

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<br>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<br>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<br>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<br>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<br>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<br>com\groupdocs\viewer\samples\javaweb\servlet\ViewerServlet.java:48: error: canno
t 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<br>com\groupdocs\viewer\samples\javaweb\servlet\ViewerServlet.java:61: error: canno
t find symbol
[javac] IOUtils.copy((InputStream) inputStream, response.getOutp
utStream());
[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.


Regards,
Siva G.


#2
Hello Siva,

Thank you for your inquiry.

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.

Best regards,
Evgen Efimov

http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+


#3

Thanks for quick reply.

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.

Total time: 0 seconds


#4
Hello again,

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.

Best regards,
Evgen Efimov

http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+


#5

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.

exception

javax.servlet.ServletException: Servlet.init() for servlet IndexServlet threw exception
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:745)

root cause

java.lang.NoClassDefFoundError: com/aspose/slides/FontsLoader
com.groupdocs.viewer.handlers.a.e.(ViewerHandlerBase.java:81)
com.groupdocs.viewer.handlers.ViewerHandlerBasic.(ViewerHandlerBasic.java:77)
com.groupdocs.viewer.handlers.ViewerHandler.(ViewerHandler.java:59)
com.groupdocs.viewer.handlers.ViewerHandler.(ViewerHandler.java:47)
com.groupdocs.viewer.samples.javaweb.servlet.ViewerServlet.init(Unknown Source)
javax.servlet.GenericServlet.init(GenericServlet.java:160)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:745)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.27 logs.



#6
Hello Siva,

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.

------

Best regards,
Evgen Efimov

http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+