Getting Started Guide

81 views
Skip to first unread message

merecat_

unread,
Oct 10, 2009, 10:39:35 AM10/10/09
to web4j-users
Just running through the getting started guide and would like some
help on a few issues if anyone can spare the time...

Landscape...
============

W2k Server on IP 192.168.1.75
- Tomcat 6.0.20 (windows / port 8080)
- MySQL 5.0.86
- JDK 1.6.0_16
- Fish.zip (dated 23/9/09)
- Junit 3.4
- MySQL Connector 5.0.8

XP Client
- Firefox 3.5.3

1. Populating The Database
=======================

At the point ran the MySQL script I got a couple of errors. I found
the ----- characters in the script stopped it running to completion,
is this normal?

2. Populating The Database
=====================

It didn't like the French characters, I previously ran the wizard and
switched the database to UTF-8, I thought this would suffice, any
ideas?

3. First Login
==========

On my client I opened the browser at http://192.168.1.75:8080/fish/. I
got the response "Unable to connect ... Firefox can't establish a
connection to the server at localhost:8080".

And in the address bar it read: http://localhost:8080/fish/main/home/HomePageAction.show

As my client (localhost) does not have Tomcat I guess this is why, as
to why it happened, I guess it had tried to redirect to an 'absolute'
URL rather than a relative one?

When I ran this on my server it ran fine. The URL ended up at
http://localhost:8080/fish/main/home/HomePageAction.show.

When I enter this full address into my XP client (obviously with
localhost swapped for my server's IP) it works fine on my client.

Could somebody explain this behaviour?

4. First Login
==========

My login attempts all fail.

I tried a number of different accounts from the database script
(assuming they all have testtest as a pwd).

Also checked the log - I expected to find some evidence of a login
attempt but found none.

Again - help would be appreciated.


I'm gonna go have a look at the code, which could take me some time as
I'm still on a learning curve with Java Tomcat etc.

Regards, Mark.

John O'Hanley

unread,
Oct 12, 2009, 9:15:06 AM10/12/09
to web4j-users
1. The ---- characters are making the script fail: this is a major
problem. I haven't anyone complain about that before, which worries
me. I don't know why your environment would not recognize such
comments. You will need to remove those comments, or replaced them
with the '#' style. (I imagine you have done this already.)


2. I have run into this problem as well. There is something wonky with
the encoding. It seems to get altered during file transfer or
something. (Sorry about that. I need to fix that.) The workaround is
to remove or comment out all of the statements that use the weird
characters, that is, all of the statements that start with :

INSERT INTO Translation (....)

The app will still function, except items will not be translated into
French (for user's with French language preferences).


3. There is a setting in web.xml named RedirectWelcomeFile. It is used
to redirect directory requests to a specific Action. This is a very
specific sort of setting, sensitive to your setup. Your setup has the
client and the server on separate machines - which is of course
perfectly fine.

However, for 'development mode', when starting to build an app, many
developers prefer to be running both the client and the server on
their local machine. Hence, the default setting for
RedirectWelcomeFile uses the 'localhost' style. You can simply change
the RedirectWelcomeFile setting in web.xml to use the IP address
instead of localhost, restart the server, and your client will work
fine.

4. User name 'testeD', password 'testtest'. Not being able to login is
the single most common problem when getting started. The most likely
issue is the Tomact file which configures the application's context -
the 'fish.xml' file. If this file is not exactly right, you will not
be able to login. You need to double check each entry. Have you
updated it to reflect the 'real' user name and password for accessing
your MySQL database? Have you pointed the docBase attribute to your
app's root directory? Again, the style shown in the example fish.xml
file is for 'development mode' - having the client and server being on
the same machine. If you need to separate the client and the server,
then your settings will be slightly different.

Regards,
John O'Hanley
> On my client I opened the browser athttp://192.168.1.75:8080/fish/. I
> got the response "Unable to connect ... Firefox can't establish a
> connection to the server at localhost:8080".
>
> And in the address bar it read:http://localhost:8080/fish/main/home/HomePageAction.show
>
> As my client (localhost) does not have Tomcat I guess this is why, as
> to why it happened, I guess it had tried to redirect to an 'absolute'
> URL rather than a relative one?
>
> When I ran this on my server it ran fine. The URL ended up athttp://localhost:8080/fish/main/home/HomePageAction.show.

merecat_

unread,
Oct 13, 2009, 5:38:46 AM10/13/09
to web4j-users
Thankyou for your replies.

1. Comment characters

Yes I just removed them, a case of running and re-running portions of
the script until it fell over to locate the offending item.

2. French characters

Both my MySQL and Unicode knowledge is still growing but it's good to
know this behaviour is not a direct consequenece of my lack of
understanding! I altered the characters to get me through this one and
it works fine.

3. RedirectWelcomeFile

I'll take a look at this setting and for the pointer too about
development style.

4. Login problem

Managed to resolve this myself over the weekend and it was exactly
what you suggested it could be :-) I had set the credentials in
fish.xml on the database connections but not on the realm. Once I'd
done this it worked fine.

The pointer that helped me locate this was the Tomcat logs (not the
fish logs) which contained entries complaining about being unable to
connect. I guess this make sense because it's the container that's
doing the authentication not the application.

I thought deployment to Tomcat always involved a WAR so learning of
the app-context file / docbase setting and this style of deployment is
a mini-revelation.

Looking forward to the rest of the tutorial now...

Regards, Mark.


On Oct 12, 2:15 pm, "John O'Hanley" <webmas...@javapractices.com>
wrote:
> > Regards, Mark.- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages