COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => SDK => Topic started by: amishjashah on 26 Feb 2012 12:43:19 PM

Title: Cognos SDK Exception- ArrayIndexOutofBound
Post by: amishjashah on 26 Feb 2012 12:43:19 PM
Hi,
  I am getting below error while executing Cognos Reports. It fails while getting the Cognos Connection itself.

Our App is integrated with Cognos Server using Cognos SDK. Cognos Reports work fine when executed normally, however during the performance testing using the performance tool, it gives below error. please Suggest.

2012-02-26 20:07:00 HKT [http-30001-Processor48] ERROR com.cognos.org.apache.axis.utils.BeanUtils - Internal Error occurred while build the property descriptors for com.cognos.developer.schemas.bibus._3._package
java.lang.ArrayIndexOutOfBoundsException
   at java.lang.System.arraycopy(Native Method)
   at com.cognos.org.apache.axis.description.TypeDesc.getFields(TypeDesc.java:196)
   at com.cognos.org.apache.axis.description.TypeDesc.getFields(TypeDesc.java:190)
   at com.cognos.org.apache.axis.utils.BeanUtils.processPropertyDescriptors(BeanUtils.java:260)
   at com.cognos.org.apache.axis.utils.BeanUtils.getPd(BeanUtils.java:104)
   at com.cognos.org.apache.axis.description.TypeDesc.getPropertyDescriptors(TypeDesc.java:445)
   at com.cognos.org.apache.axis.encoding.ser.BeanSerializerFactory.<init>(BeanSerializerFactory.java:89)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:501)
   at com.cognos.org.apache.axis.encoding.ser.BaseSerializerFactory.createFactory(BaseSerializerFactory.java:258)
   at com.cognos.org.apache.axis.client.Call.registerTypeMapping(Call.java:2121)
   at com.cognos.developer.schemas.bibus._3.ContentManagerServiceStub.createCall(ContentManagerServiceStub.java:5728)
   at com.cognos.developer.schemas.bibus._3.ContentManagerServiceStub.logon(ContentManagerServiceStub.java:6233)
   at com.jpmchase.zpcclass.dhanush.web.controller.cognos.helper.CognosLogin.getCognosLogin(CognosLogin.java:47)
Title: Re: Cognos SDK Exception- ArrayIndexOutofBound
Post by: ykud on 27 Feb 2012 03:17:32 AM
How do you call the report from SDK (maybe list a code sample)?
Are you sure you fill all the required prompts?

What performance testing tool are you using?
Title: Re: Cognos SDK Exception- ArrayIndexOutofBound
Post by: amishjashah on 27 Feb 2012 03:37:21 AM
Sample Connection Code :

//ctx=createXmlApplicationContext(XA_CONTEXT_XML);
//Logon  logon = (Logon)ctx.getBean("cognosLoginCredentials");
long t = System.currentTimeMillis();
log.info("Cognos login started " + t + "ms");
Logon logon = BusinessServiceLookup.getInstance().getLogon();
logon.setLogon(logon);

connection.connectToCognosServer(logon.getServerUrl());
if(logon.getServerUrl()  != null)
{
log.info("LogonURL " +logon.getServerUrl() );
}
else
{
log.info("Server URL is null" );
}

if(logon.getCognosCredentialString()  != null)
{
log.info("LogonCognosCredentials" + logon.getCognosCredentialString() );
}
else
{
log.info("LogonCognosCredentials is null" );
}
log.info("Before XmlEncodedXML" );
XmlEncodedXML xmlEncoded = new XmlEncodedXML(logon.getCognosCredentialString());
log.info("After XmlEncodedXML" );
log.info("Before Calling logon " );
connection.getCMService().logon(xmlEncoded, new SearchPathSingleObject[] {});
log.info("Cognos login total time " + (System.currentTimeMillis() - t) + "ms" );
log.info("Connection created ...");


Tool Used for Performance Testing - Load Runner

RA:
Added correct tags
Title: Re: Cognos SDK Exception- ArrayIndexOutofBound
Post by: ykud on 27 Feb 2012 03:57:41 AM
Are you able to run the reports with this code at all or this error just starts appearing when a certain load limit is reached?

Did you check the sample LR scripts for cognos?
http://www.ibm.com/developerworks/data/library/cognos/page406.html
Title: Re: Cognos SDK Exception- ArrayIndexOutofBound
Post by: jackmaster on 08 Jun 2012 09:31:52 AM
Hello amishjashah,

   Did you find the root cause of this, I'm having the same problems with Cognos SDK. When I connect to Cognos Server with one connection, it works just fine but when I try to create multi-thread connections to Cognos Server, this error happened. But it seemed do not effect my application, it just thrown out the Exception. But anyway, i want to find out the root cause.
   Thanks in advance.
Title: Re: Cognos SDK Exception- ArrayIndexOutofBound
Post by: asin on 20 May 2013 11:06:56 AM
The reason is described here: http://www-01.ibm.com/support/docview.wss?uid=swg21341163 (http://www-01.ibm.com/support/docview.wss?uid=swg21341163)

in short,
Quoteaxis has a number of singletons that need to be initialized properly before it can be used in a multi-threaded environment. In order to initialize axis' singletons properly, create CognosReportNetPortType and make one simple query before creating any multi-thread handling subsequent requests.

I've used ContentManagerService_ServiceLocator query instead of CognosReportNetPortType, and now multi-threaded part works fine.