Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem compiling..missing jar?

Status
Not open for further replies.

aswolff

Programmer
Jul 31, 2006
100
US
I have the following simple program:

Code:
import com.lawson.lawsec.authen.httpconnection.*;
import com.lawson.lawsec.authen.*;
import org.apache.commons.httpclient.*;

public class LawsonLogin2
{
        public static void main(String[] args)
        {
                String vUrl = "[URL unfurl="true"]http://portal.test.com";[/URL]
                String vUserName = "myuser";
                String vResult = null;
                String vPassword = "A";

                LawsonHttpConnection lhc = new LawsonHttpConnection();
                vResult = lhc.doLogin(vUrl, vUserName, vPassword);
        }
}

when I try to compile I include the location of the jar files that contain my imported classes...but I get an error as shown below:

Code:
LawsonLogin2.java:19: cannot resolve symbol
symbol  : method doLogin (java.lang.String,java.lang.String,java.lang.String)
location: class com.lawson.lawsec.authen.httpconnection.LawsonHttpConnection
                vResult = lhc.doLogin(vUrl, vUserName, vPassword);
                             ^
1 error

I decompiled LawsonHttpConnection class and found out that doLogin() method does indeed exist and is an overloaded method with the following 4 declarations.


Code:
    public String doLogin(String s, int i, String s1, String s2, char ac[])
        throws LHCException
    {
        String s3;
        if(i <= 0)
            s3 = "[URL unfurl="true"]https://"[/URL] + s + s1;
        else
            s3 = "[URL unfurl="true"]https://"[/URL] + s + ":" + i + s1;
        return doLogin(s3, s2, ac);
    }
Code:
    public String doLogin(String s, String s1, char ac[])
        throws LHCException
    {
        return doLogin(s, s1, ac, true);
    }
Code:
    public String doLogin(String s, String s1, char ac[], boolean flag)
        throws LHCException
    {
        Log.write("--------------------------------------------------");
        Log.write("doLogin()     :url [" + s + "] username [" + s1 + "]");
        String s2 = _isLoggedIn(s);
        if(s2.equalsIgnoreCase("NotAnSSOServer"))
            if(flag)
            {
                return _doLogin(s, s1, ac, "Basic");
            } else
            {
                Log.write("doLogin()     :returns [NotAnSSOServer]");
                return "NotAnSSOServer";
            }
        if(ssoCfg == null)
        {
            ssoCfg = readConfig(s, "/ssoconfig/SSOCfgInfoServlet");
            if(ssoCfg == null)
                throw new LHCException("doLogin: The call to SSOCfgInfoServlet was not successful.");
        }
        String s3 = ssoCfg.getLoginUrl();
        Log.write("doLogin()     :Login URL is " + s3);
        String s4 = ssoCfg.getAuthenType();
        Log.write("doLogin()     :Authen Type is " + s4);
        String s5 = _doLogin(s3, s1, ac, s4);
        Log.write("doLogin()     :returns " + s5);
        return s5;
    }

Code:
    private String _doLogin(String s, String s1, char ac[], String s2)
        throws LHCException
    {
        Object obj = null;
        String s3 = LHCUtil.getProtocol(s);
        String s4 = LHCUtil.getHost(s);
        if(s2.equalsIgnoreCase("Form"))
        {
            if(s3.equalsIgnoreCase("https"))
                setHttpsConnection(s3, s4);
        } else
        {
            if(s2.equalsIgnoreCase("Basic"))
            {
                if(s3.equalsIgnoreCase("https"))
                    setHttpsConnection(s3, s4);
                setBasicLogin(s1, ac);
                return "LoginSuccessful";
            }
            if(s2.equalsIgnoreCase("OS"))
                return "OS LOGIN is not implemented";
            else
                return "The Authen_Type is not supported: [" + s2 + "]";
        }
        NameValuePair anamevaluepair[] = {
            new NameValuePair("_action", "LOGIN"), new NameValuePair(ssoCfg.getUserNameField(), s1), new NameValuePair(ssoCfg.getPasswordNameField(), new String(ac)), new NameValuePair("_checkSessionTimouts", _checkSessionTimeouts ? "true" : "false")
        };
        ResponseObject responseobject = doPostMethod(s, anamevaluepair);
        String s5 = responseobject.getSSOStatus();
        String s6 = responseobject.getRedirectUrl();
        if(s5 == null)
            throw new LHCException("Failed to get SSO status");
        if(s5.equals("LoginSuccessful") || s5.equals("Redirecting"))
            return "LoginSuccessful";
        if(s5.equals("LoginFailed") || s5.equals("ExceptionError"))
            return s5;
        else
            return s5;
    }

So if my method exists...and I am passing values to it consistent with one of the methods type signature (String, String, String)....why is it not able to resolve the symbol?

Thank You!!!
 
I may be off on this, but you need to add the JAR file into your classpath session variable... or in your IDE.
 
I did that. My CLASSPATH is set to include 2 jar files that contain classes that I am importing.

 
> So if my method exists...and I am passing values to it consistent with one of the methods type signature (String, String, String)

Where is it?
You showed 4 methods, and no one matches.
Do you assume a String being equal to a char[]?
That's wrong?

don't visit my homepage:
 
Yes I was. And I have corrected the problem...and now it works. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top