• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Kyle's 2nd ED

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to run the example servlet.
I'm on page 879 a.2.3 Running the Case Study. I got here from page 96 see Appendix A on loading the workspace containing the examples and the case study.

2. Use the procedure from the export database tables section in chap 24 to export the tables for both the OIDGenerator and TimeSheetGroup EJB module projects. Since the TimeSheetGroup was was generated with the NULLID schema name, you do not want to export the tables using fully qualified names and you want to use a valid database login id.


This paragraph is very confusing. Perhaps it's because I'm jumping from page 96 to 554 to 878. The first sentence says we are trying to export the tables. The second sentence says the the time sheet group was generated with the NULLID, to me this implies a bottom up creation of EJBs. Of course for bottom-up the tables already exist.
When they talk about exporting to a database, in one option they say you can generate some ddl and run it. To me this implies creating the tables.
Page 554 says expand the databases group ... When I do I see two, OIDGen :Sample ( DB2 UD v7.2 ) and TimeSheetGroup:wsbook( DB2 UD v8.1 ). As far as I know only v8.1 is installed on my machine. Where did 7.2 come from? What am I trying to accomplish here anyway?
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sandra,
I'll go through this again at home tonight and hopefully be able to straighten your questions out. Unfortunately I'm at work and don't have a copy of my book handy right now.
Kyle
 
Sondra Colagrossi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you happen to remember to bring your book in?
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sondra Colagrossi:
I'm trying to run the example servlet.
I'm on page 879 a.2.3 Running the Case Study. I got here from page 96 see Appendix A on loading the workspace containing the examples and the case study.

This paragraph is very confusing. Perhaps it's because I'm jumping from page 96 to 554 to 878. The first sentence says we are trying to export the tables. The second sentence says the the time sheet group was generated with the NULLID, to me this implies a bottom up creation of EJBs. Of course for bottom-up the tables already exist.
When they talk about exporting to a database, in one option they say you can generate some ddl and run it. To me this implies creating the tables.
Page 554 says expand the databases group ... When I do I see two, OIDGen :Sample ( DB2 UD v7.2 ) and TimeSheetGroup:wsbook( DB2 UD v8.1 ). As far as I know only v8.1 is installed on my machine. Where did 7.2 come from? What am I trying to accomplish here anyway?



OK, in section A.2.3 step 2 you are in fact creating the tables. That is why you need to use the instructions on page 554 to use the export to server option to create the tables for both the TimeSheetGroup and OIDGen databases (the two example projects use different databases). Don't worry about the fact that one says DB2 UDB 7.2 -- that's just a red herring -- just export them both to your installed DB2 UDB 8.1 and everything will work fine.
And the NULLID schema doesn't necessarily imply top-down; it simply means that we don't have to worry about determining what schema (userid) to use in creating, populating and querying the tables. Dan covers this use of NULLID in Chapter 24, page 531 and following.
You will then populate the databases in section A.2.3.
Kyle
[ March 23, 2004: Message edited by: Kyle Brown ]
 
Sondra Colagrossi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the info.
I am moving right along.
1) Since the OIDGenerator did not have a back end folder for 8.1 I created one.
2)I right-click the item under Databases and then export to server.
3)The figure that looks pretty much the same as 24.21 I click next on.
4)Figure 24.22 I uncheck generate fully qualified names, then next.
5)Figure 24.7 I opened some command center and created a database named sample. I enter it in the Database field. I enter a user and a password name. I enter 8.1 as my vendor type. Every thing is looking good. I click finish.
ERROR - Problem encountered during export: IWAS0126E Problems encountered while trying to establish connection Con2. Reason no suitable driver
Ok clears dialog box.
6) click in JDBC Driver field and then strike F1 key for help
7) click hot link Creating a JDBC connection using a DB2 Universal Database driver
for IBM DB2 App Driver


To use this JDBC driver, follow these steps:
In the New Database Connection wizard, type the name of the database connection the Connection name field.
Type the name of the database that you want to connect to in the Database field.
If required, type the user ID and password.
Select DB2 Universal Database from the Database vendor type pull-down list.
Select IBM DB2 App Driver from the JDBC driver pull-down list.
Type COM.ibm.db2.jdbc.app.DB2Driver in the JDBC driver class field.


But the JDBC driver class field is grayed
BTW I never upgraded from WSAD
Version: 5.0.0
Build id: 20021125_2118
to the latest offered under software upgrades. When one goes through the software upgrades process, the dialog box says the jar files are not signed. With my luck somebody will do a man in the middle attack and I'll be crashed.
[ March 24, 2004: Message edited by: Sondra Colagrossi ]
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sondra -- go ahead and do the upgrade to 5.01 -- if it's from the IBM site, you're probably not going to be the subject of a man in the middle attack -- not that any exist for WSAD/Eclipse yet anyway....
Also, be sure to fix the listed APAR after 5.01 -- I think that's what you may be experiencing.
Also, you really don't have to have the OIDGenerator for all the examples -- you can do the servlet examples without it. Only some of the EJB examples use the OID generator.
Kyle
 
Sondra Colagrossi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the info.
I am moving right along, again.
I downloaded and upgraded to 5.0.1. It only took about 24 hours.
I downloaded and installed WSAD 5.0.1. Interim Fix 003.
As Kyle predicted, the old bug has vanished.
Now there's a new one. Sure wish I could copy and paste the error message.
[IBM][CLI Driver]SQL1013N The database alias name or database name "SAMPLE" could not be found. SQLSTATE = 42705
If I remember right I created a sample ( lower case ) from the command center. Sample is listed in the Database selection box as shown in figure 24.7
I select the database box and strike F1 ( Help ).
A yellow box appears, three hotlinks DBs, DB Conns, and Connecting to DBs.
Click DBs. it says
... You can define the name and type of the database, and select a project to store the database design. Once you add a database in the Data Definition view of the Data perspective, you can add schemas and tables to the database. ....
In the data definition view there are what I suppose is a bunch of open projects: OIDGen, TimeApp, TimeAppTestClient, TimeSheet-AppLogic, TimeSheetGroup, wasbook and wasbookServer. Just for fun I created a database under wasbook. Should I have created more? Do web and ejb projects generally need databases associated with them?
Search for "SQL1013N" on the WSAD Library page returns 49 hits. The best of the freely available is this FAQ page.
from that page
A: The SQL1013N error indicates that the database could not be found in the client or the server database directories. The net driver will use the native libraries on the server, so it will be using the server database directory to locate and connect to the remote database.
The SQL1013N indicates that the net driver is unable to locate the database. Ensure that the database URL is correct; that is, the server name and database name are correct. Also ensure that the DB2 JDBC Applet Server on the server is running on a port that does not conflict with port of another process (i.e., the port numbers should be different.). By default, the DB2 JDBC Applet Server on the client is started on port# 6789 when the 'db2jstrt' is issued. In this case, it is most likely that the DB2 JDBC Applet Server's port is conflicting with the port of another process, since the remote database is accessible from the DB2 command line.

From figure 24.7 my connection URL is grayed and reads jdbc:db2:SAMPLE. No way appears possible to set the host
This page from the info center is interesting too.
Use the Client Configuration Assistant on your local machine to create a database alias to the remote server.
What's that mean?
[ March 29, 2004: Message edited by: Sondra Colagrossi ]
 
Sondra Colagrossi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I overcame the above problem the wizard does not discover the databases. One has to overtype the name of the database on top of sample.
Now on to the next problem.
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, hopefully, you're through most of them now. I'm sorry you've had such problems with this install from the database side -- once all the pieces are in place, things should go much smoother when it's only WSAD that's involved.
Kyle
 
Sondra Colagrossi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe the authentication method shown in figure 8.3 page 122 should be container not application. This clears the exception, too. See the J2EE Tutorial for the details.
 
Sondra Colagrossi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I added the scratchdir = c:\scratchdir attribute to the websphere extensions page of the web.xml file. I created the directory c:\scratchdir.
This is as shown in figure 10.5, and how the wsad help system indicates to do it.
For my xqz.jsp, xqz.java shows up in
C:\WSAD\workspace\.metadata\.plugins\
com.ibm.etools.webtools\Jsp2Java\Servlet Example\Web Content
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sondra,
I don't understand your last post. Yes, this is all covered in Chapter 10 -- what in particular are you commenting on?
Kyle
[ April 30, 2004: Message edited by: Kyle Brown ]
 
Sondra Colagrossi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The scratchdir attribute is supposed to specify where the java source gets written. This is the java source created from a jsp. In my setup, the attribute seems to be ignored. If you put your cursor in the attribute section and then F1, you can see the help dialog.
The help dialog says if no scratchdir attribute is specified the java code should be in was_home\temp\host_name\application_server_name\application_name\webmodule_name.
I'm just documenting a does not work as advertised. I am hoping that if somebody come along behind me, they can jump these hurdles like a track star. I think this issue is a bug in eclipse/wsad.
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sondra,
I just tried another example in WSAD 5.0.1 (the same setup you have) and scratchdir works. However, it only works when keepgenerated is also specified (as it is in Figure 10.5). I created a directory called c:\scratch and created a simple JSP called index.jsp, and it placed the generated .java file and the .class file in
C:\scratch\localhost\server1\TestScratchdir\TestScratchdirWeb.war\
Can you post the contents of the ibm-web-ext.xmi file from your project? It should look something like this:
< ?xml version="1.0" encoding="UTF-8"?>
< webappext:WebAppExtension xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"; xmlns:webappext="webappext.xmi" xmlns:webapplication="webapplication.xmi" xmi:id="WebAppExtension_1" reloadInterval="3" reloadingEnabled="true" additionalClassPath="" fileServingEnabled="true" directoryBrowsingEnabled="false" serveServletsByClassnameEnabled="true">
< webApp href="WEB-INF/web.xml#WebApp"/>
< jspAttributes xmi:id="JSPAttribute_1083414176242" name="keepgenerated" value="true"/>
< jspAttributes xmi:id="JSPAttribute_1083414176243" name="scratchdir" value="c:\scratch"/>
< /webappext:WebAppExtension>
Thanks.
Kyle
 
Sondra Colagrossi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<?xml version="1.0" encoding="UTF-8"?>
<webappext:WebAppExtension xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:webappext="webappext.xmi"
xmlns:webapplication="webapplication.xmi" xmi:id="WebAppExtension_1"
reloadInterval="3" reloadingEnabled="true" additionalClassPath=""
fileServingEnabled="true" directoryBrowsingEnabled="false"
serveServletsByClassnameEnabled="true">
<webApp href="WEB-INF/web.xml#WebApp"/>
<jspAttributes xmi:id="JSPAttribute_1083358107609"
name="keepgenerated" value="true"/>
<jspAttributes xmi:id="JSPAttribute_1083358107610" name="scratchdir"
value="c:\scratchdir"/>
</webappext:WebAppExtension>
[ May 01, 2004: Message edited by: Sondra Colagrossi ]
 
What's that smell? I think this tiny ad may have stepped in something.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic