Wednesday, 18 November 2015

IBM ODM Rules 8.7 - Can you say "Doh" ?

I saw this exception today: -

The initialization of the model failed.
A resource provider error occurred during the loading.
Failed to load the repository.
null

ilog.rules.res.console.IlrConsoleException: The initialization of the model failed.
at ilog.rules.res.console.util.IlrModelManager.createRepository(IlrModelManager.java:546)
at ilog.rules.res.console.util.IlrModelManager.init(IlrModelManager.java:181)
at ilog.rules.res.console.util.IlrConsoleInitializer.consoleInitialized(IlrConsoleInitializer.java:86)
at ilog.rules.res.console.jsf.IlrRequestFilter.updateState(IlrRequestFilter.java:413)
at ilog.rules.res.console.jsf.IlrRequestFilter.doFilter(IlrRequestFilter.java:234)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:967)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1107)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:919)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88)
at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1818)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1881)
Caused by: ilog.rules.res.model.IlrResourceRuntimeException: A resource provider error occurred during the loading.
at ilog.rules.res.model.internal.IlrRepositoryFactoryImpl.loadRepository(IlrRepositoryFactoryImpl.java:179)
at ilog.rules.res.model.mbean.IlrJMXRepositoryFactoryImpl.createRepository(IlrJMXRepositoryFactoryImpl.java:58)
at ilog.rules.res.console.util.IlrModelManager.createRepository(IlrModelManager.java:544)
... 25 more
Caused by: ilog.rules.res.persistence.IlrDAOException: Failed to load the repository.
at ilog.rules.res.persistence.impl.IlrDAOLocalization.newIlrDAOException(IlrDAOLocalization.java:35)
at ilog.rules.res.persistence.impl.jdbc.IlrGenericRepositoryDAO.load(IlrGenericRepositoryDAO.java:127)
at ilog.rules.res.model.internal.IlrRepositoryFactoryImpl.loadRepository(IlrRepositoryFactoryImpl.java:177)
... 27 more
Caused by: java.lang.NullPointerException
at ilog.rules.res.persistence.impl.jdbc.helper.IlrRulesetsTable.load(IlrRulesetsTable.java:50)
at ilog.rules.res.persistence.impl.jdbc.IlrGenericRepositoryDAO.load(IlrGenericRepositoryDAO.java:115)
... 28 more


...
[18/11/15 15:26:45:078 GMT] 000000a7 sql           W   An error occurred when executing the SQL query.
                                 com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DB2INST1.RULEAPPS, DRIVER=3.68.61
...
com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-727, SQLSTATE=56098, SQLERRMC=2;-204;42704;DB2INST1.RULEAPPS, DRIVER=3.68.61
...
com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-727, SQLSTATE=56098, SQLERRMC=2;-204;42704;DB2INST1.RULEAPPS, DRIVER=3.68.61
...
[18/11/15 15:26:45:094 GMT] 000000a7 sql           W   An error occurred when executing the SQL query.
                                 com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DB2INST1.RULESETS, DRIVER=3.68.61

...
com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-727, SQLSTATE=56098, SQLERRMC=2;-204;42704;DB2INST1.RULESETS, DRIVER=3.68.61
...

I realised that I was missing a table or two ( RULEAPPS and RULESETS to name but two ), but I was 100% sure I'd created everything.

I checked my notes: -

db2 connect to RESDB
db2 create bufferpool BP32K size 8000 automatic pagesize 32K
db2 -tvf C:\IBM\ODM87\executionserver\databases\trace_db2.sql
db2 -tvf C:\IBM\ODM87\executionserver\databases\repository_db2.sql
db2 -tvf C:\IBM\ODM87\executionserver\databases\xomrepository_db2.sql
db2 -tvf C:\IBM\ODM87\executionserver\databases\decisionrunner_db2.sql


( For the record, I'm installing ODM Rules 8.7.0.0 on Windows Server 2008 R2 )

Can you see what I did wrong ?

Yes, when I connected to DB2, I did not specify a user - on the Windows platform, the command will use the ID that's currently logged in - Administrator in my case - which means that all objects are created with the schema of ADMINISTRATOR rather than, as required, DB2INST1.

Once I realised what I'd done wrong, I dropped the DB: -

db2 drop db RESDB

and recreated everything BUT with the correct schema: -

db2 connect to RESDB user DB2INST1
db2 create bufferpool BP32K size 8000 automatic pagesize 32K
db2 -tvf C:\IBM\ODM87\executionserver\databases\trace_db2.sql
db2 -tvf C:\IBM\ODM87\executionserver\databases\repository_db2.sql
db2 -tvf C:\IBM\ODM87\executionserver\databases\xomrepository_db2.sql
db2 -tvf C:\IBM\ODM87\executionserver\databases\decisionrunner_db2.sql

I'm sure I could have also used this: -

db2 set current schema DB2INST1

but that's not important right now.


No comments:

Note to self - use kubectl to query images in a pod or deployment

In both cases, we use JSON ... For a deployment, we can do this: - kubectl get deployment foobar --namespace snafu --output jsonpath="{...