2
votes

Running Worklight 5.0.6 on Tomcat 7 with MySQL 5.6

I dropped all the previous databases and let the Install Manager recreate them. The console runs fine and I am able to upload the wlapp and adapetrs. However, after deploying myproject.war I get the following error every 5 seconds:

SEVERE: Persistency data access problem
com.worklight.core.exceptions.PersistentDataAccessException:
Persistency data access problem at com.worklight.core.exceptions.DefaultExceptionHandler.handleException(DefaultExceptionHandler.java:50) at com.worklight.core.tasks.TaskThread.run(TaskThread.java:100)
Caused by:
org.springframework.dao.InvalidDataAccessApiUsageException: Can only perform operation while a transaction is active.;
nested exception is <openjpa-1.2.2-r422266:898935 nonfatal user error>
org.apache.openjpa.persistence.TransactionRequiredException: Can only perform operation while a transaction is active.

OS: Windows Server 2008 R2 Standard

Databases: APPCNTR, WLREPORT, WRKLGHT

Content of the context.xml

<Context>
<Resource name="jdbc/WorklightDS"
  auth="Container"
  type="javax.sql.DataSource"
  maxActive="100"
  maxIdle="30"
  maxWait="10000"
  username="worklight"
  password="***"
  driverClassName="com.mysql.jdbc.Driver"
  url="jdbc:mysql://localhost:3306/WRKLGHT"/>
<Resource name="jdbc/WorklightReportsDS"
  auth="Container"
  type="javax.sql.DataSource"
  maxActive="100"
  maxIdle="30"
  maxWait="10000"
  username="worklight"
  password="***"
  driverClassName="com.mysql.jdbc.Driver"
  url="jdbc:mysql://localhost:3306/WLREPORT"/>
<Resource name="jdbc/AppCenterDS"
  auth="Container"
  type="javax.sql.DataSource"
  maxActive="100"
  maxIdle="30"
  maxWait="10000"
  username="worklight"
  password="***"
  driverClassName="com.mysql.jdbc.Driver"
  url="jdbc:mysql://localhost:3306/APPCNTR"/>
</Context>

Tomcat's web.xml

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

worklight.properties

wl.db.jndi.name=java:comp/env/jdbc/WorklightDS
wl.db.type=MYSQL

Here are the steps in more details: Yes, here the steps:

  1. Use IM to install worklight 5.0.6.1 - this puts three webapps in my Tomcat folder: appcenterconsole.war, applicationcenter.war, and worklight.war

  2. Run console (runs successfully): http://hostname:8080/worklight/console

  3. Create a hybrid project in eclipse which this generates myprojectname.war file in the /bin folder

  4. Update the publicWorkLightContext, publicWorkLightPort, wl.db.type, wl.db.jndi.name variables found in the workllight.properties file in the server/conf folder of my project.

  5. Rename the myproject.war to myappname.war to match the value of the publicWorkLightContext variable

  6. Manually drop the myappname.war file under the webapps folder of Tomcat (this is when the error starts appearing)

  7. Additionaly upload the adapter and wlapp files through the worklight console. This step works fine and I can see the respective records created in the databases

1

1 Answers

0
votes

Make sure there is only 1 Worklight .war file deployed.

Per the steps you've mentioned, it seems like you did not remove the current worklight .war file from Tomcat prior to dropping the new .war file. There can be only 1 Worklight .war file at a time.

  1. Go to http://yourhost:8080/manager and make sure you disable and undeploy the current Worklight .war file.
  2. Using the Tomcat manager, deploy the new .war file
  3. Go to http://yourhost:8080/yourcontext/console and deploy the apps from the related Worklight project