Sunday, September 2, 2012

Unexpected character encountered (lex state 9): '='

Problem:

From the OSB Console, when trying to Generate WSDL and Service from this JCA Binding resource, you may get an Unexpected character encountered (lex state 9): '=' error.



Solution:

This could be related to the ampersand sign in your .JCA file. Turns out that my .JCA file looked like this:
<adapter-config name="Table" adapter="Database Adapter" wsdlLocation="Table.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
  <connection-factory location="eis/DB/AHMED" UIConnectionName="AHMED-DEV" adapterRef=""/>
  <endpoint-interaction portType="Table_ptt" operation="Table">
    <interaction-spec className="oracle.tip.adapter.db.DBPureSQLInteractionSpec">
      <property name="SqlString" value="SELECT username, age FROM employee WHERE dob >= #from_date AND dob &lt;= #to_date AND type = #status"/>
      <property name="GetActiveUnitOfWork" value="false"/>
    </interaction-spec>
    <input/>
    <output/>
  </endpoint-interaction>
</adapter-config>
1. Manually edit the .JCA file.

2. Replace "&" with "$amp;" so that the line looks like this:
OLD:   dob &lt;= #to_date
NEW:  dob $amp;lt;= #to_date

3. Try again.

4. When the WSDL and service are generated, revert back the change.


Applicable Versions:
  • Oracle Service Bus 11g (11.1.1.5)

References:
  • https://forums.oracle.com/forums/thread.jspa?threadID=2193101


5 comments:

Anonymous said...

Cool, it worked for me, Thanks..!!

Anonymous said...

Thanks
Worked

Anonymous said...

Thanks..!! It worked..

Anonymous said...

Thank you - Seems to be a bug in OSB even in 12.1.3!
Your solution worked.

Alex said...

Thanks!!! works like a champ