cancel
Showing results for 
Search instead for 
Did you mean: 

Login error in SampleApp for Iphone. ([SampleApp_SampleAppDB subscribe];)

Former Member
0 Kudos

Hi All,

I have build the SampleApp for Iphone with is provided by sybase. When I deploy the app I do not get any errors. When I run the app on the simulator I get a login error during [SampleApp_SampleAppDB subscribe];. Can someone tell me what the problem is?

source SampleApp.m.

- (void)run

{

NSInteger connectionResult ;

// Set log level

[MBOLogger setLogLevel:LOG_INFO];

//Delete the old database and create a new one.

if([SampleApp_SampleAppDB databaseExists])

[SampleApp_SampleAppDB deleteDatabase];

[SampleApp_SampleAppDB createDatabase];

// Set up synchronization profile .

SUPConnectionProfile* cp = [SampleApp_SampleAppDB

getSynchronizationProfile];

[cp setDomainName:@"default"];

//Register a callback handler.

CallbackHandler* databaseCH = [CallbackHandler getInstance];

[SampleApp_SampleAppDB registerCallbackHandler:databaseCH];

//Start backgroundsynchronization.

[SampleApp_SampleAppDB startBackgroundSynchronization];

//Connect to the server

connectionResult = [SUPMessageClient start];

if(connectionResult != kSUPMessageClientSuccess)

{

NSLog(@"Cannot start SUPMessageClient");

exit(0);

}

while([SUPMessageClient status] != STATUS_START_CONNECTED)

[NSThread sleepForTimeInterval:0.0];

[SampleApp_SampleAppDB beginOnlineLogin:@"supAdmin"

password:@"s3pAdmin"];

while([SampleApp_SampleAppDB getOnlineLoginStatus].status ==

SUPLoginPending)

{

[NSThread sleepForTimeInterval:0.0];

if(databaseCH.loginFailureCount > 0)

{

NSLog(@"SampleApp_SampleAppDB login failed.");

}else{

NSLog(@"SampleApp_SampleAppDB login correct.");

}

}

NSLog(@"Start subscribe.");

//Subscribe to the package.

[SampleApp_SampleAppDB subscribe];

// Wait for imports to come back from server

while([databaseCH importSuccessCount] < 1)

[NSThread sleepForTimeInterval:0.2];

//Call the functions that execute the client APIs for synchronization

//parameters, personalization keys read, create, update and delete

[self runAPITests];

// Unsubscribe

[SampleApp_SampleAppDB unsubscribe];

//Disconnect from server.

[SUPMessageClient stop];

}

Debug log

2011-05-06 22:43:13.913 SampleApp[1746:40b] SampleApp_SampleAppDB login correct.

2011-05-06 22:43:13.914 SampleApp[1746:40b] SampleApp_SampleAppDB login correct.

2011-05-06 22:43:13.914 SampleApp[1746:4403] [INFO] [CallBackHandler.m:107] =============================

2011-05-06 22:43:13.914 SampleApp[1746:40b] Start subscribe.

Data Formatters temporarily unavailable, will re-try after a 'continue'. (Not safe to call dlopen at this time.)

(gdb) continue

Current language: auto; currently objective-c

2011-05-06 22:43:13.915 SampleApp[1746:4403] [ERROR] [CallBackHandler.m:108] Login Failed

2011-05-06 22:43:36.996 SampleApp[1746:4403] [INFO] [CallBackHandler.m:109] =============================

2011-05-06 22:43:37.540 SampleApp[1746:4403] [INFO] [CallBackHandler.m:130] =============================

2011-05-06 22:43:37.540 SampleApp[1746:4403] [ERROR] [CallBackHandler.m:131] Subscribe Failed

2011-05-06 22:43:37.541 SampleApp[1746:4403] [INFO] [CallBackHandler.m:132] =============================

2011-05-06 22:43:56.018 SampleApp[1746:40b] *** Terminating app due to uncaught exception 'SUPPersistenceException', reason: 'Illegal key generator status. It must be populated first by the server after a client call to beginOnlineLogin or subscribe'

      • Call stack at first throw:

(

0 CoreFoundation 0x013c75a9 __exceptionPreprocess + 185

1 libobjc.A.dylib 0x01783313 objc_exception_throw + 44

2 SampleApp 0x00006ff3 -[SampleApp_Customer setId_:] + 0

3 SampleApp 0x0003940e +[SampleApp_SampleAppDB subscribe] + 82

4 SampleApp 0x0004572f -[SampleApp run] + 539

5 SampleApp 0x00006d44 main + 90

6 SampleApp 0x00006ce1 start + 53

7 ??? 0x00000001 0x0 + 1

)

terminate called after throwing an instance of 'SUPPersistenceException'

Kind regards,

Richard Middelburg

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi All,

I have build the myApp for Iphone with is provided by sybase. When I deploy the app I do not get any errors. When I run the app on the simulator I get a login error during subscribe;. Can someone tell me what the problem is?

Terminating app due to uncaught exception 'SUPPersistenceException', reason: 'Illegal key generator status. It must be populated first by the server after a client call to loginToSync'

      • Call stack at first throw:

(

0 CoreFoundation 0x02ab7919 __exceptionPreprocess + 185

1 libobjc.A.dylib 0x030165de objc_exception_throw + 47

2 APPLICATION 0x00009f89 MBOLogServerMessageHeader + 0

3 APPLICATION 0x0000ed94 +[InventoryManagementNew_InventoryManagementNewDB waitForKeyGenerator] + 211

4 APPLICATION 0x0000dc27 +[InventoryManagementNew_InventoryManagementNewDB subscribe] + 108

5 APPLICATION 0x00009d66 -[APPLICATIONAppDelegate application:didFinishLaunchingWithOptions:] + 773

6 UIKit 0x0099b543 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1163

7 UIKit 0x0099d9a1 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 346

8 UIKit 0x009a7452 -[UIApplication handleEvent:withNewEvent:] + 1958

9 UIKit 0x009a0074 -[UIApplication sendEvent:] + 71

10 UIKit 0x009a4ac4 _UIApplicationHandleEvent + 7495

11 GraphicsServices 0x0349eafa PurpleEventCallback + 1578

12 CoreFoundation 0x02a98dc4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52

13 CoreFoundation 0x029f9737 __CFRunLoopDoSource1 + 215

14 CoreFoundation 0x029f69c3 __CFRunLoopRun + 979

15 CoreFoundation 0x029f6280 CFRunLoopRunSpecific + 208

16 CoreFoundation 0x029f61a1 CFRunLoopRunInMode + 97

17 UIKit 0x0099d226 -[UIApplication _run] + 625

18 UIKit 0x009a8b58 UIApplicationMain + 1160

19 APPLICATION 0x0000986c main + 102

20 APPLICATION 0x000097fd start + 53

21 ??? 0x00000001 0x0 + 1

)

terminate called after throwing an instance of 'SUPPersistenceException'

it run first time but in a second time it gives error

Former Member
0 Kudos

Hi suresh,

I have registrated my simulator in Sybase and every time I run my app the date and time of last connection is changed in sybase SCC.

Regards,

Richard

Former Member
0 Kudos

hi

Have you registered your device in sybase control center

Regards

suresh