Erro de compilação Jety

0 respostas
C

estou usando uma api do google que serve pra logar no orkut a api em si funciona uma das classes do projeto da dando erro

essa aqui

...

 public void login() throws Exception {
        try {
            Server server = null;
            try {
                synchronized (accessor) {
                    List<OAuth.Parameter> callback = null;
                    while (accessor.accessToken == null) {
                        if (server == null) {
                            // Start an HTTP server:
                            final int callbackPort = getEphemeralPort();
                            server = new Server(callbackPort);
                            for (Connector c : server.getConnectors()) {
                                c.setHost("localhost"); // local clients only
                            }
                            server.setHandler(newCallback());
                            server.start();
                            // Callbacks will be directed to this server:
                            callback = OAuth.newList(OAuth.OAUTH_CALLBACK,
                                "http://localhost:" + callbackPort + CALLBACK_PATH,
                                "scope", "http://sandbox.orkut.gmodules.com/social/rpc");
                        }
                        OAuthMessage response = getOAuthClient().getRequestTokenResponse(accessor, null, callback);
                        String authorizationURL = OAuth.addParameters(
                                accessor.consumer.serviceProvider.userAuthorizationURL,
                                OAuth.OAUTH_TOKEN, accessor.requestToken,
                                "scope", "http://sandbox.orkut.gmodules.com/social/rpc");
                        if (response.getParameter(OAuth.OAUTH_CALLBACK_CONFIRMED) == null) {
                            // It appears the service provider implements OAuth 1.0, not 1.0a.
                            authorizationURL = OAuth.addParameters(authorizationURL, callback);
                        }
                        BareBonesBrowserLaunch.browse(authorizationURL);
                        accessor.wait();
                        if (accessor.accessToken == null) {
                            oauthClient.getAccessToken(accessor, null, //
                                    (verifier == null) ? null : //
                                            OAuth.newList(OAuth.OAUTH_VERIFIER, verifier.toString()));
                        }
                        accessor.notifyAll();
                    }
                }
            } finally {
                if (server != null) {
                    try {
                       // server.stop();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }
        } catch (OAuthProblemException p) {
            StringBuilder msg = new StringBuilder();
            String problem = p.getProblem();
            if (problem != null) {
                msg.append(problem);
            }
            Object response = p.getParameters().get(HttpMessage.RESPONSE);
            if (response != null) {
                String eol = System.getProperty("line.separator", "\n");
                msg.append(eol).append(response);
            }
            // for (Map.Entry e : p.getParameters().entrySet())
            // msg.append(e.getKey()).append(": ")
            // .append(e.getValue()).append(eol);
            throw new OAuthException(msg.toString(), p);
        }
    }


...






    protected static class Callback extends AbstractHandler {

        protected Callback(DesktopClient client) {
            this.client = client;
        }

        protected final DesktopClient client;

        public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch)
                throws IOException, ServletException {
            if (!CALLBACK_PATH.equals(target)) {
                response.setStatus(HttpServletResponse.SC_NOT_FOUND);
            } else {
                conclude(response);
                client.proceed(request.getParameter(OAuth.OAUTH_TOKEN),
                               request.getParameter(OAuth.OAUTH_VERIFIER));
                ((Request) request).setHandled(true);
            }
        }

        protected void conclude(HttpServletResponse response) throws IOException {
            response.setStatus(HttpServletResponse.SC_OK);
            response.setContentType("text/html");
            final PrintWriter doc = response.getWriter();
            doc.println("<HTML>");
            doc.println("<body onLoad=\"window.close();\">");
            doc.println("Thank you.  You can close this window now.");
            doc.println("<script>window.close();</script>");
            doc.println("<script>document.close();</script>");
            doc.println("</body>");
            doc.println("</HTML>");
        }

    }

os imports que eu estou usando

import com.centerkey.utils.BareBonesBrowserLaunch;

import net.oauth.OAuth;
import net.oauth.OAuthAccessor;
import net.oauth.OAuthConsumer;
import net.oauth.OAuthException;
import net.oauth.OAuthMessage;
import net.oauth.OAuthProblemException;
import net.oauth.client.OAuthClient;
import net.oauth.client.URLConnectionClient;
import net.oauth.http.HttpMessage;

import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Handler;
import org.mortbay.jetty.Request;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.handler.AbstractHandler;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.URISyntaxException;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

a saida do sistema retorna essa exception ai

C:\Arquivos de programas\Mercurial>java -jar  D:\worksace\Orkut\Orkut_fat.jar C:
\oauth.properties
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
03/03/2010 01:41:38 java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: SHA1-Digest.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
        The type org.mortbay.util.Attributes cannot be resolved. It is indirectl
y referenced from required .class files
        The method start() is undefined for the type Server
        The hierarchy of the type Callback is inconsistent
        The type org.mortbay.component.AbstractLifeCycle cannot be resolved. It
is indirectly referenced from required .class files
        The type org.mortbay.component.LifeCycle cannot be resolved. It is indir
ectly referenced from required .class files

        at net.oauth.example.desktop.DesktopClient.<init>(DesktopClient.java:137
)
        at om.google.orkut.client.sample.Transport.init(Transport.java:78)
        at om.google.orkut.client.sample.SampleApp.<init>(SampleApp.java:35)
        at om.google.orkut.client.sample.SampleApp.main(SampleApp.java:43)

C:\Arquivos de programas\Mercurial>

o meu arquivo manifest

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
	<classpathentry kind="lib" path="C:/Arquivos de programas/Mercurial/orkut-os-client/java/lib/asm-3.2.jar"/>
	<classpathentry kind="lib" path="C:/Arquivos de programas/Mercurial/orkut-os-client/java/lib/cglib-2.2.jar"/>
	<classpathentry kind="lib" path="C:/Arquivos de programas/Mercurial/orkut-os-client/java/lib/cglib-src-2.2.jar"/>
	<classpathentry kind="lib" path="C:/Arquivos de programas/Mercurial/orkut-os-client/java/lib/easymock.jar"/>
	<classpathentry kind="lib" path="C:/Arquivos de programas/Mercurial/orkut-os-client/java/lib/easymockclassextension.jar"/>
	<classpathentry kind="lib" path="C:/Arquivos de programas/Mercurial/orkut-os-client/java/lib/easymockclassextension-src.jar"/>
	<classpathentry kind="lib" path="C:/Arquivos de programas/Mercurial/orkut-os-client/java/lib/easymock-src.jar"/>
	<classpathentry kind="lib" path="C:/Arquivos de programas/Mercurial/orkut-os-client/java/lib/json-me.jar"/>
	<classpathentry kind="lib" path="C:/Arquivos de programas/Mercurial/orkut-os-client/java/lib/junit-4.5.jar"/>
	<classpathentry kind="lib" path="C:/Arquivos de programas/Mercurial/orkut-os-client/java/sample/repo/net/oauth/core/oauth/20090617/oauth-20090617-src.jar"/>
	<classpathentry kind="lib" path="C:/Arquivos de programas/Mercurial/orkut-os-client/java/sample/repo/net/oauth/core/oauth-httpclient4/20090617/oauth-httpclient4-20090617.jar"/>
	<classpathentry kind="lib" path="C:/Arquivos de programas/Mercurial/orkut-os-client/java/sample/repo/net/oauth/core/oauth-consumer/20090617/oauth-consumer-20090617.jar"/>
	<classpathentry kind="lib" path="C:/Arquivos de programas/Mercurial/orkut-os-client/java/sample/repo/net/oauth/core/oauth/20090617/oauth-20090617.jar"/>
	<classpathentry kind="lib" path="D:/javax.servlet-5.1.11.jar"/>
	<classpathentry kind="lib" path="D:/libs java/jety/activation-1.1.jar"/>
	<classpathentry kind="lib" path="D:/libs java/jety/mail-1.4.jar"/>
	<classpathentry kind="lib" path="D:/libs java/jety/servlet-api-2.5.jar"/>
	<classpathentry kind="lib" path="D:/libs java/jety/start.jar"/>
	
<!-- a entrada do jar no manifest aqui -->
<classpathentry kind="lib" path="D:/jetty-6.1.22.jar"/>
	<classpathentry kind="output" path="bin"/>
</classpath>

alguem sabe me dizer o que esta acontecendo e como posso resolver isso

essa classe ai não foi eu quem desenvolveu eu baixei pronta das apps do google
desde ja obrigado

Criado 3 de março de 2010
Respostas 0
Participantes 1