Enterprise Archive File has failed to build with error "java.lang.Exception: java.lang.StringIndexOutOfBoundsException: String index out of range: 0".

Enterprise Archive File has failed to build with error "java.lang.Exception: java.lang.StringIndexOutOfBoundsException: String index out of range: 0".

book

Article ID: KB0087778

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition -
Not Applicable -

Description

Resolution:
Description:
==========
When building Enterprise Archive File(EAR) through TIBCO BusinessEvents Studio with "Generate Debug Info" option checked, get error "java.lang.Exception: java.lang.StringIndexOutOfBoundsException: String index out of range: 0".

Envrionment:
===========
TIBCO BusinessEvents 5.1.1

Symptoms:
=========
When building Enterprise Archive File(EAR) through TIBCO BusinessEvents Studio with "Generate Debug Info" option checked, get error "java.lang.Exception: java.lang.StringIndexOutOfBoundsException: String index out of range: 0":
>>>>>>>>>>>>>>>>>>
!ENTRY com.tibco.cep.studio.ui 4 0 2014-01-07 11:09:03.822
!MESSAGE Enterprise Archive File has failed to build.
!STACK 0
java.lang.Exception: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
    at com.tibco.cep.studio.core.util.packaging.impl.DefaultRuntimeClassesPackager.close(Unknown Source)
    at com.tibco.cep.studio.core.util.packaging.impl.EMFBarPackager.close(Unknown Source)
    at com.tibco.cep.studio.core.util.packaging.impl.EMFEarPackager.close(Unknown Source)
    at com.tibco.cep.studio.ui.actions.BuildEnterpriseArchiveAction.runBuildArchive(Unknown Source)
    at com.tibco.cep.studio.ui.actions.BuildEnterpriseArchiveAction.access$1(Unknown Source)
    at com.tibco.cep.studio.ui.actions.BuildEnterpriseArchiveAction$BuildArchiveJob.run(Unknown Source)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
    at java.lang.String.charAt(String.java:658)
    at com.tibco.cep.studio.core.utils.ModelUtils.convertPath(Unknown Source)
    at com.tibco.cep.studio.core.utils.ModelUtils.getRuleAsSource(Unknown Source)
    at com.tibco.cep.studio.core.adapters.RuleAdapter.getSource(Unknown Source)
    at com.tibco.cep.studio.core.adapters.RuleAdapter.getDeclCodeBlock(Unknown Source)
    at com.tibco.be.parser.codegen.RuleBlockLineBuffer.toIndentedString(Unknown Source)
    at com.tibco.be.parser.codegen.RuleBlockLineBuffer.toIndentedString(Unknown Source)
    at com.tibco.be.parser.codegen.RuleBlockLineBuffer.getThenOffset(Unknown Source)
    at com.tibco.be.parser.codegen.SmapFileWriter.a(Unknown Source)
    at com.tibco.be.parser.codegen.SmapFileWriter.writeSMapXmlFile(Unknown Source)
    at com.tibco.cep.studio.codegen.EventCodeGenerator.generateEventJavaFile(Unknown Source)
    at com.tibco.cep.studio.codegen.EventCodeGenerator.generateEvent(Unknown Source)
    at com.tibco.cep.studio.codegen.BaseGenerator.if(Unknown Source)
    at com.tibco.cep.studio.codegen.BaseGenerator.generate(Unknown Source)
    ... 7 more
<<<<<<<<<<<<<<<<<

Cause:
=======
Event contains an extra folder attribuite specified with the null value in expiryAction. For example:
>>>>>>>>>>>>>
  &ltexpiryAction folder="" name="StatsTick_expiryAction" ownerProjectName="AdThRTB" actionText="" conditionText="">
<<<<<<<<<<<<<

'folder=""' attribute here in the expiryAction is unexpected and should not be present.

Resolution:
=========
1). Delete and recreate the event which has the extra empty folder attribute in expiryAction.

2). Open the event with a text editor, find the expiryAction element and remove the folder="" attribute, e.g.:
>>>>>>>>>>>>>
  &ltexpiryAction name="StatsTick_expiryAction" ownerProjectName="AdThRTB" actionText="" conditionText="">
<<<<<<<<<<<<<

Issue/Introduction

Enterprise Archive File has failed to build with error "java.lang.Exception: java.lang.StringIndexOutOfBoundsException: String index out of range: 0".