YouTubeMediaGroup mg = newEntry.getOrCreateMediaGroup();
mg.setTitle(new MediaTitle());
mg.getTitle().setPlainTextContent(title);
mg.addCategory(new MediaCategory(YouTubeNamespace.C
ATEGORY_SCHEME, category));
mg.setKeywords(new MediaKeywords());
mg.getKeywords().addKeyword(keywords);
mg.setDescription(new MediaDescription());
mg.getDescription().setPlainTextContent(description);
mg.addCategory(new MediaCategory(YouTubeNamespace.DEVELOPER_TAG_
SCHEME, "mydevtag"));
mg.addCategory(new MediaCategory(YouTubeNamespace.DEVELOPER_TAG_
SCHEME, "anotherdevtag"));
mg.setPrivate(false); //공개여부
newEntry.setGeoCoordinates(new GeoRssWhere(37.0,-122.0));
newEntry.setLocation("Mountain View, CA");
//업로드할 영상의 url을 entry에 세팅
MediaFileSource ms = new MediaFileSource(new File("C:\\sample.m
p4"), "video/quicktime");
//MediaFileSource ms = new MediaFileSource(multi.getFile("C:\\sa
mple.mp4"), "video/quicktime");
newEntry.setMediaSource(ms);
//API를 이용하여 영상 업로드
String uploadUrl = http://uploads.gdata.youtube.com/feeds/api/
users/;
service.setUserCredentials(username, userpassword);
VideoEntry createdEntry = service.insert(new URL(uploadUrl
+username+"/uploads"), newEntry);
System.out.println("업로드 완료");
%>
토큰이나 다른 필수 입력 사항도 정상적인데
VideoEntry createdEntry = service.insert(new URL(uploadUrl+username+"/uploads"), newEntry);
URL입력 과정에서 다음과 같은 오류가 뜨네요 ...
고수분들 조언좀 부탁드립니다
root cause
javax.servlet.ServletException: com.google.gdata.util.InvalidEntryException:
Exception message unavailable
<errors xmlns='http://schemas.google.com/g/2005'><error><domain>GData</domain>
<code>InvalidRequestUriException</code><internalReason>Exception message unavailable
</internalReason></error></errors>
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:865)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:794)
org.apache.jsp.execute_jsp._jspService(execute_jsp.java:142)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
root cause
com.google.gdata.util.InvalidEntryException: Exception message unavailable
<errors xmlns='http://schemas.google.com/g/2005'><error><domain>GData</domain><code>
InvalidRequestUriException</code><internalReason>Exception message unavailable
</internalReason></error></errors>
com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:602)
com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:564)
com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:560)
com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:538)
com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:536)
com.google.gdata.client.media.MediaService.insert(MediaService.java:400)
org.apache.jsp.execute_jsp._jspService(execute_jsp.java:131)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.37 logs.