Comments (4)
  • Add a Comment
  • Edit
  • More Actions v
  • Quarantine this Entry

1 AliceG commented Permalink

This was very helpful with lots of implementation detail. I especially liked the use of the DB2 sample database, so a typical DB2 install could just test with it. Thank you.

 
I had one stumbling block in getting your example to work, which led to another point of confusion!
 
In eclipse you have select the Employee adapter, right mouse button and select run -> then deploy adapter. I had gotten error: could not find adapter on server.
 
So I went back and reread everything. The beginning section makes it seem that you create the adapter before creating the Worklight hybrid application. The adapter has to be created within the application. I realize you were just trying to say when creating the application, do the adapter first.

2 DavidDhuyvetter commented Permalink

Alice:

 
Thanks for the comment and clarification. Yes, the adapter must be in the same project as the application where you are adding the JSON Store. Whenever you deploy an app or adapter in Studio, the built in test server is switched to the project containing the artifact, and any application or adapter in a different project that was deployed to the test server before the build is de-activated. The result there is no way to make adapter calls across projects on the test server running in eclipse. As you discovered, this also applies to running the JSON Store wizard against an adapter in a different project.

3 AliceG commented Permalink

Just in case someone else tries to deploy to a WebSphere Liberty server using derby. I ran into several problems. The basic problem was the JSONStore app EmployeeDirectory was not able to find the db2 jar file. To list the steps needed: Modify the adapter Employee.xml to use the jndi reference ie uncomment the following: <dataSourceJNDIName>java:/jdbc/db2</dataSourceJNDIName> commenting out the dataSourceDefinition. Using http://appcenter-server:9080/worklight/console/#catalog deploy Employee.adapter and EmployeeDirectiory-all.wlapp (it deploys all wlapp files) from ...workspace/JSONStore/bin directory and using http://appcenter-server:9080/applicationcenter/applications/Applications.html deploy and from ...workspace/JSONStore/apps/EmployeeDirectory/android/native/bin deploy JSONStoreEmployeeDirectoryAndroid.apk. On the appcenter-server Copy the db2 jar files (db2jcc.jar db2jcc_license_cu.jar) to C:/ProgramData/IBM/Worklight/WAS85liberty-server/wlp/usr/shared/resources//lib Then modify server.xml in C:/ProgramData/IBM/Worklight/WAS85liberty-server/wlp/usr/servers/worklightServer/server.xml (note ProgramData is a Windows "hidden" directory) In C:\ProgramData\IBM\Worklight\WAS85liberty-server\wlp\usr\servers\worklightServer\server.xml add at end of configuration: <!-- new Declare the DB2 sample database. --> <jdbcDriver id="DB2JDBCDriver" libraryRef="DB2JCC4LIB"></jdbcDriver> <library id="DB2JCC4LIB" filesetRef="db2jcc4"></library> <fileset id="db2jcc4" dir="${shared.resource.dir}/lib" includes="db2jcc.jar db2jcc_license_cu.jar"></fileset>
<dataSource id="db2Samp" jndiName="jdbc/db2" jdbcDriverRef="DB2JDBCDriver"> <properties.db2.jcc currentSchema="USER1" databaseName="SAMPLE" driverType="4" password="passw0rd" portNumber="50000" serverName="AppCenter" user="user1"></properties.db2.jcc> </dataSource> Then MODIFY the Declare of the IBM Application Center application to change the fileset includes to use *.jar instead of worklight-jee-library.jar. ie <application id="worklight" name="worklight" location="worklight.war" type="war"> <classloader delegation="parentLast"> <commonLibrary> <fileset dir="${shared.resource.dir}/lib" includes="*.jar"></fileset> </commonLibrary> </classloader> </application> . Stop and start the server. Hope this helps.

4 jkjlkjllkjl commented Permalink

I had this app running in my devel environment but since upgrading the Android SDK and eclipse environment the app wont render correctly and wont retrieve data. The adapter works OK still - looks like an issue with Javascript as the "changePage" function can't be found - any ideas?