Topic
6 replies Latest Post - ‏2012-09-27T15:32:23Z by VV3R_mordechai_taitelman
Freakenstien
Freakenstien
19 Posts
ACCEPTED ANSWER

Pinned topic Unable to run console within websphere

‏2012-06-26T11:34:15Z |
I have been trying to install Worklight server within IBM Websphere. I follow the instructions provided in Administration Guide.pdf found at http://public.dhe.ibm.com/ibmdl/export/pub/software/mobile-solutions/worklight/docs/wl_5_0_admin.pdf

but every time I try to access the console through: http://localhost:10039/worklight/console/ I get the following error.
Error 500: class java.lang.ClassNotFoundException: com.worklight.core.auth.impl.AuthenticationFilter

I tried to re-check my class loader setting as describe in guide but nothing solves this error.
  • rtimothy
    rtimothy
    22 Posts
    ACCEPTED ANSWER

    Re: Unable to run console within websphere

    ‏2012-06-26T14:07:40Z  in response to Freakenstien
    A couple things to validate:
    1) The shared library is associated at the application level (worklight_war) not the module level.
    2) You have changed the class loader modes to PARENT_LAST on both the application level AND the module level.
    • Freakenstien
      Freakenstien
      19 Posts
      ACCEPTED ANSWER

      Re: Unable to run console within websphere

      ‏2012-06-26T21:10:20Z  in response to rtimothy
      That is exactly what I have done as how it is described in the guide but somehow there is no resolve to the error.
  • VV3R_mordechai_taitelman
    43 Posts
    ACCEPTED ANSWER

    Re: Unable to run console within websphere

    ‏2012-06-27T06:23:31Z  in response to Freakenstien
    Hi
    We are in the process of updating the Admin guide.
    I shall give you several steps to verify you installed all correctly.
    I still missing some information as per your database vendor and such so I will assume MySQL.I shall also assume you are NOT installing a cluster (its simpler)
    Preparing the WebSphere
    Install WebSphere
    Do not install WebSphere to a folder containing special chars or space bar in its name (e.g. c:\program files). Best path is c:\IBM\WebSphere
    Do not start WebSphere yet
    Go to IBM\WebSphere\AppServer\profiles\AppSrv01\config\ folder
    Create folder named worklightServer
    Copy worklight-jee-library.jar to worklightServer folder
    Copy mysql-connector-java-5.xxxx-bin.jar to worklightServer folder
    In case additional JDBC drivers are required, copy them to worklightServer folder
    Start your WebSphere
    In the IBM\WebSphere\AppServer\profiles\AppSrv01\logs\AboutThisProfile.txt file you can see your administrative console port, usually 9060
    Open WebSphere admin console at http://<server>:<port>/ibm/console
    Login
    Add platform folder variable
    Go to Environment -> WebSphere variables
    Select required scope (usually cell)
    Add new environment
    Name: WL_PLATFORM_DIR
    Value: ${USER_INSTALL_ROOT}/config/worklightServer
    Add shared libraries references
    Go to Environment -> Shared libraries
    Select required scope (usually cell)
    Add new shared library
    Name: WL_PLATFORM_LIB
    Classpath:
    ${WL_PLATFORM_DIR}/worklight-jee-library.jar
    ${WL_PLATFORM_DIR}/mysql-connector-java-5.xxxx.jar
    Make sure that JAR definitions are on two separate lines in the text box (separated by enter)
    Change the server classloader order
    Go to Servers -> Server types -> WebSphere application servers
    Select your server
    In the Server-specific Application Settings change Classloader policy to Single
    Change Class loading mode to Classes loaded with local class loader first (parent last)
    Click OK
    Preparing the project's server customization
    Update your worklight.properties file with the following properties
    publicWorkLightHostname=your-servers-url
    publicWorkLightProtocol=http/https
    publicWorkLightPort=9080
    publicWorkLightContext=/your-application-context/
    wl.db.type=the-db-type (MYSQL/DB2 etc)
    wl.db.url=(e.g jdbc:mysql://localhost:3306/Worklight)
    wl.db.username=username
    wl.db.password=password
    Modify the rest of the server customization files as required
    Once you save your worklight.properties (or any other files under /server/ folder) your server customization will be created in the bin\your-project-name.war file
    Make sure that your DB have a specified empty scheme/table (it will be automatically populated once application is started)
    Installing WAR file on WebSphere
    Go to Applications -> New application
    Select New Enterprise Application
    Select the previously created WAR file
    Click Next with default settings
    In the Step 4: Map context roots for Web modules specify the Context root of your application. Use same context root as specified in worklight.properties file
    At the end you should see your application with a red X
    Click on your application name to open it's settings
    Change the application classloader order
    Select Class loading and update detection
    Select Classes loaded with local class loader first (parent last)
    Click OK
    Add shared library reference
    Select Shared library references
    Select the checkbox besides your application name
    Click Reference shared libraries
    Select WL_PLATFORM_LIB and move it from Available to Selected
    Click OK
    Click OK
    Modify modules settings
    Select Manage Modules
    Click on Worklight module
    Change Class loader order to Classes loaded with local class loader first (parent last)
    Click OK
    Click OK
    Save changes
    Go to System administration -> Save changes to master repository
    Click Save
    Go to Applications -> Application Types -> WebSphere enterprise applications
    Restart your application by selecting it and clicking Stop and Start afterwards
    Verify that your application is marked as Started and have a green arrow
    Running your application
    The Worklight console of the application should be accessible at http://server-url:port/your-context-root/console
    You can deploy your Worklight applications/adapters using it
    Troubleshooting
    Server logs can be found in IBM\WebSphere\AppServer\profiles\AppSrv01\logs\server1\SystemOut.log file
    • Freakenstien
      Freakenstien
      19 Posts
      ACCEPTED ANSWER

      Re: Unable to run console within websphere

      ‏2012-07-03T12:42:01Z  in response to VV3R_mordechai_taitelman
      Thanks for the help, it is working on WAS now.
      • SystemAdmin
        SystemAdmin
        2327 Posts
        ACCEPTED ANSWER

        Re: Unable to run console within websphere

        ‏2012-07-05T01:38:23Z  in response to Freakenstien
        Can you please provide similar instructions for WAS Liberty?
        • VV3R_mordechai_taitelman
          43 Posts
          ACCEPTED ANSWER

          Re: Unable to run console within websphere

          ‏2012-09-27T15:32:23Z  in response to SystemAdmin
          For Liberty it is much simpler.
          find the server.xml and add this

          <application id="worklight" location="worklight.war" name="worklight" type="war">
          <classloader delegation="parentLast">
          <commonLibrary>
          <fileset dir="${shared.resource.dir}/lib" includes="worklight-jee-library.jar"/>
          <fileset dir="${shared.resource.dir}/lib" includes="mysql-connector-java-5.1.18-bin.jar"/>
          </commonLibrary>
          </classloader>
          </application>

          ofcourse the worklight.war should be the WAR that your eclipse project has in its BIN directory (probably under a different name). just copy and rename that WAR into the liberty's apps/worklight.war .
          I used here a ${shared.resource.dir} variable to the jars.. but you can replace it with a full path if you don't know where is the shared resources path.