Topic
  • 10 replies
  • Latest Post - ‏2012-09-04T11:07:40Z by SwastikShetty
SwastikShetty
SwastikShetty
7 Posts

Pinned topic Deploying worklight to remote server

‏2012-08-30T07:06:18Z |
Hi,

I am using the free developer edition of worklight studio 4.2
I am a bit confused with the worklight server part. I have tested my app locally with the embedded application server in worklight studio.

Now if i need to deploy my app on a tomcat server can i directly copy the <app-name>.war file from bin folder generated by the studio into webapps folder of tomcat?
OR
DO i need to install worklight server component separately on the remote server?
OR
Is this not possible at all with the free version?

Basically i am confused when you say 'worklight server' does this mean a seperate application server or just a war file deploy-able on a standalone server like tomcat?
  • IdanAdar
    IdanAdar
    288 Posts

    Re: Deploying worklight to remote server

    ‏2012-08-30T07:18:34Z  
    Hi,

    To be able to run Worklight Server on any application server (Tomcat, WAS, Liberty, etc) you will need to purchase IBM Worklight (and read the manual :)).
    The IBM Worklight Developer Edition (note that it is meant for development only) allows you to run Worklight Server as part of the Eclipse plug-in (all-in-one approach).

    Worklight Server is not the .war file you deploy; the .war file only contains configuration settings and such.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • SwastikShetty
    SwastikShetty
    7 Posts

    Re: Deploying worklight to remote server

    ‏2012-08-30T07:43:34Z  
    • IdanAdar
    • ‏2012-08-30T07:16:52Z
    Hi,

    To be able to run Worklight Server on any application server (Tomcat, WAS, Liberty, etc) you will need to purchase IBM Worklight (and read the manual :)).
    The IBM Worklight Developer Edition (note that it is meant for development only) allows you to run Worklight Server as part of the Eclipse plug-in (all-in-one approach).

    Worklight Server is not the .war file you deploy; the .war file only contains configuration settings and such.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    yeah..i thought so..Thanks for the prompt reply Idan.
  • SwastikShetty
    SwastikShetty
    7 Posts

    Re: Deploying worklight to remote server

    ‏2012-09-04T08:00:23Z  
    yeah..i thought so..Thanks for the prompt reply Idan.
    Hi Idan,

    I now have the enterprise edition of worklight 5.0

    I have followed these steps from the wl_5_0_admin.pdf guide to deploy worklight on tomcat:

    1) Created a My-SQL instance as per the guide.
    2) Appendix B, Tomcat Installation procedure.
    a) copy
    WL_INSTALL_DIR/WorklightServer/worklight-jee-library.jar to
    TOMCAT_HOME/lib
    b) copied mysql-connector-java-5.1.21-bin.jar to
    TOMCAT_HOME/lib
    c) copy
    WL_INSTALL_DIR/WorklightServer/worklight.war to
    TOMCAT_HOME/webapps
    d) the worklight.properties file in webapps\worklight\WEB-INF\classes\conf has this content:

    publicWorkLightHostname=localhost
    # http or https
    publicWorkLightProtocol=http
    # For default port leave empty
    publicWorkLightPort=8282
    publicWorkLightContext=worklight

    wl.db.type=MYSQL
    wl.db.url=jdbc:mysql://localhost:3306/WRKLGHT
    wl.reports.db.type=MYSQL
    wl.reports.db.url=jdbc:mysql://localhost:3306/WLREPORT
    wl.db.username=worklight
    wl.db.password=worklight
    reports.exportRawData=true

    e)the file TOMCAT_HOME/conf/web.xml contains:
    <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>

    f) the file $TOMCAT_HOME/conf/context.xml contains:
    <Resource name="jdbc/WorklightDS"
    auth="Container"
    type="javax.sql.DataSource"
    maxActive="100"
    maxIdle="30"
    maxWait="10000"
    username="worklight"
    password="worklight"
    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="worklight"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/WLREPORT"/>

    After doing all this setup, when I browse to http://localhost:8282/worklight/console, i get the HTTP 404 error
    and tomcat manager fails to start the application with the error:
    FAIL - Application at context path /worklight could not be started.

    Am i missing a step? or doing something wrong?

    Regards,
    Swastik
  • IdanAdar
    IdanAdar
    288 Posts

    Re: Deploying worklight to remote server

    ‏2012-09-04T08:07:14Z  
    In your worklight.properties file, I see the following:

    publicWorkLightContext=worklight

    It should be publicWorkLightContext=/worklight/ (note the added slashes)

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • SwastikShetty
    SwastikShetty
    7 Posts

    Re: Deploying worklight to remote server

    ‏2012-09-04T08:16:24Z  
    • IdanAdar
    • ‏2012-09-04T08:07:14Z
    In your worklight.properties file, I see the following:

    publicWorkLightContext=worklight

    It should be publicWorkLightContext=/worklight/ (note the added slashes)

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    I added the missing slashes - /worklight/
    But i still get the same error....
  • IdanAdar
    IdanAdar
    288 Posts

    Re: Deploying worklight to remote server

    ‏2012-09-04T08:22:49Z  
    Have you re-deployed the .war file?

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • SwastikShetty
    SwastikShetty
    7 Posts

    Re: Deploying worklight to remote server

    ‏2012-09-04T08:36:27Z  
    • IdanAdar
    • ‏2012-09-04T08:22:49Z
    Have you re-deployed the .war file?

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    Hi Idan,

    I just went ahead and directly modified the worklight.properties file in the tomcat/webapps/... folder itself i.e. in the deployed project and then restarted the server.
    I did not change it in the original .war file.

    Does that make a difference?

    Thanks,
    Swastik
  • IdanAdar
    IdanAdar
    288 Posts

    Re: Deploying worklight to remote server

    ‏2012-09-04T09:19:45Z  
    Does the error provide anything else? Any other log files in Tomcat with relevant information?
    It looks like the context path is missing something. Trying undeploying the war file and re-deploying it just in case.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • SwastikShetty
    SwastikShetty
    7 Posts

    Re: Deploying worklight to remote server

    ‏2012-09-04T09:56:14Z  
    • IdanAdar
    • ‏2012-09-04T09:19:45Z
    Does the error provide anything else? Any other log files in Tomcat with relevant information?
    It looks like the context path is missing something. Trying undeploying the war file and re-deploying it just in case.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    Hi Idan,

    I tried redeploying the log file, but i get the same error.
    I see the following error in the tomcat/log folder:

    Error configuring application listener of class org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
    java.lang.ClassNotFoundException: org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
    Please find attached the log file.

    Also a folder is created in the tomact home outside of webapps, with the name 'worklight.home'. This directory has a error log file - server.log, which has the following error:

    2012-09-04 14:20:18,951 INFO JeeProjectActivator (main:) Worklight home folder is C:\cluster\tomcat-node-1\worklight.home\worklight
    2012-09-04 14:20:19,711 ERROR JeeProjectActivator (main:) ========= Failed starting project /worklight
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txManager' defined in URL : Cannot resolve reference to bean 'brokerSessionFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brokerSessionFactory' defined in URL : Cannot resolve reference to bean 'rssBrokerDS' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rssBrokerDS' defined in URL : Cannot resolve reference to bean 'worklight-direct' while setting bean property 'targetDataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'worklight-direct' defined in URL : Invocation of init method failed; nested exception is java.lang.RuntimeException: The table WORKLIGHT_VERSION must contain single record.
  • SwastikShetty
    SwastikShetty
    7 Posts

    Re: Deploying worklight to remote server

    ‏2012-09-04T11:07:40Z  
    Hi Idan,

    I tried redeploying the log file, but i get the same error.
    I see the following error in the tomcat/log folder:

    Error configuring application listener of class org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
    java.lang.ClassNotFoundException: org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
    Please find attached the log file.

    Also a folder is created in the tomact home outside of webapps, with the name 'worklight.home'. This directory has a error log file - server.log, which has the following error:

    2012-09-04 14:20:18,951 INFO JeeProjectActivator (main:) Worklight home folder is C:\cluster\tomcat-node-1\worklight.home\worklight
    2012-09-04 14:20:19,711 ERROR JeeProjectActivator (main:) ========= Failed starting project /worklight
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txManager' defined in URL : Cannot resolve reference to bean 'brokerSessionFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brokerSessionFactory' defined in URL : Cannot resolve reference to bean 'rssBrokerDS' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rssBrokerDS' defined in URL : Cannot resolve reference to bean 'worklight-direct' while setting bean property 'targetDataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'worklight-direct' defined in URL : Invocation of init method failed; nested exception is java.lang.RuntimeException: The table WORKLIGHT_VERSION must contain single record.
    Hi Idan,

    I have resolved the issue :)

    looking at the error about multiple entries in the table 'WORKLIGHT_VERSION must contain single record'.
    I deleted one of the records and its working now.
    I can see the console and can also deploy my app.

    Thanks,
    Swastik