IBM Worklight 6.1 - Project fails to initialize because the project database schema is from version N/A - db2

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

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.

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

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.
Upgrading to Worklight Server V6.1.0 in a production environment
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:
Manually upgrading the Worklight Server V6.1.0 databases

Related

Netbeans Entity classes from database wizard fails

My setup:
Netbeans 16 on windows 11
Mysql server 8
mysql-connector-java-8.0.30.jar
OpenJDK 64-Bit Server VM Microsoft-40354 (build 17.0.4.1+1-LTS, mixed mode, sharing)
Payara server 5.2 configured in Netbeans.
I have a legacy web application which uses Jdbc resources and connection pools defined in domain.xml inside Payara.
When I deploy the application it works correctly and can access the data in Mysql.
I need to add some new entities and I launch Entity classes from database wizard but it fails.
I had weird problems with that wizard in the past months but since then I changed computer reinstalling everything from scratch and the wizard doesn't work any more.
At step 2 I select a datasource which comes from Payara's domain.xml and an error is immediately reported:
Unable to find driver com.mysql.cj.jdbc.MysqlDataSource. Register this driver in databases tab
I think it refers to Tab Services, Databases tree node, drivers. Unfortunately I cannot add class MysqlDataSource there because it only accepts driver classes.
What can I do ?
I found two possible workarounds.
Temporarily remove the Payara server from Netbeans.
Now the Datasource select box is not populated from domain.xml
so you can finally choose a database connection already defined inside Netbeans or create a new one with "New datasource..."
Open domain.xml, search for the Jdbc connection pool you are going to use and add valid URL and driverClass properties

Whille deploying RESTful webservice, Shows error JdbcDataSource. not found

I have been trying to create my first RESTful execrcise using. But I am unable to deploy module due to error "com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Invalid resource : jdbc/playerDB__pm"
I checked and I have JNDI, daata source created.
Unlike specified in link. I am using:
-Netbeans 8.0.3, Java EE 7, GlassFish Server 4.
Also I have checked GlassFish is running fine.
Edit 1:
I have re-checked my 'Services' tab, and I could not find jdbc/__playedDB ,even though I have created it.
Its a bug, the JDBC resource file is not being created (atleast with versions I am using: GlassFish 4.1, Netbeans 8.0.2). Using GlassFish manually create.
There could still be different error untill you set following connectins:
database(data source) <- connection pool <- JNDI.

IBM Worklight 6.1 - Unable to initialize the project due to DB2 error

I'm getting the following error while trying to access the Worklight server deployed in my machine:
Error 500: Worklight Console initialization failed.Logged Exception:
java.lang.RuntimeException: FWLSE0206E: The project /worklight failed to initialize, because the project database schema for data source jdbc:db2://xxxxx:50000/WRKLGHT 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 worklight]
Follow what the error message suggests.
Make sure that the database schema you use for your DB2 database is one that fits Worklight 6.1
Upgrading from a previous version
How to manually update the database
How to configure the database using Ant
Make sure that you have properly configured your application server for working with DB2
Also make sure that you have properly set up DB2...

Failed to deploy worklight adapter in Worklight

When deploying the BPM project in a development environment, everything works. However, when trying to move the project to the WAS application server, the adapter deployment fails (.war and .wlapp deployment passes successfully):
Failed to deploy adapter 'BPMAdapter.adapter'. : Procedure 'getRest' in adapter 'BPMAdapter' requires security test 'BPMAdapter-securityTest' which is not defined in authenticationConfig.xml.
We've verified the security test exists in authenticationConfig.xml, here's the portion of the tests, so it is, in fact present:
<securityTests>
<customSecurityTest name="BPMAdapter-securityTest">
<test isInternalUserID="true" realm="BPMAuthRealm"/>
</customSecurityTest>
<webSecurityTest name="BPMApp-web-securityTest">
<testUser realm="BPMAuthRealm"/>
</webSecurityTest>
<mobileSecurityTest name="BPMApp-strong-mobile-securityTest">
<testUser realm="BPMAuthRealm"/>
<testDeviceId provisioningType="none"/>
</mobileSecurityTest>
<mobileSecurityTest name="BPMApp-mobile-securityTest">
<testUser realm="BPMAuthRealm"/>
</mobileSecurityTest>
</securityTests>
These are the steps we've taken:
Testing server: Windows 2008 R2 Datacenter
Database: DB2 10.1
Application Server: WAS 8.0.0.3 ND
Installed Worklight Server Enterprise 5.0.5 with DB2 databases successfully. (Worklight is working at: http://internal:9082
Installed in the server (for the sake of not having problems with JDBC during build) Worklight Studio Enterprise 5.0.5 successfully.
Imported the project into a new workspace inside Studio.
Deployed worklight adapter BPMAdapter.xml successfully.
Right click on the app (BPMApp) and "Build All and Deploy" successfully.
Opened http://internalIP:8080/console (Development Jetty based worklight console) to see if the application deployed, and indeed it's shown in the list (Both the apps and the adapter).
Tested with "Preview as common resources" to verify the application works, success.
Now we proceed to make the adjustments to the files needed for WAS deployment:
Changed the in the application-descriptor.xml file from
http://${local.IPAddress}:8080 to http://internalIP:9082/worklight (this example shows the same approach http://goo.gl/xbynL)
At that point we open the bin dir and copy to a folder in the desktop all the *.wlapp files and the BPMAdapter.adapter file.
Now we make the changes in the worklight.properties file:
publicWorkLightHostname=the operational hostname for the worklight server
publicWorkLightProtocol=http
publicWorkLightPort=9082
publicWorkLightContext=/worklight
wl.db.jndi.name=jdbc/WorklightDS
wl.db.type=DB2
wl.db.url=jdbc:db2:Worklight
wl.db.username=wluser
wl.db.password=correctpassword
wl.reports.db.jndi.name=jdbc/WorklightReportsDS
wl.reports.db.type=${wl.db.type}
wl.reports.db.url=${wl.db.url}
wl.reports.db.username=${wl.db.username}
wl.reports.db.password=${wl.db.password}
Saved the worklight.properties and immediately the *.war is regenerated, we copy the *.war to the deployment folder for later upload to WAS.
Create in WAS the Enterprise application according to: (Infocenter for WL 5.0.5 - Deploying a customization .war file to WebSphere Application Server Full Profile) making sure that In the "Class loader order" pane, click Classes loaded with local class loader first (parent last) and In the modules section the "Class loader order" pane, click Classes loaded with local class loader first (parent last).
WAR upload and start-up is successful.
With the .war uploaded (context root BPMWorklight) we go in the browser to http://internalIP:9082/BPMWorklight/console/#catalog
and upload the BPMApp-all.wlapp (we don't upload the other three iPhone, android or common, just the -all.wlapp) the upload is successful.
We proceed to upload in http://internalIP:9082/BPMWorklight/console/#catalog
the adapter BPMAdapter.adapter, we get the error "Failed to deploy adapter 'BPMAdapter.adapter'. : Procedure 'getRest' in adapter 'BPMAdapter' requires security test 'BPMAdapter-securityTest' which is not defined in authenticationConfig.xml."
See my answer here: Failed deploying application using Worklight Console: "Failed to deploy application <appName>.wlapp'. : ERROR
Make sure that the Worklight Server version that is installed on WebSphere matches that of the Worklight Studio Eclipse plug-in used to create the .war, .wlapps and .adapter files.
In addition, make sure that:
you use the same context root ("BPMWorklight") for all:
in application-descriptor.xml
in worklight.properties
name of the .war file
you have removed the previous .war installed by default by the Worklight installation on WAS
I am getting the feeling that you have several Worklight .war files deployed and they are somehow using the wrong .war, thus not finding/using the correct authenticationConfig.xml, which could explain not finding the securityTest.
In Worklight 5.0.x, there should be only 1 Worklight .war file at a time.

deploy a jee6 web application in glassfish v3.1.1

What things have to taken care for deploy a web appl ( war ) in glassfish v3.1.1 ( glassfish-3.1.1-web-windows.exe installer ) , the appl. is developed using netbeans 7.0.1. I am using postgresql database . Developement machine and Production machine is different and is not connected to each other. Any detailed step by step instruction ?
It all depends on what resources your application would need to run successfully on the application server.
e.g. If your application uses container managed persistence then you have to make sure that you create the required JDBC connection pool and resource on the server before you can deploy your application server. If you check the persistence.xml file you will see if your application uses some jta-datasource (the value provided there is actually the JNDI name of the JDBC resource created on the server). Here you might also have to supply the required JDBC driver to the server if it is not package within the application.
What you can do is install the same application server on your local machine and deploy the application there and see if it fails. If it fails then you can check the stacktrace to find out the reason for failure.