We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

java.lang.NoClassDefFoundError: Could not initialize class asposewobfuscated.zzU6

Hi,


When running this code:

File f = new File("Firm Gas GTC b.doc");

FileInputStream fstream = null;

try {

fstream = new FileInputStream(f);

} catch (FileNotFoundException e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

}

try {

Document doc = new Document(fstream);

// Convert the document to a different format and save to stream.

ByteArrayOutputStream dstStream = new ByteArrayOutputStream();

doc.save(dstStream, SaveFormat.PDF);


} catch (Exception e) {

// TODO Auto-generated catch block

e.printStackTrace();

}


I get this error:


java.lang.NoClassDefFoundError: Could not initialize class asposewobfuscated.zzU6 at com.aspose.words.zzC1.zzZ(Unknown Source) at com.aspose.words.zz7.zzZ(Unknown Source) at com.aspose.words.zzBU$zzZ.zz8(Unknown Source) at asposewobfuscated.zzH0.moveNext(Unknown Source) at com.aspose.words.zzBU.zzZ(Unknown Source) at com.aspose.words.zzZ87.zzZyq(Unknown Source) at com.aspose.words.zzZ87.zzY(Unknown Source) at com.aspose.words.zzBU.(Unknown Source) at com.aspose.words.zzZ5P.zzZ(Unknown Source) at com.aspose.words.zzBT.moveNext(Unknown Source) at com.aspose.words.zzZS9.zzZ(Unknown Source) at com.aspose.words.Document.updatePageLayout(Unknown Source) at com.aspose.words.zz7I.perform(Unknown Source) at com.aspose.words.zz7J.zzNJ(Unknown Source) at com.aspose.words.zz4Z.zzZq(Unknown Source) at com.aspose.words.zz4Z.zzZ(Unknown Source) at com.aspose.words.zz4Z.zzZS(Unknown Source) at com.aspose.words.Document.zzZ(Unknown Source) at com.aspose.words.Document.zzZ(Unknown Source) at com.aspose.words.Document.zzZ(Unknown Source) at com.aspose.words.Document.save(Unknown Source) at com.lexmatter.converter.LexMatterConverterServlet.doGet(LexMatterConverterServlet.java:29) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:125) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:37) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:60) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:260) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923) at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:78) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:148) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:469) at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:437) at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:444) at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:256) at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:308) at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:300) at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:441) at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:235) at java.lang.Thread.run(Thread.java:745)

I am running Aspose.Words version 15.12, thanks!

Hi Bob,

Thanks for your inquiry. NoClassDefFoundError in Java comes when Java Virtual Machine is not able to find a particular class at runtime which was available during compile time.

Please remove reference to old Aspose.Words for Java from your project, clean the project (any IDE cache etc) and add reference again in your project to the new ‘aspose-words-15.12.0-jdk16.jar’. Hope this helps you.

I am now getting:


java.lang.ExceptionInInitializerError
at com.aspose.words.zz9V.zzZ(Unknown Source)
at com.aspose.words.zz6.zzZ(Unknown Source)
at com.aspose.words.zz9P$zzZ.zzz(Unknown Source)
at asposewobfuscated.zzGH.zzVy(Unknown Source)
at asposewobfuscated.zzGH.moveNext(Unknown Source)
at com.aspose.words.zz9P.zzZ(Unknown Source)
at com.aspose.words.zzZ3F.zzZgL(Unknown Source)
at com.aspose.words.zzZ3F.zzX(Unknown Source)
at com.aspose.words.zz9P.zzSB(Unknown Source)
at com.aspose.words.zz9P.(Unknown Source)
at com.aspose.words.zzZ0S.zzY(Unknown Source)
at com.aspose.words.zz9O.zz1S(Unknown Source)
at com.aspose.words.zz9O.moveNext(Unknown Source)
at com.aspose.words.zzZNS.zzZ(Unknown Source)
at com.aspose.words.Document.updatePageLayout(Unknown Source)
at com.aspose.words.zz4Y.perform(Unknown Source)
at com.aspose.words.zz4Z.zzLA(Unknown Source)
at com.aspose.words.zz02.zzZk(Unknown Source)
at com.aspose.words.zz02.zzZ(Unknown Source)
at com.aspose.words.zz02.zzn(Unknown Source)
at com.aspose.words.Document.zz3P(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.zzP(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at com.lexmatter.LexMatterConverterServlet.doGet(LexMatterConverterServlet.java:31)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:125)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:37)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:60)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:260)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:78)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:148)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:469)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:437)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:444)
at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:256)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:308)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:300)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:441)
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:235)
at java.lang.Thread.run(Thread.java:745)

Thanks!

Hi Bob,

Thanks for your inquiry. Could you please attach your input Word document along with your environment setting e.g Operating System, Jdk version, IDE etc for testing? We will investigate the issue on our side and provide you more information.


Thanks for the response. The file is attached and the hosting environment is Google App Engine, JDK 1.7. Thanks!

Hi Bob,

Thanks for sharing the detail. We are working over your query and will get back to you soon.

Any update here? Thanks!

Hi Bob,

Thanks for your patience. We have logged a ticket as WORDSNET-13124 for your issue in our issue tracking system. Please spare us some more time for the analysis of this issue. We will update you via this forum thread soon.
Hi Bob,

Thanks for your patience. We have created a simple new web application using Google Plugin for Eclipse with following code example and deployed it to Google App Engine. We have not found any issue with Aspose.Words at Google App Engine.

Please create a simple new web application (source code without compilation errors) that helps us to reproduce your problem on our end at Google App Engine and attach it here for testing. We will investigate the issue on our side and provide you more information. Thanks for your cooperation.

public class GoogleAppServlet extends HttpServlet {

public void doGet(HttpServletRequest req, HttpServletResponse response) throws IOException {

try {

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

builder.writeln("Simple test program");

sendToBrowser(doc, "output_google_app_engine.docx", "Docx", true, response);

response.flushBuffer();

} catch (Exception e) {

// TODO Auto-generated catch block

response.getWriter().println(e.getMessage());

}

}

private void sendToBrowser(Document doc, String demoName, String formatType, boolean openNewWindow, HttpServletResponse response) throws Exception

{

String fileName = demoName + "." + formatType;

//Add Response header

if(openNewWindow)

response.setHeader("content-disposition","attachment; filename=" + fileName);

else

response.addHeader("content-disposition","inline; filename=" + fileName);

response.setContentType("application/msword");

doc.save(response.getOutputStream(), SaveFormat.DOCX);

}

}

First let me say thank you this is really awesome, but I was wondering are you able to do like I was in my original code and save it to a PDF? Thanks again!

Hi Bob,

Thanks for your inquiry. We converted the shared document to Pdf using Google App application with Eclipse and have not found the shared issue. We have attached the code with this post for your kind reference.

We suggest you please try latest version of Aspose.Words for Java 16.1.0 and let us know how it goes on your side. Hope this helps you.