If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

Reply
Contributor
arun_ramachandran
Posts: 13
Registered: ‎09-11-2013
My Device: developer
My Carrier: developer
Accepted Solution

ERROR while running the sample program(AuthenticationSample.java)

Hi,

 

I generated the proxy files using the steps provided in http://docs.blackberry.com/en/admin/deliverables/49270/index.jsp?name=for+Java+developers+-+Getting+...

 

And when i try to run the sample program (AuthenticationSample.java)
 I got an exception. Kindly assist me in this regard. Thank you.

 

Some Point to note:

Apache CXF version used : 2.6.10

 

CLIENT_VERSION is set to 1.1 (WSDL version)
    private final static String CLIENT_VERSION = "1.1";

 

Entier LOG:

 


30:02.064 Attempting BlackBerry Administration Service authentication
30:02.069 Initializing web services...
30:02.069 Entering setup()
30:02.070 Initializing BWS web service stub
12 Sep, 2013 2:27:31 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
INFO: Creating Service {http://ws.rim.com/enterprise/admin}BWSService from class com.rim.ws.enterprise.admin.BWS
30:04.917 BWS web service stub initialized
30:04.917 Initializing BWSUtil web service stub
12 Sep, 2013 2:27:33 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
INFO: Creating Service {http://ws.rim.com/enterprise/admin}BWSUtilService from class com.rim.ws.enterprise.admin.BWSUtil
30:06.042 BWSUtil web service stub initialized
30:06.081 Entering getAuthenticator()
30:06.081 Calling _bwsUtil.getAuthenticators()...
30:06.533 ..._bwsUtil.getAuthenticators() returned "SUCCESS"
30:06.534 Execution Time: 0.0000 seconds
30:06.537 Request UID: 1e942819-fc5b-4274-899a-0c716fc8b41e
30:06.537 Exiting getAuthenticator() with Authenticator object (Name "BlackBerry Administration Service")
30:06.537 Entering getEncodedUserName()
30:06.538 Calling _bwsUtil.getEncodedUsername()...
30:06.550 ..._bwsUtil.getEncodedUsername() returned "SUCCESS"
30:06.550 Execution Time: 0.0008 seconds
30:06.550 Request UID: a819935f-871a-4dc6-a075-7a54c3e426c6
30:06.550 Exiting getEncodedUserName()
30:06.551 Exiting setup() with value "true"
30:09.023 Attempting authenticated BWS call to echo()...
30:12.109 Entering echo()
30:21.638 Calling _bws.echo()...
12 Sep, 2013 2:28:01 PM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
WARNING: Interceptor for {http://ws.rim.com/enterprise/admin}BWSService#{http://ws.rim.com/enterprise/admin}echo has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
    at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:565)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:474)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:377)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:330)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:136)
    at $Proxy44.echo(Unknown Source)
    at com.rim.enterprise.admin.HelloWorld.AuthenticationSample.echo(AuthenticationSample.java:222)
    at com.rim.enterprise.admin.HelloWorld.AuthenticationSample.demonstrateBwsSetupAndAuthenticatedCall(AuthenticationSample.java:557)
    at com.rim.enterprise.admin.HelloWorld.AuthenticationSample.demonstrateBlackBerryAdministrationServiceAuthentication(AuthenticationSample.java:460)
    at com.rim.enterprise.admin.HelloWorld.AuthenticationSample.main(AuthenticationSample.java:416)
Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '401: Unauthorized' when communicating with https://bes101.blrresearch.com:38443/enterprise/admin/ws
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1626)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1537)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1445)
    at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
    at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:660)
    at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
    ... 12 more
30:42.951 Failed to authenticate with the BWS web service
30:44.370 Exiting echo() with value "false"
30:45.779 Authenticated call failed!
30:47.167
Exiting sample.
Press Enter to exit


 

Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: ERROR while running the sample program(AuthenticationSample.java)

The error boils down to a 401: Unauthorized.

 

Are you trying to use BAS or active directory credentials? Could you post the snippet of code being used to choose the authenticator?

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Contributor
arun_ramachandran
Posts: 13
Registered: ‎09-11-2013
My Device: developer
My Carrier: developer

Re: ERROR while running the sample program(AuthenticationSample.java)

Hi,
The issue got resolved. :-) As I missed some feilds to initialize. Thank you for your lead.
Please use plain text.