1

I got the following error message when I try to deploy my .war file to the application server:

Error 500: javax.servlet.ServletException: Worklight Console initialization failed.Logged Exception: java.lang.RuntimeException: FWLSE0206E: The project /rmbp failed to initialize, because the project database schema for data source jdbc:db2://192.168.1.80:50001/APPCNTR is from version N/A, which is not supported by the server from version 6.1.0.00.20131126-0630. Use the Worklight ant tasks to upgrade the project database schema. [project rmbp]

I already doing some research and ask IBM's about our issue as wellas reviewed the following similar question: IBM Worklight 6.1 - Unable to initialize the project due to DB2 error

Community
  • 1
  • 1

3 Answers3

3

It looks like you try to install a Worklight runtime to the APPCNTR database. This database is used for Application Center and is not related to the Worklight runtime database that is called WRKLGHT.

How do you install your Worklight war file : with the server configuration tool, the deployment ant scripts (that can be found in the configuration-samples directory of the Worklight installation) or manually ?

See http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/index.jsp?topic=/com.ibm.worklight.deploy.doc/devref/r_ant_tasks_configure_dbs.html that explains how to configure the Worklight runtime database and deploy a Worklight runtime war file.

  • Hi Bruno, I just done the step u provided to create a new database using ant for my Worklight application. My new Database name called 'PROD' with 2 schemas inside WL60 and WL60REP. However, the error still persists with same error (jdbc:db2://192.168.1.80:50001/PROD) even after I point the JDBC to the 'PROD' database. –  Mar 12 '14 at 08:17
  • Regarding your statement above, I'm interested to know about 'Worklight runtime database'. I don't have much idea about deploying application to Websphere Application Server, this is my first time. The application that I want deploy is a war file containing an application console which will manage all the mobile apps later (I'm not too sure whether this application needs a database connection, because I normally run this in my development Worklight server that is integrated with eclipse without any dedicated database in my local PC) –  Mar 12 '14 at 08:31
  • So as you run on WAS/DB2 you have to run 2 times the ant script "configure-was-db2.xml" after editing it and modifying the different properties : ant -f configure-was-db2.xml databases and then ant -f configure-was-db2.xml install. The first execution will create all the tables of the Worklight runtime databases and the second one will deploy your runtime war file in WAS – Bruno Charpentier Mar 12 '14 at 17:27
2

The error message looks pretty clear to me. You seem to have upgraded your Worklight installation, but did not upgrade the database scheme used for Application Center.

You need to consult with the IBM Worklight Information Center.

You do not mention how did you upgrade your installation to v6.1.0, nor what did you do. So take a look at the following topic as well regarding database upgrade, since as mentioned it looks like your DB2 database scheme for the APPCNTR database did not take place:

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • 1
    how can I check APPCNTR database schema version? from the script that i saw in the applicationcentre folder in work light installation there are 3 versions upgrade available for DB2. –  Mar 11 '14 at 06:42
  • 1
    What was your previous Worklight version prior to upgrading to 6.1? Use the correct upgrade script. – Idan Adar Mar 11 '14 at 06:46
  • 1
    worklight only or worklight server? if worklight server, i never upgrade. This is a fresh installation of worklight server 6.1. –  Mar 11 '14 at 06:51
  • 1
    Did you at all install Application Center, or have you installed on Worklight Server? You may have used the wrong script. – Idan Adar Mar 11 '14 at 08:40
  • 1
    What script are you referring to? I only install Worklight server, and after that I check in the Worklight installation directory, I found the ApplicationCenter folder, as well as sql script for DB upgrade inside it. Btw, I already run the "upgrade-appcenter-60-61-db2.sql" script and I got error message complaining about APPLINK duplicate table with SQL state=42711. –  Mar 11 '14 at 09:20
  • When you installed Worklight, how did you create its databases? which scripts did you use? You need to run a script first, otherwise there is no database scheme. – Idan Adar Mar 11 '14 at 09:22
  • I create database according to the settings given by the IBM Installation Manager, and I can see it is creating an APPCNTR database. So, I need to run additional script to create a schema for APPCNTR database to get it working?? –  Mar 11 '14 at 10:43
  • Yes. It only creates the database, it does not populate it. Review the IBM Worklight information center. – Idan Adar Mar 11 '14 at 10:52
  • When you run IBM Installation Manager it installs only Application Center (if you don't disabled it) that has its own database : APPCNTR. To deploy a Worklight war file as I've answered you need to configure the Worklight databases and to deploy the war file as stated in http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/index.jsp?topic=/com.ibm.worklight.deploy.doc/devref/r_ant_tasks_configure_dbs.html – Bruno Charpentier Mar 11 '14 at 10:55
2

Have you create a jdbc connection in your Websphere Application Server? It will be needed by the application inside the WAR file to connect to the database.

If you have done it, you can check inside your WAR file and look for web.xml file in WEB-INF/ folder. In my case I found a jdbc hardcoded inside the file, for example:

<resource-ref>
  <description>Worklight Server Database</description>
  <res-ref-name>jdbc/WorklightDS</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
</resource-ref>

<resource-ref>
  <description>Reports Database</description>
  <res-ref-name>jdbc/WorklightReportsDS</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
</resource-ref>

You can rename those hardcoded file into the same name of the jdbc that you created in you WAS.


For the database issue, you can follow this link to use ant for DB creation.

http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/index.jsp?topic=/com.ibm.worklight.deploy.doc/devref/r_ant_tasks_configure_dbs.html

If you follow the 1st ant script for DB2 creation which will have two different databases, you need to create the new user for this line if you haven't done so. Because as you can see, in the xml script, user and password will be needed to create the WRKLGHT database. For example:

<db2 database="WRKLGHT" server="proddb.example.com"
       user="wl6admin" password="wl6pass">

If you use non-default port for your DB2 connection, you can add on your port number parameter after the server parameter. For example:

port="50001"


For user creation, u can follow this link:

http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=%2Fcom.ibm.db2.luw.qb.server.doc%2Fdoc%2Ft0006742.html