Topic
  • 2 replies
  • Latest Post - ‏2013-01-17T21:42:02Z by SystemAdmin
SystemAdmin
SystemAdmin
2327 Posts

Pinned topic Does the mobile app war file need deployed?

‏2013-01-17T18:45:07Z |
I've encountered some confusion after reading the online docs. It takes you through the steps on deploying the .wlapp file and it says to deploy that under the console from within the web app war file that is generated with the mobile app.

Then it goes on to say that you can have only one war file deployed per application server. There is already a war deployed with a console for Worklight. Even if that is the case, does that mean that you can only have 1 mobile application up at a time?

I'm experiencing a database connectivity issue "Cannot create a poolable connection" in my server environment. Everything works on local environment. I was wondering if it had anything to do with the fact that I have not deployed the war file for the mobile app.

Thanks.
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: Does the mobile app war file need deployed?

    ‏2013-01-17T19:02:28Z  
    Which server are you using? Tomcat? WAS?

    You only need one WAR. The WAR contains the console that you may upload apps to as you have seen. The WAR you choose to deploy is not specific to the app that the WAR was generated from. You are free to upload as many WL apps to the same WAR as you wish. To reiterate, only one WAR file needed, several wlapp files can be uploaded to that one WAR file. The documentation saying that you should deploy the WAR file with the specific worklight app it was created from maybe should probably be clarified to reflect what I have just said here. As long as the wlapp file that is generated comes from the same studio version that the WAR file was created from, you won't have any compatibility issues.

    "Cannot create a poolable connection" sounds like you are missing a jar file. You probably have this jar file loaded on your local server which is why it works. Try uploading that jar file to your webserver as well (derby.jar for a derby connection, mysql-connector-java.jar for an sql connection, etc)
    "Everything works on local environment. I was wondering if it had anything to do with the fact that I have not deployed the war file for the mobile app."

    You are partially correct. When you create a WAR from an application, the jars loaded in the server/lib folder are added to the WAR file. Since you created a separate app with a separate WAR file, the previous WAR file doesn't have the jars that your new app needs. Since you are now running on a production server, instead of including the jars you need inside of your server/lib folder and relying on the WAR creation, you can instead put your jar files in the lib folder (or the respective folder for whatever server you are using) of your webserver. That way the classes needed are independent of the WAR file used.
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: Does the mobile app war file need deployed?

    ‏2013-01-17T21:42:02Z  
    Which server are you using? Tomcat? WAS?

    You only need one WAR. The WAR contains the console that you may upload apps to as you have seen. The WAR you choose to deploy is not specific to the app that the WAR was generated from. You are free to upload as many WL apps to the same WAR as you wish. To reiterate, only one WAR file needed, several wlapp files can be uploaded to that one WAR file. The documentation saying that you should deploy the WAR file with the specific worklight app it was created from maybe should probably be clarified to reflect what I have just said here. As long as the wlapp file that is generated comes from the same studio version that the WAR file was created from, you won't have any compatibility issues.

    "Cannot create a poolable connection" sounds like you are missing a jar file. You probably have this jar file loaded on your local server which is why it works. Try uploading that jar file to your webserver as well (derby.jar for a derby connection, mysql-connector-java.jar for an sql connection, etc)
    "Everything works on local environment. I was wondering if it had anything to do with the fact that I have not deployed the war file for the mobile app."

    You are partially correct. When you create a WAR from an application, the jars loaded in the server/lib folder are added to the WAR file. Since you created a separate app with a separate WAR file, the previous WAR file doesn't have the jars that your new app needs. Since you are now running on a production server, instead of including the jars you need inside of your server/lib folder and relying on the WAR creation, you can instead put your jar files in the lib folder (or the respective folder for whatever server you are using) of your webserver. That way the classes needed are independent of the WAR file used.
    Great explanation! This is what I was hoping for! As soon as the admins get my server back up and running, I'll try what you've suggested!

    Thanks a million!