On Thu, Jan 17, 2013 at 5:01 PM, Sriragu Arudsothy <srir...@wso2.com> wrote:

> Hai all,
>
>           I have the following class structure.
>
> class x{
>
>        public String getAuthorizeUserAccess()
>
>       {
>               try
>               {
>                       OAuthClientRequest access_request = 
> OAuthClientRequest.tokenLocation(accessEP).
>                                                                               
>                 setGrantType(GrantType.PASSWORD).
>                                                                               
>                 setClientId(clientID).
>                                                                               
>                 setClientSecret(clientSecret).
>                                                                               
>                 setUsername(resOwnerUsername).
>                                                                               
>                 setPassword(resOwnerPwd).buildBodyMessage();
>                       OAuthClient oAuthClient = new OAuthClient(new 
> URLConnectionClient());
>                       try
>                       {
>                               OAuthClientResponse oAuthClientResp = 
> oAuthClient.accessToken(access_request);
>                               accToken = 
> oAuthClientResp.getParam(accessToken);
>                               
>                       }
>                       catch (OAuthProblemException e) {
>                               // TODO Auto-generated catch block
>                               e.printStackTrace();
>                       }
>               }
>               catch (OAuthSystemException e) {
>                       // TODO Auto-generated catch block
>                       e.printStackTrace();
>               }
>               
>               return accToken;
>       }
>
>
> }
>
>
> The above class is being called as follows.
>
> claas b{
>
> String methodA()
> {
> x instx = new x();
> return instx.getAuthorizeUserAccess();
> }
>
> }
>
> When I debug the code, at the time cursor execute the x instx = new x();
> line, throws the exception as said before.
>
> The exception file is as follows:
> 1)java.lang.RuntimeException: org.apache.cxf.interceptor.Fault:
> org/apache/amber/oauth2/client/HttpClient
>
> org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:116)
>  
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:322)
>  
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122)
>  
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211)
>  
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)
>  
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154)
>  
> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129)
>  
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187)
>  
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:115)
>  javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
>
> java.lang.ClassNotFoundException: org.apache.amber.oauth2.client.HttpClient
>
>
> But I have the required jar on my classpath.
> org.apache.amber/Oauth-client/the version 2 jar and OAuth-common jars were
> added to class path.
> how can I resolve this issue ?
>

>From where you execute this? Through Ant script/IDE... ? Can you check the
jar is present at the runtime?

Regards,
Vijitha.


>
> Thanks!
> Sriragu
>
>
>



-- 
Vijitha Kumara
Senior Software Engineer; WSO2, Inc.;  http://wso2.com/
email: viji...@wso2.com

Lean . Enterprise . Middleware
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to