You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Charles Moulliard (JIRA)" <ji...@apache.org> on 2015/08/05 18:20:05 UTC
[jira] [Resolved] (CAMEL-9057) Camel Example Servlet REST generates
java.lang.NoClassDefFoundError: scala/xml/PrettyPrinter
[ https://issues.apache.org/jira/browse/CAMEL-9057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Charles Moulliard resolved CAMEL-9057.
--------------------------------------
Resolution: Fixed
Add missing scala deps
> Camel Example Servlet REST generates java.lang.NoClassDefFoundError: scala/xml/PrettyPrinter
> --------------------------------------------------------------------------------------------
>
> Key: CAMEL-9057
> URL: https://issues.apache.org/jira/browse/CAMEL-9057
> Project: Camel
> Issue Type: Bug
> Components: examples
> Affects Versions: 2.16.0
> Reporter: Charles Moulliard
> Assignee: Charles Moulliard
>
> After starting jetty:run maven goal and accessing the apiDoc of Swagger (http://localhost:8080/camel-example-servlet-rest-tomcat/api-docs/myCamel), the following error is reported
> {code}
> 2015-08-05 17:42:18.053:INFO:oejs.Server:main: Started @18962ms
> [INFO] Started Jetty Server
> 2015-08-05 17:42:26.619:WARN:oejs.ServletHandler:qtp1891031939-25: Error for /camel-example-servlet-rest-tomcat/api-docs/myCamel
> java.lang.NoClassDefFoundError: scala/xml/PrettyPrinter
> at com.wordnik.swagger.core.util.JsonSerializer$.<init>(JsonSerializer.scala:31)
> at com.wordnik.swagger.core.util.JsonSerializer$.<clinit>(JsonSerializer.scala)
> at org.apache.camel.component.swagger.RestSwaggerApiDeclarationServlet.renderResourceListing(RestSwaggerApiDeclarationServlet.scala:225)
> at org.apache.camel.component.swagger.RestSwaggerApiDeclarationServlet.doGet(RestSwaggerApiDeclarationServlet.scala:111)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
> at org.apache.camel.component.swagger.RestSwaggerCorsFilter.doFilter(RestSwaggerCorsFilter.scala:44)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
> at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
> at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
> at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
> at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
> at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
> at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
> at org.eclipse.jetty.server.Server.handle(Server.java:497)
> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
> at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
> at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
> at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
> at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
> at java.lang.Thread.run(Thread.java:745)
> Caused by:
> java.lang.ClassNotFoundException: scala.xml.PrettyPrinter
> at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
> at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)
> at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:235)
> at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
> at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:450)
> at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:403)
> at com.wordnik.swagger.core.util.JsonSerializer$.<init>(JsonSerializer.scala:31)
> at com.wordnik.swagger.core.util.JsonSerializer$.<clinit>(JsonSerializer.scala)
> at org.apache.camel.component.swagger.RestSwaggerApiDeclarationServlet.renderResourceListing(RestSwaggerApiDeclarationServlet.scala:225)
> at org.apache.camel.component.swagger.RestSwaggerApiDeclarationServlet.doGet(RestSwaggerApiDeclarationServlet.scala:111)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
> {code}
> when the same url is called a second time, then we get another class not found error
> {code}
> 2015-08-05 17:47:33.803:WARN:oejs.ServletHandler:qtp1891031939-33: Error for /camel-example-servlet-rest-tomcat/api-docs/myCamel
> java.lang.NoClassDefFoundError: Could not initialize class com.wordnik.swagger.core.util.JsonSerializer$
> at org.apache.camel.component.swagger.RestSwaggerApiDeclarationServlet.renderResourceListing(RestSwaggerApiDeclarationServlet.scala:225)
> at org.apache.camel.component.swagger.RestSwaggerApiDeclarationServlet.doGet(RestSwaggerApiDeclarationServlet.scala:111)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
> at org.apache.camel.component.swagger.RestSwaggerCorsFilter.doFilter(RestSwaggerCorsFilter.scala:44)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
> at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
> at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
> at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
> at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
> at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
> at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
> at org.eclipse.jetty.server.Server.handle(Server.java:497)
> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
> at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
> at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
> at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
> at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
> at java.lang.Thread.run(Thread.java:745)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)