Open main menu

CDOT Wiki β

Changes

NexJ Studio Tutorial Problems

5,654 bytes added, 11:42, 17 May 2011
Added in NexJ Integration PDF
== Introduction to NexJ Express Studio == === Problem 1 ===
User root is not recognized,or message likes "Can't find any matching row in the user table"
</font>
=== Problem 2 ===
Cannot deploy on server, get Error Message: Unknown component "HTTPServer.WSRP" in repository "Training 101".
</font>
=== Problem 3 ===
It only upgrade the database correctly, but it doesn't upgrade the dump file.
<h2>Summer 2011</h2>
=== Problem 4 ===
Null pointer exception when creating a new class (P. 19)
Null pointers randomly throughout use of IDE
</font>
=== Problem 5 ===
Non-matching core files
</font>
=== Problem 6 ===
Error with Model Browser in Eclipse
</font>
=== Problem 7 ===
Problem upgrading database
<code>CREATE USER 'nexj@localhost' IDENTIFIED BY 'nexj';<br />
GRANT CREATE, INSERT, DELETE, UPDATE, SELECT on train101.* to nexj@localhost;WITH GRANT OPTION<br />GRANT CREATE, INSERT, DELETE, UPDATE, SELECT on unittest.* to nexj@localhost;WITH GRANT OPTION</code>
Check with SHOW DATABASES and SHOW TABLES that appropriate tables and databases have been created
</font>
=== Problem 8 ===
"Extra character found after the s-expression (scheme syntax error)"
<font color="red">
Unresolved
</font>
 
== Fundamentals 103 Integration 20110506 PDF ==
 
=== Steps before beginning ===
 
1. Do this PDF only after finishing "Introduction to NexJ Express Studio" PDF
 
2. Start with a new workspace if you run into issues (I started with a new one to begin with)
 
3. Run the following SQL in MySQL after you have created the model :
 
[[File:Createmodel.png]]
 
CREATE DATABASE [deploymentdbname]<br />
CREATE DATABASE [unittestdbname]<br />
 
GRANT ALL ON [deploymentdbname].* TO nexj@localhost WITH GRANT OPTION<br />
GRANT ALL ON [unittestdbname].* TO nexj@localhost WITH GRANT OPTION<br />
 
4. Create the SQL script to create all the tables from Database Schema Tool (the icon two icons to the right of the schema icon, use drop down arrow) and run it with
 
USE [deploymentdbname]
SOURCE [pathtosqlscript]
 
5. Because the PDF is designed for NexJ Studio Enterprise, you cannot use the "Finance" model to start. Instead, follow these instructions before starting Chapter 1 (Emailed from Greg Fenton) :
 
Attached, find the PDF for “NexJ Studio Training – Integration Fundamentals” course. This course is geared towards our Enterprise platform, but it can be used with the Express platform with just a couple of changes:
 
1. Create an Address class with attributes:
 
· street – string
 
· city – string, required
 
2. Create a Person class in the business model layer that has attributes:
 
· firstName – string
 
· lastName – string, required
 
· address – Address, collection
 
3. In the Address class, go to Persistence Mapping and:
 
· Set the Data Source to “DefaultRelationalDatabase”
 
· Set the Primary Table to “Address”
 
· Set the Key Generator to “KeyGenerator.GUID”
 
· Click “Select Attribute Mappings…”, then “Add All”, then “OK”
 
· Click “Update Data Source…”, then “OK”
 
4. In the Person class, go to Persistence Mapping and:
 
· Set the Data Source to “DefaultRelationalDatabase”
 
· Set the Primary Table to “Person”
 
· Set the Key Generator to “KeyGenerator.GUID”
 
· Click “Select Attribute Mappings…”, then “Add All”, then “OK”
 
· Click “Update Data Source…”, then “OK”
 
5. In the previous two steps, you ended up adding two new <Table> tags to the source of the DefaultRelationalDatabase. You now need to add those same two tables as steps to an upgrade in Main.upgrade:
 
· Open Persistence >> Upgrades >> Main.upgrade
 
· Scroll to the bottom of the Upgrades list (top of the editor on the Overview tab) and click the Add (+) button >> RelationalDatabaseUpgrade
 
· Double click the Version column of the new upgrade and set a new version (if the previous version is “1.19”, then make this new step “2.19” where the first number is the version of your model and everything after the first dot (“.”) is the version of the base model)
 
· In the Upgrade Steps, click the Add (+) button >> Table Upgrade Step >> Create Table
 
· Now you can manually enter the information for the Person table (same definition as in the DefaultRelationalDatabase) and then a new Create Table for the Address table. However, this is error prone. The easier and much faster way is to copy the table definitions from the DefaultRelationalDatabase to the Main.upgrade and tweak the XML. Here’s how:
 
i. Open Persistence >> Data Sources >> DefaultRelationalDatabase
 
ii. Click the Source tab at the bottom of the editor
 
iii. Scroll to the bottom of the XML and look for the last two <Table> tags. They should be for name=”Person” and name=”Address”. Highlight all of the lines from the first <Table> tag to the last </Table> tag, then copy to your clipboard.
 
iv. Return to Main.upgrade
 
v. Click the Source tab
 
vi. Scroll to the bottom of the XML and look for the last <CreateTable/> tag, highlight and delete that tag.
 
vii. Where that tag was, paste the contents of your clipboard (the two <Table> tags).
 
viii. For the XML you just pasted in, find the “<Table>” and “</Table>”, and replace them with “<CreateTable>” and “</CreateTable>”, respectively.
 
ix. Save all files. Validate the model.
 
6. You can now create a new (or upgrade an existing) database. Now you can create Person and Address instances and persist them to the database.
 
With those two classes being persistable you should be able to work through chapters 1 to 6 using the Core model (not the Finance model). The last two chapters assume you have the full NexJ enterprise application model (though you could probably rework most of chapter 8 to work with the Person class created above instead of the Entity class from Finance chapter 8 is a cool lab!).
 
=== Problem 1 ===
 
GRANT denied when updating dump files
 
<font color="green">
Solution: use WITH GRANT OPTION when granting privileges to nexj user. See above for SQL
</font>
1
edit