Exception while using java youtube api - java

I am using java youtube api , I have this exception when i am just trying to do the first line of the connection
YouTubeService service = new YouTubeService("");
I am getting this
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.NoClassDefFoundError: com/google/gdata/client/media/MediaService
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
java.lang.ClassLoader.defineClass(ClassLoader.java:615)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2820)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1150)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
tst.Main.doGet(Main.java:197)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
tst.Main.service(Main.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause
java.lang.ClassNotFoundException: com.google.gdata.client.media.MediaService
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
java.lang.ClassLoader.defineClass(ClassLoader.java:615)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2820)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1150)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
tst.Main.doGet(Main.java:197)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
tst.Main.service(Main.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.21 logs.
I put the gdata-youtube .... etc in WEB-INF/lib
also I tried to put the same in the java build path and its the same
so whats the problem ?

you are missing dependent libraries. Add the core and media libraries as well -
gdata-client-X.X.jar
gdata-youtube-X.X.jar
gdata-core-X.X.jar
gdata-media-X.X.jar

Related

Rest Web Services without Configuring web.xml using #ApplicationPath

I am facing issue in connecting to databse!!!
I have added the ojdbc14.jar but somehow it is not capturing the jar.
SEVERE: Servlet.service() for servlet [MyJaxApp] in context with path [/develop-without-web.xml] threw exception [org.glassfish.jersey.server.ContainerException: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver] with root cause
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at MyResource.fun(MyResource.java:33)

Run Gate pipeline in eclipse I get this error Java.lang.ClassNotFoundException: gate.resource

I want to create Web service in eclipse + Tomcate v7 and use pipeline I created in Gate in Ubuntu 12.04 32 bit
but I get this error:
can you help me for solving this error??
INFO: Exception:
java.lang.NoClassDefFoundError: gate/Resource
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at org.apache.axis.utils.ClassUtils$2.run(ClassUtils.java:177)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:160)
at org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:142)
at org.apache.axis.utils.cache.ClassCache.lookup(ClassCache.java:85)
at org.apache.axis.providers.java.JavaProvider.getServiceClass(JavaProvider.java:428)
at org.apache.axis.providers.java.JavaProvider.initServiceDesc(JavaProvider.java:461)
at org.apache.axis.handlers.soap.SOAPService.getInitializedServiceDesc(SOAPService.java:286)
at org.apache.axis.deployment.wsdd.WSDDService.makeNewInstance(WSDDService.java:500)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:274)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:260)
at org.apache.axis.deployment.wsdd.WSDDDeployment.getService(WSDDDeployment.java:427)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at
Caused by: java.lang.ClassNotFoundException: gate.Resource
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
... 53 more
Add all jar files in following folders in your build path:
.../GATE_Developer_7.1/bin/
.../GATE_Developer_7.1/lib/
Maybe my answer is a bit late, but I had the same error and found that it's due to the use of '~' for $HOME.
Changing ~/Gate/bin/gate.jar with /home/user/Gate/bin/gate.jar solved the problem for me.

javax.servlet.ServletException: Servlet execution threw an exception:org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)

Hi i am getting this error while running JAX-RS WebService. i am creating JAX-Rs Web Service using Jersey. by following this link of http://www.vogella.com/articles/REST/article.html
Exception
javax.servlet.ServletException: Servlet execution threw an exception
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
Root cause
java.lang.IncompatibleClassChangeError: Class javax.ws.rs.core.Response$Status does not implement the requested interface javax.ws.rs.core.Response$StatusType
com.sun.jersey.spi.container.ContainerResponse.getStatus(ContainerResponse.java:599)
com.sun.jersey.spi.container.ContainerResponse$CommittingOutputStream.commitWrite(ContainerResponse.java:157)
com.sun.jersey.spi.container.ContainerResponse$CommittingOutputStream.write(ContainerResponse.java:134)
sun.nio.cs.StreamEncoder.writeBytes(Unknown Source)
sun.nio.cs.StreamEncoder.implFlushBuffer(Unknown Source)
sun.nio.cs.StreamEncoder.implFlush(Unknown Source)
sun.nio.cs.StreamEncoder.flush(Unknown Source)
java.io.OutputStreamWriter.flush(Unknown Source)
java.io.BufferedWriter.flush(Unknown Source)
com.sun.jersey.core.util.ReaderWriter.writeToAsString(ReaderWriter.java:191)
com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider.writeToAsString(AbstractMessageReaderWriterProvider.java:128)
com.sun.jersey.core.impl.provider.entity.StringProvider.writeTo(StringProvider.java:88)
com.sun.jersey.core.impl.provider.entity.StringProvider.writeTo(StringProvider.java:58)
com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:302)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1510)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:540)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:715)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
Note: The full stack trace of the root cause is available in the Apache Tomcat/7.0.47 logs.
Can anybody please help.
The error caused was that , i need to use same version jar for the jersey client , JAX-RS-WS. This removed my error . now i am running application successfully.

WSDL Exception in webservice

I created my first axis2 webservice and I got following error when I try to invoke the web service through my client which is created using stub.
Exception in thread "main" java.lang.NoClassDefFoundError: javax/wsdl/WSDLException
at com.test.first.TestStub.populateAxisService(TestStub.java:41)
at com.test.first.TestStub.<init>(TestStub.java:88)
at com.test.first.TestStub.<init>(TestStub.java:77)
at com.test.first.TestStub.<init>(TestStub.java:126)
at com.test.first.TestStub.<init>(TestStub.java:118)
at com.test.first.TestTest.main(TestTest.java:11)
Caused by: java.lang.ClassNotFoundException: javax.wsdl.WSDLException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Laun``cher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 6 more
What could be the root cause for this exception?
Note: I have included wsdl4j and log4j libraries.
Likely a classpath issue? Can't find javax.wsdl.WSDLException. Ensure this is available.

Java Stripes Error

So I am following the quick start guide on the Stripes website here:
http://www.stripesframework.org/display/stripes/Quick+Start+Guide
I have followed each step but when I try to view it I get the error message:
HTTP Status 500 - java.lang.ClassNotFoundException: org.apache.jsp.Test.WebContent.index_jsp
type Exception report
message java.lang.ClassNotFoundException: org.apache.jsp.Test.WebContent.index_jsp
description The server encountered an internal error (java.lang.ClassNotFoundException: org.apache.jsp.Test.WebContent.index_jsp) that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.Test.WebContent.index_jsp
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:177)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause
java.lang.ClassNotFoundException: org.apache.jsp.Test.WebContent.index_jsp
java.net.URLClassLoader$1.run(Unknown Source)
java.net.URLClassLoader$1.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(Unknown Source)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:172)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.29 logs.
I don't really understand what is going wrong.
Any help would be appreciated.
the problem is that you are not building it right, make sure all dependencies are in the build path and if you exporting it, make sure they are also in the export and deploy path

Categories

Resources